@lcap/nasl 0.3.10-beta.8 → 0.3.10-beta.9
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/out/service/create/errHandles.js +12 -0
- package/out/service/create/errHandles.js.map +1 -1
- package/out/service/create/index.js +3 -0
- package/out/service/create/index.js.map +1 -1
- package/out/types/app/App.js +1 -1
- package/out/types/app/App.js.map +1 -1
- package/out/types/app/History.js +3 -2
- package/out/types/app/History.js.map +1 -1
- package/out/types/app/Service.d.ts +3 -0
- package/out/types/app/Service.js +10 -2
- package/out/types/app/Service.js.map +1 -1
- package/out/types/data/Entity.d.ts +4 -0
- package/out/types/data/Entity.js +8 -0
- package/out/types/data/Entity.js.map +1 -1
- package/out/types/data/EntityProperty.d.ts +5 -0
- package/out/types/data/EntityProperty.js +16 -0
- package/out/types/data/EntityProperty.js.map +1 -1
- package/out/types/data/genBlock/genCurdEditTableBlock.d.ts +3 -0
- package/out/types/data/genBlock/genCurdEditTableBlock.js +578 -0
- package/out/types/data/genBlock/genCurdEditTableBlock.js.map +1 -0
- package/out/types/data/genBlock/genEditTableBlock.d.ts +234 -0
- package/out/types/data/genBlock/genEditTableBlock.js +419 -0
- package/out/types/data/genBlock/genEditTableBlock.js.map +1 -0
- package/out/types/data/genBlock/genQueryComponent.d.ts +20 -0
- package/out/types/data/genBlock/genQueryComponent.js +57 -1
- package/out/types/data/genBlock/genQueryComponent.js.map +1 -1
- package/out/types/data/genBlock/genTableBlock.js +9 -5
- package/out/types/data/genBlock/genTableBlock.js.map +1 -1
- package/out/types/data/genBlock/index.d.ts +2 -0
- package/out/types/data/genBlock/index.js +2 -0
- package/out/types/data/genBlock/index.js.map +1 -1
- package/out/types/data/genBlock/utils.d.ts +7 -0
- package/out/types/data/genBlock/utils.js +38 -1
- package/out/types/data/genBlock/utils.js.map +1 -1
- package/out/types/logic/Logic.js +9 -10
- package/out/types/logic/Logic.js.map +1 -1
- package/out/types/logic/LogicItem.js +5 -7
- package/out/types/logic/LogicItem.js.map +1 -1
- package/out/types/logic/Param.js +3 -13
- package/out/types/logic/Param.js.map +1 -1
- package/out/types/logic/Return.js +3 -11
- package/out/types/logic/Return.js.map +1 -1
- package/out/types/logic/Variable.js +3 -6
- package/out/types/logic/Variable.js.map +1 -1
- package/out/types/logic/translator.js +1 -1
- package/out/types/logic/translator.js.map +1 -1
- package/out/types/page/Element.d.ts +6 -0
- package/out/types/page/Element.js +26 -2
- package/out/types/page/Element.js.map +1 -1
- package/out/types/page/Page.d.ts +4 -0
- package/out/types/page/Page.js +7 -0
- package/out/types/page/Page.js.map +1 -1
- package/out/types/page/View.d.ts +9 -0
- package/out/types/page/View.js +32 -0
- package/out/types/page/View.js.map +1 -1
- package/out/types/page/ViewVariable.js +0 -6
- package/out/types/page/ViewVariable.js.map +1 -1
- package/out/types/utils/index.d.ts +1 -0
- package/out/types/utils/index.js +16 -7
- package/out/types/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/service/create/errHandles.js +12 -0
- package/src/service/create/index.js +4 -0
- package/src/types/app/App.ts +1 -1
- package/src/types/app/History.ts +3 -2
- package/src/types/app/Service.ts +14 -5
- package/src/types/data/Entity.ts +7 -0
- package/src/types/data/EntityProperty.ts +12 -0
- package/src/types/data/genBlock/genCurdEditTableBlock.ts +581 -0
- package/src/types/data/genBlock/genEditTableBlock.ts +470 -0
- package/src/types/data/genBlock/genQueryComponent.ts +56 -0
- package/src/types/data/genBlock/genTableBlock.ts +14 -10
- package/src/types/data/genBlock/index.ts +2 -0
- package/src/types/data/genBlock/utils.ts +38 -0
- package/src/types/logic/Logic.ts +10 -11
- package/src/types/logic/LogicItem.ts +7 -10
- package/src/types/logic/Param.ts +6 -19
- package/src/types/logic/Return.ts +18 -26
- package/src/types/logic/Variable.ts +18 -20
- package/src/types/logic/translator.js +4 -4
- package/src/types/page/Element.ts +27 -2
- package/src/types/page/Page.ts +7 -0
- package/src/types/page/View.ts +32 -0
- package/src/types/page/ViewVariable.ts +13 -19
- package/src/types/utils/index.ts +16 -7
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { immutable, excludedInJSON, action } from '../decorators';
|
|
2
|
-
import { config,
|
|
3
|
-
import { paramService } from '../../service/logic';
|
|
2
|
+
import { config, utils, Logic, Variable, View, Schema, ActionOptions } from '..';
|
|
4
3
|
import { viewService } from '../../service/page';
|
|
5
|
-
import { convert2RefType
|
|
4
|
+
import { convert2RefType } from '../data/dataTypeUtils';
|
|
6
5
|
import { getBasicTypeDefaultValue } from '../data/basicTypes';
|
|
7
6
|
import { schemaService } from '../../service/common';
|
|
8
7
|
import { catchFn } from './ViewParam';
|
|
@@ -43,7 +42,7 @@ export class ViewVariable extends Variable {
|
|
|
43
42
|
|
|
44
43
|
const body = this.toJSON('', ['ideVersion', 'editable']);
|
|
45
44
|
body.viewId = this.view.id;
|
|
46
|
-
|
|
45
|
+
|
|
47
46
|
utils.logger.debug('添加页面局部变量', body);
|
|
48
47
|
const result: ViewVariable = await viewService.createViewVariable({
|
|
49
48
|
headers: {
|
|
@@ -53,7 +52,6 @@ export class ViewVariable extends Variable {
|
|
|
53
52
|
},
|
|
54
53
|
body,
|
|
55
54
|
}).catch(catchFn(this.view));
|
|
56
|
-
// convert2RefType(result.schema);
|
|
57
55
|
this.deepPick(result, ['id']);
|
|
58
56
|
this.assign({ code: this.genCode() });
|
|
59
57
|
|
|
@@ -74,16 +72,16 @@ export class ViewVariable extends Variable {
|
|
|
74
72
|
config.defaultApp?.emit('saving');
|
|
75
73
|
|
|
76
74
|
if (this.id) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
await viewService.deleteViewVariable({
|
|
76
|
+
headers: {
|
|
77
|
+
appId: config.defaultApp?.id,
|
|
78
|
+
operationAction: actionOptions?.actionName || 'ViewVariable.delete',
|
|
79
|
+
operationDesc: actionOptions?.actionDesc || `删除页面"${this.view.name}"局部变量"${this.name}"`,
|
|
80
|
+
},
|
|
81
|
+
query: {
|
|
82
|
+
id: this.id,
|
|
83
|
+
},
|
|
84
|
+
}).catch(catchFn(this.view));
|
|
87
85
|
}
|
|
88
86
|
|
|
89
87
|
const { variables } = this.view.$def;
|
|
@@ -109,7 +107,6 @@ export class ViewVariable extends Variable {
|
|
|
109
107
|
delete body.ideVersion;
|
|
110
108
|
delete body.editable;
|
|
111
109
|
body.viewId = this.view.id;
|
|
112
|
-
// convert2SchemaType(body.schema);
|
|
113
110
|
utils.logger.debug('修改页面局部变量', body);
|
|
114
111
|
const result = await viewService.updateViewVariable({
|
|
115
112
|
headers: {
|
|
@@ -119,8 +116,6 @@ export class ViewVariable extends Variable {
|
|
|
119
116
|
},
|
|
120
117
|
body,
|
|
121
118
|
}).catch(catchFn(this.view));
|
|
122
|
-
// convert2RefType(result.schema);
|
|
123
|
-
// this.plainAssign(result);
|
|
124
119
|
|
|
125
120
|
await config.defaultApp?.history.load();
|
|
126
121
|
config.defaultApp?.emit('saved');
|
|
@@ -186,7 +181,6 @@ export class ViewVariable extends Variable {
|
|
|
186
181
|
typeInstantiation: undefined,
|
|
187
182
|
});
|
|
188
183
|
Object.assign(this.schema, schema);
|
|
189
|
-
// if (this.defaultValue)
|
|
190
184
|
this.assign({ defaultValue: getBasicTypeDefaultValue() });
|
|
191
185
|
try {
|
|
192
186
|
await this.update(undefined, {
|
package/src/types/utils/index.ts
CHANGED
|
@@ -4,6 +4,11 @@ export * from './logger';
|
|
|
4
4
|
|
|
5
5
|
import { traverse } from './traverse';
|
|
6
6
|
import { isBasicType } from '../';
|
|
7
|
+
import { cloneDeep } from 'lodash';
|
|
8
|
+
|
|
9
|
+
export function getGlobalEnv() {
|
|
10
|
+
return typeof window !== 'undefined' ? (window as any).appInfo.env : (global as any).appInfoEnv;
|
|
11
|
+
}
|
|
7
12
|
|
|
8
13
|
/**
|
|
9
14
|
* 用 lodash 的 throttle 好像有点问题,先临时做个处理
|
|
@@ -58,21 +63,25 @@ export function resolveParameter(params: Array<ParamStruts>): resolvedParameter
|
|
|
58
63
|
};
|
|
59
64
|
let hasBody = false;
|
|
60
65
|
let hasParam = false;
|
|
61
|
-
params.forEach((p) => {
|
|
62
|
-
|
|
66
|
+
params.forEach((p) => {
|
|
67
|
+
const pcopy = cloneDeep(p);
|
|
68
|
+
if(!pcopy.required) {
|
|
69
|
+
delete pcopy.defaultValue
|
|
70
|
+
}
|
|
71
|
+
if (pcopy.in === 'body') {
|
|
63
72
|
hasBody = true;
|
|
64
|
-
requestBody.description.name =
|
|
65
|
-
if (!isBasicType(
|
|
66
|
-
requestBody.content['application/json'] =
|
|
73
|
+
requestBody.description.name = pcopy.name;
|
|
74
|
+
if (!isBasicType(pcopy.schema)) {
|
|
75
|
+
requestBody.content['application/json'] = pcopy;
|
|
67
76
|
} else {
|
|
68
77
|
requestBody.content['application/json'] = {
|
|
69
|
-
schema:
|
|
78
|
+
schema: pcopy.schema,
|
|
70
79
|
};
|
|
71
80
|
}
|
|
72
81
|
requestBody.required = true;
|
|
73
82
|
} else {
|
|
74
83
|
hasParam = true;
|
|
75
|
-
parameters[
|
|
84
|
+
parameters[pcopy.name] = pcopy;
|
|
76
85
|
}
|
|
77
86
|
});
|
|
78
87
|
return {
|