@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
package/src/action/action.ts
CHANGED
|
@@ -34,8 +34,7 @@ function loadContent(actx: ActionContext, which: string | string[]) {
|
|
|
34
34
|
const content: any = {}
|
|
35
35
|
|
|
36
36
|
const fs = actx.fs()
|
|
37
|
-
const
|
|
38
|
-
const modelfolder = Path.dirname(tree.url)
|
|
37
|
+
const modelfolder = Path.dirname(actx.url)
|
|
39
38
|
|
|
40
39
|
which.map((w: string) => {
|
|
41
40
|
const indexfile = Path.join(modelfolder, w, w + '-index.jsonic')
|
package/src/action/feature.ts
CHANGED
|
@@ -13,6 +13,10 @@ import {
|
|
|
13
13
|
|
|
14
14
|
import { showChanges } from '@voxgig/util'
|
|
15
15
|
|
|
16
|
+
import {
|
|
17
|
+
KIT
|
|
18
|
+
} from '../types'
|
|
19
|
+
|
|
16
20
|
import type {
|
|
17
21
|
ActionContext,
|
|
18
22
|
ActionResult,
|
|
@@ -68,7 +72,8 @@ async function feature_add(features: string[], actx: ActionContext): Promise<Act
|
|
|
68
72
|
log: actx.log.child({ cmp: 'jostraca' }),
|
|
69
73
|
meta: {
|
|
70
74
|
// model: actx.model,
|
|
71
|
-
tree: actx.tree,
|
|
75
|
+
// tree: actx.tree,
|
|
76
|
+
url: actx.url,
|
|
72
77
|
content: loadContent(actx, 'feature')
|
|
73
78
|
},
|
|
74
79
|
model: actx.model
|
|
@@ -98,7 +103,7 @@ const FeatureRoot = cmp(function FeatureRoot(props: any) {
|
|
|
98
103
|
const { ctx$, features } = props
|
|
99
104
|
const { model, log } = ctx$
|
|
100
105
|
|
|
101
|
-
const target = model.main.
|
|
106
|
+
const target = model.main[KIT].target
|
|
102
107
|
|
|
103
108
|
Project({}, () => {
|
|
104
109
|
each(features, (n) => {
|
package/src/action/target.ts
CHANGED
|
@@ -14,6 +14,10 @@ import { showChanges } from '@voxgig/util'
|
|
|
14
14
|
|
|
15
15
|
import { getelem } from '@voxgig/struct'
|
|
16
16
|
|
|
17
|
+
import {
|
|
18
|
+
KIT
|
|
19
|
+
} from '../types'
|
|
20
|
+
|
|
17
21
|
import type {
|
|
18
22
|
ActionContext,
|
|
19
23
|
ActionResult,
|
|
@@ -36,11 +40,6 @@ const CMD_MAP: any = {
|
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
|
|
39
|
-
type Target = {
|
|
40
|
-
origin: string
|
|
41
|
-
name: string
|
|
42
|
-
}
|
|
43
|
-
|
|
44
43
|
|
|
45
44
|
async function action_target(args: string[], actx: ActionContext): Promise<ActionResult> {
|
|
46
45
|
const cmdname = args[1]
|
|
@@ -75,7 +74,8 @@ async function target_add(targets: string[], actx: ActionContext): Promise<Actio
|
|
|
75
74
|
log: actx.log.child({ cmp: 'jostraca' }),
|
|
76
75
|
meta: {
|
|
77
76
|
// model: actx.model,
|
|
78
|
-
tree: actx.tree,
|
|
77
|
+
// tree: actx.tree,
|
|
78
|
+
url: actx.url,
|
|
79
79
|
content: loadContent(actx, 'target')
|
|
80
80
|
},
|
|
81
81
|
model: actx.model,
|
|
@@ -91,7 +91,7 @@ async function target_add(targets: string[], actx: ActionContext): Promise<Actio
|
|
|
91
91
|
|
|
92
92
|
showChanges(opts.log, 'target-result', jres)
|
|
93
93
|
|
|
94
|
-
const features = Object.keys(actx.model.main.
|
|
94
|
+
const features = Object.keys(actx.model.main[KIT].feature)
|
|
95
95
|
await feature_add(features, actx)
|
|
96
96
|
|
|
97
97
|
opts.log.info({
|
package/src/cmp/Entity.ts
CHANGED
|
@@ -6,11 +6,17 @@ import {
|
|
|
6
6
|
import { requirePath } from '../utility'
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
import {
|
|
10
|
+
KIT,
|
|
11
|
+
getModelPath
|
|
12
|
+
} from '../types'
|
|
13
|
+
|
|
14
|
+
|
|
9
15
|
const Entity = cmp(function Entity(props: any) {
|
|
10
16
|
const { target, entity, ctx$ } = props
|
|
11
17
|
const { log } = ctx$
|
|
12
18
|
|
|
13
|
-
const entitySDK = ctx$.model
|
|
19
|
+
const entitySDK = getModelPath(ctx$.model, `main.${KIT}.entity.${entity.name}`)
|
|
14
20
|
|
|
15
21
|
const Entity_sdk = requirePath(ctx$, `./cmp/${target.name}/Entity_${target.name}`)
|
|
16
22
|
Entity_sdk['Entity']({ target, entity, entitySDK })
|
package/src/cmp/Feature.ts
CHANGED
|
@@ -5,16 +5,18 @@ const Feature = cmp(function Feature(props: any) {
|
|
|
5
5
|
const { target, feature, ctx$ } = props
|
|
6
6
|
const { log } = ctx$
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
if (false !== target.srcfeature) {
|
|
9
|
+
Folder({ name: 'src/feature/' + feature.name }, () => {
|
|
10
|
+
// TODO: Copy should just warn if from not found
|
|
11
|
+
Copy({
|
|
12
|
+
from: 'tm/' + target.name + '/src/feature/' + feature.name,
|
|
13
|
+
replace: {
|
|
14
|
+
FEATURE_VERSION: feature.version,
|
|
15
|
+
FEATURE_Name: feature.Name,
|
|
16
|
+
}
|
|
17
|
+
})
|
|
16
18
|
})
|
|
17
|
-
}
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
log.info({
|
|
20
22
|
point: 'generate-feature', target, feature,
|
package/src/cmp/FeatureHook.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
import { each, cmp, names, Content } from 'jostraca'
|
|
3
3
|
|
|
4
|
+
import {
|
|
5
|
+
KIT,
|
|
6
|
+
getModelPath
|
|
7
|
+
} from '../types'
|
|
8
|
+
|
|
4
9
|
|
|
5
10
|
const FeatureHook = cmp(function FeatureHook(props: any, children: any) {
|
|
6
11
|
const { ctx$: { model } } = props
|
|
7
12
|
|
|
8
|
-
const
|
|
13
|
+
const feature = getModelPath(model, `main.${KIT}.feature`)
|
|
9
14
|
|
|
10
15
|
const hook: any = {}
|
|
11
16
|
names(hook, props.name)
|
package/src/cmp/Main.ts
CHANGED
|
@@ -3,19 +3,29 @@ import { cmp, names, Copy } from 'jostraca'
|
|
|
3
3
|
|
|
4
4
|
import { requirePath } from '../utility'
|
|
5
5
|
|
|
6
|
+
import {
|
|
7
|
+
KIT
|
|
8
|
+
} from '../types'
|
|
9
|
+
|
|
6
10
|
|
|
7
11
|
const Main = cmp(function Main(props: any) {
|
|
8
12
|
const { target, ctx$ } = props
|
|
9
13
|
const { model, stdrep, log } = ctx$
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
const copyOpts: any = {
|
|
12
16
|
// This folder is relative to the .sdk folder in the project, as that is where
|
|
13
17
|
// the sdk is generated from.
|
|
14
18
|
from: 'tm/' + target.name,
|
|
15
19
|
replace: {
|
|
16
20
|
...stdrep,
|
|
17
21
|
}
|
|
18
|
-
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (false === target.srcfeature) {
|
|
25
|
+
copyOpts.exclude = [/src\//]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
Copy(copyOpts)
|
|
19
29
|
|
|
20
30
|
const Main_sdk = requirePath(ctx$, `cmp/${target.name}/Main_${target.name}`)
|
|
21
31
|
|
package/src/cmp/ReadmeEntity.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
import { cmp, each, Content } from 'jostraca'
|
|
3
3
|
|
|
4
|
+
import {
|
|
5
|
+
KIT,
|
|
6
|
+
getModelPath
|
|
7
|
+
} from '../types'
|
|
8
|
+
|
|
4
9
|
|
|
5
10
|
const ReadmeEntity = cmp(function ReadmeEntity(props: any) {
|
|
6
11
|
const { ctx$: { model } } = props
|
|
7
12
|
|
|
8
|
-
const
|
|
13
|
+
const entity = getModelPath(model, `main.${KIT}.entity`)
|
|
9
14
|
|
|
10
15
|
Content(`
|
|
11
16
|
|
package/src/cmp/Test.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
cmp,
|
|
4
|
+
} from 'jostraca'
|
|
5
|
+
|
|
6
|
+
import { requirePath } from '../utility'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
KIT,
|
|
11
|
+
getModelPath
|
|
12
|
+
} from '../types'
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const Test = cmp(function Test(props: any) {
|
|
16
|
+
const { target, ctx$ } = props
|
|
17
|
+
const { model, stdrep, log } = ctx$
|
|
18
|
+
|
|
19
|
+
const Test_sdk = requirePath(ctx$, `./cmp/${target.name}/Test_${target.name}`)
|
|
20
|
+
Test_sdk['Test']({ model, target, stdrep })
|
|
21
|
+
|
|
22
|
+
log.info({
|
|
23
|
+
point: 'generate-test', target,
|
|
24
|
+
note: 'target:' + target.name
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
Test
|
|
31
|
+
}
|
package/src/sdkgen.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright (c) 2024 Richard Rodger, MIT License */
|
|
1
|
+
/* Copyright (c) 2024-2025 Richard Rodger, MIT License */
|
|
2
2
|
|
|
3
3
|
import Fs from 'node:fs'
|
|
4
4
|
import Path from 'node:path'
|
|
@@ -7,7 +7,7 @@ import { prettyPino, Pino } from '@voxgig/util'
|
|
|
7
7
|
|
|
8
8
|
import { Jsonic } from 'jsonic'
|
|
9
9
|
import * as JostracaModule from 'jostraca'
|
|
10
|
-
import { Aontu
|
|
10
|
+
import { Aontu } from 'aontu'
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
showChanges,
|
|
@@ -25,6 +25,7 @@ import { Main } from './cmp/Main'
|
|
|
25
25
|
import { Entity } from './cmp/Entity'
|
|
26
26
|
import { Feature } from './cmp/Feature'
|
|
27
27
|
import { Readme } from './cmp/Readme'
|
|
28
|
+
import { Test } from './cmp/Test'
|
|
28
29
|
import { ReadmeInstall } from './cmp/ReadmeInstall'
|
|
29
30
|
import { ReadmeOptions } from './cmp/ReadmeOptions'
|
|
30
31
|
import { ReadmeEntity } from './cmp/ReadmeEntity'
|
|
@@ -82,6 +83,9 @@ const ACTION_MAP: any = {
|
|
|
82
83
|
const dlog = getdlog('sdkgen', __filename)
|
|
83
84
|
|
|
84
85
|
|
|
86
|
+
const aontu = new Aontu()
|
|
87
|
+
|
|
88
|
+
|
|
85
89
|
function SdkGen(opts: SdkGenOptions) {
|
|
86
90
|
const fs = opts.fs || Fs
|
|
87
91
|
const folder = opts.folder || '../'
|
|
@@ -150,29 +154,29 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
150
154
|
const pargs = args.map(arg => Jsonic(arg))
|
|
151
155
|
|
|
152
156
|
const actname = args[0]
|
|
153
|
-
const
|
|
157
|
+
const actionFunc = ACTION_MAP[actname]
|
|
154
158
|
|
|
155
|
-
if (null ==
|
|
159
|
+
if (null == actionFunc) {
|
|
156
160
|
throw new SdkGenError('Unknown action: ' + actname)
|
|
157
161
|
}
|
|
158
162
|
|
|
159
163
|
const ctx = resolveActionContext()
|
|
160
164
|
|
|
161
|
-
await
|
|
165
|
+
await actionFunc(pargs, ctx)
|
|
162
166
|
}
|
|
163
167
|
|
|
164
168
|
|
|
165
169
|
function resolveActionContext(): ActionContext {
|
|
166
170
|
|
|
167
171
|
// TODO: use AsyncLocalStorage to avoid reloading model
|
|
168
|
-
const { model,
|
|
172
|
+
const { model, url } = resolveModel()
|
|
169
173
|
|
|
170
174
|
const ctx: ActionContext = {
|
|
171
175
|
fs: () => fs,
|
|
172
176
|
log,
|
|
173
177
|
folder: '.', // The `generate` folder,
|
|
174
178
|
model,
|
|
175
|
-
|
|
179
|
+
url,
|
|
176
180
|
jostraca,
|
|
177
181
|
opts,
|
|
178
182
|
}
|
|
@@ -183,14 +187,14 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
183
187
|
|
|
184
188
|
function resolveModel() {
|
|
185
189
|
const path = './model/sdk.jsonic'
|
|
186
|
-
const
|
|
190
|
+
const errs: any[] = []
|
|
191
|
+
const aopts = { path, errs }
|
|
187
192
|
const src = fs.readFileSync(path, 'utf8')
|
|
188
193
|
|
|
189
|
-
const
|
|
190
|
-
const hasErr = tree.err && 0 < tree.err.length
|
|
194
|
+
const model = aontu.generate(src, aopts)
|
|
191
195
|
|
|
192
|
-
if (
|
|
193
|
-
for (let serr of
|
|
196
|
+
if (0 < errs.length) {
|
|
197
|
+
for (let serr of errs) {
|
|
194
198
|
let err: any = new SdkGenError('Model Error: ' + serr.msg)
|
|
195
199
|
err.cause$ = [serr]
|
|
196
200
|
|
|
@@ -198,31 +202,11 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
198
202
|
err.uxmsg$ = true
|
|
199
203
|
}
|
|
200
204
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
err.rooterrs$ = tree.err
|
|
205
|
+
err.rooterrs$ = errs
|
|
205
206
|
throw err
|
|
206
207
|
}
|
|
207
208
|
}
|
|
208
209
|
|
|
209
|
-
let genctx = new Context({ root: tree })
|
|
210
|
-
const model = tree.gen(genctx)
|
|
211
|
-
|
|
212
|
-
// TODO: collect all errors
|
|
213
|
-
if (genctx.err && 0 < genctx.err.length) {
|
|
214
|
-
const err: any = new SdkGenError('Model Error:\n' +
|
|
215
|
-
(genctx.err.map((pe: any) => pe.msg)).join('\n'))
|
|
216
|
-
// log.error({ fail: 'build', what: 'guide', file: path, err })
|
|
217
|
-
err.errs = () => genctx.err
|
|
218
|
-
throw err
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// TODO: FIX: This is a hack to set the correct src file
|
|
222
|
-
// aontu bug: url is empty
|
|
223
|
-
tree.url = path
|
|
224
|
-
|
|
225
|
-
|
|
226
210
|
model.const = { name: model.name }
|
|
227
211
|
|
|
228
212
|
names(model.const, model.name)
|
|
@@ -231,7 +215,7 @@ function SdkGen(opts: SdkGenOptions) {
|
|
|
231
215
|
|
|
232
216
|
return {
|
|
233
217
|
model,
|
|
234
|
-
|
|
218
|
+
url: path,
|
|
235
219
|
}
|
|
236
220
|
}
|
|
237
221
|
|
|
@@ -369,6 +353,7 @@ export {
|
|
|
369
353
|
Main,
|
|
370
354
|
Entity,
|
|
371
355
|
Feature,
|
|
356
|
+
Test,
|
|
372
357
|
Readme,
|
|
373
358
|
ReadmeInstall,
|
|
374
359
|
ReadmeOptions,
|
package/src/types.ts
CHANGED
|
@@ -6,6 +6,11 @@ import type {
|
|
|
6
6
|
} from 'jostraca'
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
import {
|
|
10
|
+
KIT,
|
|
11
|
+
getModelPath,
|
|
12
|
+
} from '@voxgig/apidef'
|
|
13
|
+
|
|
9
14
|
type FsUtil = typeof Fs
|
|
10
15
|
|
|
11
16
|
|
|
@@ -14,7 +19,7 @@ type ActionContext = {
|
|
|
14
19
|
log: any,
|
|
15
20
|
folder: string,
|
|
16
21
|
model: any,
|
|
17
|
-
|
|
22
|
+
url: string,
|
|
18
23
|
opts: any,
|
|
19
24
|
jostraca: any
|
|
20
25
|
}
|
|
@@ -25,6 +30,10 @@ type ActionResult = {
|
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
|
|
33
|
+
export {
|
|
34
|
+
KIT,
|
|
35
|
+
getModelPath,
|
|
36
|
+
}
|
|
28
37
|
|
|
29
38
|
export type {
|
|
30
39
|
ActionContext,
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
cmp,
|
|
4
|
-
File, Content, Folder, Fragment, Slot
|
|
5
|
-
} from '@voxgig/sdkgen'
|
|
6
|
-
|
|
7
|
-
import { jsonify } from '@voxgig/struct'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const EntityTest = cmp(function EntityTest(props: any) {
|
|
13
|
-
const ctx$ = props.ctx$
|
|
14
|
-
const { model } = props.ctx$
|
|
15
|
-
const { target, entity, entrep, ff } = props
|
|
16
|
-
|
|
17
|
-
Folder({ name: 'test/entity' }, () => {
|
|
18
|
-
|
|
19
|
-
File({ name: entity.Name + 'Entity.test.' + target.name }, () => {
|
|
20
|
-
|
|
21
|
-
Fragment({
|
|
22
|
-
from: ff + 'Entity.test.fragment.ts',
|
|
23
|
-
replace: {
|
|
24
|
-
...entrep
|
|
25
|
-
}
|
|
26
|
-
}, () => {
|
|
27
|
-
|
|
28
|
-
// TODO: should be EntityFlow
|
|
29
|
-
const basicflow = model?.main?.sdk?.flow?.['Basic' + entity.Name + 'Flow']
|
|
30
|
-
|
|
31
|
-
const dobasic = basicflow && true === basicflow.active
|
|
32
|
-
|
|
33
|
-
if (!dobasic) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let indent = 2
|
|
38
|
-
|
|
39
|
-
Slot({ name: 'basicSetup' }, () => {
|
|
40
|
-
Content(`
|
|
41
|
-
function basicSetup(extra?: any) {
|
|
42
|
-
extra = extra || {}
|
|
43
|
-
|
|
44
|
-
const options = ${jsonify(basicflow.test, { offset: indent - 2 })}
|
|
45
|
-
|
|
46
|
-
const setup: any = {
|
|
47
|
-
dm: {
|
|
48
|
-
p: envOverride(${jsonify(basicflow.param, { offset: 2 + indent })}),
|
|
49
|
-
s: {},
|
|
50
|
-
},
|
|
51
|
-
options,
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const { merge } = utility.struct
|
|
55
|
-
|
|
56
|
-
let client = ${model.Name}SDK.test(options, extra)
|
|
57
|
-
if ('TRUE' === setup.dm.p.${model.NAME}_TEST_LIVE) {
|
|
58
|
-
client = new ${model.Name}SDK(merge([
|
|
59
|
-
{
|
|
60
|
-
apikey: process.env.${model.NAME}_APIKEY,
|
|
61
|
-
},
|
|
62
|
-
extra])
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
setup.client = client
|
|
67
|
-
setup.struct = client.utility().struct
|
|
68
|
-
setup.explain = 'TRUE' === setup.dm.p.${model.Name}_TEST_EXPLAIN
|
|
69
|
-
|
|
70
|
-
return setup
|
|
71
|
-
}
|
|
72
|
-
`)
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
indent = 6
|
|
77
|
-
Slot({ name: 'basic' }, () => {
|
|
78
|
-
Content(`
|
|
79
|
-
const setup = basicSetup()
|
|
80
|
-
const { dm, options, client, struct, explain } = setup
|
|
81
|
-
const { validate, transform } = struct
|
|
82
|
-
let ctrl: any = {}
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
`)
|
|
86
|
-
|
|
87
|
-
ctx$.util.makeFlow(basicflow, {
|
|
88
|
-
indent: indent,
|
|
89
|
-
model,
|
|
90
|
-
}, {
|
|
91
|
-
FlowStep:
|
|
92
|
-
'\n// Step: $$__stepdef.name$$ - $$__stepdef.action$$ $$__stepdef.entity$$\n',
|
|
93
|
-
|
|
94
|
-
GetEntity: [
|
|
95
|
-
'const $$__stepdef.name$$ = makeStepData(dm, \'$$__stepdef.name$$\')\n',
|
|
96
|
-
(stepdef: any, pctx: any) => pctx.data.step[stepdef.name] = stepdef,
|
|
97
|
-
[
|
|
98
|
-
'__stepdef._ref',
|
|
99
|
-
'$$__stepdef.name$$.entity = $$__stepdef._ref$$.entity\n',
|
|
100
|
-
'$$__stepdef.name$$.entity = client.$$__stepdef.Entity$$()\n',
|
|
101
|
-
],
|
|
102
|
-
],
|
|
103
|
-
|
|
104
|
-
EntityMatch: [
|
|
105
|
-
(stepdef: any) => stepdef.match_JSON = jsonify(stepdef.match),
|
|
106
|
-
[
|
|
107
|
-
'__stepdef.match',
|
|
108
|
-
'$$__stepdef.name$$.match = makeMatch(dm, transform, $$__stepdef.match_JSON$$)\n'
|
|
109
|
-
]
|
|
110
|
-
],
|
|
111
|
-
|
|
112
|
-
EntityData: [
|
|
113
|
-
(stepdef: any) => stepdef.reqdata_JSON = jsonify(stepdef.reqdata),
|
|
114
|
-
[
|
|
115
|
-
'__stepdef.reqdata',
|
|
116
|
-
'$$__stepdef.name$$.reqdata = ' +
|
|
117
|
-
'makeReqdata(dm, transform, $$__stepdef.reqdata_JSON$$)\n'
|
|
118
|
-
]
|
|
119
|
-
],
|
|
120
|
-
|
|
121
|
-
EntityAction: [
|
|
122
|
-
// 'ctrl = explain ? { explain: {} } : undefined\n',
|
|
123
|
-
[
|
|
124
|
-
{ __stepdef: { action: { '`$OR`': ['update', 'create', 'remove'] } } },
|
|
125
|
-
'$$__stepdef.name$$.resdata =\n' +
|
|
126
|
-
' await $$__stepdef.name$$.entity.$$__stepdef.action$$(' +
|
|
127
|
-
'$$__stepdef.name$$.reqdata, ctrl = makeCtrl(explain))\n'
|
|
128
|
-
],
|
|
129
|
-
[
|
|
130
|
-
{ __stepdef: { action: 'load' } },
|
|
131
|
-
'$$__stepdef.name$$.resdata =\n' +
|
|
132
|
-
' await $$__stepdef.name$$.entity.load($$__stepdef.name$$.match, ctrl = makeCtrl(explain))\n'
|
|
133
|
-
],
|
|
134
|
-
[
|
|
135
|
-
{ __stepdef: { action: 'list' } },
|
|
136
|
-
'$$__stepdef.name$$.reslist =\n' +
|
|
137
|
-
' await $$__stepdef.name$$.entity.list($$__stepdef.name$$.match, ctrl = makeCtrl(explain))\n'
|
|
138
|
-
],
|
|
139
|
-
],
|
|
140
|
-
|
|
141
|
-
ExplainAction:
|
|
142
|
-
'if( explain ) { console.log(\'$$__stepdef.name$$: \', ctrl.explain) }\n',
|
|
143
|
-
|
|
144
|
-
ValidateAction: [
|
|
145
|
-
(stepdef: any) => {
|
|
146
|
-
stepdef.valid_JSON = jsonify(stepdef.valid)
|
|
147
|
-
stepdef.reslist_DATA =
|
|
148
|
-
null == stepdef.reslist ? [] : stepdef.reslist.map((ent: any) => ent.data())
|
|
149
|
-
},
|
|
150
|
-
[
|
|
151
|
-
{ __stepdef: { action: { '`$OR`': ['load', 'update', 'create', 'remove'] } } },
|
|
152
|
-
'makeValid(dm, validate, $$__stepdef.name$$.resdata, ' +
|
|
153
|
-
'$$__stepdef.valid_JSON$$)\n'
|
|
154
|
-
],
|
|
155
|
-
[
|
|
156
|
-
{ __stepdef: { action: 'list' } },
|
|
157
|
-
'makeValid(dm, validate, $$__stepdef.name$$.reslist_DATA, ' +
|
|
158
|
-
'$$__stepdef.valid_JSON$)\n'
|
|
159
|
-
],
|
|
160
|
-
]
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
Content(`
|
|
164
|
-
}
|
|
165
|
-
catch(err: any) {
|
|
166
|
-
console.dir(dm, {depth: null})
|
|
167
|
-
if( explain ) { console.dir(ctrl.explain, {depth: null}) }
|
|
168
|
-
throw err
|
|
169
|
-
}
|
|
170
|
-
`)
|
|
171
|
-
})
|
|
172
|
-
})
|
|
173
|
-
})
|
|
174
|
-
})
|
|
175
|
-
})
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
export {
|
|
179
|
-
EntityTest
|
|
180
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Context } from '../types'
|
|
3
|
-
|
|
4
|
-
function body(ctx: Context) {
|
|
5
|
-
const { op, utility } = ctx
|
|
6
|
-
const { error, reqform } = utility
|
|
7
|
-
|
|
8
|
-
let body = undefined
|
|
9
|
-
|
|
10
|
-
if ('req' === op.kind) {
|
|
11
|
-
try {
|
|
12
|
-
body = reqform(ctx)
|
|
13
|
-
|
|
14
|
-
if (op.check.nobody && null == body) {
|
|
15
|
-
return error(ctx, new Error('Request body is empty.'))
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
catch (err) {
|
|
19
|
-
return error(ctx, err)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return body
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
body
|
|
28
|
-
}
|
|
29
|
-
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { getprop } from './StructUtility'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function contextify(ctxmap: Record<string, any>, basectx?: Context): any {
|
|
6
|
-
const ctx = new Context()
|
|
7
|
-
|
|
8
|
-
ctx.ctrl = getprop(ctxmap, 'ctrl', getprop(basectx, 'ctrl', {}))
|
|
9
|
-
ctx.meta = getprop(ctxmap, 'meta', getprop(basectx, 'meta', {}))
|
|
10
|
-
ctx.work = getprop(ctxmap, 'work', getprop(basectx, 'work', {}))
|
|
11
|
-
|
|
12
|
-
ctx.client = getprop(ctxmap, 'client', getprop(basectx, 'client'))
|
|
13
|
-
ctx.config = getprop(ctxmap, 'config', getprop(basectx, 'config'))
|
|
14
|
-
ctx.entity = getprop(ctxmap, 'entity', getprop(basectx, 'entity'))
|
|
15
|
-
ctx.op = getprop(ctxmap, 'op', getprop(basectx, 'op'))
|
|
16
|
-
ctx.entopts = getprop(ctxmap, 'entopts', getprop(basectx, 'entopts'))
|
|
17
|
-
ctx.options = getprop(ctxmap, 'options', getprop(basectx, 'options'))
|
|
18
|
-
ctx.response = getprop(ctxmap, 'response', getprop(basectx, 'response'))
|
|
19
|
-
ctx.result = getprop(ctxmap, 'result', getprop(basectx, 'result'))
|
|
20
|
-
ctx.spec = getprop(ctxmap, 'spec', getprop(basectx, 'spec'))
|
|
21
|
-
ctx.utility = getprop(ctxmap, 'utility', getprop(basectx, 'utility'))
|
|
22
|
-
ctx.data = getprop(ctxmap, 'data', getprop(basectx, 'data'))
|
|
23
|
-
ctx.reqdata = getprop(ctxmap, 'reqdata', getprop(basectx, 'reqdata'))
|
|
24
|
-
ctx.match = getprop(ctxmap, 'match', getprop(basectx, 'match'))
|
|
25
|
-
ctx.reqmatch = getprop(ctxmap, 'reqmatch', getprop(basectx, 'reqmatch'))
|
|
26
|
-
|
|
27
|
-
return ctx
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class Context {
|
|
32
|
-
|
|
33
|
-
ctrl = {}
|
|
34
|
-
meta = {}
|
|
35
|
-
work = {}
|
|
36
|
-
|
|
37
|
-
client = undefined
|
|
38
|
-
config = undefined
|
|
39
|
-
entity = undefined
|
|
40
|
-
op = undefined
|
|
41
|
-
entopts = undefined
|
|
42
|
-
options = undefined
|
|
43
|
-
response = undefined
|
|
44
|
-
result = undefined
|
|
45
|
-
spec = undefined
|
|
46
|
-
utility = undefined
|
|
47
|
-
data = undefined
|
|
48
|
-
reqdata = undefined
|
|
49
|
-
match = undefined
|
|
50
|
-
reqmatch = undefined
|
|
51
|
-
|
|
52
|
-
toJSON() {
|
|
53
|
-
return {
|
|
54
|
-
op: this.op,
|
|
55
|
-
spec: this.spec,
|
|
56
|
-
entity: this.entity,
|
|
57
|
-
result: this.result,
|
|
58
|
-
meta: this.meta,
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
export {
|
|
65
|
-
contextify,
|
|
66
|
-
Context
|
|
67
|
-
}
|