@fincity/kirun-js 1.9.0 → 2.0.0
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/math/MathFunctionRepositoryTest.ts +118 -75
- package/__tests__/engine/function/system/string/StringFunctionRepoTest2.ts +3 -3
- package/__tests__/engine/function/system/string/StringFunctionRepoTest3.ts +2 -2
- package/__tests__/engine/function/system/string/StringFunctionRepositoryTest.ts +8 -8
- package/__tests__/engine/json/schema/SchemaUtil.ts +1 -1
- package/__tests__/engine/json/schema/type/TypeUtilTest.ts +1 -1
- package/__tests__/engine/json/schema/validator/AnyOfAllOfOneOfValidatorTest.ts +24 -19
- package/__tests__/engine/json/schema/validator/ArrayContainsValidatorTest.ts +22 -22
- package/__tests__/engine/json/schema/validator/ArraySchemaAdapterTypeTest.ts +10 -10
- package/__tests__/engine/json/schema/validator/ArraySchemaTypeTest.ts +22 -22
- package/__tests__/engine/json/schema/validator/ArrayValidatorTest.ts +13 -13
- package/__tests__/engine/json/schema/validator/NotValidatorTest.ts +10 -9
- package/__tests__/engine/json/schema/validator/NullValidatorTest.ts +13 -0
- package/__tests__/engine/json/schema/validator/ObjectPropertiesTest.ts +4 -4
- package/__tests__/engine/json/schema/validator/ObjectValidatorTest.ts +32 -28
- package/__tests__/engine/json/schema/validator/SchemaAnyOfValidatorTest.ts +184 -182
- package/__tests__/engine/json/schema/validator/SchemaValidatorTest.ts +43 -32
- package/__tests__/engine/json/schema/validator/StringFormatSchemaValidatorTest.ts +24 -24
- package/__tests__/engine/json/schema/validator/StringValidatorTest.ts +14 -14
- package/__tests__/engine/repository/KIRunFunctionRepositoryTest.ts +7 -7
- package/__tests__/engine/repository/RepositoryFilterTest.ts +7 -7
- package/__tests__/engine/runtime/KIRuntimeDependencyTest.ts +60 -7
- package/__tests__/engine/runtime/KIRuntimeFunctionInFunction.ts +11 -7
- package/__tests__/engine/runtime/KIRuntimeNoParamMapTest.ts +2 -2
- package/__tests__/engine/runtime/KIRuntimeNoValuesTest.ts +2 -2
- package/__tests__/engine/runtime/KIRuntimeTest.ts +8 -6
- package/__tests__/engine/runtime/KIRuntimeTestWithoutGenEvent.ts +4 -1
- package/__tests__/engine/runtime/KIRuntimeUndefinedParamTest.ts +4 -4
- package/__tests__/engine/runtime/KIRuntimeValuesEmptyTest.ts +6 -6
- package/__tests__/engine/runtime/expression/ExpressionEvaluationTest.ts +35 -0
- package/__tests__/indexTest.ts +10 -10
- 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 +17 -17
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/engine/HybridRepository.ts +5 -5
- package/src/engine/Repository.ts +2 -2
- package/src/engine/function/AbstractFunction.ts +35 -31
- package/src/engine/function/system/array/ArrayFunctionRepository.ts +8 -6
- package/src/engine/function/system/math/MathFunctionRepository.ts +7 -5
- package/src/engine/function/system/object/ObjectFunctionRepository.ts +7 -5
- package/src/engine/function/system/string/StringFunctionRepository.ts +8 -6
- package/src/engine/json/schema/SchemaUtil.ts +33 -30
- package/src/engine/json/schema/validator/ArrayValidator.ts +25 -20
- package/src/engine/json/schema/validator/NullValidator.ts +6 -7
- package/src/engine/json/schema/validator/ObjectValidator.ts +32 -14
- package/src/engine/json/schema/validator/SchemaValidator.ts +15 -11
- package/src/engine/json/schema/validator/TypeValidator.ts +5 -5
- package/src/engine/model/Statement.ts +13 -3
- package/src/engine/repository/KIRunFunctionRepository.ts +3 -2
- package/src/engine/repository/KIRunSchemaRepository.ts +7 -5
- package/src/engine/runtime/KIRuntime.ts +25 -20
- package/src/engine/util/duplicate.ts +1 -1
package/__tests__/indexTest.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { HybridRepository } from '../src/index';
|
|
1
|
+
import { HybridRepository, Repository } from '../src/index';
|
|
2
2
|
|
|
3
|
-
class TestRepository {
|
|
3
|
+
class TestRepository implements Repository<string> {
|
|
4
4
|
static TEST_INDEX: Map<string, string> = new Map<string, string>([
|
|
5
5
|
['one', 'one'],
|
|
6
6
|
['one1', 'one1'],
|
|
7
7
|
]);
|
|
8
8
|
|
|
9
|
-
find(namespace: string, name: string): string | undefined {
|
|
9
|
+
async find(namespace: string, name: string): Promise<string | undefined> {
|
|
10
10
|
return TestRepository.TEST_INDEX.get(name);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
filter(name: string): string[] {
|
|
13
|
+
async filter(name: string): Promise<string[]> {
|
|
14
14
|
return Array.from(TestRepository.TEST_INDEX.keys()).filter(
|
|
15
15
|
(e) => e.toLowerCase().indexOf(name.toLowerCase()) !== -1,
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
class TestRepository2 {
|
|
20
|
+
class TestRepository2 implements Repository<string> {
|
|
21
21
|
static TEST_INDEX: Map<string, string> = new Map<string, string>([
|
|
22
22
|
['two', 'two'],
|
|
23
23
|
['two1', 'two1'],
|
|
24
24
|
]);
|
|
25
25
|
|
|
26
|
-
find(namespace: string, name: string): string | undefined {
|
|
26
|
+
async find(namespace: string, name: string): Promise<string | undefined> {
|
|
27
27
|
return TestRepository2.TEST_INDEX.get(name);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
filter(name: string): string[] {
|
|
30
|
+
async filter(name: string): Promise<string[]> {
|
|
31
31
|
return Array.from(TestRepository.TEST_INDEX.keys()).filter(
|
|
32
32
|
(e) => e.toLowerCase().indexOf(name.toLowerCase()) !== -1,
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
test('Hybrid Repository Test', () => {
|
|
37
|
+
test('Hybrid Repository Test', async () => {
|
|
38
38
|
let hybrid: HybridRepository<string> = new HybridRepository<string>(
|
|
39
39
|
new TestRepository(),
|
|
40
40
|
new TestRepository2(),
|
|
41
41
|
);
|
|
42
42
|
|
|
43
|
-
expect(hybrid.find('', 'one')).toBe('one');
|
|
44
|
-
expect(hybrid.find('', 'two1')).toBe('two1');
|
|
43
|
+
expect(await hybrid.find('', 'one')).toBe('one');
|
|
44
|
+
expect(await hybrid.find('', 'two1')).toBe('two1');
|
|
45
45
|
});
|