@voxgig/sdkgen 0.33.0 → 0.34.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 (61) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/package.json +2 -2
  3. package/project/.sdk/model/feature/log.jsonic +1 -2
  4. package/project/.sdk/model/feature/test.jsonic +1 -2
  5. package/project/.sdk/src/cmp/go/TestDirect_go.ts +10 -10
  6. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +3 -3
  7. package/project/.sdk/src/cmp/js/EntityOperation_js.ts +1 -1
  8. package/project/.sdk/src/cmp/js/TestDirect_js.ts +12 -12
  9. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +5 -5
  10. package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +5 -5
  11. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +5 -5
  12. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +6 -6
  13. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +5 -5
  14. package/project/.sdk/src/cmp/ts/EntityBase_ts.ts +38 -0
  15. package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +1 -1
  16. package/project/.sdk/src/cmp/ts/Main_ts.ts +2 -0
  17. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +12 -12
  18. package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.ts +8 -139
  19. package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +161 -0
  20. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +7 -7
  21. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +7 -7
  22. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +7 -7
  23. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +8 -8
  24. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +5 -5
  25. package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +2 -1
  26. package/project/.sdk/tm/go/core/context.go +8 -8
  27. package/project/.sdk/tm/go/core/operation.go +6 -6
  28. package/project/.sdk/tm/go/core/target.go +3 -3
  29. package/project/.sdk/tm/go/core/types.go +1 -3
  30. package/project/.sdk/tm/go/core/utility_type.go +1 -1
  31. package/project/.sdk/tm/go/feature/base_feature.go +1 -3
  32. package/project/.sdk/tm/go/feature/test_feature.go +4 -4
  33. package/project/.sdk/tm/go/test/primary_utility_test.go +13 -13
  34. package/project/.sdk/tm/go/utility/make_spec.go +2 -2
  35. package/project/.sdk/tm/go/utility/make_target.go +18 -18
  36. package/project/.sdk/tm/go/utility/param.go +3 -3
  37. package/project/.sdk/tm/go/utility/prepare_params.go +2 -2
  38. package/project/.sdk/tm/go/utility/prepare_path.go +2 -2
  39. package/project/.sdk/tm/go/utility/prepare_query.go +3 -3
  40. package/project/.sdk/tm/go/utility/register.go +1 -1
  41. package/project/.sdk/tm/go/utility/transform_request.go +2 -2
  42. package/project/.sdk/tm/go/utility/transform_response.go +2 -2
  43. package/project/.sdk/tm/js/src/feature/log/LogFeature.js +2 -7
  44. package/project/.sdk/tm/ts/src/Context.ts +3 -3
  45. package/project/.sdk/tm/ts/src/Operation.ts +3 -3
  46. package/project/.sdk/tm/ts/src/{Target.ts → Point.ts} +2 -2
  47. package/project/.sdk/tm/ts/src/feature/base/BaseFeature.ts +7 -2
  48. package/project/.sdk/tm/ts/src/feature/log/LogFeature.ts +2 -7
  49. package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +3 -3
  50. package/project/.sdk/tm/ts/src/types.ts +18 -15
  51. package/project/.sdk/tm/ts/src/utility/{MakeTargetUtility.ts → MakePointUtility.ts} +18 -18
  52. package/project/.sdk/tm/ts/src/utility/MakeSpecUtility.ts +2 -2
  53. package/project/.sdk/tm/ts/src/utility/ParamUtility.ts +2 -2
  54. package/project/.sdk/tm/ts/src/utility/PrepareBodyUtility.ts +1 -1
  55. package/project/.sdk/tm/ts/src/utility/PrepareParamsUtility.ts +3 -3
  56. package/project/.sdk/tm/ts/src/utility/PreparePathUtility.ts +2 -2
  57. package/project/.sdk/tm/ts/src/utility/PrepareQueryUtility.ts +2 -2
  58. package/project/.sdk/tm/ts/src/utility/TransformRequestUtility.ts +2 -2
  59. package/project/.sdk/tm/ts/src/utility/TransformResponseUtility.ts +2 -2
  60. package/project/.sdk/tm/ts/src/utility/Utility.ts +2 -2
  61. package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +8 -8
@@ -8,10 +8,10 @@ import (
8
8
  "GOMODULE/core"
9
9
  )
10
10
 
11
- func makeTargetUtil(ctx *core.Context) (map[string]any, error) {
12
- if ctx.Out["target"] != nil {
13
- if tm, ok := ctx.Out["target"].(map[string]any); ok {
14
- ctx.Target = tm
11
+ func makePointUtil(ctx *core.Context) (map[string]any, error) {
12
+ if ctx.Out["point"] != nil {
13
+ if tm, ok := ctx.Out["point"].(map[string]any); ok {
14
+ ctx.Point = tm
15
15
  return tm, nil
16
16
  }
17
17
  }
@@ -21,13 +21,13 @@ func makeTargetUtil(ctx *core.Context) (map[string]any, error) {
21
21
 
22
22
  allowOp, _ := vs.GetPath([]any{"allow", "op"}, options).(string)
23
23
  if !strings.Contains(allowOp, op.Name) {
24
- return nil, ctx.MakeError("target_op_allow",
24
+ return nil, ctx.MakeError("point_op_allow",
25
25
  "Operation \""+op.Name+
26
26
  "\" not allowed by SDK option allow.op value: \""+allowOp+"\"")
27
27
  }
28
28
 
29
- if len(op.Targets) == 1 {
30
- ctx.Target = op.Targets[0]
29
+ if len(op.Points) == 1 {
30
+ ctx.Point = op.Points[0]
31
31
  } else {
32
32
  var reqselector map[string]any
33
33
  var selector map[string]any
@@ -40,10 +40,10 @@ func makeTargetUtil(ctx *core.Context) (map[string]any, error) {
40
40
  selector = ctx.Match
41
41
  }
42
42
 
43
- var target map[string]any
44
- for i := 0; i < len(op.Targets); i++ {
45
- target = op.Targets[i]
46
- selectDef := core.ToMapAny(vs.GetProp(target, "select"))
43
+ var point map[string]any
44
+ for i := 0; i < len(op.Points); i++ {
45
+ point = op.Points[i]
46
+ selectDef := core.ToMapAny(vs.GetProp(point, "select"))
47
47
  found := true
48
48
 
49
49
  if selector != nil && selectDef != nil {
@@ -77,19 +77,19 @@ func makeTargetUtil(ctx *core.Context) (map[string]any, error) {
77
77
 
78
78
  if reqselector != nil {
79
79
  reqAction := vs.GetProp(reqselector, "$action")
80
- if reqAction != nil && target != nil {
81
- targetSelect := core.ToMapAny(vs.GetProp(target, "select"))
82
- targetAction := vs.GetProp(targetSelect, "$action")
83
- if reqAction != targetAction {
84
- return nil, ctx.MakeError("target_action_invalid",
80
+ if reqAction != nil && point != nil {
81
+ pointSelect := core.ToMapAny(vs.GetProp(point, "select"))
82
+ pointAction := vs.GetProp(pointSelect, "$action")
83
+ if reqAction != pointAction {
84
+ return nil, ctx.MakeError("point_action_invalid",
85
85
  "Operation \""+op.Name+
86
86
  "\" action \""+vs.Stringify(reqAction)+"\" is not valid.")
87
87
  }
88
88
  }
89
89
  }
90
90
 
91
- ctx.Target = target
91
+ ctx.Point = point
92
92
  }
93
93
 
94
- return ctx.Target, nil
94
+ return ctx.Point, nil
95
95
  }
@@ -7,7 +7,7 @@ import (
7
7
  )
8
8
 
9
9
  func paramUtil(ctx *core.Context, paramdef any) any {
10
- target := ctx.Target
10
+ point := ctx.Point
11
11
  spec := ctx.Spec
12
12
  match := ctx.Match
13
13
  reqmatch := ctx.Reqmatch
@@ -25,8 +25,8 @@ func paramUtil(ctx *core.Context, paramdef any) any {
25
25
  }
26
26
 
27
27
  var akey string
28
- if target != nil {
29
- alias := core.ToMapAny(vs.GetProp(target, "alias"))
28
+ if point != nil {
29
+ alias := core.ToMapAny(vs.GetProp(point, "alias"))
30
30
  if alias != nil {
31
31
  if ak := vs.GetProp(alias, key); ak != nil {
32
32
  akey, _ = ak.(string)
@@ -8,10 +8,10 @@ import (
8
8
 
9
9
  func prepareParamsUtil(ctx *core.Context) map[string]any {
10
10
  utility := ctx.Utility
11
- target := ctx.Target
11
+ point := ctx.Point
12
12
 
13
13
  var params []any
14
- if args := vs.GetProp(target, "args"); args != nil {
14
+ if args := vs.GetProp(point, "args"); args != nil {
15
15
  if argsMap, ok := args.(map[string]any); ok {
16
16
  if p := vs.GetProp(argsMap, "params"); p != nil {
17
17
  if pl, ok := p.([]any); ok {
@@ -7,10 +7,10 @@ import (
7
7
  )
8
8
 
9
9
  func preparePathUtil(ctx *core.Context) string {
10
- target := ctx.Target
10
+ point := ctx.Point
11
11
 
12
12
  var parts []any
13
- if p := vs.GetProp(target, "parts"); p != nil {
13
+ if p := vs.GetProp(point, "parts"); p != nil {
14
14
  if pl, ok := p.([]any); ok {
15
15
  parts = pl
16
16
  }
@@ -7,15 +7,15 @@ import (
7
7
  )
8
8
 
9
9
  func prepareQueryUtil(ctx *core.Context) map[string]any {
10
- target := ctx.Target
10
+ point := ctx.Point
11
11
  reqmatch := ctx.Reqmatch
12
12
  if reqmatch == nil {
13
13
  reqmatch = map[string]any{}
14
14
  }
15
15
 
16
16
  var params []any
17
- if target != nil {
18
- if p := vs.GetProp(target, "params"); p != nil {
17
+ if point != nil {
18
+ if p := vs.GetProp(point, "params"); p != nil {
19
19
  if pl, ok := p.([]any); ok {
20
20
  params = pl
21
21
  }
@@ -20,7 +20,7 @@ func registerAll(u *core.Utility) {
20
20
  u.MakeRequest = makeRequestUtil
21
21
  u.MakeResponse = makeResponseUtil
22
22
  u.MakeResult = makeResultUtil
23
- u.MakeTarget = makeTargetUtil
23
+ u.MakePoint = makePointUtil
24
24
  u.MakeSpec = makeSpecUtil
25
25
  u.MakeUrl = makeUrlUtil
26
26
  u.Param = paramUtil
@@ -8,13 +8,13 @@ import (
8
8
 
9
9
  func transformRequestUtil(ctx *core.Context) any {
10
10
  spec := ctx.Spec
11
- target := ctx.Target
11
+ point := ctx.Point
12
12
 
13
13
  if spec != nil {
14
14
  spec.Step = "reqform"
15
15
  }
16
16
 
17
- transform := core.ToMapAny(vs.GetProp(target, "transform"))
17
+ transform := core.ToMapAny(vs.GetProp(point, "transform"))
18
18
  if transform == nil {
19
19
  return ctx.Reqdata
20
20
  }
@@ -9,7 +9,7 @@ import (
9
9
  func transformResponseUtil(ctx *core.Context) any {
10
10
  spec := ctx.Spec
11
11
  result := ctx.Result
12
- target := ctx.Target
12
+ point := ctx.Point
13
13
 
14
14
  if spec != nil {
15
15
  spec.Step = "resform"
@@ -19,7 +19,7 @@ func transformResponseUtil(ctx *core.Context) any {
19
19
  return nil
20
20
  }
21
21
 
22
- transform := core.ToMapAny(vs.GetProp(target, "transform"))
22
+ transform := core.ToMapAny(vs.GetProp(point, "transform"))
23
23
  if transform == nil {
24
24
  return nil
25
25
  }
@@ -69,8 +69,8 @@ class LogFeature {
69
69
  }
70
70
 
71
71
 
72
- PreTarget(ctx) {
73
- this.#loghook('PreTarget', ctx)
72
+ PrePoint(ctx) {
73
+ this.#loghook('PrePoint', ctx)
74
74
  }
75
75
 
76
76
  PreSpec(ctx) {
@@ -89,11 +89,6 @@ class LogFeature {
89
89
  this.#loghook('PreResult', ctx)
90
90
  }
91
91
 
92
- PostOperation(ctx) {
93
- this.#loghook('PostOperation', ctx)
94
- }
95
-
96
-
97
92
  #loghook(hook, ctx, level) {
98
93
  level = level || 'info'
99
94
  if(this.#logger) {
@@ -32,7 +32,7 @@ class Context {
32
32
  utility: Utility
33
33
 
34
34
  op: Operation
35
- target: any
35
+ point: any
36
36
 
37
37
  config: Record<string, any>
38
38
  entopts: Record<string, any>
@@ -75,7 +75,7 @@ class Context {
75
75
  this.match = getprop(ctxmap, 'match', {})
76
76
  this.reqmatch = getprop(ctxmap, 'reqmatch', {})
77
77
 
78
- this.target = getprop(ctxmap, 'target', getprop(basectx, 'target'))
78
+ this.point = getprop(ctxmap, 'point', getprop(basectx, 'point'))
79
79
  this.spec = getprop(ctxmap, 'spec', getprop(basectx, 'spec'))
80
80
  this.result = getprop(ctxmap, 'result', getprop(basectx, 'result'))
81
81
  this.response = getprop(ctxmap, 'response', getprop(basectx, 'response'))
@@ -101,7 +101,7 @@ class Context {
101
101
  entity: entname,
102
102
  name: opname,
103
103
  input,
104
- targets: getprop(opcfg, 'targets', [])
104
+ points: getprop(opcfg, 'points', [])
105
105
  })
106
106
 
107
107
  setprop(this.opmap, opname, op)
@@ -1,20 +1,20 @@
1
1
 
2
2
  import { getprop } from './utility/StructUtility'
3
3
 
4
- import { Target } from './Target'
4
+ import { Point } from './Point'
5
5
 
6
6
 
7
7
  class Operation {
8
8
  entity: string
9
9
  name: string
10
10
  input: string
11
- targets: Target[]
11
+ points: Point[]
12
12
 
13
13
  constructor(opmap: Record<string, any>) {
14
14
  this.entity = getprop(opmap, 'entity', '_')
15
15
  this.name = getprop(opmap, 'name', '_')
16
16
  this.input = getprop(opmap, 'input', '_')
17
- this.targets = getprop(opmap, 'targets', [])
17
+ this.points = getprop(opmap, 'points', [])
18
18
  }
19
19
  }
20
20
 
@@ -2,7 +2,7 @@
2
2
  import { getprop } from './utility/StructUtility'
3
3
 
4
4
 
5
- class Target {
5
+ class Point {
6
6
  args: { params: any[] }
7
7
  rename: { params: Record<string, string> }
8
8
  method: string
@@ -32,5 +32,5 @@ class Target {
32
32
 
33
33
 
34
34
  export {
35
- Target,
35
+ Point,
36
36
  }
@@ -16,14 +16,17 @@ class BaseFeature implements Feature {
16
16
 
17
17
  PostConstructEntity(this: any, _ctx: any) { }
18
18
 
19
+
19
20
  SetData(this: any, _ctx: any) { }
20
21
 
21
22
  GetData(this: any, _ctx: any) { }
22
23
 
24
+ SetMatch(this: any, _ctx: any) { }
25
+
23
26
  GetMatch(this: any, _ctx: any) { }
24
27
 
25
28
 
26
- PreTarget(this: any, _ctx: any) { }
29
+ PrePoint(this: any, _ctx: any) { }
27
30
 
28
31
  PreSpec(this: any, _ctx: any) { }
29
32
 
@@ -33,7 +36,9 @@ class BaseFeature implements Feature {
33
36
 
34
37
  PreResult(this: any, _ctx: any) { }
35
38
 
36
- PostOperation(this: any, _ctx: any) { }
39
+ PreDone(this: any, _ctx: any) { }
40
+
41
+ PreUnexpected(this: any, _ctx: any) { }
37
42
 
38
43
  }
39
44
 
@@ -65,8 +65,8 @@ class LogFeature extends BaseFeature {
65
65
  }
66
66
 
67
67
 
68
- PreTarget(this: any, ctx: any) {
69
- this._loghook('PreTarget', ctx)
68
+ PrePoint(this: any, ctx: any) {
69
+ this._loghook('PrePoint', ctx)
70
70
  }
71
71
 
72
72
  PreSpec(this: any, ctx: any) {
@@ -85,11 +85,6 @@ class LogFeature extends BaseFeature {
85
85
  this._loghook('PreResult', ctx)
86
86
  }
87
87
 
88
- PostOperation(this: any, ctx: any) {
89
- this._loghook('PostOperation', ctx)
90
- }
91
-
92
-
93
88
  _loghook(this: any, hook: any, ctx: any, level: any) {
94
89
  level = level || 'info'
95
90
  if (this._logger) {
@@ -168,12 +168,12 @@ class TestFeature extends BaseFeature {
168
168
  const isempty = struct.isempty
169
169
 
170
170
  const opname = getprop(op, 'name')
171
- const target =
171
+ const point =
172
172
  getelem(getpath(ctx.config, [
173
- 'entity', getprop(ctx.entity, 'name'), 'op', opname, 'targets']), -1)
173
+ 'entity', getprop(ctx.entity, 'name'), 'op', opname, 'points']), -1)
174
174
 
175
175
  const reqd = transform(
176
- select(getpath(target, ['args', 'params']), { reqd: true }),
176
+ select(getpath(point, ['args', 'params']), { reqd: true }),
177
177
  ['`$EACH`', '', '`$KEY.name`']
178
178
  )
179
179
 
@@ -1,7 +1,7 @@
1
1
 
2
- import { ProjectNameSDK } from './ProjectNameSDK'
2
+ import { ProjectNameEntityBase } from './ProjectNameEntityBase'
3
3
 
4
- import { Target } from './Target'
4
+ import { Point } from './Point'
5
5
  import { Context } from './Context'
6
6
  import { Control } from './Control'
7
7
  import { Operation } from './Operation'
@@ -22,29 +22,32 @@ interface Feature {
22
22
 
23
23
  init: (ctx: Context, options: FeatureOptions) => void | Promise<any>
24
24
 
25
- PostConstruct: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
26
- PostConstructEntity: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
27
- SetData: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
28
- GetData: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
29
- GetMatch: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
30
-
31
- PreTarget: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
32
- PreSpec: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
33
- PreRequest: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
34
- PreResponse: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
35
- PreResult: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
36
- PostOperation: (this: ProjectNameSDK, ctx: Context) => void | Promise<any>
25
+ PostConstruct: (ctx: Context) => void | Promise<any>
26
+ PostConstructEntity: (ctx: Context) => void | Promise<any>
27
+ SetData: (ctx: Context) => void | Promise<any>
28
+ GetData: (ctx: Context) => void | Promise<any>
29
+ GetMatch: (ctx: Context) => void | Promise<any>
30
+
31
+ PrePoint: (ctx: Context) => void | Promise<any>
32
+ PreSpec: (ctx: Context) => void | Promise<any>
33
+ PreRequest: (ctx: Context) => void | Promise<any>
34
+ PreResponse: (ctx: Context) => void | Promise<any>
35
+ PreResult: (ctx: Context) => void | Promise<any>
36
+ PreDone: (ctx: Context) => void | Promise<any>
37
+ PreUnexpected: (ctx: Context) => void | Promise<any>
38
+ SetMatch: (ctx: Context) => void | Promise<any>
37
39
  }
38
40
 
39
41
 
40
42
  export {
41
- Target,
43
+ Point,
42
44
  Context,
43
45
  Control,
44
46
  Operation,
45
47
  Response,
46
48
  Result,
47
49
  Spec,
50
+ ProjectNameEntityBase,
48
51
  }
49
52
 
50
53
 
@@ -1,10 +1,10 @@
1
1
 
2
- import { Context, Target } from '../types'
2
+ import { Context, Point } from '../types'
3
3
 
4
4
 
5
- function makeTarget(ctx: Context): Target | Error {
6
- if (ctx.out.target) {
7
- return ctx.target = ctx.out.target
5
+ function makePoint(ctx: Context): Point | Error {
6
+ if (ctx.out.point) {
7
+ return ctx.point = ctx.out.point
8
8
  }
9
9
 
10
10
  const getprop = ctx.utility.struct.getprop
@@ -12,23 +12,23 @@ function makeTarget(ctx: Context): Target | Error {
12
12
  const options = ctx.options
13
13
 
14
14
  if (!options.allow.op.includes(op.name)) {
15
- ctx.error('target_op_allow', 'Operation "' + op.name +
15
+ return ctx.error('point_op_allow', 'Operation "' + op.name +
16
16
  '" not allowed by SDK option allow.op value: "' + options.allow.op + '"')
17
17
  }
18
18
 
19
- // Choose the appropriate operation alternate based on the match or data.
20
- if (1 === op.targets.length) {
21
- ctx.target = op.targets[0]
19
+ // Choose the appropriate point based on the match or data.
20
+ if (1 === op.points.length) {
21
+ ctx.point = op.points[0]
22
22
  }
23
23
  else {
24
24
  // Operation argument has priority, but also look in current data or match.
25
25
  const reqselector = getprop(ctx, 'req' + op.input)
26
26
  const selector = getprop(ctx, op.input)
27
27
 
28
- let target
29
- for (let i = 0; i < op.targets.length; i++) {
30
- target = op.targets[i]
31
- const select = target.select
28
+ let point
29
+ for (let i = 0; i < op.points.length; i++) {
30
+ point = op.points[i]
31
+ const select = point.select
32
32
  let found = true
33
33
 
34
34
  if (selector && select.exist) {
@@ -57,20 +57,20 @@ function makeTarget(ctx: Context): Target | Error {
57
57
 
58
58
  if (
59
59
  null != reqselector.$action &&
60
- null != target &&
61
- reqselector.$action !== target.select.$action
60
+ null != point &&
61
+ reqselector.$action !== point.select.$action
62
62
  ) {
63
- return ctx.error('target_action_invalid', 'Operation "' + op.name +
63
+ return ctx.error('point_action_invalid', 'Operation "' + op.name +
64
64
  '" action "' + reqselector.$action + '" is not valid.')
65
65
  }
66
66
 
67
- ctx.target = target
67
+ ctx.point = point
68
68
  }
69
69
 
70
- return ctx.target
70
+ return ctx.point
71
71
  }
72
72
 
73
73
 
74
74
  export {
75
- makeTarget,
75
+ makePoint,
76
76
  }
@@ -8,7 +8,7 @@ function makeSpec(ctx: Context): Spec | Error {
8
8
  return ctx.spec = ctx.out.spec
9
9
  }
10
10
 
11
- const target = ctx.target
11
+ const point = ctx.point
12
12
  const options = ctx.options
13
13
  const utility = ctx.utility
14
14
 
@@ -23,7 +23,7 @@ function makeSpec(ctx: Context): Spec | Error {
23
23
  ctx.spec = new Spec({
24
24
  base: options.base, // string, URL endpoint base prefix,
25
25
  prefix: options.prefix,
26
- parts: target.parts,
26
+ parts: point.parts,
27
27
  suffix: options.suffix,
28
28
  step: 'start',
29
29
  })
@@ -9,7 +9,7 @@ import { Context } from '../types'
9
9
  * This function returns `undefined` rather than failing.
10
10
  */
11
11
  function param(ctx: Context, paramdef: any) {
12
- const target = ctx.target
12
+ const point = ctx.point
13
13
  const spec = ctx.spec
14
14
  const match = ctx.match
15
15
  const reqmatch = ctx.reqmatch
@@ -31,7 +31,7 @@ function param(ctx: Context, paramdef: any) {
31
31
 
32
32
  const key = 0 < (T_string & pt) ? paramdef : getprop(paramdef, 'name')
33
33
 
34
- let akey = getprop(target.alias, key)
34
+ let akey = getprop(point.alias, key)
35
35
 
36
36
  let val = getprop(reqmatch, key)
37
37
 
@@ -14,7 +14,7 @@ function prepareBody(ctx: Context) {
14
14
  try {
15
15
  body = transformRequest(ctx)
16
16
 
17
- // if (target.check.nobody && null == body) {
17
+ // if (point.check.nobody && null == body) {
18
18
  // return error(ctx, new Error('Request body is empty.'))
19
19
  // }
20
20
  }
@@ -9,9 +9,9 @@ function prepareParams(ctx: Context) {
9
9
  // const struct = utility.struct
10
10
  // const validate = struct.validate
11
11
 
12
- const target = ctx.target
12
+ const point = ctx.point
13
13
 
14
- let params = target.args.params
14
+ let params = point.args.params
15
15
  // let reqmatch = ctx.reqmatch
16
16
 
17
17
  params = params || []
@@ -26,7 +26,7 @@ function prepareParams(ctx: Context) {
26
26
  }
27
27
 
28
28
  // TODO: review
29
- // out = validate(out, target.validate.params)
29
+ // out = validate(out, point.validate.params)
30
30
 
31
31
  return out
32
32
  }
@@ -4,9 +4,9 @@ import { Context } from '../types'
4
4
 
5
5
  function preparePath(ctx: Context) {
6
6
  const join = ctx.utility.struct.join
7
- const target = ctx.target
7
+ const point = ctx.point
8
8
 
9
- const path = join(target.parts, '/', true)
9
+ const path = join(point.parts, '/', true)
10
10
 
11
11
  return path
12
12
  }
@@ -7,8 +7,8 @@ function prepareQuery(ctx: Context) {
7
7
  const struct = utility.struct
8
8
  const items = struct.items
9
9
 
10
- const target = ctx.target
11
- let params = target.params
10
+ const point = ctx.point
11
+ let params = point.params
12
12
  let reqmatch = ctx.reqmatch
13
13
 
14
14
  params = params || []
@@ -8,7 +8,7 @@ import { Context } from '../types'
8
8
  function transformRequest(ctx: Context) {
9
9
  const spec = ctx.spec
10
10
  const utility = ctx.utility
11
- const target = ctx.target
11
+ const point = ctx.point
12
12
  const isfunc = utility.struct.isfunc
13
13
  const transform = utility.struct.transform
14
14
 
@@ -17,7 +17,7 @@ function transformRequest(ctx: Context) {
17
17
  }
18
18
 
19
19
  try {
20
- const reqform = target.transform.req
20
+ const reqform = point.transform.req
21
21
  const reqdata = isfunc(reqform) ? reqform(ctx) : transform({
22
22
  reqdata: ctx.reqdata
23
23
  }, reqform)
@@ -10,7 +10,7 @@ function transformResponse(ctx: Context) {
10
10
  const spec = ctx.spec
11
11
  const result = ctx.result
12
12
  const utility = ctx.utility
13
- const target = ctx.target
13
+ const point = ctx.point
14
14
  const isfunc = utility.struct.isfunc
15
15
  const transform = utility.struct.transform
16
16
 
@@ -23,7 +23,7 @@ function transformResponse(ctx: Context) {
23
23
  }
24
24
 
25
25
  try {
26
- const resform = target.transform.res
26
+ const resform = point.transform.res
27
27
  const resdata = isfunc(resform) ? resform(ctx) : transform(ctx.result, resform)
28
28
  result.resdata = resdata
29
29
  return resdata
@@ -13,7 +13,7 @@ import { makeOptions } from './MakeOptionsUtility'
13
13
  import { makeRequest } from './MakeRequestUtility'
14
14
  import { makeResponse } from './MakeResponseUtility'
15
15
  import { makeResult } from './MakeResultUtility'
16
- import { makeTarget } from './MakeTargetUtility'
16
+ import { makePoint } from './MakePointUtility'
17
17
  import { makeSpec } from './MakeSpecUtility'
18
18
  import { makeUrl } from './MakeUrlUtility'
19
19
  import { param } from './ParamUtility'
@@ -48,7 +48,7 @@ class Utility {
48
48
  makeRequest = makeRequest
49
49
  makeResponse = makeResponse
50
50
  makeResult = makeResult
51
- makeTarget = makeTarget
51
+ makePoint = makePoint
52
52
  makeSpec = makeSpec
53
53
  makeUrl = makeUrl
54
54
  param = param