@lcap/nasl 0.3.9 → 0.3.10-beta
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 +7 -2
- package/out/service/create/errHandles.js.map +1 -1
- package/out/service/debugger/debugger.d.ts +3 -0
- package/out/service/debugger/debugger.js +95 -0
- package/out/service/debugger/debugger.js.map +1 -0
- package/out/service/logic/logic.d.ts +27 -0
- package/out/service/logic/logic.js +20 -0
- package/out/service/logic/logic.js.map +1 -1
- package/out/service/page/element.d.ts +9 -0
- package/out/service/page/element.js +6 -0
- package/out/service/page/element.js.map +1 -1
- package/out/service/permission/api.d.ts +57 -0
- package/out/service/permission/api.js +41 -0
- package/out/service/permission/api.js.map +1 -0
- package/out/service/permission/index.d.ts +2 -0
- package/out/service/permission/index.js +17 -0
- package/out/service/permission/index.js.map +1 -0
- package/out/service/webFile/index.js +5 -0
- package/out/service/webFile/index.js.map +1 -1
- package/out/types/app/App.d.ts +4 -1
- package/out/types/app/App.js +24 -0
- package/out/types/app/App.js.map +1 -1
- package/out/types/app/Service.d.ts +2 -2
- package/out/types/app/Service.js +28 -3
- package/out/types/app/Service.js.map +1 -1
- package/out/types/cache.d.ts +6 -0
- package/out/types/cache.js +54 -0
- package/out/types/cache.js.map +1 -0
- package/out/types/common/Vertex.d.ts +25 -0
- package/out/types/common/Vertex.js +40 -0
- package/out/types/common/Vertex.js.map +1 -1
- package/out/types/data/Entity.js +1 -0
- package/out/types/data/Entity.js.map +1 -1
- package/out/types/data/Enum.d.ts +5 -0
- package/out/types/data/Enum.js +5 -0
- package/out/types/data/Enum.js.map +1 -1
- package/out/types/data/Interface.js +5 -3
- package/out/types/data/Interface.js.map +1 -1
- package/out/types/data/genBlock/genCreateBlock.js +5 -5
- package/out/types/data/genBlock/genCreateBlock.js.map +1 -1
- package/out/types/data/genBlock/genCurdBlock.js +3 -3
- package/out/types/data/genBlock/genCurdBlock.js.map +1 -1
- package/out/types/data/genBlock/genEnumSelectBlock.d.ts +1 -1
- package/out/types/data/genBlock/genEnumSelectBlock.js +2 -2
- package/out/types/data/genBlock/genEnumSelectBlock.js.map +1 -1
- package/out/types/data/genBlock/genGridViewBlock.js +12 -1
- package/out/types/data/genBlock/genGridViewBlock.js.map +1 -1
- package/out/types/data/genBlock/genListViewBlock.js +2 -2
- package/out/types/data/genBlock/genSelectBlock.js +2 -2
- package/out/types/data/genBlock/genTableBlock.js +14 -3
- package/out/types/data/genBlock/genTableBlock.js.map +1 -1
- package/out/types/data/genBlock/genUpdateBlock.js +5 -5
- package/out/types/data/genBlock/genUpdateBlock.js.map +1 -1
- package/out/types/data/systemTypes.js +47 -0
- package/out/types/data/systemTypes.js.map +1 -1
- package/out/types/enum.d.ts +6 -0
- package/out/types/enum.js +11 -0
- package/out/types/enum.js.map +1 -0
- package/out/types/generator/hotReload.d.ts +2 -0
- package/out/types/generator/hotReload.js +12 -1
- package/out/types/generator/hotReload.js.map +1 -1
- package/out/types/index.d.ts +7 -1
- package/out/types/index.js +11 -2
- package/out/types/index.js.map +1 -1
- package/out/types/logic/BreakPoint.d.ts +42 -0
- package/out/types/logic/BreakPoint.js +155 -0
- package/out/types/logic/BreakPoint.js.map +1 -0
- package/out/types/logic/Debugger.d.ts +156 -0
- package/out/types/logic/Debugger.js +912 -0
- package/out/types/logic/Debugger.js.map +1 -0
- package/out/types/logic/Logic.d.ts +40 -0
- package/out/types/logic/Logic.js +130 -31
- package/out/types/logic/Logic.js.map +1 -1
- package/out/types/logic/LogicItem.d.ts +21 -1
- package/out/types/logic/LogicItem.js +227 -24
- package/out/types/logic/LogicItem.js.map +1 -1
- package/out/types/logic/Param.d.ts +1 -0
- package/out/types/logic/Param.js +38 -20
- package/out/types/logic/Param.js.map +1 -1
- package/out/types/logic/Return.js +14 -19
- package/out/types/logic/Return.js.map +1 -1
- package/out/types/logic/Variable.js +14 -19
- package/out/types/logic/Variable.js.map +1 -1
- package/out/types/logic/translator.js +0 -2
- package/out/types/logic/translator.js.map +1 -1
- package/out/types/nuims/Nuims.d.ts +1 -1
- package/out/types/nuims/Nuims.js +11 -4
- package/out/types/nuims/Nuims.js.map +1 -1
- package/out/types/page/Element.d.ts +5 -0
- package/out/types/page/Element.js +114 -130
- package/out/types/page/Element.js.map +1 -1
- package/out/types/page/Event.js.map +1 -1
- package/out/types/page/Page.d.ts +1 -0
- package/out/types/page/Page.js +59 -27
- package/out/types/page/Page.js.map +1 -1
- package/out/types/page/View.d.ts +17 -3
- package/out/types/page/View.js +53 -37
- package/out/types/page/View.js.map +1 -1
- package/out/types/page/ViewParam.d.ts +1 -0
- package/out/types/page/ViewParam.js +23 -4
- package/out/types/page/ViewParam.js.map +1 -1
- package/out/types/page/ViewVariable.js +13 -18
- package/out/types/page/ViewVariable.js.map +1 -1
- package/out/types/permission/Permission.d.ts +41 -0
- package/out/types/permission/Permission.js +122 -0
- package/out/types/permission/Permission.js.map +1 -0
- package/package.json +2 -2
- package/src/service/create/errHandles.js +6 -2
- package/src/service/debugger/debugger.js +90 -0
- package/src/service/developPermission/api.js +37 -0
- package/src/service/developPermission/index.js +13 -0
- package/src/service/logic/logic.js +20 -0
- package/src/service/page/element.js +6 -0
- package/src/service/permission/api.js +38 -0
- package/src/service/permission/index.js +13 -0
- package/src/service/webFile/index.js +6 -1
- package/src/types/app/App.ts +27 -1
- package/src/types/app/Service.ts +32 -3
- package/src/types/cache.ts +50 -0
- package/src/types/common/Vertex.ts +30 -0
- package/src/types/data/Entity.ts +1 -0
- package/src/types/data/Enum.ts +5 -0
- package/src/types/data/Interface.ts +4 -3
- package/src/types/data/genBlock/genCreateBlock.ts +5 -5
- package/src/types/data/genBlock/genCurdBlock.ts +3 -3
- package/src/types/data/genBlock/genEnumSelectBlock.ts +2 -2
- package/src/types/data/genBlock/genGridViewBlock.ts +12 -1
- package/src/types/data/genBlock/genListViewBlock.ts +2 -2
- package/src/types/data/genBlock/genSelectBlock.ts +2 -2
- package/src/types/data/genBlock/genTableBlock.ts +14 -3
- package/src/types/data/genBlock/genUpdateBlock.ts +5 -5
- package/src/types/data/systemTypes.ts +47 -0
- package/src/types/enum.ts +6 -0
- package/src/types/generator/hotReload.ts +10 -0
- package/src/types/index.ts +7 -1
- package/src/types/logic/BreakPoint.ts +200 -0
- package/src/types/logic/Debugger.ts +1140 -0
- package/src/types/logic/Logic.ts +133 -28
- package/src/types/logic/LogicItem.ts +250 -28
- package/src/types/logic/Param.ts +26 -8
- package/src/types/logic/Return.ts +4 -9
- package/src/types/logic/Variable.ts +4 -8
- package/src/types/logic/translator.d.ts +16 -0
- package/src/types/logic/translator.js +144 -88
- package/src/types/logic/translator_backup.js +5 -16
- package/src/types/nuims/Nuims.ts +11 -5
- package/src/types/page/Element.ts +63 -75
- package/src/types/page/Event.ts +0 -3
- package/src/types/page/Page.ts +73 -40
- package/src/types/page/View.ts +45 -18
- package/src/types/page/ViewParam.ts +22 -3
- package/src/types/page/ViewVariable.ts +4 -8
- package/src/types/permission/Permission.ts +112 -0
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
const { io } = require('socket.io-client');
|
|
2
|
+
import { immutable, circular } from '../decorators';
|
|
3
|
+
import { Vertex, LogicItem, View, Logic, config } from '..';
|
|
4
|
+
import { breakpointService } from '../../service/debugger/debugger';
|
|
5
|
+
class BreakPoint extends Vertex {
|
|
6
|
+
// @immutable()
|
|
7
|
+
// public lineNumberEnd: number;
|
|
8
|
+
public appId: string;
|
|
9
|
+
public logicItemId: string;
|
|
10
|
+
public componentId: string;
|
|
11
|
+
public component: View;
|
|
12
|
+
public logic: Logic;
|
|
13
|
+
public remoteBreakpointId: string;
|
|
14
|
+
public isTemporary: boolean = false;
|
|
15
|
+
public target: string; // Frontend | Backend
|
|
16
|
+
public status: string; // enabled | disabled
|
|
17
|
+
public offset: number;
|
|
18
|
+
|
|
19
|
+
public lineNumberStart: number;
|
|
20
|
+
public classIdentify: string;
|
|
21
|
+
|
|
22
|
+
@circular()
|
|
23
|
+
public logicItem: LogicItem;
|
|
24
|
+
|
|
25
|
+
constructor(source?: Partial<BreakPoint>) {
|
|
26
|
+
super();
|
|
27
|
+
source && this.assign(source);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
attachSourceMap(): boolean {
|
|
31
|
+
const offset = this.offset;
|
|
32
|
+
if (this.target === 'Frontend') {
|
|
33
|
+
const sourceMap = this.component.sourceMap;
|
|
34
|
+
const map = sourceMap[this.logicItemId];
|
|
35
|
+
if (map) {
|
|
36
|
+
const node = map.node;
|
|
37
|
+
if (node.type === 'JSBlock' && offset !== 0) {
|
|
38
|
+
this.lineNumberStart = map.from + 1 + (offset || 0);
|
|
39
|
+
} else {
|
|
40
|
+
this.lineNumberStart = map.from + (offset || 0);
|
|
41
|
+
}
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (this.target === 'Backend') {
|
|
47
|
+
const sourceMap = this.logic.sourceMap;
|
|
48
|
+
const map = sourceMap[this.logicItemId];
|
|
49
|
+
if (map) {
|
|
50
|
+
this.lineNumberStart = map.lineFrom + (offset || 0);
|
|
51
|
+
this.classIdentify = map.classIdentify;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async create({
|
|
59
|
+
appId,
|
|
60
|
+
logicItem,
|
|
61
|
+
offset,
|
|
62
|
+
}: {
|
|
63
|
+
appId: string,
|
|
64
|
+
logicItem: LogicItem,
|
|
65
|
+
offset?: number,
|
|
66
|
+
}) {
|
|
67
|
+
const vertexId = logicItem.id;
|
|
68
|
+
let logicId: string;
|
|
69
|
+
const target = logicItem.logic && logicItem.logic.view ? 'Frontend' : 'Backend';
|
|
70
|
+
if (target === 'Backend') {
|
|
71
|
+
logicId = logicItem.logic && logicItem.logic.id;
|
|
72
|
+
}
|
|
73
|
+
if (target === 'Frontend') {
|
|
74
|
+
logicId = logicItem.logic && logicItem.logic.view.id;
|
|
75
|
+
}
|
|
76
|
+
await breakpointService.setBreakPoint({
|
|
77
|
+
body: {
|
|
78
|
+
appId,
|
|
79
|
+
vertexId,
|
|
80
|
+
logicId,
|
|
81
|
+
offset,
|
|
82
|
+
status: 'Enabled',
|
|
83
|
+
target,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
this.assign({
|
|
87
|
+
appId,
|
|
88
|
+
logicItem,
|
|
89
|
+
logicItemId: logicItem.id,
|
|
90
|
+
target,
|
|
91
|
+
componentId: logicItem.logic && logicItem.logic.view && logicItem.logic.view.id,
|
|
92
|
+
component: logicItem.logic && logicItem.logic.view,
|
|
93
|
+
logic: logicItem.logic,
|
|
94
|
+
status: 'Enabled',
|
|
95
|
+
offset,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
await app.debuggerClient.removeRemoteBreakPoint(bp);
|
|
100
|
+
await bp.remove();
|
|
101
|
+
|
|
102
|
+
*/
|
|
103
|
+
async remove() {
|
|
104
|
+
await breakpointService.removeBreakPoint({
|
|
105
|
+
query: {
|
|
106
|
+
appId: this.appId,
|
|
107
|
+
vertexId: this.logicItemId,
|
|
108
|
+
offset: this.offset,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
this.removeOnLogicItem();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
removeOnLogicItem() {
|
|
115
|
+
const index = this.logicItem.breakPoints.findIndex((p) => p === this);
|
|
116
|
+
~index && this.logicItem.breakPoints.splice(index, 1);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
async enable() {
|
|
120
|
+
await breakpointService.updateBreakPointState({
|
|
121
|
+
query: {
|
|
122
|
+
appId: this.appId,
|
|
123
|
+
vertexId: this.logicItemId,
|
|
124
|
+
offset: this.offset,
|
|
125
|
+
status: 'Enabled',
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
this.status = 'Enabled';
|
|
129
|
+
const app = config.defaultApp;
|
|
130
|
+
if (app.debuggerClient.isConnected) {
|
|
131
|
+
this.attachSourceMap();
|
|
132
|
+
app.debuggerClient.setRemoteBreakPointRoundTrip(this);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async disable() {
|
|
136
|
+
await breakpointService.updateBreakPointState({
|
|
137
|
+
query: {
|
|
138
|
+
appId: this.appId,
|
|
139
|
+
vertexId: this.logicItemId,
|
|
140
|
+
offset: this.offset,
|
|
141
|
+
status: 'Disabled',
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
this.status = 'Disabled';
|
|
145
|
+
const app = config.defaultApp;
|
|
146
|
+
if (app.debuggerClient.isConnected) {
|
|
147
|
+
app.debuggerClient.removeRemoteBreakPointRoundTrip(this);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
static async from(bp: BreakpointMeta) :Promise<BreakPoint> {
|
|
152
|
+
const id = bp.vertexId;
|
|
153
|
+
let logicItem = Vertex.getVertexByRef(id) as LogicItem;
|
|
154
|
+
if (!logicItem) {
|
|
155
|
+
const logic = Vertex.getVertexByRef(bp.logicId) as Logic;
|
|
156
|
+
await logic.load();
|
|
157
|
+
logicItem = Vertex.getVertexByRef(id) as LogicItem;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const breakpoint = new BreakPoint({
|
|
161
|
+
appId: bp.appId,
|
|
162
|
+
logicItem,
|
|
163
|
+
logicItemId: id,
|
|
164
|
+
target: bp.target,
|
|
165
|
+
componentId: logicItem.logic && logicItem.logic.view && logicItem.logic.view.id,
|
|
166
|
+
component: logicItem.logic && logicItem.logic.view,
|
|
167
|
+
logic: logicItem.logic,
|
|
168
|
+
status: bp.status,
|
|
169
|
+
offset: bp.offset,
|
|
170
|
+
});
|
|
171
|
+
logicItem.addBreakPointInstance(breakpoint);
|
|
172
|
+
return breakpoint;
|
|
173
|
+
}
|
|
174
|
+
// get logicItem() {
|
|
175
|
+
// if (this._logicItem) {
|
|
176
|
+
// return this._logicItem;
|
|
177
|
+
// }
|
|
178
|
+
// this._logicItem = Vertex.getVertexByRef(this.logicId);
|
|
179
|
+
// return this._logicItem;
|
|
180
|
+
// }
|
|
181
|
+
|
|
182
|
+
// setRemoteBreakPoint(socket: io) {
|
|
183
|
+
// debugger
|
|
184
|
+
// socket.emit('setbreakpoint', {
|
|
185
|
+
// componentId: this.componentId,
|
|
186
|
+
// line: this.lineNumberStart,
|
|
187
|
+
// id: this.id,
|
|
188
|
+
// });
|
|
189
|
+
// }
|
|
190
|
+
}
|
|
191
|
+
export interface BreakpointMeta {
|
|
192
|
+
appId: string,
|
|
193
|
+
vertexId: string,
|
|
194
|
+
logicId: string,
|
|
195
|
+
offset: number,
|
|
196
|
+
status: string,
|
|
197
|
+
target: string,
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export default BreakPoint;
|