@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.
- package/bin/voxgig-sdkgen +6 -6
- package/dist/action/action.js +1 -2
- package/dist/action/action.js.map +1 -1
- package/dist/action/feature.js +4 -2
- package/dist/action/feature.js.map +1 -1
- package/dist/action/target.js +4 -2
- package/dist/action/target.js.map +1 -1
- package/dist/cmp/Entity.js +2 -1
- package/dist/cmp/Entity.js.map +1 -1
- package/dist/cmp/Feature.js +11 -9
- package/dist/cmp/Feature.js.map +1 -1
- package/dist/cmp/FeatureHook.js +2 -1
- package/dist/cmp/FeatureHook.js.map +1 -1
- package/dist/cmp/Main.js +6 -2
- package/dist/cmp/Main.js.map +1 -1
- package/dist/cmp/ReadmeEntity.js +2 -1
- package/dist/cmp/ReadmeEntity.js.map +1 -1
- package/dist/cmp/Test.d.ts +2 -0
- package/dist/cmp/Test.js +17 -0
- package/dist/cmp/Test.js.map +1 -0
- package/dist/sdkgen.d.ts +2 -1
- package/dist/sdkgen.js +17 -28
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -1
- package/model/sdkgen.jsonic +9 -9
- package/package.json +8 -6
- package/project/.sdk/model/feature/log.jsonic +3 -3
- package/project/.sdk/model/feature/test.jsonic +8 -3
- package/project/.sdk/model/target/go.jsonic +19 -4
- package/project/.sdk/model/target/js.jsonic +2 -2
- package/project/.sdk/model/target/ts.jsonic +5 -5
- package/project/.sdk/src/cmp/go/Config_go.ts +119 -0
- package/project/.sdk/src/cmp/go/EntityOperation_go.ts +48 -0
- package/project/.sdk/src/cmp/go/Entity_go.ts +67 -0
- package/project/.sdk/src/cmp/go/MainEntity_go.ts +22 -0
- package/project/.sdk/src/cmp/go/Main_go.ts +209 -0
- package/project/.sdk/src/cmp/go/Package_go.ts +89 -0
- package/project/.sdk/src/cmp/go/TestDirect_go.ts +373 -0
- package/project/.sdk/src/cmp/go/TestEntity_go.ts +341 -0
- package/project/.sdk/src/cmp/go/Test_go.ts +37 -0
- package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +146 -0
- package/project/.sdk/src/cmp/go/fragment/EntityCreateOp.fragment.go +35 -0
- package/project/.sdk/src/cmp/go/fragment/EntityListOp.fragment.go +26 -0
- package/project/.sdk/src/cmp/go/fragment/EntityLoadOp.fragment.go +38 -0
- package/project/.sdk/src/cmp/go/fragment/EntityRemoveOp.fragment.go +38 -0
- package/project/.sdk/src/cmp/go/fragment/EntityUpdateOp.fragment.go +38 -0
- package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +250 -0
- package/project/.sdk/src/cmp/go/fragment/SdkError.fragment.go +22 -0
- package/project/.sdk/src/cmp/go/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/go/utility_go.ts +88 -0
- package/project/.sdk/src/cmp/js/Main_js.ts +3 -3
- package/project/.sdk/src/cmp/js/Quick_js.ts +1 -1
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +6 -6
- package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +6 -6
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +6 -6
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +6 -6
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +6 -6
- package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +85 -1
- package/project/.sdk/src/cmp/ts/Config_ts.ts +53 -6
- package/project/.sdk/src/cmp/ts/EntityOperation_ts.ts +3 -21
- package/project/.sdk/src/cmp/ts/Entity_ts.ts +3 -5
- package/project/.sdk/src/cmp/ts/Main_ts.ts +23 -13
- package/project/.sdk/src/cmp/ts/Package_ts.ts +30 -11
- package/project/.sdk/src/cmp/ts/SdkError_ts.ts +42 -0
- package/project/.sdk/src/cmp/ts/TestDirect_ts.ts +288 -0
- package/project/.sdk/src/cmp/ts/TestEntity_ts.ts +349 -2
- package/project/.sdk/src/cmp/ts/TestMain_ts.ts +0 -3
- package/project/.sdk/src/cmp/ts/Test_ts.ts +23 -3
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +38 -5
- package/project/.sdk/src/cmp/ts/fragment/Direct.test.fragment.ts +30 -0
- package/project/.sdk/src/cmp/ts/fragment/Entity.fragment.ts +50 -38
- package/project/.sdk/src/cmp/ts/fragment/Entity.test.fragment.ts +9 -7
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +47 -31
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +49 -31
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +50 -33
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +51 -32
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +51 -31
- package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +166 -34
- package/project/.sdk/src/cmp/ts/fragment/SdkError.fragment.ts +25 -0
- package/project/.sdk/src/cmp/ts/tsconfig.json +15 -0
- package/project/.sdk/src/cmp/ts/utility_ts.ts +55 -1
- package/project/.sdk/tm/go/Makefile +10 -0
- package/project/.sdk/tm/go/core/context.go +267 -0
- package/project/.sdk/tm/go/core/control.go +7 -0
- package/project/.sdk/tm/go/core/error.go +25 -0
- package/project/.sdk/tm/go/core/helpers.go +33 -0
- package/project/.sdk/tm/go/core/operation.go +61 -0
- package/project/.sdk/tm/go/core/response.go +55 -0
- package/project/.sdk/tm/go/core/result.go +73 -0
- package/project/.sdk/tm/go/core/spec.go +97 -0
- package/project/.sdk/tm/go/core/target.go +102 -0
- package/project/.sdk/tm/go/core/types.go +44 -0
- package/project/.sdk/tm/go/core/utility_type.go +54 -0
- package/project/.sdk/tm/go/feature/base_feature.go +40 -0
- package/project/.sdk/tm/go/feature/test_feature.go +196 -0
- package/project/.sdk/tm/go/src/feature/README.md +1 -0
- package/project/.sdk/tm/go/src/feature/base/.gitkeep +0 -0
- package/project/.sdk/tm/go/src/feature/test/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/custom_utility_test.go +80 -0
- package/project/.sdk/tm/go/test/exists_test.go +16 -0
- package/project/.sdk/tm/go/test/primary_utility_test.go +899 -0
- package/project/.sdk/tm/go/test/runner_test.go +428 -0
- package/project/.sdk/tm/go/test/struct_runner_test.go +1094 -0
- package/project/.sdk/tm/go/test/struct_utility_test.go +1423 -0
- package/project/.sdk/tm/go/utility/clean.go +7 -0
- package/project/.sdk/tm/go/utility/done.go +20 -0
- package/project/.sdk/tm/go/utility/feature_add.go +10 -0
- package/project/.sdk/tm/go/utility/feature_hook.go +30 -0
- package/project/.sdk/tm/go/utility/feature_init.go +30 -0
- package/project/.sdk/tm/go/utility/fetcher.go +102 -0
- package/project/.sdk/tm/go/utility/make_context.go +7 -0
- package/project/.sdk/tm/go/utility/make_error.go +69 -0
- package/project/.sdk/tm/go/utility/make_fetch_def.go +44 -0
- package/project/.sdk/tm/go/utility/make_options.go +130 -0
- package/project/.sdk/tm/go/utility/make_request.go +59 -0
- package/project/.sdk/tm/go/utility/make_response.go +46 -0
- package/project/.sdk/tm/go/utility/make_result.go +55 -0
- package/project/.sdk/tm/go/utility/make_spec.go +68 -0
- package/project/.sdk/tm/go/utility/make_target.go +95 -0
- package/project/.sdk/tm/go/utility/make_url.go +41 -0
- package/project/.sdk/tm/go/utility/param.go +66 -0
- package/project/.sdk/tm/go/utility/prepare_auth.go +40 -0
- package/project/.sdk/tm/go/utility/prepare_body.go +14 -0
- package/project/.sdk/tm/go/utility/prepare_headers.go +22 -0
- package/project/.sdk/tm/go/utility/prepare_method.go +21 -0
- package/project/.sdk/tm/go/utility/prepare_params.go +41 -0
- package/project/.sdk/tm/go/utility/prepare_path.go +21 -0
- package/project/.sdk/tm/go/utility/prepare_query.go +47 -0
- package/project/.sdk/tm/go/utility/register.go +39 -0
- package/project/.sdk/tm/go/utility/result_basic.go +31 -0
- package/project/.sdk/tm/go/utility/result_body.go +17 -0
- package/project/.sdk/tm/go/utility/result_headers.go +22 -0
- package/project/.sdk/tm/go/utility/struct/go.mod +3 -0
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +4891 -0
- package/project/.sdk/tm/go/utility/transform_request.go +32 -0
- package/project/.sdk/tm/go/utility/transform_response.go +45 -0
- package/project/.sdk/tm/js/src/feature/log/LogFeature.js +2 -2
- package/project/.sdk/tm/ts/src/Context.ts +144 -0
- package/project/.sdk/tm/ts/src/Control.ts +20 -0
- package/project/.sdk/tm/ts/src/Operation.ts +24 -0
- package/project/.sdk/tm/ts/src/Response.ts +26 -0
- package/project/.sdk/tm/ts/src/Result.ts +30 -0
- package/project/.sdk/tm/ts/src/Spec.ts +40 -0
- package/project/.sdk/tm/ts/src/Target.ts +36 -0
- package/project/.sdk/tm/ts/src/feature/base/BaseFeature.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/log/LogFeature.ts +2 -2
- package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +158 -104
- package/project/.sdk/tm/ts/src/types.ts +18 -78
- package/project/.sdk/tm/ts/src/utility/CleanUtility.ts +17 -31
- package/project/.sdk/tm/ts/src/utility/DoneUtility.ts +3 -4
- package/project/.sdk/tm/ts/src/utility/{AddfeatureUtility.ts → FeatureAddUtility.ts} +2 -2
- package/project/.sdk/tm/ts/src/utility/{FeaturehookUtility.ts → FeatureHookUtility.ts} +8 -5
- package/project/.sdk/tm/ts/src/utility/FeatureInitUtility.ts +15 -0
- package/project/.sdk/tm/ts/src/utility/FetcherUtility.ts +20 -2
- package/project/.sdk/tm/ts/src/utility/MakeContextUtility.ts +27 -0
- package/project/.sdk/tm/ts/src/utility/{ErrorUtility.ts → MakeErrorUtility.ts} +10 -6
- package/project/.sdk/tm/ts/src/utility/MakeFetchDefUtility.ts +46 -0
- package/project/.sdk/tm/ts/src/utility/{OptionsUtility.ts → MakeOptionsUtility.ts} +32 -7
- package/project/.sdk/tm/ts/src/utility/MakeRequestUtility.ts +66 -0
- package/project/.sdk/tm/ts/src/utility/MakeResponseUtility.ts +61 -0
- package/project/.sdk/tm/ts/src/utility/MakeResultUtility.ts +56 -0
- package/project/.sdk/tm/ts/src/utility/MakeSpecUtility.ts +61 -0
- package/project/.sdk/tm/ts/src/utility/MakeTargetUtility.ts +76 -0
- package/project/.sdk/tm/ts/src/utility/MakeUrlUtility.ts +61 -0
- package/project/.sdk/tm/ts/src/utility/{FindparamUtility.ts → ParamUtility.ts} +28 -8
- package/project/.sdk/tm/ts/src/utility/{AuthUtility.ts → PrepareAuthUtility.ts} +10 -4
- package/project/.sdk/tm/ts/src/utility/PrepareBodyUtility.ts +32 -0
- package/project/.sdk/tm/ts/src/utility/{HeadersUtility.ts → PrepareHeadersUtility.ts} +5 -7
- package/project/.sdk/tm/ts/src/utility/{MethodUtility.ts → PrepareMethodUtility.ts} +6 -6
- package/project/.sdk/tm/ts/src/utility/PrepareParamsUtility.ts +37 -0
- package/project/.sdk/tm/ts/src/utility/PreparePathUtility.ts +17 -0
- package/project/.sdk/tm/ts/src/utility/PrepareQueryUtility.ts +30 -0
- package/project/.sdk/tm/ts/src/utility/{ResbasicUtility.ts → ResultBasicUtility.ts} +12 -7
- package/project/.sdk/tm/ts/src/utility/ResultBodyUtility.ts +22 -0
- package/project/.sdk/tm/ts/src/utility/ResultHeadersUtility.ts +26 -0
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +1113 -525
- package/project/.sdk/tm/ts/src/utility/{ReqformUtility.ts → TransformRequestUtility.ts} +9 -7
- package/project/.sdk/tm/ts/src/utility/{ResformUtility.ts → TransformResponseUtility.ts} +11 -8
- package/project/.sdk/tm/ts/src/utility/Utility.ts +52 -65
- package/project/.sdk/tm/ts/test/exists.test.ts +0 -1
- package/project/.sdk/tm/ts/test/runner.ts +36 -13
- package/project/.sdk/tm/ts/test/utility/Custom.test.ts +30 -29
- package/project/.sdk/tm/ts/test/utility/PrimaryUtility.test.ts +385 -168
- package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +433 -189
- package/src/action/action.ts +1 -2
- package/src/action/feature.ts +7 -2
- package/src/action/target.ts +7 -7
- package/src/cmp/Entity.ts +7 -1
- package/src/cmp/Feature.ts +11 -9
- package/src/cmp/FeatureHook.ts +6 -1
- package/src/cmp/Main.ts +12 -2
- package/src/cmp/ReadmeEntity.ts +6 -1
- package/src/cmp/Test.ts +31 -0
- package/src/sdkgen.ts +19 -34
- package/src/types.ts +10 -1
- package/project/.sdk/src/cmp/ts/EntityTest_ts.ts +0 -180
- package/project/.sdk/tm/ts/src/utility/BodyUtility.ts +0 -29
- package/project/.sdk/tm/ts/src/utility/ContextUtility.ts +0 -67
- package/project/.sdk/tm/ts/src/utility/FullurlUtility.ts +0 -46
- package/project/.sdk/tm/ts/src/utility/InitfeatureUtility.ts +0 -13
- package/project/.sdk/tm/ts/src/utility/JoinurlUtility.ts +0 -15
- package/project/.sdk/tm/ts/src/utility/OperatorUtility.ts +0 -90
- package/project/.sdk/tm/ts/src/utility/ParamsUtility.ts +0 -37
- package/project/.sdk/tm/ts/src/utility/QueryUtility.ts +0 -27
- package/project/.sdk/tm/ts/src/utility/RequestUtility.ts +0 -66
- package/project/.sdk/tm/ts/src/utility/ResbodyUtility.ts +0 -19
- package/project/.sdk/tm/ts/src/utility/ResheadersUtility.ts +0 -23
- package/project/.sdk/tm/ts/src/utility/ResponseUtility.ts +0 -30
- package/project/.sdk/tm/ts/src/utility/ResultUtility.ts +0 -36
- 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
|
-
|
|
11
|
-
let client = this.#client
|
|
14
|
+
|
|
12
15
|
const utility = this.#utility
|
|
13
16
|
const {
|
|
14
|
-
|
|
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
|
|
21
|
-
|
|
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
|
|
36
|
+
}, this._entctx)
|
|
40
37
|
|
|
41
38
|
try {
|
|
39
|
+
// #PreSelection-Hook
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
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
|
|
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
|
-
// #
|
|
79
|
+
// #PreDone-Hook
|
|
69
80
|
|
|
70
|
-
if (null != ctx.result
|
|
71
|
-
|
|
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
|
-
|
|
11
|
-
let client = this.#client
|
|
14
|
+
|
|
12
15
|
const utility = this.#utility
|
|
16
|
+
|
|
13
17
|
const {
|
|
14
|
-
|
|
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
|
|
20
|
-
|
|
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
|
|
37
|
+
}, this._entctx)
|
|
39
38
|
|
|
40
39
|
try {
|
|
40
|
+
// #PreSelection-Hook
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
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
|
|
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
|
-
// #
|
|
80
|
+
// #PreDone-Hook
|
|
68
81
|
|
|
69
|
-
if (null != ctx.result
|
|
70
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
21
|
-
|
|
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
|
|
37
|
+
}, this._entctx)
|
|
40
38
|
|
|
41
39
|
try {
|
|
40
|
+
// #PreSelection-Hook
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
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
|
|
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
|
-
// #
|
|
80
|
+
// #PreDone-Hook
|
|
69
81
|
|
|
70
|
-
if (null != ctx.result
|
|
71
|
-
|
|
72
|
-
|
|
82
|
+
if (null != ctx.result) {
|
|
83
|
+
if (null != ctx.result.resmatch) {
|
|
84
|
+
this.#match = ctx.result.resmatch
|
|
85
|
+
}
|
|
73
86
|
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
11
|
-
let client = this.#client
|
|
14
|
+
|
|
12
15
|
const utility = this.#utility
|
|
16
|
+
|
|
13
17
|
const {
|
|
14
|
-
|
|
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
|
|
20
|
-
|
|
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
|
|
37
|
+
}, this._entctx)
|
|
39
38
|
|
|
40
39
|
try {
|
|
41
40
|
|
|
42
|
-
// #
|
|
41
|
+
// #PreTarget-Hook
|
|
43
42
|
|
|
44
|
-
|
|
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
|
|
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
|
|
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
|
-
// #
|
|
81
|
+
// #PreDone-Hook
|
|
68
82
|
|
|
69
|
-
if (null != ctx.result
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
if (null != ctx.result) {
|
|
84
|
+
if (null != ctx.result.resmatch) {
|
|
85
|
+
this.#match = ctx.result.resmatch
|
|
86
|
+
}
|
|
72
87
|
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
11
|
-
let client = this.#client
|
|
14
|
+
|
|
12
15
|
const utility = this.#utility
|
|
16
|
+
|
|
13
17
|
const {
|
|
14
|
-
|
|
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
|
|
20
|
-
|
|
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
|
|
37
|
+
}, this._entctx)
|
|
38
38
|
|
|
39
39
|
try {
|
|
40
40
|
|
|
41
|
-
// #
|
|
41
|
+
// #PreSelection-Hook
|
|
42
42
|
|
|
43
|
-
|
|
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
|
|
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
|
|
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
|
-
// #
|
|
81
|
+
// #PreDone-Hook
|
|
67
82
|
|
|
68
|
-
if (null != ctx.result
|
|
69
|
-
|
|
70
|
-
|
|
83
|
+
if (null != ctx.result) {
|
|
84
|
+
if (null != ctx.result.resmatch) {
|
|
85
|
+
this.#match = ctx.result.resmatch
|
|
86
|
+
}
|
|
71
87
|
|
|
72
|
-
|
|
73
|
-
|
|
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
|
}
|