@voxgig/sdkgen 0.25.0 → 0.28.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 (213) hide show
  1. package/bin/voxgig-sdkgen +6 -6
  2. package/dist/action/action.js +1 -2
  3. package/dist/action/action.js.map +1 -1
  4. package/dist/action/feature.js +4 -2
  5. package/dist/action/feature.js.map +1 -1
  6. package/dist/action/target.js +4 -2
  7. package/dist/action/target.js.map +1 -1
  8. package/dist/cmp/Entity.js +2 -1
  9. package/dist/cmp/Entity.js.map +1 -1
  10. package/dist/cmp/Feature.js +11 -9
  11. package/dist/cmp/Feature.js.map +1 -1
  12. package/dist/cmp/FeatureHook.js +2 -1
  13. package/dist/cmp/FeatureHook.js.map +1 -1
  14. package/dist/cmp/Main.js +6 -2
  15. package/dist/cmp/Main.js.map +1 -1
  16. package/dist/cmp/ReadmeEntity.js +2 -1
  17. package/dist/cmp/ReadmeEntity.js.map +1 -1
  18. package/dist/cmp/Test.d.ts +2 -0
  19. package/dist/cmp/Test.js +17 -0
  20. package/dist/cmp/Test.js.map +1 -0
  21. package/dist/sdkgen.d.ts +2 -1
  22. package/dist/sdkgen.js +17 -28
  23. package/dist/sdkgen.js.map +1 -1
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/dist/types.d.ts +3 -1
  26. package/dist/types.js +4 -0
  27. package/dist/types.js.map +1 -1
  28. package/model/sdkgen.jsonic +9 -9
  29. package/package.json +8 -6
  30. package/project/.sdk/model/feature/log.jsonic +3 -3
  31. package/project/.sdk/model/feature/test.jsonic +8 -3
  32. package/project/.sdk/model/target/go.jsonic +19 -4
  33. package/project/.sdk/model/target/js.jsonic +2 -2
  34. package/project/.sdk/model/target/ts.jsonic +5 -5
  35. package/project/.sdk/src/cmp/go/Config_go.ts +119 -0
  36. package/project/.sdk/src/cmp/go/EntityOperation_go.ts +48 -0
  37. package/project/.sdk/src/cmp/go/Entity_go.ts +67 -0
  38. package/project/.sdk/src/cmp/go/MainEntity_go.ts +22 -0
  39. package/project/.sdk/src/cmp/go/Main_go.ts +209 -0
  40. package/project/.sdk/src/cmp/go/Package_go.ts +89 -0
  41. package/project/.sdk/src/cmp/go/TestDirect_go.ts +373 -0
  42. package/project/.sdk/src/cmp/go/TestEntity_go.ts +341 -0
  43. package/project/.sdk/src/cmp/go/Test_go.ts +37 -0
  44. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +146 -0
  45. package/project/.sdk/src/cmp/go/fragment/EntityCreateOp.fragment.go +35 -0
  46. package/project/.sdk/src/cmp/go/fragment/EntityListOp.fragment.go +26 -0
  47. package/project/.sdk/src/cmp/go/fragment/EntityLoadOp.fragment.go +38 -0
  48. package/project/.sdk/src/cmp/go/fragment/EntityRemoveOp.fragment.go +38 -0
  49. package/project/.sdk/src/cmp/go/fragment/EntityUpdateOp.fragment.go +38 -0
  50. package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +250 -0
  51. package/project/.sdk/src/cmp/go/fragment/SdkError.fragment.go +22 -0
  52. package/project/.sdk/src/cmp/go/tsconfig.json +15 -0
  53. package/project/.sdk/src/cmp/go/utility_go.ts +88 -0
  54. package/project/.sdk/src/cmp/js/Main_js.ts +3 -3
  55. package/project/.sdk/src/cmp/js/Quick_js.ts +1 -1
  56. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +6 -6
  57. package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +6 -6
  58. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +6 -6
  59. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +6 -6
  60. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +6 -6
  61. package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +85 -1
  62. package/project/.sdk/src/cmp/ts/Config_ts.ts +53 -6
  63. package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +3 -21
  64. package/project/.sdk/src/cmp/ts/Entity_ts.ts +3 -5
  65. package/project/.sdk/src/cmp/ts/Main_ts.ts +23 -13
  66. package/project/.sdk/src/cmp/ts/Package_ts.ts +30 -11
  67. package/project/.sdk/src/cmp/ts/SdkError_ts.ts +42 -0
  68. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +288 -0
  69. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +349 -2
  70. package/project/.sdk/src/cmp/ts/TestMain_ts.ts +0 -3
  71. package/project/.sdk/src/cmp/ts/Test_ts.ts +23 -3
  72. package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +38 -5
  73. package/project/.sdk/src/cmp/ts/fragment/Direct.test.fragment.ts +30 -0
  74. package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.ts +50 -38
  75. package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +9 -7
  76. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +47 -31
  77. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +49 -31
  78. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +50 -33
  79. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +51 -32
  80. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +51 -31
  81. package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +166 -34
  82. package/project/.sdk/src/cmp/ts/fragment/SdkError.fragment.ts +25 -0
  83. package/project/.sdk/src/cmp/ts/tsconfig.json +15 -0
  84. package/project/.sdk/src/cmp/ts/utility_ts.ts +55 -1
  85. package/project/.sdk/tm/go/Makefile +10 -0
  86. package/project/.sdk/tm/go/core/context.go +267 -0
  87. package/project/.sdk/tm/go/core/control.go +7 -0
  88. package/project/.sdk/tm/go/core/error.go +25 -0
  89. package/project/.sdk/tm/go/core/helpers.go +33 -0
  90. package/project/.sdk/tm/go/core/operation.go +61 -0
  91. package/project/.sdk/tm/go/core/response.go +55 -0
  92. package/project/.sdk/tm/go/core/result.go +73 -0
  93. package/project/.sdk/tm/go/core/spec.go +97 -0
  94. package/project/.sdk/tm/go/core/target.go +102 -0
  95. package/project/.sdk/tm/go/core/types.go +44 -0
  96. package/project/.sdk/tm/go/core/utility_type.go +54 -0
  97. package/project/.sdk/tm/go/feature/base_feature.go +40 -0
  98. package/project/.sdk/tm/go/feature/test_feature.go +196 -0
  99. package/project/.sdk/tm/go/src/feature/README.md +1 -0
  100. package/project/.sdk/tm/go/src/feature/base/.gitkeep +0 -0
  101. package/project/.sdk/tm/go/src/feature/test/.gitkeep +0 -0
  102. package/project/.sdk/tm/go/test/custom_utility_test.go +80 -0
  103. package/project/.sdk/tm/go/test/exists_test.go +16 -0
  104. package/project/.sdk/tm/go/test/primary_utility_test.go +899 -0
  105. package/project/.sdk/tm/go/test/runner_test.go +428 -0
  106. package/project/.sdk/tm/go/test/struct_runner_test.go +1094 -0
  107. package/project/.sdk/tm/go/test/struct_utility_test.go +1423 -0
  108. package/project/.sdk/tm/go/utility/clean.go +7 -0
  109. package/project/.sdk/tm/go/utility/done.go +20 -0
  110. package/project/.sdk/tm/go/utility/feature_add.go +10 -0
  111. package/project/.sdk/tm/go/utility/feature_hook.go +30 -0
  112. package/project/.sdk/tm/go/utility/feature_init.go +30 -0
  113. package/project/.sdk/tm/go/utility/fetcher.go +102 -0
  114. package/project/.sdk/tm/go/utility/make_context.go +7 -0
  115. package/project/.sdk/tm/go/utility/make_error.go +69 -0
  116. package/project/.sdk/tm/go/utility/make_fetch_def.go +44 -0
  117. package/project/.sdk/tm/go/utility/make_options.go +130 -0
  118. package/project/.sdk/tm/go/utility/make_request.go +59 -0
  119. package/project/.sdk/tm/go/utility/make_response.go +46 -0
  120. package/project/.sdk/tm/go/utility/make_result.go +55 -0
  121. package/project/.sdk/tm/go/utility/make_spec.go +68 -0
  122. package/project/.sdk/tm/go/utility/make_target.go +95 -0
  123. package/project/.sdk/tm/go/utility/make_url.go +41 -0
  124. package/project/.sdk/tm/go/utility/param.go +66 -0
  125. package/project/.sdk/tm/go/utility/prepare_auth.go +40 -0
  126. package/project/.sdk/tm/go/utility/prepare_body.go +14 -0
  127. package/project/.sdk/tm/go/utility/prepare_headers.go +22 -0
  128. package/project/.sdk/tm/go/utility/prepare_method.go +21 -0
  129. package/project/.sdk/tm/go/utility/prepare_params.go +41 -0
  130. package/project/.sdk/tm/go/utility/prepare_path.go +21 -0
  131. package/project/.sdk/tm/go/utility/prepare_query.go +47 -0
  132. package/project/.sdk/tm/go/utility/register.go +39 -0
  133. package/project/.sdk/tm/go/utility/result_basic.go +31 -0
  134. package/project/.sdk/tm/go/utility/result_body.go +17 -0
  135. package/project/.sdk/tm/go/utility/result_headers.go +22 -0
  136. package/project/.sdk/tm/go/utility/struct/go.mod +3 -0
  137. package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +4891 -0
  138. package/project/.sdk/tm/go/utility/transform_request.go +32 -0
  139. package/project/.sdk/tm/go/utility/transform_response.go +45 -0
  140. package/project/.sdk/tm/js/src/feature/log/LogFeature.js +2 -2
  141. package/project/.sdk/tm/ts/src/Context.ts +144 -0
  142. package/project/.sdk/tm/ts/src/Control.ts +20 -0
  143. package/project/.sdk/tm/ts/src/Operation.ts +24 -0
  144. package/project/.sdk/tm/ts/src/Response.ts +26 -0
  145. package/project/.sdk/tm/ts/src/Result.ts +30 -0
  146. package/project/.sdk/tm/ts/src/Spec.ts +40 -0
  147. package/project/.sdk/tm/ts/src/Target.ts +36 -0
  148. package/project/.sdk/tm/ts/src/feature/base/BaseFeature.ts +1 -1
  149. package/project/.sdk/tm/ts/src/feature/log/LogFeature.ts +2 -2
  150. package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +158 -104
  151. package/project/.sdk/tm/ts/src/types.ts +18 -78
  152. package/project/.sdk/tm/ts/src/utility/CleanUtility.ts +17 -31
  153. package/project/.sdk/tm/ts/src/utility/DoneUtility.ts +3 -4
  154. package/project/.sdk/tm/ts/src/utility/{AddfeatureUtility.ts → FeatureAddUtility.ts} +2 -2
  155. package/project/.sdk/tm/ts/src/utility/{FeaturehookUtility.ts → FeatureHookUtility.ts} +8 -5
  156. package/project/.sdk/tm/ts/src/utility/FeatureInitUtility.ts +15 -0
  157. package/project/.sdk/tm/ts/src/utility/FetcherUtility.ts +20 -2
  158. package/project/.sdk/tm/ts/src/utility/MakeContextUtility.ts +27 -0
  159. package/project/.sdk/tm/ts/src/utility/{ErrorUtility.ts → MakeErrorUtility.ts} +10 -6
  160. package/project/.sdk/tm/ts/src/utility/MakeFetchDefUtility.ts +46 -0
  161. package/project/.sdk/tm/ts/src/utility/{OptionsUtility.ts → MakeOptionsUtility.ts} +32 -7
  162. package/project/.sdk/tm/ts/src/utility/MakeRequestUtility.ts +66 -0
  163. package/project/.sdk/tm/ts/src/utility/MakeResponseUtility.ts +61 -0
  164. package/project/.sdk/tm/ts/src/utility/MakeResultUtility.ts +56 -0
  165. package/project/.sdk/tm/ts/src/utility/MakeSpecUtility.ts +61 -0
  166. package/project/.sdk/tm/ts/src/utility/MakeTargetUtility.ts +76 -0
  167. package/project/.sdk/tm/ts/src/utility/MakeUrlUtility.ts +61 -0
  168. package/project/.sdk/tm/ts/src/utility/{FindparamUtility.ts → ParamUtility.ts} +28 -8
  169. package/project/.sdk/tm/ts/src/utility/{AuthUtility.ts → PrepareAuthUtility.ts} +10 -4
  170. package/project/.sdk/tm/ts/src/utility/PrepareBodyUtility.ts +32 -0
  171. package/project/.sdk/tm/ts/src/utility/{HeadersUtility.ts → PrepareHeadersUtility.ts} +5 -7
  172. package/project/.sdk/tm/ts/src/utility/{MethodUtility.ts → PrepareMethodUtility.ts} +6 -6
  173. package/project/.sdk/tm/ts/src/utility/PrepareParamsUtility.ts +37 -0
  174. package/project/.sdk/tm/ts/src/utility/PreparePathUtility.ts +17 -0
  175. package/project/.sdk/tm/ts/src/utility/PrepareQueryUtility.ts +30 -0
  176. package/project/.sdk/tm/ts/src/utility/{ResbasicUtility.ts → ResultBasicUtility.ts} +12 -7
  177. package/project/.sdk/tm/ts/src/utility/ResultBodyUtility.ts +22 -0
  178. package/project/.sdk/tm/ts/src/utility/ResultHeadersUtility.ts +26 -0
  179. package/project/.sdk/tm/ts/src/utility/StructUtility.ts +1113 -525
  180. package/project/.sdk/tm/ts/src/utility/{ReqformUtility.ts → TransformRequestUtility.ts} +9 -7
  181. package/project/.sdk/tm/ts/src/utility/{ResformUtility.ts → TransformResponseUtility.ts} +11 -8
  182. package/project/.sdk/tm/ts/src/utility/Utility.ts +52 -65
  183. package/project/.sdk/tm/ts/test/exists.test.ts +0 -1
  184. package/project/.sdk/tm/ts/test/runner.ts +36 -13
  185. package/project/.sdk/tm/ts/test/utility/Custom.test.ts +30 -29
  186. package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +385 -168
  187. package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +433 -189
  188. package/src/action/action.ts +1 -2
  189. package/src/action/feature.ts +7 -2
  190. package/src/action/target.ts +7 -7
  191. package/src/cmp/Entity.ts +7 -1
  192. package/src/cmp/Feature.ts +11 -9
  193. package/src/cmp/FeatureHook.ts +6 -1
  194. package/src/cmp/Main.ts +12 -2
  195. package/src/cmp/ReadmeEntity.ts +6 -1
  196. package/src/cmp/Test.ts +31 -0
  197. package/src/sdkgen.ts +19 -34
  198. package/src/types.ts +10 -1
  199. package/project/.sdk/src/cmp/ts/EntityTest_ts.ts +0 -180
  200. package/project/.sdk/tm/ts/src/utility/BodyUtility.ts +0 -29
  201. package/project/.sdk/tm/ts/src/utility/ContextUtility.ts +0 -67
  202. package/project/.sdk/tm/ts/src/utility/FullurlUtility.ts +0 -46
  203. package/project/.sdk/tm/ts/src/utility/InitfeatureUtility.ts +0 -13
  204. package/project/.sdk/tm/ts/src/utility/JoinurlUtility.ts +0 -15
  205. package/project/.sdk/tm/ts/src/utility/OperatorUtility.ts +0 -90
  206. package/project/.sdk/tm/ts/src/utility/ParamsUtility.ts +0 -37
  207. package/project/.sdk/tm/ts/src/utility/QueryUtility.ts +0 -27
  208. package/project/.sdk/tm/ts/src/utility/RequestUtility.ts +0 -66
  209. package/project/.sdk/tm/ts/src/utility/ResbodyUtility.ts +0 -19
  210. package/project/.sdk/tm/ts/src/utility/ResheadersUtility.ts +0 -23
  211. package/project/.sdk/tm/ts/src/utility/ResponseUtility.ts +0 -30
  212. package/project/.sdk/tm/ts/src/utility/ResultUtility.ts +0 -36
  213. package/project/.sdk/tm/ts/src/utility/SpecUtility.ts +0 -61
@@ -1,79 +1,94 @@
1
1
  type Context = any
2
- type Operation = any
3
2
  type Control = any
4
3
 
5
4
  class EntityOperation {
6
5
 
6
+ #match: any
7
+ #data: any
8
+ #utility: any
9
+
10
+
7
11
  // EJECT-START
8
12
 
9
13
  async create(this: any, reqdata?: any, ctrl?: Control) {
10
- let entity = this
11
- let client = this.#client
14
+
12
15
  const utility = this.#utility
13
16
  const {
14
- operator, spec, request, response, result, done, contextify, opify, featurehook
17
+ makeContext,
18
+ done,
19
+ error,
20
+ featureHook,
21
+ makeTarget,
22
+ makeRequest,
23
+ makeResponse,
24
+ makeResult,
25
+ makeSpec,
15
26
  } = utility
16
27
 
17
-
18
28
  let fres: Promise<any> | undefined = undefined
19
29
 
20
- let op: Operation = opify({
21
- entity: 'entityname',
22
- name: 'create',
23
- path: 'PATH',
24
- pathalt: ['PATHALT'],
25
- params: ['PARAM-LIST'],
26
- alias: { 'ALIAS': 'MAP' },
27
- state: {},
28
- reqform: 'REQFORM',
29
- resform: 'RESFORM',
30
- validate: 'VALIDATE',
31
- })
32
-
33
- let ctx: Context = contextify({
30
+ let ctx: Context = makeContext({
31
+ opname: 'create',
34
32
  ctrl,
35
- op,
36
33
  match: this.#match,
37
34
  data: this.#data,
38
35
  reqdata
39
- }, this.#_basectx)
36
+ }, this._entctx)
40
37
 
41
38
  try {
39
+ // #PreSelection-Hook
42
40
 
43
- // #PreOperation-Hook
44
-
45
- operator(ctx)
41
+ ctx.out.target = makeTarget(ctx)
42
+ if (ctx.out.target instanceof Error) {
43
+ return error(ctx, ctx.out.target)
44
+ }
46
45
 
47
46
 
48
47
  // #PreSpec-Hook
49
48
 
50
- spec(ctx)
49
+ ctx.out.spec = makeSpec(ctx)
50
+ if (ctx.out.spec instanceof Error) {
51
+ return error(ctx, ctx.out.spec)
52
+ }
51
53
 
52
54
 
53
55
  // #PreRequest-Hook
54
56
 
55
- await request(ctx)
57
+ ctx.out.request = await makeRequest(ctx)
58
+ if (ctx.out.request instanceof Error) {
59
+ return error(ctx, ctx.out.request)
60
+ }
56
61
 
57
62
 
58
63
  // #PreResponse-Hook
59
64
 
60
- await response(ctx)
65
+ ctx.out.response = await makeResponse(ctx)
66
+ if (ctx.out.response instanceof Error) {
67
+ return error(ctx, ctx.out.response)
68
+ }
61
69
 
62
70
 
63
71
  // #PreResult-Hook
64
72
 
65
- result(ctx)
73
+ ctx.out.result = await makeResult(ctx)
74
+ if (ctx.out.result instanceof Error) {
75
+ return error(ctx, ctx.out.result)
76
+ }
66
77
 
67
78
 
68
- // #PostOperation-Hook
79
+ // #PreDone-Hook
69
80
 
70
- if (null != ctx.result.resdata) {
71
- this.#data = ctx.result.resdata
81
+ if (null != ctx.result) {
82
+ if (null != ctx.result.resdata) {
83
+ this.#data = ctx.result.resdata
84
+ }
72
85
  }
73
86
 
74
87
  return done(ctx)
75
88
  }
76
89
  catch (err: any) {
90
+ // #PreUnexpected-Hook
91
+
77
92
  err = this.#unexpected(ctx, err)
78
93
 
79
94
  if (err) {
@@ -87,5 +102,6 @@ class EntityOperation {
87
102
 
88
103
  // EJECT-END
89
104
 
105
+
90
106
  #unexpected(this: any, ctx: Context, ctrl: any, err: any): any { return err }
91
107
  }
@@ -1,78 +1,95 @@
1
1
  type Context = any
2
- type Operation = any
3
2
  type Control = any
4
3
 
5
4
  class EntityOperation {
6
5
 
6
+ #match: any
7
+ #data: any
8
+ #utility: any
9
+
10
+
7
11
  // EJECT-START
8
12
 
9
13
  async list(this: any, reqmatch?: any, ctrl?: Control) {
10
- let entity = this
11
- let client = this.#client
14
+
12
15
  const utility = this.#utility
16
+
13
17
  const {
14
- operator, spec, request, response, result, done, contextify, opify, featurehook
18
+ makeContext,
19
+ done,
20
+ error,
21
+ featureHook,
22
+ makeTarget,
23
+ makeRequest,
24
+ makeResponse,
25
+ makeResult,
26
+ makeSpec,
15
27
  } = utility
16
28
 
17
29
  let fres: Promise<any> | undefined = undefined
18
30
 
19
- let op: Operation = opify({
20
- entity: 'entityname',
21
- name: 'list',
22
- path: 'PATH',
23
- pathalt: ['PATHALT'],
24
- params: ['PARAM-LIST'],
25
- alias: { 'ALIAS': 'MAP' },
26
- state: {},
27
- reqform: 'REQFORM',
28
- resform: 'RESFORM',
29
- validate: 'VALIDATE',
30
- })
31
-
32
- let ctx: Context = contextify({
31
+ let ctx: Context = makeContext({
32
+ opname: 'list',
33
33
  ctrl,
34
- op,
35
34
  match: this.#match,
36
35
  data: this.#data,
37
36
  reqmatch
38
- }, this.#_basectx)
37
+ }, this._entctx)
39
38
 
40
39
  try {
40
+ // #PreSelection-Hook
41
41
 
42
- // #PreOperation-Hook
43
-
44
- operator(ctx)
42
+ ctx.out.target = makeTarget(ctx)
43
+ if (ctx.out.target instanceof Error) {
44
+ return error(ctx, ctx.out.target)
45
+ }
45
46
 
46
47
 
47
48
  // #PreSpec-Hook
48
49
 
49
- spec(ctx)
50
+ ctx.out.spec = makeSpec(ctx)
51
+ if (ctx.out.spec instanceof Error) {
52
+ return error(ctx, ctx.out.spec)
53
+ }
50
54
 
51
55
 
52
56
  // #PreRequest-Hook
53
57
 
54
- await request(ctx)
58
+ ctx.out.request = await makeRequest(ctx)
59
+ if (ctx.out.request instanceof Error) {
60
+ return error(ctx, ctx.out.request)
61
+ }
55
62
 
56
63
 
57
64
  // #PreResponse-Hook
58
65
 
59
- await response(ctx)
66
+ ctx.out.response = await makeResponse(ctx)
67
+ if (ctx.out.response instanceof Error) {
68
+ return error(ctx, ctx.out.response)
69
+ }
60
70
 
61
71
 
62
72
  // #PreResult-Hook
63
73
 
64
- result(ctx)
74
+ ctx.out.result = await makeResult(ctx)
75
+ if (ctx.out.result instanceof Error) {
76
+ return error(ctx, ctx.out.result)
77
+ }
65
78
 
66
79
 
67
- // #PostOperation-Hook
80
+ // #PreDone-Hook
68
81
 
69
- if (null != ctx.result.resmatch) {
70
- this.#match = ctx.result.resmatch
82
+ if (null != ctx.result) {
83
+ if (null != ctx.result.resmatch) {
84
+ this.#match = ctx.result.resmatch
85
+ }
71
86
  }
72
87
 
73
88
  return done(ctx)
74
89
  }
75
90
  catch (err: any) {
91
+ // #PreUnexpected-Hook
92
+
76
93
  err = this.#unexpected(ctx, err)
77
94
 
78
95
  if (err) {
@@ -86,7 +103,8 @@ class EntityOperation {
86
103
 
87
104
  // EJECT-END
88
105
 
89
- #unexpected(this: any, ctx: Context, ctrl: any, err: any): any { return err }
106
+
107
+ #unexpected(this: any, _ctx: Context, _ctrl: any, err: any): any { return err }
90
108
 
91
109
  }
92
110
 
@@ -1,83 +1,99 @@
1
1
  type Context = any
2
- type Operation = any
3
2
  type Control = any
4
3
 
5
4
  class EntityOperation {
6
5
 
6
+ #match: any
7
+ #data: any
8
+ #utility: any
9
+
10
+
7
11
  // EJECT-START
8
12
 
9
13
  async load(this: any, reqmatch?: any, ctrl?: Control) {
10
14
 
11
- const entity = this
12
- const client = this.#client
13
15
  const utility = this.#utility
16
+
14
17
  const {
15
- operator, spec, request, response, result, done, contextify, opify, featurehook
18
+ makeContext,
19
+ done,
20
+ error,
21
+ featureHook,
22
+ makeTarget,
23
+ makeRequest,
24
+ makeResponse,
25
+ makeResult,
26
+ makeSpec,
16
27
  } = utility
17
28
 
18
29
  let fres: Promise<any> | undefined = undefined
19
30
 
20
- const op: Operation = opify({
21
- entity: 'entityname',
22
- name: 'load',
23
- path: 'PATH',
24
- pathalt: ['PATHALT'],
25
- params: ['PARAM-LIST'],
26
- alias: { 'ALIAS': 'MAP' },
27
- state: {},
28
- reqform: 'REQFORM',
29
- resform: 'RESFORM',
30
- validate: 'VALIDATE',
31
- })
32
-
33
- let ctx: Context = contextify({
31
+ let ctx: Context = makeContext({
32
+ opname: 'load',
34
33
  ctrl,
35
- op,
36
34
  match: this.#match,
37
35
  data: this.#data,
38
36
  reqmatch
39
- }, this.#_basectx)
37
+ }, this._entctx)
40
38
 
41
39
  try {
40
+ // #PreSelection-Hook
42
41
 
43
- // #PreOperation-Hook
44
-
45
- operator(ctx)
42
+ ctx.out.target = makeTarget(ctx)
43
+ if (ctx.out.target instanceof Error) {
44
+ return error(ctx, ctx.out.target)
45
+ }
46
46
 
47
47
 
48
48
  // #PreSpec-Hook
49
49
 
50
- spec(ctx)
50
+ ctx.out.spec = makeSpec(ctx)
51
+ if (ctx.out.spec instanceof Error) {
52
+ return error(ctx, ctx.out.spec)
53
+ }
51
54
 
52
55
 
53
56
  // #PreRequest-Hook
54
57
 
55
- await request(ctx)
58
+ ctx.out.request = await makeRequest(ctx)
59
+ if (ctx.out.request instanceof Error) {
60
+ return error(ctx, ctx.out.request)
61
+ }
56
62
 
57
63
 
58
64
  // #PreResponse-Hook
59
65
 
60
- await response(ctx)
66
+ ctx.out.response = await makeResponse(ctx)
67
+ if (ctx.out.response instanceof Error) {
68
+ return error(ctx, ctx.out.response)
69
+ }
61
70
 
62
71
 
63
72
  // #PreResult-Hook
64
73
 
65
- result(ctx)
74
+ ctx.out.result = await makeResult(ctx)
75
+ if (ctx.out.result instanceof Error) {
76
+ return error(ctx, ctx.out.result)
77
+ }
66
78
 
67
79
 
68
- // #PostOperation-Hook
80
+ // #PreDone-Hook
69
81
 
70
- if (null != ctx.result.resmatch) {
71
- this.#match = ctx.result.resmatch
72
- }
82
+ if (null != ctx.result) {
83
+ if (null != ctx.result.resmatch) {
84
+ this.#match = ctx.result.resmatch
85
+ }
73
86
 
74
- if (null != ctx.result.resdata) {
75
- this.#data = ctx.result.resdata
87
+ if (null != ctx.result.resdata) {
88
+ this.#data = ctx.result.resdata
89
+ }
76
90
  }
77
91
 
78
92
  return done(ctx)
79
93
  }
80
94
  catch (err: any) {
95
+ // #PreUnexpected-Hook
96
+
81
97
  err = this.#unexpected(ctx, err)
82
98
 
83
99
  if (err) {
@@ -91,6 +107,7 @@ class EntityOperation {
91
107
 
92
108
  // EJECT-END
93
109
 
110
+
94
111
  #unexpected(this: any, ctx: Context, ctrl: any, err: any): any { return err }
95
112
  }
96
113
 
@@ -1,82 +1,100 @@
1
1
  type Context = any
2
- type Operation = any
3
2
  type Control = any
4
3
 
5
4
  class EntityOperation {
6
5
 
6
+ #match: any
7
+ #data: any
8
+ #utility: any
9
+
10
+
7
11
  // EJECT-START
8
12
 
9
13
  async remove(this: any, reqmatch?: any, ctrl?: Control) {
10
- let entity = this
11
- let client = this.#client
14
+
12
15
  const utility = this.#utility
16
+
13
17
  const {
14
- operator, spec, request, response, result, done, contextify, opify, featurehook
18
+ makeContext,
19
+ done,
20
+ error,
21
+ featureHook,
22
+ makeTarget,
23
+ makeRequest,
24
+ makeResponse,
25
+ makeResult,
26
+ makeSpec,
15
27
  } = utility
16
28
 
17
29
  let fres: Promise<any> | undefined = undefined
18
30
 
19
- let op: Operation = opify({
20
- entity: 'entityname',
21
- name: 'remove',
22
- path: 'PATH',
23
- pathalt: ['PATHALT'],
24
- params: ['PARAM-LIST'],
25
- alias: { 'ALIAS': 'MAP' },
26
- state: {},
27
- reqform: 'REQFORM',
28
- resform: 'RESFORM',
29
- validate: 'VALIDATE',
30
- })
31
-
32
- let ctx: Context = contextify({
31
+ let ctx: Context = makeContext({
32
+ opname: 'remove',
33
33
  ctrl,
34
- op,
35
34
  match: this.#match,
36
35
  data: this.#data,
37
36
  reqmatch
38
- }, this.#_basectx)
37
+ }, this._entctx)
39
38
 
40
39
  try {
41
40
 
42
- // #PreOperation-Hook
41
+ // #PreTarget-Hook
43
42
 
44
- operator(ctx)
43
+ ctx.out.target = makeTarget(ctx)
44
+ if (ctx.out.target instanceof Error) {
45
+ return error(ctx, ctx.out.target)
46
+ }
45
47
 
46
48
 
47
49
  // #PreSpec-Hook
48
50
 
49
- spec(ctx)
51
+ ctx.out.spec = makeSpec(ctx)
52
+ if (ctx.out.spec instanceof Error) {
53
+ return error(ctx, ctx.out.spec)
54
+ }
50
55
 
51
56
 
52
57
  // #PreRequest-Hook
53
58
 
54
- await request(ctx)
59
+ ctx.out.request = await makeRequest(ctx)
60
+ if (ctx.out.request instanceof Error) {
61
+ return error(ctx, ctx.out.request)
62
+ }
55
63
 
56
64
 
57
65
  // #PreResponse-Hook
58
66
 
59
- await response(ctx)
67
+ ctx.out.response = await makeResponse(ctx)
68
+ if (ctx.out.response instanceof Error) {
69
+ return error(ctx, ctx.out.response)
70
+ }
60
71
 
61
72
 
62
73
  // #PreResult-Hook
63
74
 
64
- result(ctx)
75
+ ctx.out.result = await makeResult(ctx)
76
+ if (ctx.out.result instanceof Error) {
77
+ return error(ctx, ctx.out.result)
78
+ }
65
79
 
66
80
 
67
- // #PostOperation-Hook
81
+ // #PreDone-Hook
68
82
 
69
- if (null != ctx.result.resmatch) {
70
- this.#match = ctx.result.resmatch
71
- }
83
+ if (null != ctx.result) {
84
+ if (null != ctx.result.resmatch) {
85
+ this.#match = ctx.result.resmatch
86
+ }
72
87
 
73
- if (null != ctx.result.resdata) {
74
- this.#data = ctx.result.resdata
88
+ if (null != ctx.result.resdata) {
89
+ this.#data = ctx.result.resdata
90
+ }
75
91
  }
76
92
 
77
93
  return done(ctx)
78
94
  }
79
95
  catch (err: any) {
96
+ // #PreSelection-Hook
97
+
80
98
  err = this.#unexpected(ctx, err)
81
99
 
82
100
  if (err) {
@@ -90,6 +108,7 @@ class EntityOperation {
90
108
 
91
109
  // EJECT-END
92
110
 
111
+
93
112
  #unexpected(this: any, ctx: Context, ctrl: any, err: any): any { return err }
94
113
 
95
114
  }
@@ -1,81 +1,100 @@
1
1
  type Context = any
2
- type Operation = any
3
2
  type Control = any
4
3
 
5
4
  class EntityOperation {
6
5
 
6
+ #match: any
7
+ #data: any
8
+ #utility: any
9
+
10
+
7
11
  // EJECT-START
8
12
 
9
13
  async update(this: any, reqdata?: any, ctrl?: Control) {
10
- let entity = this
11
- let client = this.#client
14
+
12
15
  const utility = this.#utility
16
+
13
17
  const {
14
- operator, spec, request, response, result, done, contextify, opify, featurehook
18
+ makeContext,
19
+ done,
20
+ error,
21
+ featureHook,
22
+ makeTarget,
23
+ makeRequest,
24
+ makeResponse,
25
+ makeResult,
26
+ makeSpec,
15
27
  } = utility
16
28
 
17
29
  let fres: Promise<any> | undefined = undefined
18
30
 
19
- let op: Operation = opify({
20
- entity: 'entityname',
21
- name: 'update',
22
- path: 'PATH',
23
- params: ['PARAM-LIST'],
24
- alias: { 'ALIAS': 'MAP' },
25
- state: {},
26
- reqform: 'REQFORM',
27
- resform: 'RESFORM',
28
- validate: 'VALIDATE',
29
- })
30
-
31
- let ctx: Context = contextify({
31
+ let ctx: Context = makeContext({
32
+ opname: 'update',
32
33
  ctrl,
33
- op,
34
34
  match: this.#match,
35
35
  data: this.#data,
36
36
  reqdata
37
- }, this.#_basectx)
37
+ }, this._entctx)
38
38
 
39
39
  try {
40
40
 
41
- // #PreOperation-Hook
41
+ // #PreSelection-Hook
42
42
 
43
- operator(ctx)
43
+ ctx.out.target = makeTarget(ctx)
44
+ if (ctx.out.target instanceof Error) {
45
+ return error(ctx, ctx.out.target)
46
+ }
44
47
 
45
48
 
46
49
  // #PreSpec-Hook
47
50
 
48
- spec(ctx)
51
+ ctx.out.spec = makeSpec(ctx)
52
+ if (ctx.out.spec instanceof Error) {
53
+ return error(ctx, ctx.out.spec)
54
+ }
49
55
 
50
56
 
51
57
  // #PreRequest-Hook
52
58
 
53
- await request(ctx)
59
+ ctx.out.request = await makeRequest(ctx)
60
+ if (ctx.out.request instanceof Error) {
61
+ return error(ctx, ctx.out.request)
62
+ }
54
63
 
55
64
 
56
65
  // #PreResponse-Hook
57
66
 
58
- await response(ctx)
67
+ ctx.out.response = await makeResponse(ctx)
68
+ if (ctx.out.response instanceof Error) {
69
+ return error(ctx, ctx.out.response)
70
+ }
59
71
 
60
72
 
61
73
  // #PreResult-Hook
62
74
 
63
- result(ctx)
75
+ ctx.out.result = await makeResult(ctx)
76
+ if (ctx.out.result instanceof Error) {
77
+ return error(ctx, ctx.out.result)
78
+ }
64
79
 
65
80
 
66
- // #PostOperation-Hook
81
+ // #PreDone-Hook
67
82
 
68
- if (null != ctx.result.resmatch) {
69
- this.#match = ctx.result.resmatch
70
- }
83
+ if (null != ctx.result) {
84
+ if (null != ctx.result.resmatch) {
85
+ this.#match = ctx.result.resmatch
86
+ }
71
87
 
72
- if (null != ctx.result.resdata) {
73
- this.#data = ctx.result.resdata
88
+ if (null != ctx.result.resdata) {
89
+ this.#data = ctx.result.resdata
90
+ }
74
91
  }
75
92
 
76
93
  return done(ctx)
77
94
  }
78
95
  catch (err: any) {
96
+ // #PreUnexpected-Hook
97
+
79
98
  err = this.#unexpected(ctx, err)
80
99
 
81
100
  if (err) {
@@ -89,6 +108,7 @@ class EntityOperation {
89
108
 
90
109
  // EJECT-END
91
110
 
111
+
92
112
  #unexpected(this: any, ctx: Context, ctrl: any, err: any): any { return err }
93
113
 
94
114
  }