@lcap/nasl 2.22.1 → 2.22.2-beta.1
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/breakpoint/generator/AfterStartNode.d.ts +7 -0
- package/out/breakpoint/generator/AfterStartNode.js +27 -0
- package/out/breakpoint/generator/AfterStartNode.js.map +1 -0
- package/out/breakpoint/generator/BeforeEndNode.d.ts +7 -0
- package/out/breakpoint/generator/BeforeEndNode.js +27 -0
- package/out/breakpoint/generator/BeforeEndNode.js.map +1 -0
- package/out/breakpoint/generator/BreakpointNode.d.ts +14 -0
- package/out/breakpoint/generator/BreakpointNode.js +200 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -0
- package/out/breakpoint/generator/index.d.ts +4 -0
- package/out/breakpoint/generator/index.js +98 -0
- package/out/breakpoint/generator/index.js.map +1 -0
- package/out/breakpoint/index.d.ts +3 -0
- package/out/breakpoint/index.js +20 -0
- package/out/breakpoint/index.js.map +1 -0
- package/out/breakpoint/shared/constants.d.ts +31 -0
- package/out/breakpoint/shared/constants.js +91 -0
- package/out/breakpoint/shared/constants.js.map +1 -0
- package/out/breakpoint/shared/index.d.ts +3 -0
- package/out/breakpoint/shared/index.js +33 -0
- package/out/breakpoint/shared/index.js.map +1 -0
- package/out/breakpoint/shared/operations.d.ts +10 -0
- package/out/breakpoint/shared/operations.js +25 -0
- package/out/breakpoint/shared/operations.js.map +1 -0
- package/out/breakpoint/shared/socket.d.ts +47 -0
- package/out/breakpoint/shared/socket.js +210 -0
- package/out/breakpoint/shared/socket.js.map +1 -0
- package/out/breakpoint/shared/utils.d.ts +23 -0
- package/out/breakpoint/shared/utils.js +165 -0
- package/out/breakpoint/shared/utils.js.map +1 -0
- package/out/breakpoint/store/core.d.ts +32 -0
- package/out/breakpoint/store/core.js +388 -0
- package/out/breakpoint/store/core.js.map +1 -0
- package/out/breakpoint/store/dock.d.ts +1 -0
- package/out/breakpoint/store/dock.js +127 -0
- package/out/breakpoint/store/dock.js.map +1 -0
- package/out/breakpoint/store/index.d.ts +2 -0
- package/out/breakpoint/store/index.js +19 -0
- package/out/breakpoint/store/index.js.map +1 -0
- package/out/common/asyncFuncMap.d.ts +2 -0
- package/out/common/asyncFuncMap.js +16 -0
- package/out/common/asyncFuncMap.js.map +1 -0
- package/out/concepts/AnonymousFunction__.js +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/AuthInterface__.d.ts +37 -0
- package/out/concepts/AuthInterface__.js +141 -0
- package/out/concepts/AuthInterface__.js.map +1 -0
- package/out/concepts/AuthLogicForCallInterface__.d.ts +138 -0
- package/out/concepts/AuthLogicForCallInterface__.js +493 -0
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
- package/out/concepts/AuthLogic__.d.ts +66 -0
- package/out/concepts/AuthLogic__.js +206 -0
- package/out/concepts/AuthLogic__.js.map +1 -0
- package/out/concepts/BackendVariable__.d.ts +137 -0
- package/out/concepts/BackendVariable__.js +422 -0
- package/out/concepts/BackendVariable__.js.map +1 -0
- package/out/concepts/Backend__.d.ts +134 -0
- package/out/concepts/Backend__.js +274 -0
- package/out/concepts/Backend__.js.map +1 -0
- package/out/concepts/CallAuthInterface__.d.ts +126 -0
- package/out/concepts/CallAuthInterface__.js +408 -0
- package/out/concepts/CallAuthInterface__.js.map +1 -0
- package/out/concepts/CallConnector__.d.ts +42 -0
- package/out/concepts/CallConnector__.js +198 -0
- package/out/concepts/CallConnector__.js.map +1 -0
- package/out/concepts/ConnectorTrigger__.d.ts +78 -0
- package/out/concepts/ConnectorTrigger__.js +155 -0
- package/out/concepts/ConnectorTrigger__.js.map +1 -0
- package/out/concepts/Connector__.d.ts +464 -0
- package/out/concepts/Connector__.js +698 -0
- package/out/concepts/Connector__.js.map +1 -0
- package/out/concepts/Destination__.js +6 -4
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/FrontendVariable__.d.ts +21 -0
- package/out/concepts/FrontendVariable__.js +64 -0
- package/out/concepts/FrontendVariable__.js.map +1 -0
- package/out/concepts/Match__.js +25 -6
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.d.ts +137 -0
- package/out/concepts/MsgTriggerEvent__.js +228 -0
- package/out/concepts/MsgTriggerEvent__.js.map +1 -0
- package/out/concepts/MsgTriggerLauncher__.d.ts +118 -0
- package/out/concepts/MsgTriggerLauncher__.js +204 -0
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -0
- package/out/concepts/OverriddenLogic__.d.ts +643 -0
- package/out/concepts/OverriddenLogic__.js +1602 -0
- package/out/concepts/OverriddenLogic__.js.map +1 -0
- package/out/concepts/Param__.js +1 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/StringLiteral__.js +5 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/TriggerEvent__.d.ts +120 -0
- package/out/concepts/TriggerEvent__.js +222 -0
- package/out/concepts/TriggerEvent__.js.map +1 -0
- package/out/concepts/TriggerLauncher__.d.ts +88 -0
- package/out/concepts/TriggerLauncher__.js +235 -0
- package/out/concepts/TriggerLauncher__.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.http.d.ts +7 -0
- package/out/concepts/basics/stdlib/nasl.http.js +167 -0
- package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
- package/out/concepts/types__.d.ts +124 -0
- package/out/concepts/types__.js +3 -0
- package/out/concepts/types__.js.map +1 -0
- package/out/server/getConnector.d.ts +11 -0
- package/out/server/getConnector.js +42 -0
- package/out/server/getConnector.js.map +1 -0
- package/out/server/naslServer.js +4 -0
- package/out/server/naslServer.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/templator/genCreateBlock.js +2 -1
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +6 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -2
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +2 -1
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +2 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/package.json +2 -2
- package/src/concepts/AnonymousFunction__.ts +1 -1
- package/src/concepts/Destination__.ts +7 -5
- package/src/concepts/Match__.ts +24 -6
- package/src/concepts/Param__.ts +1 -1
- package/src/concepts/StringLiteral__.ts +5 -1
- package/src/concepts/dist/App__.js +2204 -0
- package/src/concepts/dist/CallLogic__.js +1149 -0
- package/src/concepts/dist/Destination__.js +756 -0
- package/src/concepts/dist/Logic__.js +1612 -0
- package/src/concepts/dist/Match__.js +768 -0
- package/src/concepts/dist/MsgTriggerEvent__.js +245 -0
- package/src/concepts/dist/OqlQueryComponent__.js +377 -0
- package/src/concepts/dist/Param__.js +1 -1
- package/src/concepts/dist/StringLiteral__.js +158 -0
- package/src/generator/dist/genBundleFiles.js +15 -4
- package/src/generator/dist/genReleaseBody.js +501 -0
- package/src/server/dist/naslServer.js +25 -6
- package/src/server/naslServer.ts +4 -0
- package/src/service/creator/errHandles.js +8 -3
- package/src/service/storage/dist/init.js +34 -32
- package/src/templator/genCreateBlock.ts +2 -1
- package/src/templator/genCurdEditMultipleKeyBlock.ts +6 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -2
- package/src/templator/genEditTableBlock.ts +2 -1
- package/src/templator/genUpdateBlock.ts +2 -1
- package/test/examples/qzbusiness.json +1 -98265
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const BreakpointNode_1 = __importDefault(require("./BreakpointNode"));
|
|
7
|
+
class AfterStartNode extends BreakpointNode_1.default {
|
|
8
|
+
_logicNodePath = '';
|
|
9
|
+
constructor(options = {}) {
|
|
10
|
+
super(options);
|
|
11
|
+
this.init();
|
|
12
|
+
}
|
|
13
|
+
init() {
|
|
14
|
+
super.init();
|
|
15
|
+
const { logic } = this;
|
|
16
|
+
const ancestor = logic.getAncestor('Logic');
|
|
17
|
+
this._logicNodePath = ancestor && ancestor.nodePath;
|
|
18
|
+
}
|
|
19
|
+
toJS() {
|
|
20
|
+
const id = this._logicNodePath;
|
|
21
|
+
const logic = this.logic ? this.logic.toJS() : '';
|
|
22
|
+
const hook = `await $breaker.fireHook('after-start')('${id}')`;
|
|
23
|
+
return `${logic}\n${hook}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = AfterStartNode;
|
|
27
|
+
//# sourceMappingURL=AfterStartNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AfterStartNode.js","sourceRoot":"","sources":["../../../src/breakpoint/generator/AfterStartNode.ts"],"names":[],"mappings":";;;;;AAAA,sEAA8C;AAE9C,MAAqB,cAAe,SAAQ,wBAAc;IACtD,cAAc,GAAW,EAAE,CAAC;IAE5B,YAAY,OAAO,GAAG,EAAE;QACpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,IAAI;QACA,KAAK,CAAC,IAAI,EAAE,CAAC;QAEb,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,CAAC,cAAc,GAAG,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC;IACxD,CAAC;IAED,IAAI;QACA,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAE,IAAI,CAAC,KAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,GAAG,2CAA2C,EAAE,IAAI,CAAC;QAE/D,OAAO,GAAG,KAAK,KAAK,IAAI,EAAE,CAAC;IAC/B,CAAC;CACJ;AAxBD,iCAwBC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const BreakpointNode_1 = __importDefault(require("./BreakpointNode"));
|
|
7
|
+
class BeforeEndNode extends BreakpointNode_1.default {
|
|
8
|
+
_logicNodePath = '';
|
|
9
|
+
constructor(options = {}) {
|
|
10
|
+
super(options);
|
|
11
|
+
this.init();
|
|
12
|
+
}
|
|
13
|
+
init() {
|
|
14
|
+
super.init();
|
|
15
|
+
const { logic } = this;
|
|
16
|
+
const ancestor = logic.getAncestor('Logic');
|
|
17
|
+
this._logicNodePath = ancestor && ancestor.nodePath;
|
|
18
|
+
}
|
|
19
|
+
toJS() {
|
|
20
|
+
const id = this._logicNodePath;
|
|
21
|
+
const logic = this.logic ? this.logic.toJS() : '';
|
|
22
|
+
const hook = `await $breaker.fireHook('before-end')('${id}')`;
|
|
23
|
+
return `${hook}\n${logic}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = BeforeEndNode;
|
|
27
|
+
//# sourceMappingURL=BeforeEndNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BeforeEndNode.js","sourceRoot":"","sources":["../../../src/breakpoint/generator/BeforeEndNode.ts"],"names":[],"mappings":";;;;;AAAA,sEAA8C;AAE9C,MAAqB,aAAc,SAAQ,wBAAc;IACrD,cAAc,GAAW,EAAE,CAAC;IAE5B,YAAY,OAAO,GAAG,EAAE;QACpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,IAAI;QACA,KAAK,CAAC,IAAI,EAAE,CAAC;QAEb,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,CAAC,cAAc,GAAG,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC;IACxD,CAAC;IAED,IAAI;QACA,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAE,IAAI,CAAC,KAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,GAAG,0CAA0C,EAAE,IAAI,CAAC;QAE9D,OAAO,GAAG,IAAI,KAAK,KAAK,EAAE,CAAC;IAC/B,CAAC;CACJ;AAxBD,gCAwBC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseNode } from '../../concepts';
|
|
2
|
+
declare type Options = {
|
|
3
|
+
logic?: BaseNode;
|
|
4
|
+
variable?: BaseNode;
|
|
5
|
+
};
|
|
6
|
+
export default class BreakpointNode extends BaseNode {
|
|
7
|
+
_nodePath: string;
|
|
8
|
+
variable: BaseNode;
|
|
9
|
+
logic: BaseNode;
|
|
10
|
+
constructor(options?: Options);
|
|
11
|
+
init(): void;
|
|
12
|
+
toJS(): string;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const concepts_1 = require("../../concepts");
|
|
4
|
+
const utils_1 = require("../shared/utils");
|
|
5
|
+
const MATCH_CONCEPT = 'Match';
|
|
6
|
+
const MATCH_CASE_CONCEPT = 'MatchCase';
|
|
7
|
+
const ASSIGNMENT_CONCEPT = 'Assignment';
|
|
8
|
+
const CALL_LOGIC_CONCEPT = 'CallLogic';
|
|
9
|
+
const WHILE_STATEMENT_CONCEPT = 'WhileStatement';
|
|
10
|
+
const DESTINATION_CONCPETS = ['ExternalDestination', 'Destination'];
|
|
11
|
+
const BEFORE_LOGIC_CONCEPTS = [
|
|
12
|
+
MATCH_CONCEPT,
|
|
13
|
+
'JSBlock',
|
|
14
|
+
'New',
|
|
15
|
+
'NewMap',
|
|
16
|
+
'NewList',
|
|
17
|
+
'NewComposite',
|
|
18
|
+
'ForEachStatement',
|
|
19
|
+
'SwitchStatement',
|
|
20
|
+
'IfStatement',
|
|
21
|
+
];
|
|
22
|
+
const attribute = '[Symbol.for(\'breakpoint\')]';
|
|
23
|
+
const parse = `(code) => eval(code)`;
|
|
24
|
+
const callLogicGenerator = (instance) => (breaker) => {
|
|
25
|
+
const { _nodePath, logic, variable } = instance;
|
|
26
|
+
const node = logic || variable;
|
|
27
|
+
if (!node) {
|
|
28
|
+
return breaker;
|
|
29
|
+
}
|
|
30
|
+
const source = node;
|
|
31
|
+
const { concept, isViewLogic } = source;
|
|
32
|
+
if (concept !== CALL_LOGIC_CONCEPT) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const { arguments: args } = source;
|
|
36
|
+
const wrapper = (callback) => {
|
|
37
|
+
if (isViewLogic) {
|
|
38
|
+
return callback();
|
|
39
|
+
}
|
|
40
|
+
const logic = source.getCallNode() || {};
|
|
41
|
+
const { params: logicParams } = logic;
|
|
42
|
+
const logicBase = logicParams || [];
|
|
43
|
+
logic.params = logicBase.concat({ name: attribute });
|
|
44
|
+
const result = callback();
|
|
45
|
+
logic.params = logicParams;
|
|
46
|
+
return result;
|
|
47
|
+
};
|
|
48
|
+
const breakpointExpression = new BreakpointNode();
|
|
49
|
+
const breakpointArgument = new concepts_1.Argument();
|
|
50
|
+
const base = args || [];
|
|
51
|
+
breakpointArgument.name = attribute;
|
|
52
|
+
breakpointArgument.expression = breakpointExpression;
|
|
53
|
+
breakpointExpression._nodePath = _nodePath;
|
|
54
|
+
source.arguments = base.concat(breakpointArgument);
|
|
55
|
+
const callback = () => source.toJS();
|
|
56
|
+
const code = wrapper(callback);
|
|
57
|
+
source.arguments = args;
|
|
58
|
+
return code;
|
|
59
|
+
};
|
|
60
|
+
const variableGenerator = (instance) => (breaker) => {
|
|
61
|
+
const { _nodePath, variable } = instance;
|
|
62
|
+
if (!variable) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const promise = variable?.toJS() || '';
|
|
66
|
+
return `await $breaker.generateBreakpoint('${_nodePath}', ${parse})(${promise})`;
|
|
67
|
+
};
|
|
68
|
+
const assignmentGenerator = (instance) => (breaker) => {
|
|
69
|
+
const { _nodePath, logic } = instance;
|
|
70
|
+
if (!logic) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const source = logic;
|
|
74
|
+
const { concept, right } = source;
|
|
75
|
+
if (concept !== ASSIGNMENT_CONCEPT) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const options = { variable: right };
|
|
79
|
+
const breakpointRight = new BreakpointNode(options);
|
|
80
|
+
breakpointRight._nodePath = _nodePath;
|
|
81
|
+
source.right = breakpointRight;
|
|
82
|
+
const code = source.toJS();
|
|
83
|
+
source.right = right;
|
|
84
|
+
return code;
|
|
85
|
+
};
|
|
86
|
+
const whileStatementGenerator = (instance) => (breaker) => {
|
|
87
|
+
const { _nodePath, logic } = instance;
|
|
88
|
+
if (!logic) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const source = logic;
|
|
92
|
+
const { concept, body = [] } = source;
|
|
93
|
+
if (concept !== WHILE_STATEMENT_CONCEPT) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const item = new BreakpointNode();
|
|
97
|
+
item._nodePath = _nodePath;
|
|
98
|
+
source.body = body.concat(item);
|
|
99
|
+
const code = source.toJS();
|
|
100
|
+
source.body = body;
|
|
101
|
+
return `${breaker}\n${code}`;
|
|
102
|
+
};
|
|
103
|
+
const matchCaseLogicGenerator = (instance) => (breaker) => {
|
|
104
|
+
const { _nodePath, logic } = instance;
|
|
105
|
+
if (!logic) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const source = logic;
|
|
109
|
+
const parentConcept = source?.parentNode?.concept;
|
|
110
|
+
const underMatch = parentConcept === MATCH_CASE_CONCEPT;
|
|
111
|
+
const ancestor = source.getAncestor(MATCH_CONCEPT) || {};
|
|
112
|
+
const { isExpression } = ancestor;
|
|
113
|
+
if (!underMatch || !isExpression) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const breakpoint = new BreakpointNode({ variable: source });
|
|
117
|
+
breakpoint._nodePath = _nodePath;
|
|
118
|
+
return breakpoint.toJS();
|
|
119
|
+
};
|
|
120
|
+
const destinationLogicGenerator = (instance) => (breaker) => {
|
|
121
|
+
const { _nodePath, logic } = instance;
|
|
122
|
+
if (!logic) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const source = logic;
|
|
126
|
+
const { anchor, concept } = source;
|
|
127
|
+
if (!DESTINATION_CONCPETS.includes(concept)) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const breakpoint = new BreakpointNode({ variable: anchor });
|
|
131
|
+
breakpoint._nodePath = _nodePath;
|
|
132
|
+
source.anchor = breakpoint;
|
|
133
|
+
const code = source.toJS();
|
|
134
|
+
source.anchor = anchor;
|
|
135
|
+
return code;
|
|
136
|
+
};
|
|
137
|
+
const logicGenerator = (instance) => (breaker) => {
|
|
138
|
+
const { logic } = instance;
|
|
139
|
+
if (!logic) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const promise = logic?.toJS() || '';
|
|
143
|
+
const { concept } = logic;
|
|
144
|
+
const shouldSetBefore = BEFORE_LOGIC_CONCEPTS.includes(concept);
|
|
145
|
+
const code = shouldSetBefore ? [breaker, promise] : [promise, breaker];
|
|
146
|
+
return code.join('\n');
|
|
147
|
+
};
|
|
148
|
+
// 不要更换顺序
|
|
149
|
+
const generators = [
|
|
150
|
+
callLogicGenerator,
|
|
151
|
+
variableGenerator,
|
|
152
|
+
assignmentGenerator,
|
|
153
|
+
whileStatementGenerator,
|
|
154
|
+
matchCaseLogicGenerator,
|
|
155
|
+
destinationLogicGenerator,
|
|
156
|
+
logicGenerator,
|
|
157
|
+
];
|
|
158
|
+
const failsafes = [
|
|
159
|
+
variableGenerator,
|
|
160
|
+
logicGenerator,
|
|
161
|
+
];
|
|
162
|
+
class BreakpointNode extends concepts_1.BaseNode {
|
|
163
|
+
_nodePath = '';
|
|
164
|
+
variable = undefined;
|
|
165
|
+
logic = undefined;
|
|
166
|
+
constructor(options = {}) {
|
|
167
|
+
super();
|
|
168
|
+
this.logic = options.logic;
|
|
169
|
+
this.variable = options.variable;
|
|
170
|
+
this.init();
|
|
171
|
+
}
|
|
172
|
+
init() {
|
|
173
|
+
const source = this.logic || this.variable;
|
|
174
|
+
const node = (0, utils_1.getRealNode)(source);
|
|
175
|
+
if (!node) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
this._nodePath = (0, utils_1.getUniqueIdFromNode)(node);
|
|
179
|
+
}
|
|
180
|
+
toJS() {
|
|
181
|
+
const node = this.logic || this.variable;
|
|
182
|
+
const id = this._nodePath;
|
|
183
|
+
const keyword = `'${id}'`;
|
|
184
|
+
const breaker = id && `await $breaker.generateBreakpoint(${keyword}, ${parse})()`;
|
|
185
|
+
if (!node) {
|
|
186
|
+
return breaker;
|
|
187
|
+
}
|
|
188
|
+
let result;
|
|
189
|
+
result = generators.reduce((result, generator) => {
|
|
190
|
+
return result || generator(this)(breaker);
|
|
191
|
+
}, '');
|
|
192
|
+
result = failsafes.reduce((result, generator) => {
|
|
193
|
+
const useful = result && result.includes(keyword);
|
|
194
|
+
return useful ? result : generator(this)(breaker);
|
|
195
|
+
}, result);
|
|
196
|
+
return result || breaker;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.default = BreakpointNode;
|
|
200
|
+
//# sourceMappingURL=BreakpointNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreakpointNode.js","sourceRoot":"","sources":["../../../src/breakpoint/generator/BreakpointNode.ts"],"names":[],"mappings":";;AAAA,6CAAoD;AAEpD,2CAAmE;AAOnE,MAAM,aAAa,GAAG,OAAO,CAAC;AAC9B,MAAM,kBAAkB,GAAG,WAAW,CAAC;AACvC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AACxC,MAAM,kBAAkB,GAAG,WAAW,CAAC;AACvC,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;AACjD,MAAM,oBAAoB,GAAG,CAAC,qBAAqB,EAAE,aAAa,CAAC,CAAC;AAEpE,MAAM,qBAAqB,GAAG;IAC1B,aAAa;IACb,SAAS;IACT,KAAK;IACL,QAAQ;IACR,SAAS;IACT,cAAc;IACd,kBAAkB;IAClB,iBAAiB;IACjB,aAAa;CAChB,CAAC;AAEF,MAAM,SAAS,GAAG,8BAA8B,CAAC;AACjD,MAAM,KAAK,GAAG,sBAAsB,CAAC;AAErC,MAAM,kBAAkB,GAAG,CAAC,QAAwB,EAAE,EAAE,CAAC,CAAC,OAAe,EAAE,EAAE;IACzE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;IAChD,MAAM,IAAI,GAAG,KAAK,IAAI,QAAQ,CAAC;IAE/B,IAAI,CAAC,IAAI,EAAE;QACP,OAAO,OAAO,CAAC;KAClB;IAED,MAAM,MAAM,GAAG,IAAW,CAAC;IAC3B,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IAExC,IAAI,OAAO,KAAK,kBAAkB,EAAE;QAChC,OAAO;KACV;IAED,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAEnC,MAAM,OAAO,GAAG,CAAqB,QAAW,E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E;YAC5C,MAAM,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAClD,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;QACtD,CAAC,EAAE,MAAM,CAAC,CAAC;QAEX,OAAO,MAAM,IAAI,OAAO,CAAC;IAC7B,CAAC;CACJ;AAhDD,iCAgDC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.clearBreakpoints = exports.genBreakpoints = void 0;
|
|
7
|
+
const concepts_1 = require("../../concepts");
|
|
8
|
+
const constants_1 = require("../shared/constants");
|
|
9
|
+
const utils_1 = require("../shared/utils");
|
|
10
|
+
const AfterStartNode_1 = __importDefault(require("./AfterStartNode"));
|
|
11
|
+
const BeforeEndNode_1 = __importDefault(require("./BeforeEndNode"));
|
|
12
|
+
const BreakpointNode_1 = __importDefault(require("./BreakpointNode"));
|
|
13
|
+
const START_CONCEPT = 'Start';
|
|
14
|
+
const END_CONCEPT = 'End';
|
|
15
|
+
const addBreakpointNodes = (node) => {
|
|
16
|
+
if (!node) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const wrap = (key) => (value) => {
|
|
20
|
+
if (!key) {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
const useful = value instanceof concepts_1.BaseNode;
|
|
24
|
+
const breakable = useful && (0, utils_1.isBreakable)(value);
|
|
25
|
+
if (!useful) {
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
addBreakpointNodes(value);
|
|
29
|
+
if (breakable) {
|
|
30
|
+
return new BreakpointNode_1.default({ [key]: value });
|
|
31
|
+
}
|
|
32
|
+
switch (value.concept) {
|
|
33
|
+
case START_CONCEPT: {
|
|
34
|
+
return new AfterStartNode_1.default({ [key]: value });
|
|
35
|
+
}
|
|
36
|
+
case END_CONCEPT: {
|
|
37
|
+
return new BeforeEndNode_1.default({ [key]: value });
|
|
38
|
+
}
|
|
39
|
+
default: {
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
constants_1.NODE_KEYS.forEach((key) => {
|
|
45
|
+
const { [key]: value } = node;
|
|
46
|
+
const isVaribale = constants_1.VARIABLE_KEYS.includes(key);
|
|
47
|
+
const isStack = constants_1.STACK_KEYS.includes(key);
|
|
48
|
+
const isArray = Array.isArray(value);
|
|
49
|
+
if (isVaribale) {
|
|
50
|
+
const warpper = wrap('variable');
|
|
51
|
+
if (isArray) {
|
|
52
|
+
node[key] = value.map(warpper);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
node[key] = warpper(value);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (isStack && isArray) {
|
|
59
|
+
const warpper = wrap('logic');
|
|
60
|
+
node[key] = value.map(warpper);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const removeBreakpointNodes = (node) => {
|
|
65
|
+
if (!node) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const getter = (value) => {
|
|
69
|
+
if (value instanceof BreakpointNode_1.default) {
|
|
70
|
+
value = value.variable || value.logic;
|
|
71
|
+
}
|
|
72
|
+
if (value instanceof concepts_1.BaseNode) {
|
|
73
|
+
removeBreakpointNodes(value);
|
|
74
|
+
}
|
|
75
|
+
return value;
|
|
76
|
+
};
|
|
77
|
+
constants_1.NODE_KEYS.forEach((key) => {
|
|
78
|
+
const { [key]: value } = node;
|
|
79
|
+
if (Array.isArray(value)) {
|
|
80
|
+
node[key] = value.map(getter);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
node[key] = getter(value);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const genBreakpoints = (app) => {
|
|
88
|
+
const logics = (0, utils_1.getLogics)(app);
|
|
89
|
+
logics.forEach(addBreakpointNodes);
|
|
90
|
+
};
|
|
91
|
+
exports.genBreakpoints = genBreakpoints;
|
|
92
|
+
const clearBreakpoints = (app) => {
|
|
93
|
+
const logics = (0, utils_1.getLogics)(app);
|
|
94
|
+
logics.forEach(removeBreakpointNodes);
|
|
95
|
+
};
|
|
96
|
+
exports.clearBreakpoints = clearBreakpoints;
|
|
97
|
+
exports.default = exports.genBreakpoints;
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/breakpoint/generator/index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA+C;AAE/C,mDAA2E;AAC3E,2CAAyD;AAEzD,sEAA8C;AAC9C,oEAA4C;AAC5C,sEAA8C;AAE9C,MAAM,aAAa,GAAG,OAAO,CAAC;AAC9B,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B,MAAM,kBAAkB,GAAG,CAAC,IAAoB,EAAE,EAAE;IAChD,IAAI,CAAC,IAAI,EAAE;QACP,OAAO;KACV;IAED,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,KAAe,EAAE,EAAE;QAC9C,IAAI,CAAC,GAAG,EAAE;YACN,OAAO,KAAK,CAAC;SAChB;QAED,MAAM,MAAM,GAAG,KAAK,YAAY,mBAAQ,CAAC;QACzC,MAAM,SAAS,GAAG,MAAM,IAAI,IAAA,mBAAW,EAAC,KAAK,CAAC,CAAC;QAE/C,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,KAAK,CAAC;SAChB;QAED,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAE1B,IAAI,SAAS,EAAE;YACX,OAAO,IAAI,wBAAc,CAAC,EAAE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+1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./generator"), exports);
|
|
18
|
+
__exportStar(require("./shared"), exports);
|
|
19
|
+
__exportStar(require("./store"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/breakpoint/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const VARIABLE_KEYS: string[];
|
|
2
|
+
export declare const STACK_KEYS: string[];
|
|
3
|
+
export declare const NODE_KEYS: string[];
|
|
4
|
+
export declare const TRAVERSE_NODE_KEYS: string[];
|
|
5
|
+
export declare const BREAKPOINT_CONCEPTS: string[];
|
|
6
|
+
export declare const DEFAULT_ACTIVE_DEBUGGER = false;
|
|
7
|
+
export declare const EVENT_DISCONNECT = "disconnect";
|
|
8
|
+
export declare const EVENT_RECONNECT = "reconnect";
|
|
9
|
+
export declare const STATUS_ENABLED = "ENABLED";
|
|
10
|
+
export declare const STATUS_DELETED = "DELETED";
|
|
11
|
+
export declare const STATUS_DISABLED = "DISABLED";
|
|
12
|
+
export declare const TARGET_FRONTEND = "Frontend";
|
|
13
|
+
export declare const TARGET_BACKEND = "Backend";
|
|
14
|
+
export declare const EVENT_TYPE_PAGE_INFO = "PAGE_INFO";
|
|
15
|
+
export declare const EVENT_TYPE_OBJECT_INFO = "OBJECT_INFO";
|
|
16
|
+
export declare const EVENT_TYPE_SYNC_BREAKPOINTS = "SYNC_BREAKPOINTS";
|
|
17
|
+
export declare const EVENT_TYPE_BREAKPOINT = "BREAKPOINT";
|
|
18
|
+
export declare const EVENT_TYPE_STEP_OVER = "STEP_OVER";
|
|
19
|
+
export declare const EVENT_TYPE_RESOLVE = "RESOLVE";
|
|
20
|
+
export declare const EVENT_TYPE_PARSE = "PARSE";
|
|
21
|
+
export declare const EVENT_TYPE_CACHE = "CACHE";
|
|
22
|
+
export declare const RESPONSE_TYPE_FRONTEND_INFO = "FrontendInfo";
|
|
23
|
+
export declare const RESPONSE_TYPE_OBJECT_INFO = "ObjectInfo";
|
|
24
|
+
export declare const RESPONSE_TYPE_PAGE_INFO = "PageInfo";
|
|
25
|
+
export declare const RESPONSE_TYPE_DEBUG_INFO = "DebugInfo";
|
|
26
|
+
export declare const RESPONSE_TYPE_CONNECTION_INFO = "ConnectionInfo";
|
|
27
|
+
export declare const RESPONSE_TYPE_EXCEPTION_INFO = "ExceptionInfo";
|
|
28
|
+
export declare const CONNECTION_NAME_FRONTEND = "Frontend";
|
|
29
|
+
export declare const CONNECTION_NAME_BACKEND = "Backend";
|
|
30
|
+
export declare const CONNECTION_STATUS_CONNECTED = "Connected";
|
|
31
|
+
export declare const CONNECTION_STATUS_DISCONNECTED = "Disconnected";
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONNECTION_STATUS_DISCONNECTED = exports.CONNECTION_STATUS_CONNECTED = exports.CONNECTION_NAME_BACKEND = exports.CONNECTION_NAME_FRONTEND = exports.RESPONSE_TYPE_EXCEPTION_INFO = exports.RESPONSE_TYPE_CONNECTION_INFO = exports.RESPONSE_TYPE_DEBUG_INFO = exports.RESPONSE_TYPE_PAGE_INFO = exports.RESPONSE_TYPE_OBJECT_INFO = exports.RESPONSE_TYPE_FRONTEND_INFO = exports.EVENT_TYPE_CACHE = exports.EVENT_TYPE_PARSE = exports.EVENT_TYPE_RESOLVE = exports.EVENT_TYPE_STEP_OVER = exports.EVENT_TYPE_BREAKPOINT = exports.EVENT_TYPE_SYNC_BREAKPOINTS = exports.EVENT_TYPE_OBJECT_INFO = exports.EVENT_TYPE_PAGE_INFO = exports.TARGET_BACKEND = exports.TARGET_FRONTEND = exports.STATUS_DISABLED = exports.STATUS_DELETED = exports.STATUS_ENABLED = exports.EVENT_RECONNECT = exports.EVENT_DISCONNECT = exports.DEFAULT_ACTIVE_DEBUGGER = exports.BREAKPOINT_CONCEPTS = exports.TRAVERSE_NODE_KEYS = exports.NODE_KEYS = exports.STACK_KEYS = exports.VARIABLE_KEYS = void 0;
|
|
4
|
+
exports.VARIABLE_KEYS = [
|
|
5
|
+
'test',
|
|
6
|
+
'left',
|
|
7
|
+
'right',
|
|
8
|
+
'rights',
|
|
9
|
+
'patterns',
|
|
10
|
+
'arguments',
|
|
11
|
+
'expression',
|
|
12
|
+
'expressions',
|
|
13
|
+
'cases',
|
|
14
|
+
'each',
|
|
15
|
+
'end',
|
|
16
|
+
'link',
|
|
17
|
+
'start',
|
|
18
|
+
'anchor',
|
|
19
|
+
];
|
|
20
|
+
exports.STACK_KEYS = [
|
|
21
|
+
'body',
|
|
22
|
+
'consequent',
|
|
23
|
+
'alternate',
|
|
24
|
+
];
|
|
25
|
+
exports.NODE_KEYS = [
|
|
26
|
+
...exports.VARIABLE_KEYS,
|
|
27
|
+
...exports.STACK_KEYS,
|
|
28
|
+
];
|
|
29
|
+
exports.TRAVERSE_NODE_KEYS = [
|
|
30
|
+
'playground',
|
|
31
|
+
...exports.NODE_KEYS,
|
|
32
|
+
];
|
|
33
|
+
exports.BREAKPOINT_CONCEPTS = [
|
|
34
|
+
'IfStatement',
|
|
35
|
+
'Match',
|
|
36
|
+
'SwitchStatement',
|
|
37
|
+
'ForEachStatement',
|
|
38
|
+
'WhileStatement',
|
|
39
|
+
// 'StringInterpolation',
|
|
40
|
+
'New',
|
|
41
|
+
'NewMap',
|
|
42
|
+
'NewList',
|
|
43
|
+
'NewComposite',
|
|
44
|
+
'Unparsed',
|
|
45
|
+
'CallFunction',
|
|
46
|
+
'CallLogic',
|
|
47
|
+
'CallInterface',
|
|
48
|
+
'CallAuthInterface',
|
|
49
|
+
'Assignment',
|
|
50
|
+
'BatchAssignment',
|
|
51
|
+
// 'CallConsoleLog',
|
|
52
|
+
'CallMessageShow',
|
|
53
|
+
'Destination',
|
|
54
|
+
'ExternalDestination',
|
|
55
|
+
'JSBlock',
|
|
56
|
+
// 'BinaryExpression',
|
|
57
|
+
// 'UnaryExpression',
|
|
58
|
+
// 'End',
|
|
59
|
+
// 'JSONSerialize',
|
|
60
|
+
// 'JSONDeserialize',
|
|
61
|
+
'SqlQueryComponent',
|
|
62
|
+
'OqlQueryComponent',
|
|
63
|
+
'CallQueryComponent',
|
|
64
|
+
];
|
|
65
|
+
exports.DEFAULT_ACTIVE_DEBUGGER = false;
|
|
66
|
+
exports.EVENT_DISCONNECT = 'disconnect';
|
|
67
|
+
exports.EVENT_RECONNECT = 'reconnect';
|
|
68
|
+
exports.STATUS_ENABLED = 'ENABLED';
|
|
69
|
+
exports.STATUS_DELETED = 'DELETED';
|
|
70
|
+
exports.STATUS_DISABLED = 'DISABLED';
|
|
71
|
+
exports.TARGET_FRONTEND = 'Frontend';
|
|
72
|
+
exports.TARGET_BACKEND = 'Backend';
|
|
73
|
+
exports.EVENT_TYPE_PAGE_INFO = 'PAGE_INFO';
|
|
74
|
+
exports.EVENT_TYPE_OBJECT_INFO = 'OBJECT_INFO';
|
|
75
|
+
exports.EVENT_TYPE_SYNC_BREAKPOINTS = 'SYNC_BREAKPOINTS';
|
|
76
|
+
exports.EVENT_TYPE_BREAKPOINT = 'BREAKPOINT';
|
|
77
|
+
exports.EVENT_TYPE_STEP_OVER = 'STEP_OVER';
|
|
78
|
+
exports.EVENT_TYPE_RESOLVE = 'RESOLVE';
|
|
79
|
+
exports.EVENT_TYPE_PARSE = 'PARSE';
|
|
80
|
+
exports.EVENT_TYPE_CACHE = 'CACHE';
|
|
81
|
+
exports.RESPONSE_TYPE_FRONTEND_INFO = 'FrontendInfo';
|
|
82
|
+
exports.RESPONSE_TYPE_OBJECT_INFO = 'ObjectInfo';
|
|
83
|
+
exports.RESPONSE_TYPE_PAGE_INFO = 'PageInfo';
|
|
84
|
+
exports.RESPONSE_TYPE_DEBUG_INFO = 'DebugInfo';
|
|
85
|
+
exports.RESPONSE_TYPE_CONNECTION_INFO = 'ConnectionInfo';
|
|
86
|
+
exports.RESPONSE_TYPE_EXCEPTION_INFO = 'ExceptionInfo';
|
|
87
|
+
exports.CONNECTION_NAME_FRONTEND = 'Frontend';
|
|
88
|
+
exports.CONNECTION_NAME_BACKEND = 'Backend';
|
|
89
|
+
exports.CONNECTION_STATUS_CONNECTED = 'Connected';
|
|
90
|
+
exports.CONNECTION_STATUS_DISCONNECTED = 'Disconnected';
|
|
91
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/breakpoint/shared/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IACzB,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,UAAU;IACV,WAAW;IACX,YAAY;IACZ,aAAa;IACb,OAAO;IACP,MAAM;IACN,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;CACX,CAAC;AAEW,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AAG,OAAO,CAAC;AAE3B,QAAA,2BAA2B,GAAG,cAAc,CAAC;AAC7C,QAAA,yBAAyB,GAAG,YAAY,CAAC;AACzC,QAAA,uBAAuB,GAAG,UAAU,CAAC;AACrC,QAAA,wBAAwB,GAAG,WAAW,CAAC;AACvC,QAAA,6BAA6B,GAAG,gBAAgB,CAAC;AACjD,QAAA,4BAA4B,GAAG,eAAe,CAAC;AAE/C,QAAA,wBAAwB,GAAG,UAAU,CAAC;AACtC,QAAA,uBAAuB,GAAG,SAAS,CAAC;AAEpC,QAAA,2BAA2B,GAAG,WAAW,CAAC;AAC1C,QAAA,8BAA8B,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.socket = void 0;
|
|
30
|
+
exports.socket = __importStar(require("./socket"));
|
|
31
|
+
__exportStar(require("./constants"), exports);
|
|
32
|
+
__exportStar(require("./utils"), exports);
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/breakpoint/shared/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAmC;AACnC,8CAA4B;AAC5B,0CAAwB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare type Callback = (...args: any[]) => void;
|
|
2
|
+
declare const operators: {
|
|
3
|
+
create: (...args: any[]) => void;
|
|
4
|
+
update: (...args: any[]) => void;
|
|
5
|
+
delete: (...args: any[]) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const setCreate: (callback: Callback) => void;
|
|
8
|
+
export declare const setUpdate: (callback: Callback) => void;
|
|
9
|
+
export declare const setDelete: (callback: Callback) => void;
|
|
10
|
+
export default operators;
|