@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
package/bin/create-sdkgen CHANGED
@@ -4,7 +4,7 @@ const Path = require('node:path')
4
4
  const { statSync } = require('node:fs')
5
5
  const { parseArgs } = require('node:util')
6
6
 
7
- const { Gubu, Fault, One } = require('gubu')
7
+ const { Shape, Fault, One } = require('shape')
8
8
 
9
9
  const Pkg = require('../package.json')
10
10
 
@@ -21,10 +21,6 @@ async function run() {
21
21
  try {
22
22
  let options = resolveOptions()
23
23
 
24
- if(options.debug) {
25
- DEBUG = true
26
- }
27
-
28
24
  if(options.version) {
29
25
  version()
30
26
  }
@@ -105,7 +101,7 @@ function resolveOptions() {
105
101
 
106
102
  folder: {
107
103
  type: 'string',
108
- short: 'f',
104
+ short: 'o',
109
105
  default: ''
110
106
  },
111
107
 
@@ -161,12 +157,12 @@ function resolveOptions() {
161
157
  name = null == name ? '' : name
162
158
  name = '' === name && (args.values.help || args.values.version) ? '__none__' : name
163
159
 
164
- targets = args.values.target || []
160
+ let targets = args.values.target || []
165
161
  if( 1 < args.positionals.length ) {
166
- targets.push(args.positionals.slice(1))
162
+ targets.push(...args.positionals.slice(1))
167
163
  }
168
164
 
169
- features = args.values.feature || []
165
+ let features = args.values.feature || []
170
166
 
171
167
  const options = {
172
168
  name,
@@ -193,7 +189,7 @@ function resolveOptions() {
193
189
 
194
190
 
195
191
  function validateOptions(rawOptions) {
196
- const optShape = Gubu({
192
+ const optShape = Shape({
197
193
  name: Fault('The first argument must be the project name.', String),
198
194
  def: '',
199
195
  project: String,
@@ -245,13 +241,16 @@ Usage: npm create @voxgig/sdkgen@latest <name> <args>
245
241
  <args> are the command arguments:
246
242
 
247
243
  --def Path to the OpenAPI definition file (optional).
248
- -d
244
+ -d
249
245
 
250
246
  --project Project template (folder or package reference). Default: standard.
251
- -p
247
+ -p
252
248
 
253
249
  --folder Target output folder. Default: ./<name>-sdk.
254
- -f
250
+ -o
251
+
252
+ --feature Features to add. Can be specified multiple times.
253
+ -f
255
254
 
256
255
  --install Run installation scripts. Default: install.
257
256
  --no-install
@@ -1 +1 @@
1
- {"root":["../src/create-sdkgen.ts","../src/project/standard/createroot.ts","../src/project/standard/modelsdk.ts"],"version":"5.9.3"}
1
+ {"root":["../src/create-sdkgen.ts","../src/project/standard/createroot.ts","../src/project/standard/modelsdk.ts"],"version":"6.0.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voxgig/create-sdkgen",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "main": "dist/create-sdkgen.js",
5
5
  "type": "commonjs",
6
6
  "types": "dist/create-sdkgen.d.ts",
@@ -41,17 +41,15 @@
41
41
  "LICENSE"
42
42
  ],
43
43
  "devDependencies": {
44
- "@hapi/code": "^9.0.3",
45
- "@types/node": "25.3.3",
46
- "esbuild": "^0.27.3",
47
- "memfs": "^4.56.10",
48
- "typescript": "^5.9.3"
44
+ "@types/node": "25.5.0",
45
+ "memfs": "^4.57.1",
46
+ "typescript": "^6.0.2"
49
47
  },
50
48
  "dependencies": {
51
- "@voxgig/util": "^0.2.2",
52
- "aontu": "^0.36.0",
49
+ "@voxgig/util": "^0.4.0",
50
+ "aontu": "^0.39.0",
53
51
  "chokidar": "^5.0.0",
54
- "gubu": "^9.0.0",
55
- "jostraca": "^0.25.1"
52
+ "jostraca": "^0.28.0",
53
+ "shape": "^10.0.1"
56
54
  }
57
55
  }
@@ -23,8 +23,8 @@
23
23
  "license": "$$const.License$$",
24
24
  "devDependencies": {
25
25
  "@types/node": ">=25",
26
- "typescript": ">=5",
27
- "@voxgig/apidef": ">=3",
26
+ "typescript": ">=6",
27
+ "@voxgig/apidef": ">=5",
28
28
  "@voxgig/model": ">=7",
29
29
  "@voxgig/sdkgen": ">=0",
30
30
  "@voxgig/util": ">=0",
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "sys": {
3
3
  "model": {
4
- "builders": {}
4
+ "builders": {},
5
+ "action": {},
6
+ "order": {
7
+ "action": ""
8
+ }
5
9
  }
6
10
  }
7
11
  }
@@ -4,4 +4,3 @@ basic: set: [
4
4
 
5
5
  { ctx:{result:{ok:false}}, err:'unknown operation: unknown error' }
6
6
  ]
7
-
@@ -0,0 +1,2 @@
1
+
2
+ basic: set: []
@@ -0,0 +1,2 @@
1
+
2
+ basic: set: []
@@ -0,0 +1,2 @@
1
+
2
+ basic: set: []
@@ -0,0 +1,4 @@
1
+
2
+ basic: set: [
3
+ { in:{opname:create}, match:out:{op:{name:create,input:data}} }
4
+ ]
@@ -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
+ ]
@@ -0,0 +1,2 @@
1
+
2
+ basic: set: []
@@ -1,7 +1,7 @@
1
1
 
2
2
  basic: set: [
3
3
  {
4
- in:prep: { config:{}, options:{} }
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:prep: { options: {}, config: options: {
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:prep: {
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:out: {
26
- native: '__EXISTS__'
27
- err: '__UNDEF__'
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
+ ]
@@ -0,0 +1,2 @@
1
+
2
+ basic: set: []
@@ -1,6 +1,6 @@
1
1
 
2
2
  DEF: {
3
- client: a: test: options: {
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
- op:name: 'list'
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,2 @@
1
+
2
+ basic: set: []
@@ -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
- 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
- }
4
+ in: {
5
+ entity: 'Foo',
6
+ name: 'load',
7
+ input: 'match',
8
+ targets: []
18
9
  }
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
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: {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:{}}
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,13 @@
1
+
2
+ DEF: {
3
+ setup: a: { apikey: 'APIKEY01' }
4
+ }
5
+
6
+
7
+ basic: set: [
8
+
9
+ { ctx: spec:headers:{}
10
+ match: ctx:spec:headers:authorization:' APIKEY01'
11
+ }
12
+
13
+ ]
@@ -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,4 @@
1
+
2
+ basic: set: [
3
+ { ctx: {}, out: { 'content-type': 'application/json' } }
4
+ ]
@@ -0,0 +1,10 @@
1
+
2
+ basic: set: [
3
+ { ctx: { opname:create }, out: POST }
4
+ { ctx: { opname:update }, out: PUT }
5
+ { ctx: { opname:list }, out: GET }
6
+ { ctx: { opname:load }, out: GET }
7
+ { ctx: { opname:remove }, out: DELETE }
8
+
9
+ { ctx: { opname:bad } }
10
+ ]
@@ -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,2 @@
1
+
2
+ basic: set: []
@@ -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
+ ]
@@ -1,23 +1,30 @@
1
- primary: auth: @"auth.jsonic"
2
- primary: body: @"body.jsonic"
3
- primary: context: @"context.jsonic"
1
+ primary: clean: @"clean.jsonic"
4
2
  primary: done: @"done.jsonic"
5
- primary: error: @"error.jsonic"
6
- primary: findparam: @"findparam.jsonic"
7
- primary: fullurl: @"fullurl.jsonic"
8
- primary: headers: @"headers.jsonic"
9
- primary: inward: @"inward.jsonic"
10
- primary: method: @"method.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"
11
17
  primary: operator: @"operator.jsonic"
12
- primary: options: @"options.jsonic"
13
- primary: outward: @"outward.jsonic"
14
- primary: params: @"params.jsonic"
15
- primary: query: @"query.jsonic"
16
- primary: reqform: @"reqform.jsonic"
17
- primary: request: @"request.jsonic"
18
- primary: resbasic: @"resbasic.jsonic"
19
- primary: resbody: @"resbody.jsonic"
20
- primary: resform: @"resform.jsonic"
21
- primary: resheaders: @"resheaders.jsonic"
22
- primary: response: @"response.jsonic"
23
- primary: spec: @"spec.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
+ ]
@@ -0,0 +1,4 @@
1
+
2
+ basic: set: [
3
+ { ctx:{response:{body:{a:A,b:B}},result:{}}, match:ctx:result:body:{a:A,b:B} }
4
+ ]
@@ -0,0 +1,7 @@
1
+
2
+ basic: set: [
3
+ {
4
+ ctx:{response:{headers:{a:A,B:B}},result:{}},
5
+ match:ctx:result:headers:{a:A,b:B}
6
+ }
7
+ ]
@@ -0,0 +1,8 @@
1
+
2
+ basic: set: [
3
+ {
4
+ ctx: { spec:{step:''}, target:{transform:{req:'`reqdata.foo`'}}, reqdata:{foo:{x:1}} }
5
+ out: {x:1}
6
+ match: ctx:spec:step:reqform
7
+ }
8
+ ]
@@ -0,0 +1,10 @@
1
+
2
+ basic: set: [
3
+
4
+ {
5
+ ctx: { result:{ok:true,body:{foo:{x:1}}}, spec:{step:''}, target:{transform:{res:'`body.foo`'}} }
6
+ out: {x:1}
7
+ match: ctx:spec:step:'resform'
8
+ }
9
+
10
+ ]