@fincity/kirun-js 2.7.0 → 2.8.2

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.
Files changed (100) hide show
  1. package/__tests__/engine/function/system/WaitTest.ts +1 -1
  2. package/__tests__/engine/function/system/array/AddFirstTest.ts +2 -6
  3. package/__tests__/engine/function/system/array/IndexOfTest.ts +8 -13
  4. package/__tests__/engine/function/system/array/LastIndexOfTest.ts +9 -28
  5. package/__tests__/engine/function/system/date/AddSubtractTimeTest.ts +93 -0
  6. package/__tests__/engine/function/system/date/DateFunctionRepositoryTest.ts +96 -0
  7. package/__tests__/engine/function/system/date/DifferenceTest.ts +93 -0
  8. package/__tests__/engine/function/system/date/EpochToTimestampTest.ts +133 -0
  9. package/__tests__/engine/function/system/date/FromDateStringTest.ts +51 -0
  10. package/__tests__/engine/function/system/date/FromNowTest.ts +71 -0
  11. package/__tests__/engine/function/system/date/GetCurrentTimeStampTest.ts +19 -27
  12. package/__tests__/engine/function/system/date/GetNamesTest.ts +105 -0
  13. package/__tests__/engine/function/system/date/IsBetweenTest.ts +53 -0
  14. package/__tests__/engine/function/system/date/IsValidISODateTest.ts +42 -54
  15. package/__tests__/engine/function/system/date/LastFirstOfTest.ts +64 -0
  16. package/__tests__/engine/function/system/date/SetTimeZoneTest.ts +48 -0
  17. package/__tests__/engine/function/system/date/StartEndOfTest.ts +53 -0
  18. package/__tests__/engine/function/system/date/TimeAsTest.ts +24 -0
  19. package/__tests__/engine/function/system/date/TimestampToEpochTest.ts +45 -0
  20. package/__tests__/engine/function/system/date/ToDateStringTest.ts +48 -0
  21. package/__tests__/engine/function/system/math/RandomFloatTest.ts +21 -22
  22. package/__tests__/engine/function/system/math/RandomIntTest.ts +5 -4
  23. package/__tests__/engine/repository/RepositoryFilterTest.ts +4 -1
  24. package/__tests__/engine/runtime/expression/ExpressionEqualityTest.ts +76 -0
  25. package/dist/index.js +1 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/module.js +1 -1
  28. package/dist/module.js.map +1 -1
  29. package/dist/types.d.ts +14 -13
  30. package/dist/types.d.ts.map +1 -1
  31. package/generator/generateValidationCSV.ts +51 -42
  32. package/generator/validation-js.csv +0 -0
  33. package/package.json +9 -7
  34. package/src/engine/function/AbstractFunction.ts +1 -1
  35. package/src/engine/function/system/Print.ts +19 -5
  36. package/src/engine/function/system/Wait.ts +1 -1
  37. package/src/engine/function/system/array/AbstractArrayFunction.ts +3 -3
  38. package/src/engine/function/system/array/Fill.ts +1 -1
  39. package/src/engine/function/system/array/Frequency.ts +0 -1
  40. package/src/engine/function/system/array/IndexOf.ts +4 -4
  41. package/src/engine/function/system/array/LastIndexOf.ts +3 -3
  42. package/src/engine/function/system/array/Rotate.ts +1 -1
  43. package/src/engine/function/system/array/Shuffle.ts +1 -1
  44. package/src/engine/function/system/array/Sort.ts +1 -1
  45. package/src/engine/function/system/date/AbstractDateFunction.ts +229 -111
  46. package/src/engine/function/system/date/AddSubtractTime.ts +99 -0
  47. package/src/engine/function/system/date/DateFunctionRepository.ts +228 -122
  48. package/src/engine/function/system/date/EpochToTimestamp.ts +75 -0
  49. package/src/engine/function/system/date/FromDateString.ts +44 -0
  50. package/src/engine/function/system/date/FromNow.ts +77 -0
  51. package/src/engine/function/system/date/GetCurrent.ts +20 -0
  52. package/src/engine/function/system/date/GetNames.ts +74 -0
  53. package/src/engine/function/system/date/IsBetween.ts +62 -0
  54. package/src/engine/function/system/date/IsValidISODate.ts +54 -40
  55. package/src/engine/function/system/date/LastFirstOf.ts +72 -0
  56. package/src/engine/function/system/date/SetTimeZone.ts +43 -0
  57. package/src/engine/function/system/date/StartEndOf.ts +44 -0
  58. package/src/engine/function/system/date/TimeAs.ts +64 -0
  59. package/src/engine/function/system/date/TimestampToEpoch.ts +54 -0
  60. package/src/engine/function/system/date/ToDateString.ts +49 -0
  61. package/src/engine/function/system/date/common.ts +9 -0
  62. package/src/engine/function/system/math/MathFunctionRepository.ts +43 -4
  63. package/src/engine/function/system/math/RandomAny.ts +57 -0
  64. package/src/engine/function/system/object/ObjectConvert.ts +45 -19
  65. package/src/engine/function/system/object/ObjectFunctionRepository.ts +2 -1
  66. package/src/engine/function/system/string/AbstractStringFunction.ts +42 -82
  67. package/src/engine/function/system/string/StringFunctionRepository.ts +39 -20
  68. package/src/engine/json/schema/SchemaUtil.ts +1 -1
  69. package/src/engine/repository/KIRunSchemaRepository.ts +57 -3
  70. package/src/engine/util/string/StringUtil.ts +12 -0
  71. package/tsconfig.json +1 -2
  72. package/__tests__/engine/function/system/date/AddTimeTest.ts +0 -115
  73. package/__tests__/engine/function/system/date/DateToEpochTest.ts +0 -74
  74. package/__tests__/engine/function/system/date/DifferenceOfTimestampsTest.ts +0 -53
  75. package/__tests__/engine/function/system/date/EpochToDateTest.ts +0 -105
  76. package/__tests__/engine/function/system/date/GetDateTest.ts +0 -85
  77. package/__tests__/engine/function/system/date/GetDayTest.ts +0 -85
  78. package/__tests__/engine/function/system/date/GetFullYearTest.ts +0 -85
  79. package/__tests__/engine/function/system/date/GetHoursTest.ts +0 -85
  80. package/__tests__/engine/function/system/date/GetMilliSecondsTest.ts +0 -85
  81. package/__tests__/engine/function/system/date/GetMinutesTest.ts +0 -85
  82. package/__tests__/engine/function/system/date/GetMonthTest.ts +0 -85
  83. package/__tests__/engine/function/system/date/GetSecondsTest.ts +0 -85
  84. package/__tests__/engine/function/system/date/GetTimeAsArrayTest.ts +0 -59
  85. package/__tests__/engine/function/system/date/GetTimeAsObjectTest.ts +0 -83
  86. package/__tests__/engine/function/system/date/GetTimeTest.ts +0 -86
  87. package/__tests__/engine/function/system/date/IsLeapYearTest.ts +0 -85
  88. package/__tests__/engine/function/system/date/MaximumTimestampTest.ts +0 -55
  89. package/__tests__/engine/function/system/date/MinimumTimestampTest.ts +0 -54
  90. package/__tests__/engine/function/system/date/SubtractTimeTest.ts +0 -95
  91. package/src/engine/function/system/date/DateToEpoch.ts +0 -39
  92. package/src/engine/function/system/date/DifferenceOfTimestamps.ts +0 -45
  93. package/src/engine/function/system/date/EpochToDate.ts +0 -76
  94. package/src/engine/function/system/date/GetCurrentTimeStamp.ts +0 -36
  95. package/src/engine/function/system/date/GetTimeAsArray.ts +0 -48
  96. package/src/engine/function/system/date/GetTimeAsObject.ts +0 -66
  97. package/src/engine/function/system/date/MaximumTimestamp.ts +0 -73
  98. package/src/engine/function/system/date/MinimumTimestamp.ts +0 -74
  99. package/src/engine/function/system/math/RandomFloat.ts +0 -56
  100. package/src/engine/function/system/math/RandomInt.ts +0 -56
@@ -1,56 +0,0 @@
1
- import { Schema } from '../../../json/schema/Schema';
2
- import { Event } from '../../../model/Event';
3
- import { EventResult } from '../../../model/EventResult';
4
- import { FunctionOutput } from '../../../model/FunctionOutput';
5
- import { FunctionSignature } from '../../../model/FunctionSignature';
6
- import { Parameter } from '../../../model/Parameter';
7
- import { Namespaces } from '../../../namespaces/Namespaces';
8
- import { FunctionExecutionParameters } from '../../../runtime/FunctionExecutionParameters';
9
- import { MapUtil } from '../../../util/MapUtil';
10
- import { AbstractFunction } from '../../AbstractFunction';
11
-
12
- export class RandomFloat extends AbstractFunction {
13
- public static readonly MIN_VALUE = 'minValue';
14
-
15
- public static readonly MAX_VALUE = 'maxValue';
16
-
17
- public static readonly VALUE = 'value';
18
-
19
- private static readonly SIGNATURE: FunctionSignature = new FunctionSignature('RandomFloat')
20
- .setParameters(
21
- MapUtil.of(
22
- RandomFloat.MIN_VALUE,
23
- Parameter.of(
24
- RandomFloat.MIN_VALUE,
25
- Schema.ofFloat(RandomFloat.MIN_VALUE).setDefaultValue(0),
26
- ),
27
- RandomFloat.MAX_VALUE,
28
- Parameter.of(
29
- RandomFloat.MAX_VALUE,
30
- Schema.ofFloat(RandomFloat.MAX_VALUE).setDefaultValue(2147483647),
31
- ),
32
- ),
33
- )
34
- .setNamespace(Namespaces.MATH)
35
- .setEvents(
36
- new Map<string, Event>([
37
- Event.outputEventMapEntry(
38
- MapUtil.of(RandomFloat.VALUE, Schema.ofFloat(RandomFloat.VALUE)),
39
- ),
40
- ]),
41
- );
42
-
43
- public getSignature(): FunctionSignature {
44
- return RandomFloat.SIGNATURE;
45
- }
46
-
47
- protected async internalExecute(context: FunctionExecutionParameters): Promise<FunctionOutput> {
48
- let min: number = context.getArguments()?.get(RandomFloat.MIN_VALUE);
49
-
50
- let max: number = context.getArguments()?.get(RandomFloat.MAX_VALUE);
51
-
52
- let num: number = Math.random() * (max - min) + min;
53
-
54
- return new FunctionOutput([EventResult.outputOf(new Map([[RandomFloat.VALUE, num]]))]);
55
- }
56
- }
@@ -1,56 +0,0 @@
1
- import { Schema } from '../../../json/schema/Schema';
2
- import { Event } from '../../../model/Event';
3
- import { EventResult } from '../../../model/EventResult';
4
- import { FunctionOutput } from '../../../model/FunctionOutput';
5
- import { FunctionSignature } from '../../../model/FunctionSignature';
6
- import { Parameter } from '../../../model/Parameter';
7
- import { Namespaces } from '../../../namespaces/Namespaces';
8
- import { FunctionExecutionParameters } from '../../../runtime/FunctionExecutionParameters';
9
- import { MapUtil } from '../../../util/MapUtil';
10
- import { AbstractFunction } from '../../AbstractFunction';
11
-
12
- export class RandomInt extends AbstractFunction {
13
- public static readonly MIN_VALUE = 'minValue';
14
-
15
- public static readonly MAX_VALUE = 'maxValue';
16
-
17
- public static readonly VALUE = 'value';
18
-
19
- private static readonly SIGNATURE: FunctionSignature = new FunctionSignature('RandomInt')
20
- .setParameters(
21
- MapUtil.of(
22
- RandomInt.MIN_VALUE,
23
- Parameter.of(
24
- RandomInt.MIN_VALUE,
25
- Schema.ofInteger(RandomInt.MIN_VALUE).setDefaultValue(0),
26
- ),
27
- RandomInt.MAX_VALUE,
28
- Parameter.of(
29
- RandomInt.MAX_VALUE,
30
- Schema.ofInteger(RandomInt.MAX_VALUE).setDefaultValue(2147483647),
31
- ),
32
- ),
33
- )
34
- .setNamespace(Namespaces.MATH)
35
- .setEvents(
36
- new Map<string, Event>([
37
- Event.outputEventMapEntry(
38
- MapUtil.of(RandomInt.VALUE, Schema.ofInteger(RandomInt.VALUE)),
39
- ),
40
- ]),
41
- );
42
-
43
- public getSignature(): FunctionSignature {
44
- return RandomInt.SIGNATURE;
45
- }
46
-
47
- protected async internalExecute(context: FunctionExecutionParameters): Promise<FunctionOutput> {
48
- let min: number = context.getArguments()?.get(RandomInt.MIN_VALUE);
49
-
50
- let max: number = context.getArguments()?.get(RandomInt.MAX_VALUE);
51
-
52
- let num: number = Math.floor(Math.random() * (max - min) + min);
53
-
54
- return new FunctionOutput([EventResult.outputOf(new Map([[RandomInt.VALUE, num]]))]);
55
- }
56
- }