@lcap/nasl 3.1.0-beta.4 → 3.1.0-beta.5
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/automate/engine/utils.js +4 -0
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/upgrader/2.12.js +1 -5
- package/out/automate/upgrader/2.12.js.map +1 -1
- package/out/automate/upgrader/2.14.js +1 -5
- package/out/automate/upgrader/2.14.js.map +1 -1
- package/out/automate/upgrader/2.16.js +1 -5
- package/out/automate/upgrader/2.16.js.map +1 -1
- package/out/automate/upgrader/2.17.js +1 -5
- package/out/automate/upgrader/2.17.js.map +1 -1
- package/out/automate/upgrader/2.18.js +1 -5
- package/out/automate/upgrader/2.18.js.map +1 -1
- package/out/automate/upgrader/2.20.js +1 -5
- package/out/automate/upgrader/2.20.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.js +14 -4
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/index.js +1 -5
- package/out/breakpoint/index.js.map +1 -1
- package/out/breakpoint/shared/index.js +1 -5
- package/out/breakpoint/shared/index.js.map +1 -1
- package/out/breakpoint/shared/utils.js +1 -1
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/breakpoint/store/core.js +1 -5
- package/out/breakpoint/store/core.js.map +1 -1
- package/out/breakpoint/store/dock.js +1 -5
- package/out/breakpoint/store/dock.js.map +1 -1
- package/out/breakpoint/store/index.js +1 -5
- package/out/breakpoint/store/index.js.map +1 -1
- package/out/common/BaseNode.d.ts +1 -1
- package/out/common/BaseNode.js +17 -11
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/index.js +1 -5
- package/out/common/index.js.map +1 -1
- package/out/concepts/Anchor__.js +1 -5
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +9 -8
- package/out/concepts/AnonymousFunction__.js +14 -18
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.js +1 -5
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +2 -11
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js +1 -5
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/Assignment__.js +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +1 -5
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/Backend__.js +1 -5
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +3 -8
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +2 -15
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +1 -5
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +1 -5
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +1 -5
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.js +1 -5
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallFunction__.js +2 -2
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +50 -62
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +4 -1
- package/out/concepts/CallLogic__.js +86 -123
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +1 -1
- package/out/concepts/CallQueryComponent__.js +1 -5
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +8 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +1 -5
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +1 -5
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +1 -5
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connector__.js +1 -5
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/DataSource__.js +1 -5
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.js +1 -5
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +1 -5
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +1 -5
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.js +1 -5
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +1 -5
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +1 -5
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +29 -29
- package/out/concepts/FrontendLibrary__.js +3 -7
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.js +1 -5
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +2 -6
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Interface__.js +1 -5
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +6 -6
- package/out/concepts/LogicItem__.js +6 -6
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +5 -24
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js +1 -5
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Module__.js +1 -5
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.js +1 -5
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.js +1 -5
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +29 -29
- package/out/concepts/Namespace__.js +3 -7
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +0 -1
- package/out/concepts/NewComposite__.js +4 -72
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +0 -1
- package/out/concepts/NewList__.js +2 -22
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js +1 -5
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +1 -5
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +1 -5
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +1 -5
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Process__.js +1 -5
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +1 -5
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -5
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/SelectMembers__.js +1 -5
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +1 -5
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/Structure__.js +1 -5
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/TriggerEvent__.js +1 -5
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +5 -5
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +10 -4
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/ViewComponent__.d.ts +33 -33
- package/out/concepts/ViewComponent__.js +8 -12
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +53 -74
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +5 -9
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.http.js +2 -2
- package/out/concepts/basics/stdlib/nasl.util.js +9 -17
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/types/index.js +1 -1
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/concepts/index.js +1 -5
- package/out/concepts/index.js.map +1 -1
- package/out/concepts/index__.js +1 -5
- package/out/concepts/index__.js.map +1 -1
- package/out/generator/genBundleFiles.js +1 -5
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genHash.js +1 -5
- package/out/generator/genHash.js.map +1 -1
- package/out/generator/genMetaData.js +1 -13
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/index.js +1 -5
- package/out/generator/index.js.map +1 -1
- package/out/generator/permission.js +48 -24
- package/out/generator/permission.js.map +1 -1
- package/out/generator/styleReplacer.js +1 -5
- package/out/generator/styleReplacer.js.map +1 -1
- package/out/index.js +1 -5
- package/out/index.js.map +1 -1
- package/out/sentry/index.js +1 -8
- package/out/sentry/index.js.map +1 -1
- package/out/server/formatTsUtils.js +28 -29
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getMemberIdentifier.js +1 -1
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.js +17 -20
- package/out/server/naslServer.js.map +1 -1
- package/out/service/creator/errHandles.d.ts +1 -1
- package/out/service/storage/init.js +5 -8
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +1 -5
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +2 -6
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +3 -7
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.d.ts +1 -1
- package/out/templator/genEditTableBlock.js +3 -11
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -5
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.d.ts +2 -2
- package/out/templator/genGridViewBlock.js +9 -19
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.d.ts +2 -2
- package/out/templator/genListViewBlock.js +6 -14
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +1 -5
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.d.ts +2 -2
- package/out/templator/genSelectBlock.js +10 -20
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.d.ts +1 -1
- package/out/templator/genTableBlock.js +4 -12
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +1 -5
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/index.js +1 -5
- package/out/templator/index.js.map +1 -1
- package/out/utils/index.js +1 -5
- package/out/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/src/breakpoint/generator/BreakpointNode.ts +19 -4
- package/src/breakpoint/shared/utils.ts +1 -1
- package/src/common/BaseNode.ts +15 -3
- package/src/concepts/CallLogic__.ts +45 -15
- package/src/concepts/ValidationRule__.ts +15 -5
- package/src/concepts/ViewElement__.ts +9 -6
- package/src/generator/permission.ts +28 -8
- package/src/server/formatTsUtils.ts +26 -28
- package/src/server/getMemberIdentifier.ts +1 -1
- package/src/server/naslServer.ts +0 -1
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +106 -0
- package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +45 -0
- package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +102 -0
- package/test/concepts/call-logic/fixtures/nested-call-logic.json +934 -0
- package/test/concepts/call-logic/getQuickInfoOffset.spec.ts +23 -0
- package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +6 -0
- package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +5 -0
- package/test/concepts/validation-rule/fixtures/argument-without-keyout.json +34 -0
- package/test/concepts/validation-rule/validation-rule.spec.ts +15 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import type { CallLogic } from '../../../out';
|
|
3
|
+
import { readFixture, getNodeByData } from '../utils';
|
|
4
|
+
import { ConceptName, cases } from './constant';
|
|
5
|
+
|
|
6
|
+
describe(`${ConceptName}:getQuickInfoOffset`, () => {
|
|
7
|
+
const fakeInputOffset = {
|
|
8
|
+
line: 1,
|
|
9
|
+
offset: 1,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
cases.forEach((name) => {
|
|
13
|
+
it(name, () => {
|
|
14
|
+
const data = readFixture(ConceptName, name);
|
|
15
|
+
const node = getNodeByData<CallLogic>(data);
|
|
16
|
+
const tsCode = node.toEmbeddedTS();
|
|
17
|
+
expect({
|
|
18
|
+
code: tsCode,
|
|
19
|
+
...node.getQuickInfoOffset(fakeInputOffset, tsCode),
|
|
20
|
+
}).toMatchSnapshot();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`validation-rule:toEmbeddedTS argument-without-keyout 1`] = `
|
|
4
|
+
"__IDENTIFIER__;
|
|
5
|
+
nasl.validation.max(new nasl.core.Long(10));
|
|
6
|
+
"
|
|
7
|
+
`;
|
|
8
|
+
|
|
3
9
|
exports[`validation-rule:toEmbeddedTS with-param-with-target 1`] = `
|
|
4
10
|
"filter.id;
|
|
5
11
|
nasl.validation.max(new nasl.core.Long(10));
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`validation-rule:toJS argument-without-keyout 1`] = `
|
|
4
|
+
"({ validate: \\"max\\", args: [10], trigger: \\"input+blur\\", message: undefined });
|
|
5
|
+
"
|
|
6
|
+
`;
|
|
7
|
+
|
|
3
8
|
exports[`validation-rule:toJS with-param-with-target 1`] = `
|
|
4
9
|
"({ validate: \\"max\\", args: [10], trigger: \\"input+blur\\", message: undefined });
|
|
5
10
|
"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"concept": "ValidationRule",
|
|
3
|
+
"changedTime": 1691065082931,
|
|
4
|
+
"name": "",
|
|
5
|
+
"label": "验证规则",
|
|
6
|
+
"folded": false,
|
|
7
|
+
"calleeNamespace": "nasl.validation",
|
|
8
|
+
"calleeName": "max",
|
|
9
|
+
"arguments": [
|
|
10
|
+
{
|
|
11
|
+
"concept": "Argument",
|
|
12
|
+
"name": "",
|
|
13
|
+
"folded": false,
|
|
14
|
+
"keyword": "",
|
|
15
|
+
"expression": {
|
|
16
|
+
"concept": "NumericLiteral",
|
|
17
|
+
"name": "",
|
|
18
|
+
"folded": false,
|
|
19
|
+
"value": "10",
|
|
20
|
+
"typeAnnotation": {
|
|
21
|
+
"concept": "TypeAnnotation",
|
|
22
|
+
"name": "",
|
|
23
|
+
"typeKind": "primitive",
|
|
24
|
+
"typeNamespace": "nasl.core",
|
|
25
|
+
"typeName": "Long",
|
|
26
|
+
"typeArguments": null,
|
|
27
|
+
"returnType": null,
|
|
28
|
+
"properties": null
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"enableServerValidation": true
|
|
34
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import type { ValidationRule } from '../../../out';
|
|
3
|
+
import { readFixture, getNodeByData } from '../utils';
|
|
4
|
+
import { ConceptName } from './constant';
|
|
5
|
+
|
|
6
|
+
describe(ConceptName, () => {
|
|
7
|
+
it('The missing "keyword" props in the validation function argument should be filled after generating the ts file.', () => {
|
|
8
|
+
const data = readFixture(ConceptName, 'argument-without-keyout');
|
|
9
|
+
const node = getNodeByData<ValidationRule>(data);
|
|
10
|
+
expect(node.arguments.length).to.eq(1);
|
|
11
|
+
expect(Boolean(node.arguments[0].keyword)).to.false;
|
|
12
|
+
node.toEmbeddedTS();
|
|
13
|
+
expect(node.arguments[0].keyword).to.eq('max');
|
|
14
|
+
});
|
|
15
|
+
});
|