@voxgig/sdkgen 0.34.1 → 0.34.3
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.
- package/bin/voxgig-sdkgen +1 -1
- package/package.json +1 -1
- package/project/.sdk/src/cmp/ts/EntityBase_ts.ts +9 -13
- package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +7 -7
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +4 -4
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +4 -4
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +5 -5
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +5 -5
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +6 -6
package/bin/voxgig-sdkgen
CHANGED
package/package.json
CHANGED
|
@@ -14,21 +14,17 @@ const EntityBase = cmp(async function EntityBase(props: any) {
|
|
|
14
14
|
const { target } = props
|
|
15
15
|
const { model } = props.ctx$
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
File({ name: model.const.Name + 'EntityBase.' + target.name }, () => {
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
from:
|
|
24
|
-
Path.normalize(__dirname + '/../../../src/cmp/ts/fragment/EntityBase.fragment.ts'),
|
|
25
|
-
|
|
26
|
-
replace: {
|
|
27
|
-
...props.ctx$.stdrep,
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
})
|
|
19
|
+
Fragment(
|
|
20
|
+
{
|
|
21
|
+
from:
|
|
22
|
+
Path.normalize(__dirname + '/../../../src/cmp/ts/fragment/EntityBase.fragment.ts'),
|
|
31
23
|
|
|
24
|
+
replace: {
|
|
25
|
+
...props.ctx$.stdrep,
|
|
26
|
+
}
|
|
27
|
+
})
|
|
32
28
|
})
|
|
33
29
|
})
|
|
34
30
|
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import { inspect } from 'node:util'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from '
|
|
5
|
+
ProjectNameSDK,
|
|
6
|
+
} from './ProjectNameSDK'
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
Utility
|
|
10
|
-
} from '
|
|
10
|
+
} from './utility/Utility'
|
|
11
11
|
|
|
12
12
|
import type {
|
|
13
13
|
Context,
|
|
14
|
-
} from '
|
|
14
|
+
} from './types'
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
// TODO: needs Entity superclass
|
|
@@ -20,7 +20,7 @@ class ProjectNameEntityBase {
|
|
|
20
20
|
name_ = ''
|
|
21
21
|
Name = ''
|
|
22
22
|
|
|
23
|
-
_client:
|
|
23
|
+
_client: ProjectNameSDK
|
|
24
24
|
_utility: Utility
|
|
25
25
|
_entopts: any
|
|
26
26
|
_data: any
|
|
@@ -28,7 +28,7 @@ class ProjectNameEntityBase {
|
|
|
28
28
|
_entctx: Context
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
constructor(client:
|
|
31
|
+
constructor(client: ProjectNameSDK, entopts: any) {
|
|
32
32
|
entopts = entopts || {}
|
|
33
33
|
entopts.active = false !== entopts.active
|
|
34
34
|
|
|
@@ -50,7 +50,7 @@ class ProjectNameEntityBase {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
entopts() {
|
|
53
|
-
return this._utility.merge({}, this._entopts
|
|
53
|
+
return this._utility.struct.merge([{}, this._entopts])
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
client() {
|
|
@@ -12,7 +12,7 @@ class EntityOperation {
|
|
|
12
12
|
|
|
13
13
|
async create(this: any, reqdata?: any, ctrl?: Control) {
|
|
14
14
|
|
|
15
|
-
const utility = this
|
|
15
|
+
const utility = this._utility
|
|
16
16
|
const {
|
|
17
17
|
makeContext,
|
|
18
18
|
done,
|
|
@@ -30,8 +30,8 @@ class EntityOperation {
|
|
|
30
30
|
let ctx: Context = makeContext({
|
|
31
31
|
opname: 'create',
|
|
32
32
|
ctrl,
|
|
33
|
-
match: this
|
|
34
|
-
data: this
|
|
33
|
+
match: this._match,
|
|
34
|
+
data: this._data,
|
|
35
35
|
reqdata
|
|
36
36
|
}, this._entctx)
|
|
37
37
|
|
|
@@ -80,7 +80,7 @@ class EntityOperation {
|
|
|
80
80
|
|
|
81
81
|
if (null != ctx.result) {
|
|
82
82
|
if (null != ctx.result.resdata) {
|
|
83
|
-
this
|
|
83
|
+
this._data = ctx.result.resdata
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -12,7 +12,7 @@ class EntityOperation {
|
|
|
12
12
|
|
|
13
13
|
async list(this: any, reqmatch?: any, ctrl?: Control) {
|
|
14
14
|
|
|
15
|
-
const utility = this
|
|
15
|
+
const utility = this._utility
|
|
16
16
|
|
|
17
17
|
const {
|
|
18
18
|
makeContext,
|
|
@@ -31,8 +31,8 @@ class EntityOperation {
|
|
|
31
31
|
let ctx: Context = makeContext({
|
|
32
32
|
opname: 'list',
|
|
33
33
|
ctrl,
|
|
34
|
-
match: this
|
|
35
|
-
data: this
|
|
34
|
+
match: this._match,
|
|
35
|
+
data: this._data,
|
|
36
36
|
reqmatch
|
|
37
37
|
}, this._entctx)
|
|
38
38
|
|
|
@@ -81,7 +81,7 @@ class EntityOperation {
|
|
|
81
81
|
|
|
82
82
|
if (null != ctx.result) {
|
|
83
83
|
if (null != ctx.result.resmatch) {
|
|
84
|
-
this
|
|
84
|
+
this._match = ctx.result.resmatch
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -12,7 +12,7 @@ class EntityOperation {
|
|
|
12
12
|
|
|
13
13
|
async load(this: any, reqmatch?: any, ctrl?: Control) {
|
|
14
14
|
|
|
15
|
-
const utility = this
|
|
15
|
+
const utility = this._utility
|
|
16
16
|
|
|
17
17
|
const {
|
|
18
18
|
makeContext,
|
|
@@ -31,8 +31,8 @@ class EntityOperation {
|
|
|
31
31
|
let ctx: Context = makeContext({
|
|
32
32
|
opname: 'load',
|
|
33
33
|
ctrl,
|
|
34
|
-
match: this
|
|
35
|
-
data: this
|
|
34
|
+
match: this._match,
|
|
35
|
+
data: this._data,
|
|
36
36
|
reqmatch
|
|
37
37
|
}, this._entctx)
|
|
38
38
|
|
|
@@ -81,11 +81,11 @@ class EntityOperation {
|
|
|
81
81
|
|
|
82
82
|
if (null != ctx.result) {
|
|
83
83
|
if (null != ctx.result.resmatch) {
|
|
84
|
-
this
|
|
84
|
+
this._match = ctx.result.resmatch
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
if (null != ctx.result.resdata) {
|
|
88
|
-
this
|
|
88
|
+
this._data = ctx.result.resdata
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -12,7 +12,7 @@ class EntityOperation {
|
|
|
12
12
|
|
|
13
13
|
async remove(this: any, reqmatch?: any, ctrl?: Control) {
|
|
14
14
|
|
|
15
|
-
const utility = this
|
|
15
|
+
const utility = this._utility
|
|
16
16
|
|
|
17
17
|
const {
|
|
18
18
|
makeContext,
|
|
@@ -31,8 +31,8 @@ class EntityOperation {
|
|
|
31
31
|
let ctx: Context = makeContext({
|
|
32
32
|
opname: 'remove',
|
|
33
33
|
ctrl,
|
|
34
|
-
match: this
|
|
35
|
-
data: this
|
|
34
|
+
match: this._match,
|
|
35
|
+
data: this._data,
|
|
36
36
|
reqmatch
|
|
37
37
|
}, this._entctx)
|
|
38
38
|
|
|
@@ -82,11 +82,11 @@ class EntityOperation {
|
|
|
82
82
|
|
|
83
83
|
if (null != ctx.result) {
|
|
84
84
|
if (null != ctx.result.resmatch) {
|
|
85
|
-
this
|
|
85
|
+
this._match = ctx.result.resmatch
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
if (null != ctx.result.resdata) {
|
|
89
|
-
this
|
|
89
|
+
this._data = ctx.result.resdata
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -12,7 +12,7 @@ class EntityOperation {
|
|
|
12
12
|
|
|
13
13
|
async update(this: any, reqdata?: any, ctrl?: Control) {
|
|
14
14
|
|
|
15
|
-
const utility = this
|
|
15
|
+
const utility = this._utility
|
|
16
16
|
|
|
17
17
|
const {
|
|
18
18
|
makeContext,
|
|
@@ -31,8 +31,8 @@ class EntityOperation {
|
|
|
31
31
|
let ctx: Context = makeContext({
|
|
32
32
|
opname: 'update',
|
|
33
33
|
ctrl,
|
|
34
|
-
match: this
|
|
35
|
-
data: this
|
|
34
|
+
match: this._match,
|
|
35
|
+
data: this._data,
|
|
36
36
|
reqdata
|
|
37
37
|
}, this._entctx)
|
|
38
38
|
|
|
@@ -82,11 +82,11 @@ class EntityOperation {
|
|
|
82
82
|
|
|
83
83
|
if (null != ctx.result) {
|
|
84
84
|
if (null != ctx.result.resmatch) {
|
|
85
|
-
this
|
|
85
|
+
this._match = ctx.result.resmatch
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
if (null != ctx.result.resdata) {
|
|
89
|
-
this
|
|
89
|
+
this._data = ctx.result.resdata
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -95,7 +95,7 @@ class EntityOperation {
|
|
|
95
95
|
catch (err: any) {
|
|
96
96
|
// #PreUnexpected-Hook
|
|
97
97
|
|
|
98
|
-
err = this
|
|
98
|
+
err = this._unexpected(ctx, err)
|
|
99
99
|
|
|
100
100
|
if (err) {
|
|
101
101
|
throw err
|