@voxgig/create-sdkgen 0.1.1 → 0.2.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.
Files changed (68) hide show
  1. package/bin/create-sdkgen +2 -0
  2. package/bin/create-sdkgen~ +261 -0
  3. package/dist/create-sdkgen.js +2 -1
  4. package/dist/create-sdkgen.js.map +1 -1
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/package.json +5 -5
  7. package/project/standard/.env.local +1 -0
  8. package/project/standard/.sdk/build/apidef.js +8 -0
  9. package/project/standard/.sdk/build/docgen.js +15 -0
  10. package/project/standard/.sdk/build/sdkgen.js +16 -0
  11. package/project/standard/.sdk/def/README.md +4 -0
  12. package/project/standard/.sdk/model/.model-config/model-config.jsonic +19 -0
  13. package/project/standard/.sdk/model/README.md +2 -0
  14. package/project/standard/.sdk/model/api/api-def.jsonic +5 -0
  15. package/project/standard/.sdk/model/api/api-entity-index.jsonic +2 -0
  16. package/project/standard/.sdk/model/config.jsonic +13 -0
  17. package/project/standard/.sdk/model/feature/README.md +2 -0
  18. package/project/standard/.sdk/model/feature/feature-index.jsonic +3 -0
  19. package/project/standard/.sdk/model/flow/flow-index.jsonic +2 -0
  20. package/project/standard/.sdk/model/guide.jsonic +5 -0
  21. package/project/standard/.sdk/model/sdk.fragment.jsonic +39 -0
  22. package/project/standard/.sdk/model/target/README.md +2 -0
  23. package/project/standard/.sdk/model/target/target-index.jsonic +2 -0
  24. package/project/standard/.sdk/model/target/target-index.jsonic~ +4 -0
  25. package/project/standard/.sdk/package.json +37 -0
  26. package/project/standard/.sdk/src/DocStaticRoot.ts +45 -0
  27. package/project/standard/.sdk/src/Root.ts +233 -0
  28. package/project/standard/.sdk/src/Top.ts +48 -0
  29. package/project/standard/.sdk/src/cmp/README.md +2 -0
  30. package/project/standard/.sdk/src/tsconfig.json +16 -0
  31. package/project/standard/.sdk/test/.model-config/model-config.json +7 -0
  32. package/project/standard/.sdk/test/.model-config/model-config.jsonic +4 -0
  33. package/project/standard/.sdk/test/primary/auth.jsonic +20 -0
  34. package/project/standard/.sdk/test/primary/body.jsonic +27 -0
  35. package/project/standard/.sdk/test/primary/contextify.jsonic +5 -0
  36. package/project/standard/.sdk/test/primary/done.jsonic +7 -0
  37. package/project/standard/.sdk/test/primary/error.jsonic +19 -0
  38. package/project/standard/.sdk/test/primary/findparam.jsonic +22 -0
  39. package/project/standard/.sdk/test/primary/fullurl.jsonic +50 -0
  40. package/project/standard/.sdk/test/primary/headers.jsonic +12 -0
  41. package/project/standard/.sdk/test/primary/inward.jsonic +3 -0
  42. package/project/standard/.sdk/test/primary/method.jsonic +11 -0
  43. package/project/standard/.sdk/test/primary/operator.jsonic +60 -0
  44. package/project/standard/.sdk/test/primary/options.jsonic +60 -0
  45. package/project/standard/.sdk/test/primary/outward.jsonic +3 -0
  46. package/project/standard/.sdk/test/primary/params.jsonic +10 -0
  47. package/project/standard/.sdk/test/primary/query.jsonic +9 -0
  48. package/project/standard/.sdk/test/primary/reqform.jsonic +9 -0
  49. package/project/standard/.sdk/test/primary/request.jsonic +31 -0
  50. package/project/standard/.sdk/test/primary/resbasic.jsonic +15 -0
  51. package/project/standard/.sdk/test/primary/resbody.jsonic +5 -0
  52. package/project/standard/.sdk/test/primary/resform.jsonic +11 -0
  53. package/project/standard/.sdk/test/primary/resheaders.jsonic +9 -0
  54. package/project/standard/.sdk/test/primary/response.jsonic +20 -0
  55. package/project/standard/.sdk/test/primary/spec.jsonic +32 -0
  56. package/project/standard/.sdk/test/struct/getpath.jsonic +143 -0
  57. package/project/standard/.sdk/test/struct/inject.jsonic +76 -0
  58. package/project/standard/.sdk/test/struct/merge.jsonic +161 -0
  59. package/project/standard/.sdk/test/struct/minor.jsonic +693 -0
  60. package/project/standard/.sdk/test/struct/select.jsonic +166 -0
  61. package/project/standard/.sdk/test/struct/transform.jsonic +453 -0
  62. package/project/standard/.sdk/test/struct/validate.jsonic +287 -0
  63. package/project/standard/.sdk/test/struct/walk.jsonic +57 -0
  64. package/project/standard/.sdk/test/test.json +15080 -0
  65. package/project/standard/.sdk/test/test.jsonic +44 -0
  66. package/project/standard/.sdk/tm/LICENSE +22 -0
  67. package/project/standard/.sdk/tm/README.md +2 -0
  68. package/src/create-sdkgen.ts +3 -1
@@ -0,0 +1,233 @@
1
+
2
+ import {
3
+ names,
4
+ cmp,
5
+ each,
6
+ getx,
7
+
8
+ Project,
9
+ Folder,
10
+
11
+ Main,
12
+ Entity,
13
+ Feature,
14
+ Readme,
15
+
16
+ } from '@voxgig/sdkgen'
17
+
18
+
19
+ import { transform, select, ismap } from '@voxgig/struct'
20
+
21
+ import { PointUtil, Content } from 'jostraca'
22
+
23
+ const {
24
+ buildPoints,
25
+ SerialPoint,
26
+ } = PointUtil
27
+
28
+
29
+ import { Top } from './Top'
30
+
31
+
32
+ const Root = cmp(function Root(props: any) {
33
+ const { model, ctx$ } = props
34
+
35
+ ctx$.util = ctx$.util || {}
36
+ ctx$.util.makeFlow = makeFlow
37
+
38
+ // TODO: move to @voxgig/util as duplicated
39
+ model.const = { name: model.name }
40
+ names(model.const, model.name)
41
+ model.const.year = new Date().getFullYear()
42
+
43
+ ctx$.model = model
44
+
45
+ const target = model.main.sdk.target || {}
46
+ const feature = model.main.sdk.feature || {}
47
+ const entity = model.main.api.entity || {}
48
+
49
+ ctx$.log.debug({
50
+ point: 'cmp-root', target, entity, feature, note: [
51
+ '\ntarget: \n' + Object.keys(target).map(s => ' ' + s).join('\n'),
52
+ '\nentity:\n' + Object.keys(entity).map(s => ' ' + s).join('\n'),
53
+ '\nfeature:\n' + Object.keys(feature).map(s => ' ' + s).join('\n'),
54
+ ].join('\n')
55
+ })
56
+
57
+ names(model, model.name)
58
+ // console.log('MODEL name', model.name, model.Name)
59
+
60
+ // Standard Replacements
61
+ ctx$.stdrep = {}
62
+ names(ctx$.stdrep, model.Name, 'ProjectName')
63
+ // console.log('STDREP', stdrep)
64
+
65
+ Project({}, () => {
66
+
67
+ // TODO: jostraca should accept no props
68
+ Top({})
69
+
70
+ each(target, (target: any) => {
71
+ names(target, target.name)
72
+
73
+ Folder({ name: target.name }, () => {
74
+
75
+ each(entity, (entity: any) => {
76
+ names(entity, entity.name)
77
+ Entity({ target, entity })
78
+ })
79
+
80
+ // each(feature).filter((feature: any) => feature.active).map((feature: any) => {
81
+ each(feature).filter((feature: any) => feature.active).map((feature: any) => {
82
+ names(feature, feature.name)
83
+ Feature({ target, feature })
84
+ })
85
+
86
+ Main({ target })
87
+
88
+ Readme({ target })
89
+
90
+ })
91
+ })
92
+
93
+ })
94
+ })
95
+
96
+
97
+ function makeFlow(def: any, data: any, stepMakers: Record<string, any>) {
98
+
99
+ const steps: any = {}
100
+ each(stepMakers, (n: any) => {
101
+ // TODO: support after?
102
+ if ('function' === typeof n.val$) {
103
+ steps[n.key$] = (id: any, pdef: any) => makeFlowStep(id(), pdef, n.val$)
104
+ }
105
+ else if ('string' === typeof n.val$) {
106
+ steps[n.key$] = (id: any, pdef: any) => makeFlowStep(id(), pdef, (sd: any, pctx: any) => {
107
+ Content({
108
+ indent: pctx.data.indent,
109
+ extra: {
110
+ __stepdef: sd
111
+ },
112
+ }, n.val$)
113
+ })
114
+ }
115
+ else if (Array.isArray(n)) {
116
+ steps[(n as any).key$] =
117
+ (id: any, pdef: any) => makeFlowStep(id(), pdef, (sd: any, pctx: any) => {
118
+ const extra = {
119
+ __stepdef: sd
120
+ }
121
+ for (let tmdef of n) {
122
+ let tmtxt
123
+ if ('string' === typeof tmdef) {
124
+ tmtxt = tmdef
125
+ }
126
+ else if (Array.isArray(tmdef)) {
127
+ let pass = true
128
+ let cond = tmdef[0]
129
+ tmtxt = tmdef[1]
130
+
131
+ if ('string' === typeof cond) {
132
+ pass = (null != getx(extra, tmdef[0]) || null != getx(pctx.data.model, tmdef[0]))
133
+ }
134
+ else if (ismap(cond)) {
135
+ let children = [{ ...pctx.data.model, ...extra }]
136
+ let found = select(
137
+ children,
138
+ cond
139
+ )
140
+ pass = 0 < found.length
141
+ }
142
+
143
+ if (!pass) {
144
+ tmtxt = tmdef[2]
145
+ }
146
+ }
147
+ else if ('function' === typeof tmdef) {
148
+ tmdef(sd, pctx)
149
+ }
150
+
151
+ if (null != tmtxt) {
152
+ Content({
153
+ indent: pctx.data.indent,
154
+ extra,
155
+ }, tmtxt)
156
+ }
157
+ }
158
+ })
159
+ }
160
+ })
161
+
162
+ each(def.step, (step: any) => {
163
+ names(step, step.entity, 'entity')
164
+ })
165
+
166
+ // console.log('STEPS', stepMakers, steps, def)
167
+
168
+ const spec = transform(def, {
169
+ p: ['`$EACH`', 'step', {
170
+ k: 'FlowStep',
171
+ a: '`.`',
172
+ p: [
173
+ { k: 'GetEntity', a: '`...`' },
174
+ { k: 'EntityMatch', a: '`...`' },
175
+ { k: 'EntityData', a: '`...`' },
176
+ { k: 'EntityAction', a: '`...`' },
177
+ { k: 'ExplainAction', a: '`...`' },
178
+ { k: 'ValidateAction', a: '`...`' },
179
+ ]
180
+ }]
181
+ })
182
+
183
+ const rootPoint = buildPoints(spec, steps) as any
184
+
185
+ data = data || {}
186
+ data.step = {}
187
+
188
+ rootPoint.direct(data)
189
+ }
190
+
191
+
192
+ function makeFlowStep(
193
+ id: string,
194
+ pdef: any,
195
+ before: any,
196
+ after?: any,
197
+ _parent?: any
198
+ ): any {
199
+
200
+ class FlowStep extends SerialPoint {
201
+ pdef: any
202
+
203
+ constructor(id: string, pdef: any) {
204
+ super(id)
205
+ this.pdef = pdef
206
+ }
207
+
208
+ async run(pctx: any): Promise<void> {
209
+ const stepdef = pdef.a
210
+ if (stepdef.ref) {
211
+ const refstep = pctx.data.step[stepdef.ref]
212
+ stepdef.kind = refstep.kind
213
+ stepdef.entity = refstep.entity
214
+ stepdef._ref = stepdef.ref
215
+ delete stepdef.ref
216
+ }
217
+
218
+ before.call(this, stepdef, pctx)
219
+ super.run(pctx)
220
+ after && after.call(this, stepdef, pctx)
221
+ }
222
+ }
223
+
224
+ return new FlowStep(id, pdef)
225
+ }
226
+
227
+
228
+
229
+
230
+ export {
231
+ Root
232
+ }
233
+
@@ -0,0 +1,48 @@
1
+
2
+
3
+ import {
4
+ cmp, each, Line, File, Content
5
+ } from '@voxgig/sdkgen'
6
+
7
+
8
+ const Top = cmp(function Top(props: any) {
9
+ const { ctx$ } = props
10
+ const { model } = ctx$
11
+
12
+ File({ name: 'README.md' }, () => {
13
+ Content(`# ${model.Name} SDKs
14
+
15
+ ## API Entities
16
+
17
+ \`\`\`mermaid
18
+ flowchart LR
19
+ `)
20
+
21
+ const entityMap = model.main.api.entity
22
+
23
+ each(entityMap, (entity: any) => {
24
+ const ancestors = entity.ancestors || []
25
+ if (0 < ancestors.length) {
26
+ const pname = ancestors[ancestors.length - 1]
27
+ const parent = entityMap[pname]
28
+ if (null != parent) {
29
+ Line(` ${parent.Name} --> ${entity.Name}`)
30
+ }
31
+ }
32
+ })
33
+
34
+ Content(`
35
+ \`\`\`
36
+
37
+ `)
38
+
39
+
40
+
41
+ })
42
+ })
43
+
44
+
45
+ export {
46
+ Top
47
+ }
48
+
@@ -0,0 +1,2 @@
1
+ # Target builder components
2
+
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "esModuleInterop": true,
4
+ "module": "nodenext",
5
+ "noEmitOnError": true,
6
+ "outDir":"../dist",
7
+ "rootDir":".",
8
+ "resolveJsonModule": true,
9
+ "sourceMap": true,
10
+ "strict": true,
11
+ "target": "es2021",
12
+ "declaration": true,
13
+ "declarationDir": "../dist"
14
+ },
15
+ "exclude": ["**/fragment/*.fragment.ts"]
16
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "sys": {
3
+ "model": {
4
+ "builders": {}
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+
2
+ @"@voxgig/model/model/.model-config/model-config.jsonic"
3
+
4
+ sys: model: builders: {}
@@ -0,0 +1,20 @@
1
+
2
+ DEF: {
3
+ client: a: test: options: { apikey: 'APIKEY01' }
4
+ client: b: test: options: {}
5
+ }
6
+
7
+
8
+ basic: set: [
9
+
10
+ { ctx: spec:headers:{}
11
+ client: a
12
+ match: out:headers:authorization:'Bearer APIKEY01'
13
+ }
14
+
15
+ # { ctx: spec:headers:{}
16
+ # client: b
17
+ # match: out:headers:authorization:'__UNDEF__' }
18
+
19
+ ]
20
+
@@ -0,0 +1,27 @@
1
+
2
+ basic: set: [
3
+ {
4
+ ctx: {
5
+ op:kind:req, op:reqform:'`data.foo`', op:check:nobody:true
6
+ op:data:foo:{x:1}
7
+ }
8
+ out: {x:1}
9
+ }
10
+
11
+ {
12
+ ctx: {
13
+ op:kind:req, op:reqform:'`data.bar`', op:check:nobody:false
14
+ op:data:foo:{x:2}
15
+ }
16
+ }
17
+
18
+ {
19
+ ctx: {
20
+ op:kind:req, op:reqform:'`data.bar`', op:check:nobody:true
21
+ op:data:foo:{x:3}
22
+ }
23
+ err: 'empty'
24
+ }
25
+
26
+ ]
27
+
@@ -0,0 +1,5 @@
1
+
2
+ basic: set: [
3
+ { in:{op:{kind:req}}, match:out:{op:{kind:req}} }
4
+ ]
5
+
@@ -0,0 +1,7 @@
1
+
2
+ basic: set: [
3
+ { ctx:{result:{ok:true,resdata:{x:1}}}, out:{x:1} }
4
+
5
+ { ctx:{result:{ok:false}}, err:'unknown operation: unknown error' }
6
+ ]
7
+
@@ -0,0 +1,19 @@
1
+
2
+ basic: set: [
3
+ { args:[], err:'SDK: unknown operation: unknown error' }
4
+ { args:[{}], err:'SDK: unknown operation: unknown error' }
5
+ { args:[{},{}], err:'SDK: unknown operation: unknown error' }
6
+
7
+ { args:[{op:{}}], err:'SDK: unknown operation: unknown error' }
8
+ { args:[{op:name:foo}], err:'SDK: foo: unknown error' }
9
+ { args:[{op:name:foo,result:{}}], err:'SDK: foo: unknown error' }
10
+
11
+ { args:[{op:name:foo,result:{err:message:bar}}], err:'SDK: foo: bar' }
12
+ { args:[{op:name:foo}, {message:zed}], err:'SDK: foo: zed' }
13
+
14
+ { args:[{op:name:o0}, {message:e0}], err:'SDK: o0: e0'
15
+ match: err:message:'SDK: o0: e0'
16
+ }
17
+
18
+ ]
19
+
@@ -0,0 +1,22 @@
1
+
2
+
3
+ DEF: {
4
+ ctx0: {op:{}}
5
+ ctx1: .ctx0 & {op:kind:res}
6
+ ctx2: .ctx1 & {op:match:{}}
7
+ ctx3: .ctx2 & {op:match:a:'A'}
8
+ ctx4: .ctx3 & {op:alias:{}}
9
+ ctx5: .ctx4 & {op:alias:b:'a',spec:{}}
10
+ }
11
+
12
+ basic: set: [
13
+ { mark:10, args: [ .....DEF.ctx0, a ] }
14
+ { mark:20, args: [ .....DEF.ctx1, a ] }
15
+ { mark:30, args: [ .....DEF.ctx2, a ] }
16
+ { mark:40, args: [ .....DEF.ctx3, a ], out: 'A'}
17
+ { mark:50, args: [ .....DEF.ctx3, b ] }
18
+ { mark:60, args: [ .....DEF.ctx4, b ] }
19
+ { mark:70, args: [ .....DEF.ctx5, a ], out: 'A' }
20
+ { mark:80, args: [ .....DEF.ctx5, b ], out: 'A', match: ctx:spec:alias:a:'b' }
21
+ ]
22
+
@@ -0,0 +1,50 @@
1
+
2
+ basic: set: [
3
+ {
4
+ ctx: {
5
+ op: {
6
+ params: ['a'],
7
+ },
8
+ spec: {
9
+ base: 'base-',
10
+ prefix: 'prefix-',
11
+ suffix: 'suffix-',
12
+ path: '/p0/{a}',
13
+ params: {
14
+ a: 'A'
15
+ },
16
+ query: {
17
+ b: 'B'
18
+ },
19
+ alias: {}
20
+ },
21
+ },
22
+ out: 'base-/prefix-/p0/A/suffix-?b=B'
23
+ }
24
+
25
+ {
26
+ ctx: {
27
+ op: {
28
+ kind: 'res',
29
+ params: ['foo_id'],
30
+ alias: {
31
+ foo_id: 'id'
32
+ },
33
+ match: {
34
+ id: 'A',
35
+ },
36
+ },
37
+ spec: {
38
+ base: 'base-',
39
+ prefix: 'prefix-',
40
+ suffix: 'suffix-',
41
+ path: '/p0/{foo_id}',
42
+ params: {},
43
+ alias: {}
44
+ }
45
+ }
46
+ out: 'base-/prefix-/p0/A/suffix-'
47
+ }
48
+
49
+ ]
50
+
@@ -0,0 +1,12 @@
1
+
2
+ DEF: {
3
+ client: a: test: options: { headers: { foo:FOO, bar:BAR, accept: '*/*' } }
4
+ }
5
+
6
+ basic: set: [
7
+ { ctx: {}, out: { 'content-type': 'application/json', 'accept': 'application/json' } }
8
+
9
+ { ctx: {}, client:a,
10
+ out: { foo:FOO, bar:BAR, 'content-type': 'application/json', 'accept': '*/*' } }
11
+ ]
12
+
@@ -0,0 +1,3 @@
1
+
2
+ basic: set: []
3
+
@@ -0,0 +1,11 @@
1
+
2
+ basic: set: [
3
+ { ctx: { op:name:create }, out: POST }
4
+ { ctx: { op:name:update }, out: PUT }
5
+ { ctx: { op:name:list }, out: GET }
6
+ { ctx: { op:name:load }, out: GET }
7
+ { ctx: { op:name:remove }, out: DELETE }
8
+
9
+ { ctx: { op:name:bad } }
10
+ ]
11
+
@@ -0,0 +1,60 @@
1
+
2
+ basic: set: [
3
+ {
4
+ ctx: {
5
+ op: {
6
+ entity: 'Foo',
7
+ name: 'load',
8
+ path: '/foo/{foo_id}',
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
+ }
18
+ }
19
+ match: {
20
+ ctx: op: {
21
+ kind: ''
22
+ entity: 'Foo',
23
+ name: 'load',
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
55
+ }
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
+ }
58
+
59
+ ]
60
+
@@ -0,0 +1,60 @@
1
+
2
+ basic: set: [
3
+ {
4
+ in:prep: { config:{}, options:{} }
5
+ match: out: {
6
+ base: 'http://localhost:8000',
7
+ entity: {},
8
+ prefix: '',
9
+ suffix: '',
10
+ }
11
+ }
12
+
13
+ {
14
+ in:prep: { options: {}, config: options: {
15
+ base: 'http://cbase.example',
16
+ prefix: 'cpre-',
17
+ suffix: 'csuf-',
18
+ entity: {
19
+ foo: {}
20
+ }
21
+ }}
22
+ match: out: {
23
+ base: 'http://cbase.example',
24
+ prefix: 'cpre-',
25
+ suffix: 'csuf-',
26
+ entity: {
27
+ foo: {
28
+ alias: {}
29
+ }
30
+ }
31
+ }
32
+ }
33
+
34
+ {
35
+ in:prep: {
36
+ options: {
37
+ base: 'http://cbase.example',
38
+ prefix: 'cpre-',
39
+ suffix: 'csuf-',
40
+ entity: {
41
+ foo: {}
42
+ }
43
+ }
44
+ config: {}
45
+ }
46
+ match: out: {
47
+ base: 'http://cbase.example',
48
+ prefix: 'cpre-',
49
+ suffix: 'csuf-',
50
+ entity: {
51
+ foo: {
52
+ alias: {}
53
+ }
54
+ }
55
+ }
56
+ }
57
+
58
+
59
+ ]
60
+
@@ -0,0 +1,3 @@
1
+
2
+ basic: set: []
3
+
@@ -0,0 +1,10 @@
1
+
2
+ basic: set: [
3
+ { ctx: {op:{}}, out:{} }
4
+ { ctx: {op:params:[a]}, out:{} }
5
+ { ctx: {op:params:[a], op:match:a:A}, out:{a:A} }
6
+ { ctx: {op:params:[a], op:match:b:B}, out:{} }
7
+ { ctx: {op:params:[a], op:match:a:A,b:B}, out:{a:A} }
8
+
9
+ ]
10
+
@@ -0,0 +1,9 @@
1
+
2
+ basic: set: [
3
+ { mark:10, ctx: {op:{}}, out: {} }
4
+ { mark:20, ctx: {op:params:[a]}, out: {} }
5
+ { mark:30, ctx: {op:params:[a],op:match:a:A}, out: {} }
6
+ { mark:40, ctx: {op:params:[a],op:match:b:B}, out: {b:B} }
7
+ { mark:50, ctx: {op:params:[a],op:match:{a:A,b:B}}, out: {b:B} }
8
+ ]
9
+
@@ -0,0 +1,9 @@
1
+
2
+ basic: set: [
3
+ {
4
+ ctx: { spec:step:'' op:reqform:'`data.foo`' op:data:foo:x:1 }
5
+ out: {x:1}
6
+ match: ctx:spec:step:reqform
7
+ }
8
+ ]
9
+
@@ -0,0 +1,31 @@
1
+
2
+
3
+ DEF: {
4
+ client: a: test: options: { base: 'b0', system: fetch: '`fetch`' }
5
+ }
6
+
7
+
8
+
9
+ basic: set: [
10
+ {
11
+ ctx: {
12
+ op: params: [],
13
+ spec: {
14
+ base: 'http://localhost/base-',
15
+ prefix: 'prefix-',
16
+ suffix: 'suffix-',
17
+ path: '/p0',
18
+ params: {},
19
+ query: {},
20
+ alias: {},
21
+ }
22
+ },
23
+ client: a
24
+
25
+ match:out: {
26
+ native: '__EXISTS__'
27
+ err: '__UNDEF__'
28
+ }
29
+ }
30
+ ]
31
+