@voxgig/create-sdkgen 0.3.1 → 0.5.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/create-sdkgen +36 -20
- package/dist/create-sdkgen.d.ts +2 -0
- package/dist/create-sdkgen.js +51 -5
- package/dist/create-sdkgen.js.map +1 -1
- package/dist/project/standard/CreateRoot.d.ts +2 -0
- package/dist/project/standard/CreateRoot.js +50 -0
- package/dist/project/standard/CreateRoot.js.map +1 -0
- package/dist/project/standard/ModelSdk.js +6 -1
- package/dist/project/standard/ModelSdk.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -12
- package/project/standard/.sdk/model/api/api-info.jsonic +5 -0
- package/project/standard/.sdk/model/config.jsonic +3 -1
- package/project/standard/.sdk/model/{api/api-entity-index.jsonic → entity/entity-index.jsonic} +1 -0
- package/project/standard/.sdk/model/guide/guide.jsonic +8 -0
- package/project/standard/.sdk/model/sdk.fragment.jsonic +6 -10
- package/project/standard/.sdk/package.json +5 -7
- package/project/standard/.sdk/src/BuildSDK.ts +113 -0
- package/project/standard/.sdk/src/Root.ts +19 -7
- package/project/standard/.sdk/src/Top.ts +6 -2
- package/project/standard/.sdk/test/.model-config/model-config.json +5 -1
- package/project/standard/.sdk/test/primary/{outward.jsonic → clean.jsonic} +0 -1
- package/project/standard/.sdk/test/primary/done.jsonic +0 -1
- package/project/standard/.sdk/test/primary/{inward.jsonic → featureAdd.jsonic} +0 -1
- package/project/standard/.sdk/test/primary/featureHook.jsonic +2 -0
- package/project/standard/.sdk/test/primary/featureInit.jsonic +2 -0
- package/project/standard/.sdk/test/primary/fetcher.jsonic +2 -0
- package/project/standard/.sdk/test/primary/makeContext.jsonic +4 -0
- package/project/standard/.sdk/test/primary/makeError.jsonic +16 -0
- package/project/standard/.sdk/test/primary/makeFetchDef.jsonic +2 -0
- package/project/standard/.sdk/test/primary/{options.jsonic → makeOptions.jsonic} +5 -6
- package/project/standard/.sdk/test/primary/{request.jsonic → makeRequest.jsonic} +7 -13
- package/project/standard/.sdk/test/primary/makeResponse.jsonic +22 -0
- package/project/standard/.sdk/test/primary/makeResult.jsonic +2 -0
- package/project/standard/.sdk/test/primary/{spec.jsonic → makeSpec.jsonic} +9 -5
- package/project/standard/.sdk/test/primary/makeTarget.jsonic +2 -0
- package/project/standard/.sdk/test/primary/makeUrl.jsonic +21 -0
- package/project/standard/.sdk/test/primary/operator.jsonic +10 -53
- package/project/standard/.sdk/test/primary/{findparam.jsonic → param.jsonic} +6 -7
- package/project/standard/.sdk/test/primary/prepareAuth.jsonic +13 -0
- package/project/standard/.sdk/test/primary/prepareBody.jsonic +18 -0
- package/project/standard/.sdk/test/primary/prepareHeaders.jsonic +4 -0
- package/project/standard/.sdk/test/primary/prepareMethod.jsonic +10 -0
- package/project/standard/.sdk/test/primary/prepareParams.jsonic +9 -0
- package/project/standard/.sdk/test/primary/preparePath.jsonic +2 -0
- package/project/standard/.sdk/test/primary/prepareQuery.jsonic +8 -0
- package/project/standard/.sdk/test/primary/primary-test-index.jsonic +30 -0
- package/project/standard/.sdk/test/primary/resultBasic.jsonic +14 -0
- package/project/standard/.sdk/test/primary/resultBody.jsonic +4 -0
- package/project/standard/.sdk/test/primary/resultHeaders.jsonic +7 -0
- package/project/standard/.sdk/test/primary/transformRequest.jsonic +8 -0
- package/project/standard/.sdk/test/primary/transformResponse.jsonic +10 -0
- package/project/standard/.sdk/test/struct/merge.jsonic +102 -4
- package/project/standard/.sdk/test/struct/minor.jsonic +106 -38
- package/project/standard/.sdk/test/struct/select.jsonic +86 -5
- package/project/standard/.sdk/test/struct/test.json +16635 -0
- package/project/standard/.sdk/test/struct/test.jsonic +25 -0
- package/project/standard/.sdk/test/struct/transform.jsonic +100 -1
- package/project/standard/.sdk/test/struct/validate.jsonic +82 -45
- package/project/standard/.sdk/test/struct/walk.jsonic +57 -6
- package/project/standard/.sdk/test/test.json +5952 -3326
- package/project/standard/.sdk/test/test.jsonic +2 -43
- package/src/create-sdkgen.ts +74 -7
- package/src/project/standard/{Root.ts → CreateRoot.ts} +11 -6
- package/src/project/standard/ModelSdk.ts +6 -1
- package/dist/project/standard/Root.d.ts +0 -2
- package/dist/project/standard/Root.js +0 -79
- package/dist/project/standard/Root.js.map +0 -1
- package/dist/standard/ModelSdk.d.ts +0 -2
- package/dist/standard/ModelSdk.js +0 -19
- package/dist/standard/ModelSdk.js.map +0 -1
- package/dist/standard/Root.d.ts +0 -2
- package/dist/standard/Root.js +0 -77
- package/dist/standard/Root.js.map +0 -1
- package/dist/utility.d.ts +0 -2
- package/dist/utility.js +0 -5
- package/dist/utility.js.map +0 -1
- package/project/standard/.sdk/model/api/api-def.jsonic +0 -5
- package/project/standard/.sdk/model/guide.jsonic +0 -5
- package/project/standard/.sdk/model/target/target-index.jsonic~ +0 -4
- package/project/standard/.sdk/test/primary/auth.jsonic +0 -20
- package/project/standard/.sdk/test/primary/body.jsonic +0 -27
- package/project/standard/.sdk/test/primary/contextify.jsonic +0 -5
- package/project/standard/.sdk/test/primary/error.jsonic +0 -19
- package/project/standard/.sdk/test/primary/fullurl.jsonic +0 -50
- package/project/standard/.sdk/test/primary/headers.jsonic +0 -12
- package/project/standard/.sdk/test/primary/method.jsonic +0 -11
- package/project/standard/.sdk/test/primary/params.jsonic +0 -10
- package/project/standard/.sdk/test/primary/query.jsonic +0 -9
- package/project/standard/.sdk/test/primary/reqform.jsonic +0 -9
- package/project/standard/.sdk/test/primary/resbasic.jsonic +0 -15
- package/project/standard/.sdk/test/primary/resbody.jsonic +0 -5
- package/project/standard/.sdk/test/primary/resform.jsonic +0 -11
- package/project/standard/.sdk/test/primary/resheaders.jsonic +0 -9
- package/project/standard/.sdk/test/primary/response.jsonic +0 -20
|
@@ -12,21 +12,30 @@ import {
|
|
|
12
12
|
Entity,
|
|
13
13
|
Feature,
|
|
14
14
|
Readme,
|
|
15
|
+
Test,
|
|
15
16
|
|
|
16
17
|
} from '@voxgig/sdkgen'
|
|
17
18
|
|
|
19
|
+
import {
|
|
20
|
+
KIT
|
|
21
|
+
} from '@voxgig/apidef'
|
|
22
|
+
|
|
18
23
|
|
|
19
24
|
import { transform, select, ismap } from '@voxgig/struct'
|
|
20
25
|
|
|
21
26
|
import { PointUtil, Content } from 'jostraca'
|
|
22
27
|
|
|
28
|
+
|
|
29
|
+
import { Top } from './Top'
|
|
30
|
+
import { BuildSDK } from './BuildSDK'
|
|
31
|
+
|
|
32
|
+
|
|
23
33
|
const {
|
|
24
34
|
buildPoints,
|
|
25
35
|
SerialPoint,
|
|
26
36
|
} = PointUtil
|
|
27
37
|
|
|
28
38
|
|
|
29
|
-
import { Top } from './Top'
|
|
30
39
|
|
|
31
40
|
|
|
32
41
|
const Root = cmp(function Root(props: any) {
|
|
@@ -42,9 +51,9 @@ const Root = cmp(function Root(props: any) {
|
|
|
42
51
|
|
|
43
52
|
ctx$.model = model
|
|
44
53
|
|
|
45
|
-
const target = model.main.
|
|
46
|
-
const feature = model.main.
|
|
47
|
-
const entity = model.main.
|
|
54
|
+
const target = model.main[KIT].target || {}
|
|
55
|
+
const feature = model.main[KIT].feature || {}
|
|
56
|
+
const entity = model.main[KIT].entity || {}
|
|
48
57
|
|
|
49
58
|
ctx$.log.debug({
|
|
50
59
|
point: 'cmp-root', target, entity, feature, note: [
|
|
@@ -59,7 +68,7 @@ const Root = cmp(function Root(props: any) {
|
|
|
59
68
|
|
|
60
69
|
// Standard Replacements
|
|
61
70
|
ctx$.stdrep = {}
|
|
62
|
-
names(ctx$.stdrep, model.Name, '
|
|
71
|
+
names(ctx$.stdrep, model.Name, 'Project' + 'Name')
|
|
63
72
|
// console.log('STDREP', stdrep)
|
|
64
73
|
|
|
65
74
|
Project({}, () => {
|
|
@@ -67,6 +76,8 @@ const Root = cmp(function Root(props: any) {
|
|
|
67
76
|
// TODO: jostraca should accept no props
|
|
68
77
|
Top({})
|
|
69
78
|
|
|
79
|
+
BuildSDK({})
|
|
80
|
+
|
|
70
81
|
each(target, (target: any) => {
|
|
71
82
|
names(target, target.name)
|
|
72
83
|
|
|
@@ -77,7 +88,6 @@ const Root = cmp(function Root(props: any) {
|
|
|
77
88
|
Entity({ target, entity })
|
|
78
89
|
})
|
|
79
90
|
|
|
80
|
-
// each(feature).filter((feature: any) => feature.active).map((feature: any) => {
|
|
81
91
|
each(feature).filter((feature: any) => feature.active).map((feature: any) => {
|
|
82
92
|
names(feature, feature.name)
|
|
83
93
|
Feature({ target, feature })
|
|
@@ -87,6 +97,7 @@ const Root = cmp(function Root(props: any) {
|
|
|
87
97
|
|
|
88
98
|
Readme({ target })
|
|
89
99
|
|
|
100
|
+
Test({ target })
|
|
90
101
|
})
|
|
91
102
|
})
|
|
92
103
|
|
|
@@ -228,6 +239,7 @@ function makeFlowStep(
|
|
|
228
239
|
|
|
229
240
|
|
|
230
241
|
export {
|
|
231
|
-
|
|
242
|
+
KIT,
|
|
243
|
+
Root,
|
|
232
244
|
}
|
|
233
245
|
|
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
} from '@voxgig/sdkgen'
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
import { KIT } from './Root'
|
|
9
|
+
|
|
10
|
+
|
|
8
11
|
const Top = cmp(function Top(props: any) {
|
|
9
12
|
const { ctx$ } = props
|
|
10
13
|
const { model } = ctx$
|
|
@@ -18,7 +21,7 @@ const Top = cmp(function Top(props: any) {
|
|
|
18
21
|
flowchart LR
|
|
19
22
|
`)
|
|
20
23
|
|
|
21
|
-
const entityMap = model.main.
|
|
24
|
+
const entityMap = model.main[KIT].entity
|
|
22
25
|
|
|
23
26
|
each(entityMap, (entity: any) => {
|
|
24
27
|
const ancestors = entity.ancestors || []
|
|
@@ -35,10 +38,11 @@ flowchart LR
|
|
|
35
38
|
\`\`\`
|
|
36
39
|
|
|
37
40
|
`)
|
|
41
|
+
})
|
|
42
|
+
|
|
38
43
|
|
|
39
44
|
|
|
40
45
|
|
|
41
|
-
})
|
|
42
46
|
})
|
|
43
47
|
|
|
44
48
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
basic: set: [
|
|
3
|
+
{ args:[{}], err:'SolardemoSDK: unknown operation: unknown error' }
|
|
4
|
+
{ args:[{},{}], err:'SolardemoSDK: unknown operation: unknown error' }
|
|
5
|
+
|
|
6
|
+
{ args:[{opname:foo}], err:'SolardemoSDK: foo: unknown error' }
|
|
7
|
+
{ args:[{opname:foo,result:{}}], err:'SolardemoSDK: foo: unknown error' }
|
|
8
|
+
|
|
9
|
+
{ args:[{opname:foo,result:{err:{message:bar}}}], err:'SolardemoSDK: foo: bar' }
|
|
10
|
+
{ args:[{opname:foo}, {message:zed}], err:'SolardemoSDK: foo: zed' }
|
|
11
|
+
|
|
12
|
+
{ args:[{opname:o0}, {message:e0}], err:'SolardemoSDK: o0: e0'
|
|
13
|
+
match: err:message:'SolardemoSDK: o0: e0'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
basic: set: [
|
|
3
3
|
{
|
|
4
|
-
in:
|
|
4
|
+
in: { config:{}, options:{} }
|
|
5
5
|
match: out: {
|
|
6
6
|
base: 'http://localhost:8000',
|
|
7
7
|
entity: {},
|
|
@@ -11,14 +11,14 @@ basic: set: [
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
{
|
|
14
|
-
in:
|
|
14
|
+
in: { options: {}, config: { options: {
|
|
15
15
|
base: 'http://cbase.example',
|
|
16
16
|
prefix: 'cpre-',
|
|
17
17
|
suffix: 'csuf-',
|
|
18
18
|
entity: {
|
|
19
19
|
foo: {}
|
|
20
20
|
}
|
|
21
|
-
}}
|
|
21
|
+
}}}
|
|
22
22
|
match: out: {
|
|
23
23
|
base: 'http://cbase.example',
|
|
24
24
|
prefix: 'cpre-',
|
|
@@ -32,7 +32,7 @@ basic: set: [
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
{
|
|
35
|
-
in:
|
|
35
|
+
in: {
|
|
36
36
|
options: {
|
|
37
37
|
base: 'http://cbase.example',
|
|
38
38
|
prefix: 'cpre-',
|
|
@@ -55,6 +55,5 @@ basic: set: [
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
]
|
|
60
58
|
|
|
59
|
+
]
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
DEF: {
|
|
4
|
-
client: a: test: options: { base: 'b0', system: fetch: '`fetch`' }
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
3
|
basic: set: [
|
|
10
4
|
{
|
|
11
5
|
ctx: {
|
|
12
|
-
op: params: [],
|
|
13
6
|
spec: {
|
|
14
7
|
base: 'http://localhost/base-',
|
|
15
8
|
prefix: 'prefix-',
|
|
@@ -17,15 +10,16 @@ basic: set: [
|
|
|
17
10
|
path: '/p0',
|
|
18
11
|
params: {},
|
|
19
12
|
query: {},
|
|
13
|
+
headers: {},
|
|
14
|
+
method: 'GET',
|
|
15
|
+
body: '__UNDEF__',
|
|
20
16
|
alias: {},
|
|
21
|
-
}
|
|
17
|
+
}
|
|
22
18
|
},
|
|
23
|
-
client: a
|
|
24
19
|
|
|
25
|
-
match:
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
match:ctx: {
|
|
21
|
+
response: '__EXISTS__'
|
|
22
|
+
result: '__EXISTS__'
|
|
28
23
|
}
|
|
29
24
|
}
|
|
30
25
|
]
|
|
31
|
-
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
basic: set: [
|
|
3
|
+
{
|
|
4
|
+
ctx: {
|
|
5
|
+
response: {
|
|
6
|
+
status: 201,
|
|
7
|
+
statusText: 'OK1'
|
|
8
|
+
headers: {h1:v1}
|
|
9
|
+
body: {b:1}
|
|
10
|
+
}
|
|
11
|
+
spec: {step:''}
|
|
12
|
+
result: {ok:false,status:-1,statusText:''}
|
|
13
|
+
target: {transform:{}}
|
|
14
|
+
}
|
|
15
|
+
match:ctx:result: {
|
|
16
|
+
ok: true
|
|
17
|
+
status: 201
|
|
18
|
+
statusText: 'OK1'
|
|
19
|
+
body: {b:1}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
DEF: {
|
|
3
|
-
|
|
3
|
+
setup: a: {
|
|
4
4
|
base: 'BASE-',
|
|
5
5
|
prefix: 'PREFIX-',
|
|
6
6
|
suffix: 'SUFFIX-',
|
|
@@ -11,9 +11,15 @@ DEF: {
|
|
|
11
11
|
basic: set: [
|
|
12
12
|
{
|
|
13
13
|
ctx: {
|
|
14
|
-
|
|
14
|
+
opname: 'list'
|
|
15
|
+
target: {
|
|
16
|
+
parts: [],
|
|
17
|
+
args: { params: [] },
|
|
18
|
+
params: [],
|
|
19
|
+
alias: {},
|
|
20
|
+
transform: {},
|
|
21
|
+
}
|
|
15
22
|
},
|
|
16
|
-
client: a
|
|
17
23
|
match: ctx: spec: {
|
|
18
24
|
base: 'BASE-',
|
|
19
25
|
prefix: 'PREFIX-',
|
|
@@ -25,8 +31,6 @@ basic: set: [
|
|
|
25
31
|
'content-type': 'application/json',
|
|
26
32
|
},
|
|
27
33
|
step: 'start',
|
|
28
|
-
alias: {}
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
36
|
]
|
|
32
|
-
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
basic: set: [
|
|
3
|
+
{
|
|
4
|
+
ctx: {
|
|
5
|
+
spec: {
|
|
6
|
+
base: 'base-',
|
|
7
|
+
prefix: 'prefix-',
|
|
8
|
+
suffix: 'suffix-',
|
|
9
|
+
path: '/p0/{a}',
|
|
10
|
+
params: {
|
|
11
|
+
a: 'A'
|
|
12
|
+
},
|
|
13
|
+
query: {},
|
|
14
|
+
alias: {}
|
|
15
|
+
},
|
|
16
|
+
result: { resmatch: {} }
|
|
17
|
+
},
|
|
18
|
+
out: 'base-/prefix-/p0/A/suffix-'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
]
|
|
@@ -1,60 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
basic: set: [
|
|
3
3
|
{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
params: ['foo_id'],
|
|
10
|
-
alias: {'foo_id':'id','id':'foo_id'},
|
|
11
|
-
match: {},
|
|
12
|
-
data: {},
|
|
13
|
-
state: {},
|
|
14
|
-
reqform: '`data`',
|
|
15
|
-
resform: '`body`',
|
|
16
|
-
check: {}
|
|
17
|
-
}
|
|
4
|
+
in: {
|
|
5
|
+
entity: 'Foo',
|
|
6
|
+
name: 'load',
|
|
7
|
+
input: 'match',
|
|
8
|
+
targets: []
|
|
18
9
|
}
|
|
19
|
-
match: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
path: '/foo/{foo_id}',
|
|
25
|
-
params: ['foo_id'],
|
|
26
|
-
alias: {'foo_id':'id','id':'foo_id'},
|
|
27
|
-
match: {},
|
|
28
|
-
data: {},
|
|
29
|
-
state: {},
|
|
30
|
-
reqform: '`data`',
|
|
31
|
-
resform: '`body`',
|
|
32
|
-
check: {}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
ctx: op: {}
|
|
39
|
-
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.'
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
{
|
|
43
|
-
ctx: op: {
|
|
44
|
-
entity: 11,
|
|
45
|
-
name: 22,
|
|
46
|
-
path: 33,
|
|
47
|
-
params: [44],
|
|
48
|
-
alias: {'foo_id':55},
|
|
49
|
-
match: 101,
|
|
50
|
-
data: 102,
|
|
51
|
-
state: 103,
|
|
52
|
-
reqform: 66,
|
|
53
|
-
resform: 77,
|
|
54
|
-
check: 88
|
|
10
|
+
match: out: {
|
|
11
|
+
entity: 'Foo',
|
|
12
|
+
name: 'load',
|
|
13
|
+
input: 'match',
|
|
14
|
+
targets: []
|
|
55
15
|
}
|
|
56
|
-
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.'
|
|
57
16
|
}
|
|
58
|
-
|
|
59
17
|
]
|
|
60
|
-
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
DEF: {
|
|
4
|
-
ctx0: {
|
|
5
|
-
ctx1: .ctx0
|
|
6
|
-
ctx2: .ctx1 & {
|
|
7
|
-
ctx3: .ctx2 & {
|
|
8
|
-
ctx4: .ctx3
|
|
9
|
-
ctx5: .ctx4 & {
|
|
4
|
+
ctx0: {target:{alias:{}}}
|
|
5
|
+
ctx1: .ctx0
|
|
6
|
+
ctx2: .ctx1 & {reqmatch:{}}
|
|
7
|
+
ctx3: .ctx2 & {reqmatch:{a:'A'}}
|
|
8
|
+
ctx4: .ctx3
|
|
9
|
+
ctx5: .ctx4 & {target:{alias:{b:a}},spec:{alias:{}}}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
basic: set: [
|
|
@@ -19,4 +19,3 @@ basic: set: [
|
|
|
19
19
|
{ mark:70, args: [ .....DEF.ctx5, a ], out: 'A' }
|
|
20
20
|
{ mark:80, args: [ .....DEF.ctx5, b ], out: 'A', match: ctx:spec:alias:a:'b' }
|
|
21
21
|
]
|
|
22
|
-
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
basic: set: [
|
|
3
|
+
{
|
|
4
|
+
ctx: {
|
|
5
|
+
opname:create, target:{transform:{req:'`reqdata.foo`'}},
|
|
6
|
+
reqdata:{foo:{x:1}}
|
|
7
|
+
}
|
|
8
|
+
out: {x:1}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
{
|
|
12
|
+
ctx: {
|
|
13
|
+
opname:create, target:{transform:{req:'`reqdata.bar`'}},
|
|
14
|
+
reqdata:{foo:{x:2}}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
basic: set: [
|
|
3
|
+
{ ctx: {target:{args:{params:[]},params:[],alias:{}}}, out:{} }
|
|
4
|
+
{ ctx: {target:{args:{params:[{name:a}]},params:[a],alias:{}},reqmatch:{}}, out:{} }
|
|
5
|
+
{ ctx: {target:{args:{params:[{name:a}]},params:[a],alias:{}},reqmatch:{a:A}}, out:{a:A} }
|
|
6
|
+
{ ctx: {target:{args:{params:[{name:a}]},params:[a],alias:{}},reqmatch:{b:B}}, out:{} }
|
|
7
|
+
{ ctx: {target:{args:{params:[{name:a}]},params:[a],alias:{}},reqmatch:{a:A,b:B}}, out:{a:A} }
|
|
8
|
+
|
|
9
|
+
]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
basic: set: [
|
|
3
|
+
{ mark:10, ctx: {target:{params:[],alias:{}},reqmatch:{}}, out: {} }
|
|
4
|
+
{ mark:20, ctx: {target:{params:[a],alias:{}},reqmatch:{}}, out: {} }
|
|
5
|
+
{ mark:30, ctx: {target:{params:[a],alias:{}},reqmatch:{a:A}}, out: {} }
|
|
6
|
+
{ mark:40, ctx: {target:{params:[a],alias:{}},reqmatch:{b:B}}, out: {b:B} }
|
|
7
|
+
{ mark:50, ctx: {target:{params:[a],alias:{}},reqmatch:{a:A,b:B}}, out: {b:B} }
|
|
8
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
primary: clean: @"clean.jsonic"
|
|
2
|
+
primary: done: @"done.jsonic"
|
|
3
|
+
primary: featureAdd: @"featureAdd.jsonic"
|
|
4
|
+
primary: featureHook: @"featureHook.jsonic"
|
|
5
|
+
primary: featureInit: @"featureInit.jsonic"
|
|
6
|
+
primary: fetcher: @"fetcher.jsonic"
|
|
7
|
+
primary: makeContext: @"makeContext.jsonic"
|
|
8
|
+
primary: makeError: @"makeError.jsonic"
|
|
9
|
+
primary: makeFetchDef: @"makeFetchDef.jsonic"
|
|
10
|
+
primary: makeOptions: @"makeOptions.jsonic"
|
|
11
|
+
primary: makeRequest: @"makeRequest.jsonic"
|
|
12
|
+
primary: makeResponse: @"makeResponse.jsonic"
|
|
13
|
+
primary: makeResult: @"makeResult.jsonic"
|
|
14
|
+
primary: makeSpec: @"makeSpec.jsonic"
|
|
15
|
+
primary: makeTarget: @"makeTarget.jsonic"
|
|
16
|
+
primary: makeUrl: @"makeUrl.jsonic"
|
|
17
|
+
primary: operator: @"operator.jsonic"
|
|
18
|
+
primary: param: @"param.jsonic"
|
|
19
|
+
primary: prepareAuth: @"prepareAuth.jsonic"
|
|
20
|
+
primary: prepareBody: @"prepareBody.jsonic"
|
|
21
|
+
primary: prepareHeaders: @"prepareHeaders.jsonic"
|
|
22
|
+
primary: prepareMethod: @"prepareMethod.jsonic"
|
|
23
|
+
primary: prepareParams: @"prepareParams.jsonic"
|
|
24
|
+
primary: preparePath: @"preparePath.jsonic"
|
|
25
|
+
primary: prepareQuery: @"prepareQuery.jsonic"
|
|
26
|
+
primary: resultBasic: @"resultBasic.jsonic"
|
|
27
|
+
primary: resultBody: @"resultBody.jsonic"
|
|
28
|
+
primary: resultHeaders: @"resultHeaders.jsonic"
|
|
29
|
+
primary: transformRequest: @"transformRequest.jsonic"
|
|
30
|
+
primary: transformResponse: @"transformResponse.jsonic"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
basic: set: [
|
|
3
|
+
{ ctx:{response:{status:200,statusText:'OK'},result:{}},
|
|
4
|
+
match:out:{status:200,statusText:'OK'}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
{ ctx:{response:{status:500,statusText:'r01'},result:{}},
|
|
8
|
+
match:out:{status:500,statusText:'r01',err:message:'request: 500: r01'}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
{ ctx:{response:{status:400,statusText:'BAD'},result:{err:{message:'Foo'}}},
|
|
12
|
+
match:out:{status:400,statusText:'BAD',err:message:'Foo: request: 400: BAD'}
|
|
13
|
+
}
|
|
14
|
+
]
|