@voxgig/sdkgen 0.32.2 → 0.33.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 (56) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/Readme.js +10 -0
  3. package/dist/cmp/Readme.js.map +1 -1
  4. package/dist/cmp/ReadmeEntity.js +91 -8
  5. package/dist/cmp/ReadmeEntity.js.map +1 -1
  6. package/dist/cmp/ReadmeIntro.js +24 -2
  7. package/dist/cmp/ReadmeIntro.js.map +1 -1
  8. package/dist/cmp/ReadmeModel.js +93 -16
  9. package/dist/cmp/ReadmeModel.js.map +1 -1
  10. package/dist/cmp/ReadmeOptions.js +30 -5
  11. package/dist/cmp/ReadmeOptions.js.map +1 -1
  12. package/dist/cmp/ReadmeRef.d.ts +2 -0
  13. package/dist/cmp/ReadmeRef.js +334 -0
  14. package/dist/cmp/ReadmeRef.js.map +1 -0
  15. package/dist/sdkgen.d.ts +2 -1
  16. package/dist/sdkgen.js +3 -1
  17. package/dist/sdkgen.js.map +1 -1
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/package.json +2 -3
  20. package/project/.sdk/src/cmp/go/TestDirect_go.ts +2 -2
  21. package/project/.sdk/src/cmp/go/TestEntity_go.ts +3 -3
  22. package/project/.sdk/src/cmp/js/Config_js.ts +62 -23
  23. package/project/.sdk/src/cmp/js/EntityOperation_js.ts +49 -0
  24. package/project/.sdk/src/cmp/js/Entity_js.ts +21 -50
  25. package/project/.sdk/src/cmp/js/MainEntity_js.ts +1 -1
  26. package/project/.sdk/src/cmp/js/Main_js.ts +53 -44
  27. package/project/.sdk/src/cmp/js/Package_js.ts +39 -12
  28. package/project/.sdk/src/cmp/js/Quick_js.ts +6 -10
  29. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +101 -5
  30. package/project/.sdk/src/cmp/js/SdkError_js.ts +42 -0
  31. package/project/.sdk/src/cmp/js/TestDirect_js.ts +288 -0
  32. package/project/.sdk/src/cmp/js/TestEntity_js.ts +352 -2
  33. package/project/.sdk/src/cmp/js/TestMain_js.ts +0 -3
  34. package/project/.sdk/src/cmp/js/Test_js.ts +20 -8
  35. package/project/.sdk/src/cmp/js/fragment/Config.fragment.js +55 -0
  36. package/project/.sdk/src/cmp/js/fragment/Direct.test.fragment.js +30 -0
  37. package/project/.sdk/src/cmp/js/fragment/Entity.fragment.js +119 -28
  38. package/project/.sdk/src/cmp/js/fragment/Entity.test.fragment.js +39 -0
  39. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +89 -45
  40. package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +92 -41
  41. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +95 -45
  42. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +95 -43
  43. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +95 -43
  44. package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +150 -65
  45. package/project/.sdk/src/cmp/js/fragment/SdkError.fragment.js +22 -0
  46. package/project/.sdk/src/cmp/js/utility_js.ts +64 -0
  47. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +102 -5
  48. package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +2 -2
  49. package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +11 -8
  50. package/src/cmp/Readme.ts +12 -0
  51. package/src/cmp/ReadmeEntity.ts +105 -9
  52. package/src/cmp/ReadmeIntro.ts +30 -2
  53. package/src/cmp/ReadmeModel.ts +101 -18
  54. package/src/cmp/ReadmeOptions.ts +35 -6
  55. package/src/cmp/ReadmeRef.ts +369 -0
  56. package/src/sdkgen.ts +2 -0
@@ -1,61 +1,111 @@
1
- class EntityOperation { // REMOVED
2
-
3
- async load(match) {
4
- const entity = this
5
- const client = this.#client
6
- const utility = this.#utility
7
- const { operator, makeSpec, makeRequest, makeResponse, makeResult, error, struct, done } = utility
8
-
9
- const op = {
10
- entity: 'Name',
11
- name: 'load',
12
- path: 'PATH',
13
- params: ['PARAM-LIST'],
14
- alias: {'ALIAS':'MAP'},
15
- match,
16
- data: this.#data,
17
- state: {},
18
- reqform: 'REQFORM',
19
- resform: 'RESFORM',
20
- }
21
1
 
22
- let ctx = { client, entity, op, utility}
2
+ class EntityOperation {
3
+
4
+ #match
5
+ #data
6
+ #utility
7
+
8
+
9
+ // EJECT-START
10
+
11
+ async load(reqmatch, ctrl) {
12
+
13
+ const utility = this.#utility
14
+
15
+ const {
16
+ makeContext,
17
+ done,
18
+ error,
19
+ featureHook,
20
+ makeTarget,
21
+ makeRequest,
22
+ makeResponse,
23
+ makeResult,
24
+ makeSpec,
25
+ } = utility
26
+
27
+ let fres = undefined
28
+
29
+ let ctx = makeContext({
30
+ opname: 'load',
31
+ ctrl,
32
+ match: this.#match,
33
+ data: this.#data,
34
+ reqmatch
35
+ }, this._entctx)
36
+
37
+ try {
38
+ // #PreSelection-Hook
39
+
40
+ ctx.out.target = makeTarget(ctx)
41
+ if (ctx.out.target instanceof Error) {
42
+ return error(ctx, ctx.out.target)
43
+ }
23
44
 
24
-
25
- // #PreTarget-Hook
26
45
 
27
- await operator(ctx)
46
+ // #PreSpec-Hook
28
47
 
29
-
30
- // #PreSpec-Hook
48
+ ctx.out.spec = makeSpec(ctx)
49
+ if (ctx.out.spec instanceof Error) {
50
+ return error(ctx, ctx.out.spec)
51
+ }
31
52
 
32
- this.#match = op.match
33
-
34
- await makeSpec(ctx)
35
53
 
36
-
37
- // #PreRequest-Hook
54
+ // #PreRequest-Hook
38
55
 
39
- await makeRequest(ctx)
56
+ ctx.out.request = await makeRequest(ctx)
57
+ if (ctx.out.request instanceof Error) {
58
+ return error(ctx, ctx.out.request)
59
+ }
40
60
 
41
-
42
- // #PreResponse-Hook
43
61
 
44
- await makeResponse(ctx)
62
+ // #PreResponse-Hook
45
63
 
46
-
47
- // #PreResult-Hook
48
-
49
- await makeResult(ctx)
64
+ ctx.out.response = await makeResponse(ctx)
65
+ if (ctx.out.response instanceof Error) {
66
+ return error(ctx, ctx.out.response)
67
+ }
50
68
 
51
-
52
- // #PostOperation-Hook
53
69
 
54
- if(null != ctx.result.resdata) {
55
- this.#data = ctx.result.resdata
70
+ // #PreResult-Hook
71
+
72
+ ctx.out.result = await makeResult(ctx)
73
+ if (ctx.out.result instanceof Error) {
74
+ return error(ctx, ctx.out.result)
75
+ }
76
+
77
+
78
+ // #PreDone-Hook
79
+
80
+ if (null != ctx.result) {
81
+ if (null != ctx.result.resmatch) {
82
+ this.#match = ctx.result.resmatch
83
+ }
84
+
85
+ if (null != ctx.result.resdata) {
86
+ this.#data = ctx.result.resdata
87
+ }
88
+ }
89
+
90
+ return done(ctx)
91
+ }
92
+ catch (err) {
93
+ // #PreUnexpected-Hook
94
+
95
+ err = this.#unexpected(ctx, err)
96
+
97
+ if (err) {
98
+ throw err
99
+ }
100
+ else {
101
+ return undefined
102
+ }
103
+ }
56
104
  }
57
105
 
58
- return done(ctx)
106
+ // EJECT-END
107
+
108
+
109
+ #unexpected(ctx, err) { return err }
59
110
  }
60
111
 
61
- } // REMOVED
@@ -1,61 +1,113 @@
1
- class EntityOperation { // REMOVED
2
-
3
- async remove(match) {
4
- let entity = this
5
- let client = this.#client
6
- const utility = this.#utility
7
- const { operator, makeSpec, makeRequest, makeResponse, makeResult, error, struct, done } = utility
8
-
9
- let op = {
10
- entity: 'Name',
11
- name: 'remove',
12
- path: 'PATH',
13
- params: ['PARAM-LIST'],
14
- alias: {'ALIAS':'MAP'},
15
- match,
16
- data: this.#data,
17
- state: {},
18
- reqform: 'REQFORM',
19
- resform: 'RESFORM',
20
- }
21
1
 
22
- let ctx = {client, entity, op, utility}
2
+ class EntityOperation {
3
+
4
+ #match
5
+ #data
6
+ #utility
7
+
8
+
9
+ // EJECT-START
10
+
11
+ async remove(reqmatch, ctrl) {
12
+
13
+ const utility = this.#utility
14
+
15
+ const {
16
+ makeContext,
17
+ done,
18
+ error,
19
+ featureHook,
20
+ makeTarget,
21
+ makeRequest,
22
+ makeResponse,
23
+ makeResult,
24
+ makeSpec,
25
+ } = utility
26
+
27
+ let fres = undefined
28
+
29
+ let ctx = makeContext({
30
+ opname: 'remove',
31
+ ctrl,
32
+ match: this.#match,
33
+ data: this.#data,
34
+ reqmatch
35
+ }, this._entctx)
36
+
37
+ try {
38
+
39
+ // #PreTarget-Hook
23
40
 
41
+ ctx.out.target = makeTarget(ctx)
42
+ if (ctx.out.target instanceof Error) {
43
+ return error(ctx, ctx.out.target)
44
+ }
24
45
 
25
- // #PreTarget-Hook
26
46
 
27
- await operator(ctx)
47
+ // #PreSpec-Hook
28
48
 
29
-
30
- // #PreSpec-Hook
49
+ ctx.out.spec = makeSpec(ctx)
50
+ if (ctx.out.spec instanceof Error) {
51
+ return error(ctx, ctx.out.spec)
52
+ }
31
53
 
32
- this.#data = op.data
33
-
34
- await makeSpec(ctx)
35
54
 
36
-
37
- // #PreRequest-Hook
55
+ // #PreRequest-Hook
38
56
 
39
- await makeRequest(ctx)
57
+ ctx.out.request = await makeRequest(ctx)
58
+ if (ctx.out.request instanceof Error) {
59
+ return error(ctx, ctx.out.request)
60
+ }
40
61
 
41
-
42
- // #PreResponse-Hook
43
62
 
44
- await makeResponse(ctx)
63
+ // #PreResponse-Hook
45
64
 
46
-
47
- // #PreResult-Hook
65
+ ctx.out.response = await makeResponse(ctx)
66
+ if (ctx.out.response instanceof Error) {
67
+ return error(ctx, ctx.out.response)
68
+ }
48
69
 
49
- await makeResult(ctx)
50
70
 
71
+ // #PreResult-Hook
51
72
 
52
- // #PostOperation-Hook
73
+ ctx.out.result = await makeResult(ctx)
74
+ if (ctx.out.result instanceof Error) {
75
+ return error(ctx, ctx.out.result)
76
+ }
53
77
 
54
- if(null != ctx.result.resdata) {
55
- this.#data = ctx.result.resdata
78
+
79
+ // #PreDone-Hook
80
+
81
+ if (null != ctx.result) {
82
+ if (null != ctx.result.resmatch) {
83
+ this.#match = ctx.result.resmatch
84
+ }
85
+
86
+ if (null != ctx.result.resdata) {
87
+ this.#data = ctx.result.resdata
88
+ }
89
+ }
90
+
91
+ return done(ctx)
92
+ }
93
+ catch (err) {
94
+ // #PreSelection-Hook
95
+
96
+ err = this.#unexpected(ctx, err)
97
+
98
+ if (err) {
99
+ throw err
100
+ }
101
+ else {
102
+ return undefined
103
+ }
104
+ }
56
105
  }
57
106
 
58
- return done(ctx)
107
+ // EJECT-END
108
+
109
+
110
+ #unexpected(ctx, err) { return err }
111
+
59
112
  }
60
-
61
- } // REMOVED
113
+
@@ -1,61 +1,113 @@
1
- class EntityOperation { // REMOVED
2
-
3
- async update(data) {
4
- let entity = this
5
- let client = this.#client
6
- const utility = this.#utility
7
- const { operator, makeSpec, makeRequest, makeResponse, makeResult, error, struct, done } = utility
8
-
9
- let op = {
10
- entity: 'Name',
11
- name: 'update',
12
- path: 'PATH',
13
- params: ['PARAM-LIST'],
14
- alias: {'ALIAS':'MAP'},
15
- match: this.#match,
16
- data: null == data ? this.#data : data,
17
- state: {},
18
- reqform: 'REQFORM',
19
- resform: 'RESFORM',
20
- }
21
-
22
- let ctx = {client, entity, op, utility}
23
1
 
2
+ class EntityOperation {
3
+
4
+ #match
5
+ #data
6
+ #utility
7
+
8
+
9
+ // EJECT-START
10
+
11
+ async update(reqdata, ctrl) {
12
+
13
+ const utility = this.#utility
14
+
15
+ const {
16
+ makeContext,
17
+ done,
18
+ error,
19
+ featureHook,
20
+ makeTarget,
21
+ makeRequest,
22
+ makeResponse,
23
+ makeResult,
24
+ makeSpec,
25
+ } = utility
26
+
27
+ let fres = undefined
28
+
29
+ let ctx = makeContext({
30
+ opname: 'update',
31
+ ctrl,
32
+ match: this.#match,
33
+ data: this.#data,
34
+ reqdata
35
+ }, this._entctx)
36
+
37
+ try {
38
+
39
+ // #PreSelection-Hook
24
40
 
25
- // #PreTarget-Hook
41
+ ctx.out.target = makeTarget(ctx)
42
+ if (ctx.out.target instanceof Error) {
43
+ return error(ctx, ctx.out.target)
44
+ }
26
45
 
27
- await operator(ctx)
28
46
 
29
-
30
- // #PreSpec-Hook
47
+ // #PreSpec-Hook
31
48
 
32
- this.#data = op.data
33
-
34
- await makeSpec(ctx)
49
+ ctx.out.spec = makeSpec(ctx)
50
+ if (ctx.out.spec instanceof Error) {
51
+ return error(ctx, ctx.out.spec)
52
+ }
35
53
 
36
-
37
- // #PreRequest-Hook
38
54
 
39
- await makeRequest(ctx)
55
+ // #PreRequest-Hook
40
56
 
41
-
42
- // #PreResponse-Hook
57
+ ctx.out.request = await makeRequest(ctx)
58
+ if (ctx.out.request instanceof Error) {
59
+ return error(ctx, ctx.out.request)
60
+ }
43
61
 
44
- await makeResponse(ctx)
45
62
 
46
-
47
- // #PreResult-Hook
63
+ // #PreResponse-Hook
48
64
 
49
- await makeResult(ctx)
65
+ ctx.out.response = await makeResponse(ctx)
66
+ if (ctx.out.response instanceof Error) {
67
+ return error(ctx, ctx.out.response)
68
+ }
50
69
 
51
70
 
52
- // #PostOperation-Hook
71
+ // #PreResult-Hook
53
72
 
54
- if(null != ctx.result.resdata) {
55
- this.#data = ctx.result.resdata
73
+ ctx.out.result = await makeResult(ctx)
74
+ if (ctx.out.result instanceof Error) {
75
+ return error(ctx, ctx.out.result)
76
+ }
77
+
78
+
79
+ // #PreDone-Hook
80
+
81
+ if (null != ctx.result) {
82
+ if (null != ctx.result.resmatch) {
83
+ this.#match = ctx.result.resmatch
84
+ }
85
+
86
+ if (null != ctx.result.resdata) {
87
+ this.#data = ctx.result.resdata
88
+ }
89
+ }
90
+
91
+ return done(ctx)
92
+ }
93
+ catch (err) {
94
+ // #PreUnexpected-Hook
95
+
96
+ err = this.#unexpected(ctx, err)
97
+
98
+ if (err) {
99
+ throw err
100
+ }
101
+ else {
102
+ return undefined
103
+ }
104
+ }
56
105
  }
57
106
 
58
- return done(ctx)
107
+ // EJECT-END
108
+
109
+
110
+ #unexpected(ctx, err) { return err }
111
+
59
112
  }
60
113
 
61
- } // REMOVED