@voxgig/sdkgen 0.21.0 → 0.23.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 (127) hide show
  1. package/bin/voxgig-sdkgen +12 -4
  2. package/dist/action/action.d.ts +4 -0
  3. package/dist/action/action.js +35 -0
  4. package/dist/action/action.js.map +1 -0
  5. package/dist/action/feature.d.ts +4 -2
  6. package/dist/action/feature.js +57 -38
  7. package/dist/action/feature.js.map +1 -1
  8. package/dist/action/target.d.ts +4 -2
  9. package/dist/action/target.js +136 -45
  10. package/dist/action/target.js.map +1 -1
  11. package/dist/cmp/Entity.js +5 -0
  12. package/dist/cmp/Entity.js.map +1 -1
  13. package/dist/cmp/Feature.js +5 -0
  14. package/dist/cmp/Feature.js.map +1 -1
  15. package/dist/cmp/Main.js +6 -6
  16. package/dist/cmp/Main.js.map +1 -1
  17. package/dist/cmp/ReadmeIntro.js.map +1 -1
  18. package/dist/cmp/Top.d.ts +2 -0
  19. package/dist/cmp/Top.js +23 -0
  20. package/dist/cmp/Top.js.map +1 -0
  21. package/dist/sdkgen.d.ts +10 -4
  22. package/dist/sdkgen.js +54 -10
  23. package/dist/sdkgen.js.map +1 -1
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/dist/types.d.ts +16 -0
  26. package/dist/types.js +3 -0
  27. package/dist/types.js.map +1 -0
  28. package/dist/utility.d.ts +3 -3
  29. package/dist/utility.js +7 -8
  30. package/dist/utility.js.map +1 -1
  31. package/package.json +6 -10
  32. package/project/.sdk/model/feature/README.md +2 -0
  33. package/project/.sdk/model/feature/log.jsonic +7 -4
  34. package/project/.sdk/model/feature/test.jsonic +26 -0
  35. package/project/.sdk/model/target/ts.jsonic +1 -0
  36. package/project/.sdk/src/cmp/ts/Config_ts.ts +7 -2
  37. package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +67 -0
  38. package/project/.sdk/src/cmp/ts/EntityTest_ts.ts +180 -0
  39. package/project/.sdk/src/cmp/ts/Entity_ts.ts +41 -66
  40. package/project/.sdk/src/cmp/ts/{MainEntity_ts.ts.off → MainEntity_ts.ts} +2 -2
  41. package/project/.sdk/src/cmp/ts/Main_ts.ts +52 -53
  42. package/project/.sdk/src/cmp/ts/Package_ts.ts +12 -7
  43. package/project/.sdk/src/cmp/ts/{ReadmeInstall_ts.ts.off → ReadmeInstall_ts.ts} +1 -1
  44. package/project/.sdk/src/cmp/ts/{ReadmeQuick_ts.ts.off → ReadmeQuick_ts.ts} +1 -2
  45. package/project/.sdk/src/cmp/ts/{TestMain_ts.ts.off → TestMain_ts.ts} +1 -1
  46. package/project/.sdk/src/cmp/ts/Test_ts.ts +20 -0
  47. package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +8 -1
  48. package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.ts +164 -0
  49. package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +37 -0
  50. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +91 -0
  51. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +92 -0
  52. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +96 -0
  53. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +96 -0
  54. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +95 -0
  55. package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +107 -0
  56. package/project/.sdk/src/cmp/ts/utility_ts.ts +10 -0
  57. package/project/.sdk/tm/ts/src/feature/base/BaseFeature.ts +43 -0
  58. package/project/.sdk/tm/ts/src/feature/log/LogFeature.ts +109 -0
  59. package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +159 -0
  60. package/project/.sdk/tm/ts/src/tsconfig.json +1 -1
  61. package/project/.sdk/tm/ts/src/types.ts +114 -0
  62. package/project/.sdk/tm/ts/src/utility/AddfeatureUtility.ts +47 -0
  63. package/project/.sdk/tm/ts/src/utility/AuthUtility.ts +42 -0
  64. package/project/.sdk/tm/ts/src/utility/BodyUtility.ts +29 -0
  65. package/project/.sdk/tm/ts/src/utility/CleanUtility.ts +50 -0
  66. package/project/.sdk/tm/ts/src/utility/ContextUtility.ts +67 -0
  67. package/project/.sdk/tm/ts/src/utility/DoneUtility.ts +28 -0
  68. package/project/.sdk/tm/ts/src/utility/ErrorUtility.ts +59 -0
  69. package/project/.sdk/tm/ts/src/utility/FeaturehookUtility.ts +26 -0
  70. package/project/.sdk/tm/ts/src/utility/FetcherUtility.ts +17 -0
  71. package/project/.sdk/tm/ts/src/utility/FindparamUtility.ts +54 -0
  72. package/project/.sdk/tm/ts/src/utility/FullurlUtility.ts +46 -0
  73. package/project/.sdk/tm/ts/src/utility/HeadersUtility.ts +24 -0
  74. package/project/.sdk/tm/ts/src/utility/InitfeatureUtility.ts +13 -0
  75. package/project/.sdk/tm/ts/src/utility/JoinurlUtility.ts +15 -0
  76. package/project/.sdk/tm/ts/src/utility/MethodUtility.ts +25 -0
  77. package/project/.sdk/tm/ts/src/utility/OperatorUtility.ts +90 -0
  78. package/project/.sdk/tm/ts/src/utility/OptionsUtility.ts +72 -0
  79. package/project/.sdk/tm/ts/src/utility/ParamsUtility.ts +37 -0
  80. package/project/.sdk/tm/ts/src/utility/QueryUtility.ts +27 -0
  81. package/project/.sdk/tm/ts/src/utility/ReqformUtility.ts +33 -0
  82. package/project/.sdk/tm/ts/src/utility/RequestUtility.ts +66 -0
  83. package/project/.sdk/tm/ts/src/utility/ResbasicUtility.ts +34 -0
  84. package/project/.sdk/tm/ts/src/utility/ResbodyUtility.ts +19 -0
  85. package/project/.sdk/tm/ts/src/utility/ResformUtility.ts +36 -0
  86. package/project/.sdk/tm/ts/src/utility/ResheadersUtility.ts +23 -0
  87. package/project/.sdk/tm/ts/src/utility/ResponseUtility.ts +30 -0
  88. package/project/.sdk/tm/ts/src/utility/ResultUtility.ts +36 -0
  89. package/project/.sdk/tm/ts/src/utility/SpecUtility.ts +61 -0
  90. package/project/.sdk/tm/ts/src/utility/StructUtility.ts +2499 -0
  91. package/project/.sdk/tm/ts/src/utility/Utility.ts +88 -0
  92. package/project/.sdk/tm/ts/test/exists.test.ts +17 -0
  93. package/project/.sdk/tm/ts/test/runner.ts +402 -0
  94. package/project/.sdk/tm/ts/test/tsconfig.json +1 -1
  95. package/project/.sdk/tm/ts/test/utility/Custom.test.ts +62 -0
  96. package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +244 -0
  97. package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +678 -0
  98. package/project/.sdk/tm/ts/test/utility/index.ts +9 -0
  99. package/project/.sdk/tm/ts/test/utility.ts +86 -0
  100. package/src/action/action.ts +54 -0
  101. package/src/action/feature.ts +83 -47
  102. package/src/action/target.ts +173 -53
  103. package/src/cmp/Entity.ts +6 -0
  104. package/src/cmp/Feature.ts +6 -3
  105. package/src/cmp/Main.ts +7 -8
  106. package/src/cmp/ReadmeIntro.ts +1 -1
  107. package/src/sdkgen.ts +86 -12
  108. package/src/types.ts +33 -0
  109. package/src/utility.ts +5 -3
  110. package/project/.sdk/model/feature/limit.jsonic +0 -12
  111. package/project/.sdk/model/feature/page.jsonic +0 -9
  112. package/project/.sdk/model/feature/telemetry.jsonic +0 -10
  113. package/project/.sdk/src/cmp/ts/Main_ts.ts~ +0 -88
  114. package/project/.sdk/src/cmp/ts/Package_ts.ts~ +0 -58
  115. package/project/.sdk/src/cmp/ts/Quick_ts.ts.off +0 -82
  116. package/project/.sdk/src/cmp/ts/TestAcceptEntity_ts.ts.off +0 -13
  117. package/project/.sdk/src/cmp/ts/TestAccept_ts.ts.off +0 -18
  118. package/project/.sdk/src/cmp/ts/Test_ts.ts.off +0 -24
  119. package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.js +0 -79
  120. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.js +0 -61
  121. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.js +0 -57
  122. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.js +0 -61
  123. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.js +0 -61
  124. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.js +0 -61
  125. package/project/.sdk/src/cmp/ts/fragment/Main.fragment.js +0 -67
  126. package/project/.sdk/tm/ts/test/README.md~ +0 -2
  127. /package/project/.sdk/src/cmp/ts/{TestEntity_ts.ts.off → TestEntity_ts.ts} +0 -0
@@ -0,0 +1,164 @@
1
+
2
+ import { inspect } from 'node:util'
3
+
4
+ import {
5
+ SdkNameSDK,
6
+ SdkNameEntity,
7
+ } from '../SdkNameSDK'
8
+
9
+
10
+ import type {
11
+ Operation,
12
+ Context,
13
+ Control,
14
+ } from '../types'
15
+
16
+
17
+ class EntityNameEntity {
18
+ #client: SdkNameSDK
19
+ #entopts: any
20
+ #utility: any
21
+ #data: any
22
+ #match: any
23
+
24
+ #_basectx: any
25
+
26
+ constructor(client: SdkNameSDK, entopts: any) {
27
+ // super()
28
+ entopts = entopts || {}
29
+ entopts.active = false !== entopts.active
30
+
31
+ this.#client = client
32
+ this.#entopts = entopts
33
+ this.#utility = client.utility()
34
+ this.#data = {}
35
+ this.#match = {}
36
+
37
+ const contextify = this.#utility.contextify
38
+ this.#_basectx = contextify({
39
+ entity: this,
40
+ client,
41
+ utility: this.#utility,
42
+ entopts,
43
+ options: client.options()
44
+ })
45
+
46
+ const featurehook = this.#utility.featurehook
47
+ featurehook(this.#_basectx, 'PostConstructEntity')
48
+ }
49
+
50
+ entopts() {
51
+ return { ...this.#entopts }
52
+ }
53
+
54
+ client() {
55
+ return this.#client
56
+ }
57
+
58
+ make() {
59
+ return new EntityNameEntity(this.#client, this.entopts())
60
+ }
61
+
62
+
63
+ data(this: any, data?: any) {
64
+ const featurehook = this.#utility.featurehook
65
+ const ctx = this.#_basectx
66
+
67
+ if (null != data) {
68
+ featurehook(ctx, 'SetData')
69
+ this.#data = { ...data }
70
+ }
71
+
72
+ let out = { ...this.#data }
73
+
74
+ featurehook(ctx, 'GetData')
75
+ return out
76
+ }
77
+
78
+
79
+ match(match?: any) {
80
+ const featurehook = this.#utility.featurehook
81
+ const ctx = this.#_basectx
82
+
83
+ if (null != match) {
84
+ featurehook(ctx, 'SetMatch')
85
+ this.#match = { ...match }
86
+ }
87
+
88
+ let out = { ...this.#match }
89
+
90
+ featurehook(ctx, 'GetMatch')
91
+ return out
92
+ }
93
+
94
+
95
+ toString() {
96
+ return 'EntityName ' + this.#utility.struct.jsonify(this.#data)
97
+ }
98
+
99
+ [inspect.custom]() {
100
+ return this.toString()
101
+ }
102
+
103
+
104
+ // #LoadOp
105
+
106
+ // #ListOp
107
+
108
+ // #CreateOp
109
+
110
+ // #UpdateOp
111
+
112
+ // #RemoveOp
113
+
114
+
115
+
116
+ #unexpected(this: any, ctx: Context, err: any) {
117
+ const ctrl = ctx.ctrl
118
+
119
+ ctrl.err = err
120
+
121
+ if (ctrl.explain) {
122
+ const { clean, struct } = this.#utility
123
+ const { delprop, clone } = struct
124
+
125
+ ctx.ctrl.explain = clean(ctx, ctx.ctrl.explain)
126
+ delprop(ctx.ctrl.explain.result, 'err')
127
+
128
+ if (null != ctx.result && null != ctx.result.err) {
129
+ ctrl.explain.err = clean(ctx, {
130
+ ...clone({ err: ctx.result.err }).err,
131
+ message: ctx.result.err.message,
132
+ stack: ctx.result.err.stack,
133
+ })
134
+ }
135
+
136
+ const cleanerr = clean(ctx, {
137
+ ...clone({ err }).err,
138
+ message: err.message,
139
+ stack: err.stack,
140
+ })
141
+
142
+ if (null == ctrl.explain.err) {
143
+ ctrl.explain.err = cleanerr
144
+ }
145
+ else if (ctrl.explain.err.message != cleanerr.message) {
146
+ ctrl.explain.unexpected = cleanerr
147
+ }
148
+ }
149
+
150
+ if (false === ctrl.throw) {
151
+ return undefined
152
+ }
153
+
154
+ return err
155
+ }
156
+
157
+ }
158
+
159
+
160
+
161
+
162
+ export {
163
+ EntityNameEntity
164
+ }
@@ -0,0 +1,37 @@
1
+
2
+ const envlocal = __dirname + '/../../../.env.local'
3
+ require('dotenv').config({ quiet: true, path: [envlocal] })
4
+
5
+
6
+ import { test, describe } from 'node:test'
7
+ import { equal } from 'node:assert'
8
+
9
+
10
+ import { ProjectNameSDK, BaseFeature, utility } from '../..'
11
+
12
+ import {
13
+ makeStepData,
14
+ makeMatch,
15
+ makeReqdata,
16
+ makeValid,
17
+ makeCtrl,
18
+ envOverride,
19
+ } from '../utility'
20
+
21
+
22
+ describe('EntityNameEntity', async () => {
23
+
24
+ test('instance', async () => {
25
+ const testsdk = ProjectNameSDK.test()
26
+ const ent = testsdk.EntityName()
27
+ equal(null !== ent, true)
28
+ })
29
+
30
+
31
+ test('basic', async () => {
32
+ // <[SLOT:basic]>
33
+ })
34
+ })
35
+
36
+
37
+ // <[SLOT:basicSetup]>
@@ -0,0 +1,91 @@
1
+ type Context = any
2
+ type Operation = any
3
+ type Control = any
4
+
5
+ class EntityOperation {
6
+
7
+ // EJECT-START
8
+
9
+ async create(this: any, reqdata?: any, ctrl?: Control) {
10
+ let entity = this
11
+ let client = this.#client
12
+ const utility = this.#utility
13
+ const {
14
+ operator, spec, request, response, result, done, contextify, opify, featurehook
15
+ } = utility
16
+
17
+
18
+ let fres: Promise<any> | undefined = undefined
19
+
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({
34
+ ctrl,
35
+ op,
36
+ match: this.#match,
37
+ data: this.#data,
38
+ reqdata
39
+ }, this.#_basectx)
40
+
41
+ try {
42
+
43
+ // #PreOperation-Hook
44
+
45
+ operator(ctx)
46
+
47
+
48
+ // #PreSpec-Hook
49
+
50
+ spec(ctx)
51
+
52
+
53
+ // #PreRequest-Hook
54
+
55
+ await request(ctx)
56
+
57
+
58
+ // #PreResponse-Hook
59
+
60
+ await response(ctx)
61
+
62
+
63
+ // #PreResult-Hook
64
+
65
+ result(ctx)
66
+
67
+
68
+ // #PostOperation-Hook
69
+
70
+ if (null != ctx.result.resdata) {
71
+ this.#data = ctx.result.resdata
72
+ }
73
+
74
+ return done(ctx)
75
+ }
76
+ catch (err: any) {
77
+ err = this.#unexpected(ctx, err)
78
+
79
+ if (err) {
80
+ throw err
81
+ }
82
+ else {
83
+ return undefined
84
+ }
85
+ }
86
+ }
87
+
88
+ // EJECT-END
89
+
90
+ #unexpected(this: any, ctx: Context, ctrl: any, err: any): any { return err }
91
+ }
@@ -0,0 +1,92 @@
1
+ type Context = any
2
+ type Operation = any
3
+ type Control = any
4
+
5
+ class EntityOperation {
6
+
7
+ // EJECT-START
8
+
9
+ async list(this: any, reqmatch?: any, ctrl?: Control) {
10
+ let entity = this
11
+ let client = this.#client
12
+ const utility = this.#utility
13
+ const {
14
+ operator, spec, request, response, result, done, contextify, opify, featurehook
15
+ } = utility
16
+
17
+ let fres: Promise<any> | undefined = undefined
18
+
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({
33
+ ctrl,
34
+ op,
35
+ match: this.#match,
36
+ data: this.#data,
37
+ reqmatch
38
+ }, this.#_basectx)
39
+
40
+ try {
41
+
42
+ // #PreOperation-Hook
43
+
44
+ operator(ctx)
45
+
46
+
47
+ // #PreSpec-Hook
48
+
49
+ spec(ctx)
50
+
51
+
52
+ // #PreRequest-Hook
53
+
54
+ await request(ctx)
55
+
56
+
57
+ // #PreResponse-Hook
58
+
59
+ await response(ctx)
60
+
61
+
62
+ // #PreResult-Hook
63
+
64
+ result(ctx)
65
+
66
+
67
+ // #PostOperation-Hook
68
+
69
+ if (null != ctx.result.resmatch) {
70
+ this.#match = ctx.result.resmatch
71
+ }
72
+
73
+ return done(ctx)
74
+ }
75
+ catch (err: any) {
76
+ err = this.#unexpected(ctx, err)
77
+
78
+ if (err) {
79
+ throw err
80
+ }
81
+ else {
82
+ return undefined
83
+ }
84
+ }
85
+ }
86
+
87
+ // EJECT-END
88
+
89
+ #unexpected(this: any, ctx: Context, ctrl: any, err: any): any { return err }
90
+
91
+ }
92
+
@@ -0,0 +1,96 @@
1
+ type Context = any
2
+ type Operation = any
3
+ type Control = any
4
+
5
+ class EntityOperation {
6
+
7
+ // EJECT-START
8
+
9
+ async load(this: any, reqmatch?: any, ctrl?: Control) {
10
+
11
+ const entity = this
12
+ const client = this.#client
13
+ const utility = this.#utility
14
+ const {
15
+ operator, spec, request, response, result, done, contextify, opify, featurehook
16
+ } = utility
17
+
18
+ let fres: Promise<any> | undefined = undefined
19
+
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({
34
+ ctrl,
35
+ op,
36
+ match: this.#match,
37
+ data: this.#data,
38
+ reqmatch
39
+ }, this.#_basectx)
40
+
41
+ try {
42
+
43
+ // #PreOperation-Hook
44
+
45
+ operator(ctx)
46
+
47
+
48
+ // #PreSpec-Hook
49
+
50
+ spec(ctx)
51
+
52
+
53
+ // #PreRequest-Hook
54
+
55
+ await request(ctx)
56
+
57
+
58
+ // #PreResponse-Hook
59
+
60
+ await response(ctx)
61
+
62
+
63
+ // #PreResult-Hook
64
+
65
+ result(ctx)
66
+
67
+
68
+ // #PostOperation-Hook
69
+
70
+ if (null != ctx.result.resmatch) {
71
+ this.#match = ctx.result.resmatch
72
+ }
73
+
74
+ if (null != ctx.result.resdata) {
75
+ this.#data = ctx.result.resdata
76
+ }
77
+
78
+ return done(ctx)
79
+ }
80
+ catch (err: any) {
81
+ err = this.#unexpected(ctx, err)
82
+
83
+ if (err) {
84
+ throw err
85
+ }
86
+ else {
87
+ return undefined
88
+ }
89
+ }
90
+ }
91
+
92
+ // EJECT-END
93
+
94
+ #unexpected(this: any, ctx: Context, ctrl: any, err: any): any { return err }
95
+ }
96
+
@@ -0,0 +1,96 @@
1
+ type Context = any
2
+ type Operation = any
3
+ type Control = any
4
+
5
+ class EntityOperation {
6
+
7
+ // EJECT-START
8
+
9
+ async remove(this: any, reqmatch?: any, ctrl?: Control) {
10
+ let entity = this
11
+ let client = this.#client
12
+ const utility = this.#utility
13
+ const {
14
+ operator, spec, request, response, result, done, contextify, opify, featurehook
15
+ } = utility
16
+
17
+ let fres: Promise<any> | undefined = undefined
18
+
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({
33
+ ctrl,
34
+ op,
35
+ match: this.#match,
36
+ data: this.#data,
37
+ reqmatch
38
+ }, this.#_basectx)
39
+
40
+ try {
41
+
42
+ // #PreOperation-Hook
43
+
44
+ operator(ctx)
45
+
46
+
47
+ // #PreSpec-Hook
48
+
49
+ spec(ctx)
50
+
51
+
52
+ // #PreRequest-Hook
53
+
54
+ await request(ctx)
55
+
56
+
57
+ // #PreResponse-Hook
58
+
59
+ await response(ctx)
60
+
61
+
62
+ // #PreResult-Hook
63
+
64
+ result(ctx)
65
+
66
+
67
+ // #PostOperation-Hook
68
+
69
+ if (null != ctx.result.resmatch) {
70
+ this.#match = ctx.result.resmatch
71
+ }
72
+
73
+ if (null != ctx.result.resdata) {
74
+ this.#data = ctx.result.resdata
75
+ }
76
+
77
+ return done(ctx)
78
+ }
79
+ catch (err: any) {
80
+ err = this.#unexpected(ctx, err)
81
+
82
+ if (err) {
83
+ throw err
84
+ }
85
+ else {
86
+ return undefined
87
+ }
88
+ }
89
+ }
90
+
91
+ // EJECT-END
92
+
93
+ #unexpected(this: any, ctx: Context, ctrl: any, err: any): any { return err }
94
+
95
+ }
96
+
@@ -0,0 +1,95 @@
1
+ type Context = any
2
+ type Operation = any
3
+ type Control = any
4
+
5
+ class EntityOperation {
6
+
7
+ // EJECT-START
8
+
9
+ async update(this: any, reqdata?: any, ctrl?: Control) {
10
+ let entity = this
11
+ let client = this.#client
12
+ const utility = this.#utility
13
+ const {
14
+ operator, spec, request, response, result, done, contextify, opify, featurehook
15
+ } = utility
16
+
17
+ let fres: Promise<any> | undefined = undefined
18
+
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({
32
+ ctrl,
33
+ op,
34
+ match: this.#match,
35
+ data: this.#data,
36
+ reqdata
37
+ }, this.#_basectx)
38
+
39
+ try {
40
+
41
+ // #PreOperation-Hook
42
+
43
+ operator(ctx)
44
+
45
+
46
+ // #PreSpec-Hook
47
+
48
+ spec(ctx)
49
+
50
+
51
+ // #PreRequest-Hook
52
+
53
+ await request(ctx)
54
+
55
+
56
+ // #PreResponse-Hook
57
+
58
+ await response(ctx)
59
+
60
+
61
+ // #PreResult-Hook
62
+
63
+ result(ctx)
64
+
65
+
66
+ // #PostOperation-Hook
67
+
68
+ if (null != ctx.result.resmatch) {
69
+ this.#match = ctx.result.resmatch
70
+ }
71
+
72
+ if (null != ctx.result.resdata) {
73
+ this.#data = ctx.result.resdata
74
+ }
75
+
76
+ return done(ctx)
77
+ }
78
+ catch (err: any) {
79
+ err = this.#unexpected(ctx, err)
80
+
81
+ if (err) {
82
+ throw err
83
+ }
84
+ else {
85
+ return undefined
86
+ }
87
+ }
88
+ }
89
+
90
+ // EJECT-END
91
+
92
+ #unexpected(this: any, ctx: Context, ctrl: any, err: any): any { return err }
93
+
94
+ }
95
+