@fincity/kirun-js 1.1.2 → 1.1.3
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/__tests__/engine/function/system/array/AddFirstTest.ts +29 -7
- package/__tests__/engine/function/system/array/AddTest.ts +21 -5
- package/__tests__/engine/function/system/array/BinarySearchTest.ts +26 -7
- package/__tests__/engine/function/system/array/CompareTest.ts +5 -1
- package/__tests__/engine/function/system/array/CopyTest.ts +22 -7
- package/__tests__/engine/function/system/array/DeleteFirstTest.ts +21 -5
- package/__tests__/engine/function/system/array/DeleteFromTest.ts +17 -4
- package/__tests__/engine/function/system/array/DeleteLastTest.ts +21 -5
- package/__tests__/engine/function/system/array/DeleteTest.ts +25 -6
- package/__tests__/engine/function/system/array/DisjointTest.ts +13 -3
- package/__tests__/engine/function/system/array/Equals.ts +13 -3
- package/__tests__/engine/function/system/array/FillTest.ts +5 -1
- package/__tests__/engine/function/system/array/FrequencyTest.ts +13 -3
- package/__tests__/engine/function/system/array/IndexOfArrayTest.ts +29 -7
- package/__tests__/engine/function/system/array/IndexOfTest.ts +21 -5
- package/__tests__/engine/function/system/array/InsertTest.ts +25 -6
- package/__tests__/engine/function/system/array/LastIndexOfArrayTest.ts +21 -5
- package/__tests__/engine/function/system/array/LastIndexOfTest.ts +25 -6
- package/__tests__/engine/function/system/array/MaxTest.ts +33 -24
- package/__tests__/engine/function/system/array/MinTest.ts +33 -24
- package/__tests__/engine/function/system/array/MisMatchTest.ts +17 -4
- package/__tests__/engine/function/system/array/ReverseTest.ts +21 -5
- package/__tests__/engine/function/system/array/RotateTest.ts +13 -3
- package/__tests__/engine/function/system/array/ShuffleTest.ts +9 -2
- package/__tests__/engine/function/system/array/SortTest.ts +21 -5
- package/__tests__/engine/function/system/array/SubArrayTest.ts +21 -5
- package/__tests__/engine/function/system/context/SetFunctionTest.ts +13 -3
- package/__tests__/engine/function/system/math/AddTest.ts +5 -3
- package/__tests__/engine/function/system/math/RandomIntTest.ts +13 -5
- package/__tests__/engine/function/system/string/ConcatenateTest.ts +9 -2
- package/__tests__/engine/function/system/string/DeleteForGivenLengthTest.ts +9 -2
- package/__tests__/engine/function/system/string/InsertAtGivenPositionTest.ts +13 -3
- package/__tests__/engine/function/system/string/PostPadTest.ts +13 -3
- package/__tests__/engine/function/system/string/PrePadTest.ts +13 -3
- package/__tests__/engine/function/system/string/RegionMatchesTest.ts +13 -3
- package/__tests__/engine/function/system/string/ReverseTest.ts +10 -3
- package/__tests__/engine/function/system/string/SplitTest.ts +9 -2
- package/__tests__/engine/function/system/string/StringFunctionRepoTest2.ts +13 -3
- package/__tests__/engine/function/system/string/StringFunctionRepoTest3.ts +9 -2
- package/__tests__/engine/function/system/string/StringFunctionRepositoryTest.ts +33 -8
- package/__tests__/engine/function/system/string/ToStringTest.ts +10 -3
- package/__tests__/engine/function/system/string/TrimToTest.ts +9 -2
- package/__tests__/engine/json/schema/SchemaUtil.ts +3 -0
- package/__tests__/engine/json/schema/type/TypeUtilTest.ts +10 -0
- package/__tests__/engine/json/schema/validator/SchemaValidatorTest.ts +29 -0
- package/__tests__/engine/runtime/KIRuntimeTest.ts +23 -12
- package/__tests__/engine/runtime/KIRuntimeWithDefinitionTest.ts +9 -10
- package/__tests__/engine/runtime/expression/ExpressionEvaluationTest.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +7 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/engine/function/AbstractFunction.ts +14 -5
- package/src/engine/json/schema/Schema.ts +3 -3
- package/src/engine/json/schema/SchemaUtil.ts +4 -4
- package/src/engine/json/schema/type/TypeUtil.ts +3 -5
- package/src/engine/json/schema/validator/SchemaValidator.ts +4 -1
- package/src/engine/runtime/FunctionExecutionParameters.ts +30 -0
- package/src/engine/runtime/KIRuntime.ts +37 -24
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MisMatch } from '../../../../../src/engine/function/system/array/MisMatch';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
3
4
|
|
|
4
5
|
let mismatch: MisMatch = new MisMatch();
|
|
5
6
|
|
|
@@ -22,7 +23,10 @@ test('mismatch test 1', async () => {
|
|
|
22
23
|
res.push('c');
|
|
23
24
|
res.push('d');
|
|
24
25
|
|
|
25
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
26
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
27
|
+
new KIRunFunctionRepository(),
|
|
28
|
+
new KIRunSchemaRepository(),
|
|
29
|
+
).setArguments(
|
|
26
30
|
new Map<string, any>([
|
|
27
31
|
[MisMatch.PARAMETER_ARRAY_SOURCE.getParameterName(), arr],
|
|
28
32
|
[MisMatch.PARAMETER_INT_FIND_FROM.getParameterName(), 7],
|
|
@@ -59,7 +63,10 @@ test('mismatch test 2', async () => {
|
|
|
59
63
|
res.push('c');
|
|
60
64
|
res.push('d');
|
|
61
65
|
|
|
62
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
66
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
67
|
+
new KIRunFunctionRepository(),
|
|
68
|
+
new KIRunSchemaRepository(),
|
|
69
|
+
).setArguments(
|
|
63
70
|
new Map<string, any>([
|
|
64
71
|
[MisMatch.PARAMETER_ARRAY_SOURCE.getParameterName(), arr],
|
|
65
72
|
[MisMatch.PARAMETER_INT_FIND_FROM.getParameterName(), 0],
|
|
@@ -156,7 +163,10 @@ test('Mismatch test 3', async () => {
|
|
|
156
163
|
res.push(array1);
|
|
157
164
|
res.push(array4);
|
|
158
165
|
|
|
159
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
166
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
167
|
+
new KIRunFunctionRepository(),
|
|
168
|
+
new KIRunSchemaRepository(),
|
|
169
|
+
).setArguments(
|
|
160
170
|
new Map<string, any>([
|
|
161
171
|
[MisMatch.PARAMETER_ARRAY_SOURCE.getParameterName(), arr],
|
|
162
172
|
[MisMatch.PARAMETER_INT_FIND_FROM.getParameterName(), 2],
|
|
@@ -193,7 +203,10 @@ test('mismatch test 4', async () => {
|
|
|
193
203
|
res.push('c');
|
|
194
204
|
res.push('d');
|
|
195
205
|
|
|
196
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
206
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
207
|
+
new KIRunFunctionRepository(),
|
|
208
|
+
new KIRunSchemaRepository(),
|
|
209
|
+
).setArguments(
|
|
197
210
|
new Map<string, any>([
|
|
198
211
|
[MisMatch.PARAMETER_ARRAY_SOURCE.getParameterName(), arr],
|
|
199
212
|
[MisMatch.PARAMETER_INT_FIND_FROM.getParameterName(), 1],
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { Reverse } from '../../../../../src/engine/function/system/array/Reverse';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
3
4
|
|
|
4
5
|
let rev: Reverse = new Reverse();
|
|
5
6
|
|
|
6
7
|
test('Reverse test 1 ', async () => {
|
|
7
8
|
let src: any[] = [4, 5, 6, 7];
|
|
8
9
|
|
|
9
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
10
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
11
|
+
new KIRunFunctionRepository(),
|
|
12
|
+
new KIRunSchemaRepository(),
|
|
13
|
+
)
|
|
10
14
|
.setArguments(
|
|
11
15
|
new Map<string, any>([
|
|
12
16
|
[Reverse.PARAMETER_ARRAY_SOURCE.getParameterName(), src],
|
|
@@ -38,7 +42,10 @@ test('Reverse test 2 ', async () => {
|
|
|
38
42
|
src.push('Driven');
|
|
39
43
|
src.push('developement');
|
|
40
44
|
|
|
41
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
45
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
46
|
+
new KIRunFunctionRepository(),
|
|
47
|
+
new KIRunSchemaRepository(),
|
|
48
|
+
)
|
|
42
49
|
.setArguments(
|
|
43
50
|
new Map<string, any>([
|
|
44
51
|
[Reverse.PARAMETER_ARRAY_SOURCE.getParameterName(), src],
|
|
@@ -62,7 +69,10 @@ test('Reverse test 3', async () => {
|
|
|
62
69
|
arr.push('c');
|
|
63
70
|
arr.push('d');
|
|
64
71
|
|
|
65
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
72
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
73
|
+
new KIRunFunctionRepository(),
|
|
74
|
+
new KIRunSchemaRepository(),
|
|
75
|
+
)
|
|
66
76
|
.setContext(new Map([]))
|
|
67
77
|
.setSteps(new Map([]));
|
|
68
78
|
|
|
@@ -146,7 +156,10 @@ test('Rev test 4', async () => {
|
|
|
146
156
|
arr.push(array4);
|
|
147
157
|
arr.push(array1);
|
|
148
158
|
|
|
149
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
159
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
160
|
+
new KIRunFunctionRepository(),
|
|
161
|
+
new KIRunSchemaRepository(),
|
|
162
|
+
)
|
|
150
163
|
.setArguments(
|
|
151
164
|
new Map<string, any>([
|
|
152
165
|
[Reverse.PARAMETER_ARRAY_SOURCE.getParameterName(), arr],
|
|
@@ -199,7 +212,10 @@ test('rev test 5', async () => {
|
|
|
199
212
|
arr.push('c');
|
|
200
213
|
arr.push('d');
|
|
201
214
|
|
|
202
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
215
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
216
|
+
new KIRunFunctionRepository(),
|
|
217
|
+
new KIRunSchemaRepository(),
|
|
218
|
+
)
|
|
203
219
|
.setArguments(
|
|
204
220
|
new Map<string, any>([
|
|
205
221
|
[Reverse.PARAMETER_ARRAY_SOURCE.getParameterName(), arr],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Rotate } from '../../../../../src/engine/function/system/array/Rotate';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
3
4
|
|
|
4
5
|
let rotate: Rotate = new Rotate();
|
|
5
6
|
|
|
@@ -18,7 +19,10 @@ test('Rotate test1 ', async () => {
|
|
|
18
19
|
array.push('Driven');
|
|
19
20
|
array.push('developement');
|
|
20
21
|
|
|
21
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
22
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
23
|
+
new KIRunFunctionRepository(),
|
|
24
|
+
new KIRunSchemaRepository(),
|
|
25
|
+
)
|
|
22
26
|
.setArguments(
|
|
23
27
|
new Map<string, any>([
|
|
24
28
|
[Rotate.PARAMETER_ARRAY_SOURCE.getParameterName(), array],
|
|
@@ -64,7 +68,10 @@ test('rotate test 2', async () => {
|
|
|
64
68
|
src.push('Driven');
|
|
65
69
|
src.push('developement');
|
|
66
70
|
|
|
67
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
71
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
72
|
+
new KIRunFunctionRepository(),
|
|
73
|
+
new KIRunSchemaRepository(),
|
|
74
|
+
)
|
|
68
75
|
.setArguments(
|
|
69
76
|
new Map<string, any>([
|
|
70
77
|
[Rotate.PARAMETER_ARRAY_SOURCE.getParameterName(), src],
|
|
@@ -109,7 +116,10 @@ test('rotate test 3', async () => {
|
|
|
109
116
|
array.push('Driven');
|
|
110
117
|
array.push('developement');
|
|
111
118
|
|
|
112
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
119
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
120
|
+
new KIRunFunctionRepository(),
|
|
121
|
+
new KIRunSchemaRepository(),
|
|
122
|
+
)
|
|
113
123
|
.setArguments(
|
|
114
124
|
new Map<string, any>([[Rotate.PARAMETER_ARRAY_SOURCE.getParameterName(), array]]),
|
|
115
125
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Shuffle } from '../../../../../src/engine/function/system/array/Shuffle';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
3
4
|
|
|
4
5
|
let shuffle: Shuffle = new Shuffle();
|
|
5
6
|
|
|
@@ -36,7 +37,10 @@ test('shuffle test 1', async () => {
|
|
|
36
37
|
|
|
37
38
|
res.forEach((element) => set1.add(element));
|
|
38
39
|
|
|
39
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
40
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
41
|
+
new KIRunFunctionRepository(),
|
|
42
|
+
new KIRunSchemaRepository(),
|
|
43
|
+
)
|
|
40
44
|
.setArguments(
|
|
41
45
|
new Map<string, any>([[Shuffle.PARAMETER_ARRAY_SOURCE.getParameterName(), array]]),
|
|
42
46
|
)
|
|
@@ -140,7 +144,10 @@ test('Shuffle test 2', async () => {
|
|
|
140
144
|
Set1.add(el);
|
|
141
145
|
});
|
|
142
146
|
|
|
143
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
147
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
148
|
+
new KIRunFunctionRepository(),
|
|
149
|
+
new KIRunSchemaRepository(),
|
|
150
|
+
)
|
|
144
151
|
.setArguments(
|
|
145
152
|
new Map<string, any>([[Shuffle.PARAMETER_ARRAY_SOURCE.getParameterName(), arr]]),
|
|
146
153
|
)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
1
2
|
import { Sort } from '../../../../../src/engine/function/system/array/Sort';
|
|
2
3
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
4
|
|
|
@@ -11,7 +12,10 @@ test('sort test 1', async () => {
|
|
|
11
12
|
arr.push(98);
|
|
12
13
|
arr.push(1);
|
|
13
14
|
|
|
14
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
15
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
16
|
+
new KIRunFunctionRepository(),
|
|
17
|
+
new KIRunSchemaRepository(),
|
|
18
|
+
).setArguments(
|
|
15
19
|
new Map<string, any>([
|
|
16
20
|
[Sort.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr],
|
|
17
21
|
[Sort.PARAMETER_INT_FIND_FROM.getParameterName(), 0],
|
|
@@ -36,7 +40,10 @@ test('sort test 2', async () => {
|
|
|
36
40
|
arr.push(98);
|
|
37
41
|
arr.push(1);
|
|
38
42
|
|
|
39
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
43
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
44
|
+
new KIRunFunctionRepository(),
|
|
45
|
+
new KIRunSchemaRepository(),
|
|
46
|
+
).setArguments(
|
|
40
47
|
new Map<string, any>([
|
|
41
48
|
[Sort.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr],
|
|
42
49
|
[Sort.PARAMETER_INT_FIND_FROM.getParameterName(), 1],
|
|
@@ -70,7 +77,10 @@ test('sort test 3', async () => {
|
|
|
70
77
|
res.push(98);
|
|
71
78
|
res.push(1);
|
|
72
79
|
|
|
73
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
80
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
81
|
+
new KIRunFunctionRepository(),
|
|
82
|
+
new KIRunSchemaRepository(),
|
|
83
|
+
).setArguments(
|
|
74
84
|
new Map<string, any>([
|
|
75
85
|
[Sort.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr],
|
|
76
86
|
[Sort.PARAMETER_INT_FIND_FROM.getParameterName(), 2],
|
|
@@ -104,7 +114,10 @@ test('sort test 4', async () => {
|
|
|
104
114
|
res.push(1);
|
|
105
115
|
res.push(null);
|
|
106
116
|
|
|
107
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
117
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
118
|
+
new KIRunFunctionRepository(),
|
|
119
|
+
new KIRunSchemaRepository(),
|
|
120
|
+
).setArguments(
|
|
108
121
|
new Map<string, any>([
|
|
109
122
|
[Sort.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr],
|
|
110
123
|
[Sort.PARAMETER_INT_FIND_FROM.getParameterName(), 2],
|
|
@@ -118,7 +131,10 @@ test('sort test 4', async () => {
|
|
|
118
131
|
test('sort test 5', async () => {
|
|
119
132
|
let arr: any[] = ['Banana', 'Orange', 'Apple', 'Mango'];
|
|
120
133
|
|
|
121
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
134
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
135
|
+
new KIRunFunctionRepository(),
|
|
136
|
+
new KIRunSchemaRepository(),
|
|
137
|
+
).setArguments(
|
|
122
138
|
new Map<string, any>([
|
|
123
139
|
[Sort.PARAMETER_ARRAY_SOURCE_PRIMITIVE.getParameterName(), arr],
|
|
124
140
|
[Sort.PARAMETER_INT_FIND_FROM.getParameterName(), 1],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SubArray } from '../../../../../src/engine/function/system/array/SubArray';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
3
4
|
|
|
4
5
|
test('SubArray of Test 1', async () => {
|
|
5
6
|
let sub: SubArray = new SubArray();
|
|
@@ -35,7 +36,10 @@ test('SubArray of Test 1', async () => {
|
|
|
35
36
|
res.push('changes');
|
|
36
37
|
res.push('with');
|
|
37
38
|
|
|
38
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
39
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
40
|
+
new KIRunFunctionRepository(),
|
|
41
|
+
new KIRunSchemaRepository(),
|
|
42
|
+
).setArguments(
|
|
39
43
|
new Map<string, any>([
|
|
40
44
|
[SubArray.PARAMETER_ARRAY_SOURCE.getParameterName(), array],
|
|
41
45
|
[SubArray.PARAMETER_INT_FIND_FROM.getParameterName(), 4],
|
|
@@ -54,7 +58,10 @@ test('SubArray of Test 1', async () => {
|
|
|
54
58
|
test('SubArray of Test 2', async () => {
|
|
55
59
|
let sub: SubArray = new SubArray();
|
|
56
60
|
|
|
57
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
61
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
62
|
+
new KIRunFunctionRepository(),
|
|
63
|
+
new KIRunSchemaRepository(),
|
|
64
|
+
)
|
|
58
65
|
.setArguments(
|
|
59
66
|
new Map<string, any>([
|
|
60
67
|
[SubArray.PARAMETER_ARRAY_SOURCE.getParameterName(), undefined],
|
|
@@ -93,7 +100,10 @@ test('SubArray of Test 5', async () => {
|
|
|
93
100
|
res.push('a');
|
|
94
101
|
res.push('b');
|
|
95
102
|
|
|
96
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
103
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
104
|
+
new KIRunFunctionRepository(),
|
|
105
|
+
new KIRunSchemaRepository(),
|
|
106
|
+
).setArguments(
|
|
97
107
|
new Map<string, any>([
|
|
98
108
|
[SubArray.PARAMETER_ARRAY_SOURCE.getParameterName(), array],
|
|
99
109
|
[SubArray.PARAMETER_INT_FIND_FROM.getParameterName(), 1],
|
|
@@ -134,7 +144,10 @@ test('SubArray of Test 3', async () => {
|
|
|
134
144
|
res.push('a');
|
|
135
145
|
res.push('b');
|
|
136
146
|
|
|
137
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
147
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
148
|
+
new KIRunFunctionRepository(),
|
|
149
|
+
new KIRunSchemaRepository(),
|
|
150
|
+
).setArguments(
|
|
138
151
|
new Map<string, any>([
|
|
139
152
|
[SubArray.PARAMETER_ARRAY_SOURCE.getParameterName(), array],
|
|
140
153
|
[SubArray.PARAMETER_INT_FIND_FROM.getParameterName(), 1123],
|
|
@@ -229,7 +242,10 @@ test('SubArray of Test 4', async () => {
|
|
|
229
242
|
res.push(array4);
|
|
230
243
|
res.push(array1);
|
|
231
244
|
|
|
232
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
245
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
246
|
+
new KIRunFunctionRepository(),
|
|
247
|
+
new KIRunSchemaRepository(),
|
|
248
|
+
).setArguments(
|
|
233
249
|
new Map<string, any>([
|
|
234
250
|
[SubArray.PARAMETER_ARRAY_SOURCE.getParameterName(), array],
|
|
235
251
|
// [SubArray.PARAMETER_INT_FIND_FROM.getParameterName(), 2],
|
|
@@ -2,11 +2,15 @@ import { Schema } from '../../../../../src';
|
|
|
2
2
|
import { SetFunction } from '../../../../../src/engine/function/system/context/SetFunction';
|
|
3
3
|
import { ContextElement } from '../../../../../src/engine/runtime/ContextElement';
|
|
4
4
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
5
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
5
6
|
|
|
6
7
|
test('Set function test 1', async () => {
|
|
7
8
|
let setFunction: SetFunction = new SetFunction();
|
|
8
9
|
|
|
9
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
10
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
11
|
+
new KIRunFunctionRepository(),
|
|
12
|
+
new KIRunSchemaRepository(),
|
|
13
|
+
);
|
|
10
14
|
|
|
11
15
|
let contextMap: Map<string, ContextElement> = new Map();
|
|
12
16
|
contextMap.set('a', new ContextElement(Schema.ofAny('test'), {}));
|
|
@@ -35,7 +39,10 @@ test('Set function test 1', async () => {
|
|
|
35
39
|
test('Set function test 2', async () => {
|
|
36
40
|
let setFunction: SetFunction = new SetFunction();
|
|
37
41
|
|
|
38
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
42
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
43
|
+
new KIRunFunctionRepository(),
|
|
44
|
+
new KIRunSchemaRepository(),
|
|
45
|
+
);
|
|
39
46
|
|
|
40
47
|
let contextMap: Map<string, ContextElement> = new Map();
|
|
41
48
|
contextMap.set('a', new ContextElement(Schema.ofAny('test'), []));
|
|
@@ -54,7 +61,10 @@ test('Set function test 2', async () => {
|
|
|
54
61
|
test('Set function test 3', async () => {
|
|
55
62
|
let setFunction: SetFunction = new SetFunction();
|
|
56
63
|
|
|
57
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
64
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
65
|
+
new KIRunFunctionRepository(),
|
|
66
|
+
new KIRunSchemaRepository(),
|
|
67
|
+
);
|
|
58
68
|
|
|
59
69
|
let contextMap: Map<string, ContextElement> = new Map();
|
|
60
70
|
contextMap.set('a', new ContextElement(Schema.ofAny('test'), {}));
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Add } from '../../../../../src/engine/function/system/math/Add';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
3
4
|
|
|
4
5
|
const add: Add = new Add();
|
|
5
6
|
|
|
6
7
|
test('add test 1', async () => {
|
|
7
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
8
|
-
new
|
|
9
|
-
|
|
8
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
9
|
+
new KIRunFunctionRepository(),
|
|
10
|
+
new KIRunSchemaRepository(),
|
|
11
|
+
).setArguments(new Map([['value', [1, 2, 3, 4, 5, 6, 5.5]]]));
|
|
10
12
|
|
|
11
13
|
expect((await add.execute(fep)).allResults()[0].getResult().get('value')).toBe(26.5);
|
|
12
14
|
});
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { RandomInt } from '../../../../../src/engine/function/system/math/RandomInt';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
3
4
|
|
|
4
5
|
const rand = new RandomInt();
|
|
5
6
|
|
|
6
7
|
test(' rand int 1', async () => {
|
|
7
8
|
let min = 100,
|
|
8
9
|
max = 1000123;
|
|
9
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
10
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
11
|
+
new KIRunFunctionRepository(),
|
|
12
|
+
new KIRunSchemaRepository(),
|
|
13
|
+
).setArguments(
|
|
10
14
|
new Map([
|
|
11
15
|
['minValue', min],
|
|
12
16
|
['maxValue', max],
|
|
@@ -20,9 +24,10 @@ test(' rand int 1', async () => {
|
|
|
20
24
|
|
|
21
25
|
test(' rand int 2', async () => {
|
|
22
26
|
let min = 100;
|
|
23
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
24
|
-
new
|
|
25
|
-
|
|
27
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
28
|
+
new KIRunFunctionRepository(),
|
|
29
|
+
new KIRunSchemaRepository(),
|
|
30
|
+
).setArguments(new Map([['minValue', min]]));
|
|
26
31
|
let num: number = (await rand.execute(fep)).allResults()[0].getResult().get('value');
|
|
27
32
|
|
|
28
33
|
expect(num).toBeLessThanOrEqual(2147483647);
|
|
@@ -32,7 +37,10 @@ test(' rand int 2', async () => {
|
|
|
32
37
|
test(' rand int 3', async () => {
|
|
33
38
|
let min = 100,
|
|
34
39
|
max = 101;
|
|
35
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
40
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
41
|
+
new KIRunFunctionRepository(),
|
|
42
|
+
new KIRunSchemaRepository(),
|
|
43
|
+
).setArguments(
|
|
36
44
|
new Map([
|
|
37
45
|
['minValue', min],
|
|
38
46
|
['maxValue', max],
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
1
2
|
import { Concatenate } from '../../../../../src/engine/function/system/string/Concatenate';
|
|
2
3
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
4
|
import { MapUtil } from '../../../../../src/engine/util/MapUtil';
|
|
@@ -5,7 +6,10 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
|
|
|
5
6
|
const cat: Concatenate = new Concatenate();
|
|
6
7
|
|
|
7
8
|
test('conatenate test1', async () => {
|
|
8
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
9
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
10
|
+
new KIRunFunctionRepository(),
|
|
11
|
+
new KIRunSchemaRepository(),
|
|
12
|
+
);
|
|
9
13
|
|
|
10
14
|
let array: string[] = [];
|
|
11
15
|
array.push('I ');
|
|
@@ -37,7 +41,10 @@ test('conatenate test2', async () => {
|
|
|
37
41
|
list.push(' PLATform ');
|
|
38
42
|
list.push('2');
|
|
39
43
|
|
|
40
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
44
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
45
|
+
new KIRunFunctionRepository(),
|
|
46
|
+
new KIRunSchemaRepository(),
|
|
47
|
+
);
|
|
41
48
|
|
|
42
49
|
fep.setArguments(MapUtil.of('value', list));
|
|
43
50
|
expect((await cat.execute(fep)).allResults()[0].getResult().get('value')).toBe(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
1
2
|
import { DeleteForGivenLength } from '../../../../../src/engine/function/system/string/DeleteForGivenLength';
|
|
2
3
|
import { SchemaValidationException } from '../../../../../src/engine/json/schema/validator/exception/SchemaValidationException';
|
|
3
4
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
@@ -6,7 +7,10 @@ import { MapUtil } from '../../../../../src/engine/util/MapUtil';
|
|
|
6
7
|
const deleteT: DeleteForGivenLength = new DeleteForGivenLength();
|
|
7
8
|
|
|
8
9
|
test('DeleteForGivenLength test1', async () => {
|
|
9
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
10
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
11
|
+
new KIRunFunctionRepository(),
|
|
12
|
+
new KIRunSchemaRepository(),
|
|
13
|
+
);
|
|
10
14
|
|
|
11
15
|
fep.setArguments(
|
|
12
16
|
new Map<string, string | number>([
|
|
@@ -24,7 +28,10 @@ test('DeleteForGivenLength test1', async () => {
|
|
|
24
28
|
});
|
|
25
29
|
|
|
26
30
|
test('DeleteForGivenLength test2', async () => {
|
|
27
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
31
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
32
|
+
new KIRunFunctionRepository(),
|
|
33
|
+
new KIRunSchemaRepository(),
|
|
34
|
+
);
|
|
28
35
|
|
|
29
36
|
fep.setArguments(
|
|
30
37
|
new Map<string, string | number>([
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { InsertAtGivenPosition } from '../../../../../src/engine/function/system/string/InsertAtGivenPosition';
|
|
2
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
2
3
|
|
|
3
4
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
4
5
|
|
|
5
6
|
const reve: InsertAtGivenPosition = new InsertAtGivenPosition();
|
|
6
7
|
|
|
7
8
|
test('InsertATGivenPositions test1', async () => {
|
|
8
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
9
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
10
|
+
new KIRunFunctionRepository(),
|
|
11
|
+
new KIRunSchemaRepository(),
|
|
12
|
+
);
|
|
9
13
|
|
|
10
14
|
fep.setArguments(
|
|
11
15
|
new Map<string, string | number>([
|
|
@@ -21,7 +25,10 @@ test('InsertATGivenPositions test1', async () => {
|
|
|
21
25
|
});
|
|
22
26
|
|
|
23
27
|
test('InsertATGivenPositions test2', async () => {
|
|
24
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
28
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
29
|
+
new KIRunFunctionRepository(),
|
|
30
|
+
new KIRunSchemaRepository(),
|
|
31
|
+
);
|
|
25
32
|
|
|
26
33
|
fep.setArguments(
|
|
27
34
|
new Map<string, string | number>([
|
|
@@ -37,7 +44,10 @@ test('InsertATGivenPositions test2', async () => {
|
|
|
37
44
|
});
|
|
38
45
|
|
|
39
46
|
test('InsertATGivenPositions test3', async () => {
|
|
40
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
47
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
48
|
+
new KIRunFunctionRepository(),
|
|
49
|
+
new KIRunSchemaRepository(),
|
|
50
|
+
);
|
|
41
51
|
|
|
42
52
|
fep.setArguments(
|
|
43
53
|
new Map<string, string | number>([
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { PostPad } from '../../../../../src/engine/function/system/string/PostPad';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
3
|
import { MapEntry, MapUtil } from '../../../../../src/engine/util/MapUtil';
|
|
4
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
4
5
|
|
|
5
6
|
const reve: PostPad = new PostPad();
|
|
6
7
|
|
|
7
8
|
test('postpad test1', async () => {
|
|
8
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
9
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
10
|
+
new KIRunFunctionRepository(),
|
|
11
|
+
new KIRunSchemaRepository(),
|
|
12
|
+
);
|
|
9
13
|
|
|
10
14
|
fep.setArguments(
|
|
11
15
|
new Map<string, string | number>([
|
|
@@ -21,7 +25,10 @@ test('postpad test1', async () => {
|
|
|
21
25
|
});
|
|
22
26
|
|
|
23
27
|
test('postpad test2', async () => {
|
|
24
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
28
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
29
|
+
new KIRunFunctionRepository(),
|
|
30
|
+
new KIRunSchemaRepository(),
|
|
31
|
+
);
|
|
25
32
|
|
|
26
33
|
fep.setArguments(
|
|
27
34
|
new Map<string, string | number>([
|
|
@@ -37,7 +44,10 @@ test('postpad test2', async () => {
|
|
|
37
44
|
});
|
|
38
45
|
|
|
39
46
|
test('postpad test3', async () => {
|
|
40
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
47
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
48
|
+
new KIRunFunctionRepository(),
|
|
49
|
+
new KIRunSchemaRepository(),
|
|
50
|
+
);
|
|
41
51
|
|
|
42
52
|
fep.setArguments(
|
|
43
53
|
new Map<string, string | number>([
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { PrePad } from '../../../../../src/engine/function/system/string/PrePad';
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
3
|
import { MapEntry, MapUtil } from '../../../../../src/engine/util/MapUtil';
|
|
4
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
4
5
|
|
|
5
6
|
const prepad: PrePad = new PrePad();
|
|
6
7
|
|
|
7
8
|
test('prepad test1', async () => {
|
|
8
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
9
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
10
|
+
new KIRunFunctionRepository(),
|
|
11
|
+
new KIRunSchemaRepository(),
|
|
12
|
+
);
|
|
9
13
|
|
|
10
14
|
fep.setArguments(
|
|
11
15
|
new Map<string, string | number>([
|
|
@@ -23,7 +27,10 @@ test('prepad test1', async () => {
|
|
|
23
27
|
});
|
|
24
28
|
|
|
25
29
|
test('prepad test2', async () => {
|
|
26
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
30
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
31
|
+
new KIRunFunctionRepository(),
|
|
32
|
+
new KIRunSchemaRepository(),
|
|
33
|
+
);
|
|
27
34
|
|
|
28
35
|
fep.setArguments(
|
|
29
36
|
new Map<string, string | number>([
|
|
@@ -39,7 +46,10 @@ test('prepad test2', async () => {
|
|
|
39
46
|
});
|
|
40
47
|
|
|
41
48
|
test('prepad test3', async () => {
|
|
42
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
49
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
50
|
+
new KIRunFunctionRepository(),
|
|
51
|
+
new KIRunSchemaRepository(),
|
|
52
|
+
);
|
|
43
53
|
|
|
44
54
|
fep.setArguments(
|
|
45
55
|
new Map<string, string | number>([
|
|
@@ -2,10 +2,14 @@ import { RegionMatches } from '../../../../../src/engine/function/system/string/
|
|
|
2
2
|
import { FunctionExecutionParameters } from '../../../../../src/engine/runtime/FunctionExecutionParameters';
|
|
3
3
|
import { MapUtil } from '../../../../../src/engine/util/MapUtil';
|
|
4
4
|
|
|
5
|
+
import { KIRunFunctionRepository, KIRunSchemaRepository } from '../../../../../src';
|
|
5
6
|
const region: RegionMatches = new RegionMatches();
|
|
6
7
|
|
|
7
8
|
test('toString test1', async () => {
|
|
8
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
9
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
10
|
+
new KIRunFunctionRepository(),
|
|
11
|
+
new KIRunSchemaRepository(),
|
|
12
|
+
);
|
|
9
13
|
|
|
10
14
|
fep.setArguments(
|
|
11
15
|
MapUtil.of<string, string | number | boolean>(
|
|
@@ -33,7 +37,10 @@ test('toString test1', async () => {
|
|
|
33
37
|
});
|
|
34
38
|
|
|
35
39
|
test('toString test2', async () => {
|
|
36
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
40
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
41
|
+
new KIRunFunctionRepository(),
|
|
42
|
+
new KIRunSchemaRepository(),
|
|
43
|
+
);
|
|
37
44
|
fep.setArguments(
|
|
38
45
|
MapUtil.of<string, string | number | boolean>(
|
|
39
46
|
RegionMatches.PARAMETER_BOOLEAN_NAME,
|
|
@@ -60,7 +67,10 @@ test('toString test2', async () => {
|
|
|
60
67
|
});
|
|
61
68
|
|
|
62
69
|
test('toString test3', async () => {
|
|
63
|
-
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
70
|
+
let fep: FunctionExecutionParameters = new FunctionExecutionParameters(
|
|
71
|
+
new KIRunFunctionRepository(),
|
|
72
|
+
new KIRunSchemaRepository(),
|
|
73
|
+
);
|
|
64
74
|
fep.setArguments(
|
|
65
75
|
MapUtil.of<string, string | number | boolean>(
|
|
66
76
|
RegionMatches.PARAMETER_BOOLEAN_NAME,
|