@fincity/kirun-js 1.0.5 → 1.1.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.
- package/__tests__/engine/function/system/array/AddFirstTest.ts +13 -12
- package/__tests__/engine/function/system/array/AddTest.ts +11 -11
- package/__tests__/engine/function/system/array/BinarySearchTest.ts +29 -14
- package/__tests__/engine/function/system/array/CompareTest.ts +3 -3
- package/__tests__/engine/function/system/array/CopyTest.ts +5 -5
- package/__tests__/engine/function/system/array/DeleteFirstTest.ts +10 -10
- package/__tests__/engine/function/system/array/DeleteFromTest.ts +8 -8
- package/__tests__/engine/function/system/array/DeleteLastTest.ts +10 -10
- package/__tests__/engine/function/system/array/DeleteTest.ts +60 -25
- package/__tests__/engine/function/system/array/DisjointTest.ts +6 -7
- package/__tests__/engine/function/system/array/Equals.ts +5 -5
- package/__tests__/engine/function/system/array/FillTest.ts +5 -5
- package/__tests__/engine/function/system/array/FrequencyTest.ts +11 -11
- package/__tests__/engine/function/system/array/IndexOfArrayTest.ts +14 -20
- package/__tests__/engine/function/system/array/IndexOfTest.ts +26 -14
- package/__tests__/engine/function/system/array/InsertTest.ts +12 -12
- package/__tests__/engine/function/system/array/LastIndexOfArrayTest.ts +9 -12
- package/__tests__/engine/function/system/array/LastIndexOfTest.ts +16 -16
- package/__tests__/engine/function/system/array/MaxTest.ts +18 -18
- package/__tests__/engine/function/system/array/MinTest.ts +18 -18
- package/__tests__/engine/function/system/array/MisMatchTest.ts +8 -11
- package/__tests__/engine/function/system/array/ReverseTest.ts +12 -12
- package/__tests__/engine/function/system/array/RotateTest.ts +6 -6
- package/__tests__/engine/function/system/array/ShuffleTest.ts +7 -4
- package/__tests__/engine/function/system/array/SortTest.ts +10 -10
- package/__tests__/engine/function/system/array/SubArrayTest.ts +19 -10
- package/__tests__/engine/function/system/context/SetFunctionTest.ts +24 -5
- package/__tests__/engine/function/system/math/AddTest.ts +2 -2
- package/__tests__/engine/function/system/math/RandomIntTest.ts +46 -0
- package/__tests__/engine/function/system/string/ConcatenateTest.ts +4 -4
- package/__tests__/engine/function/system/string/DeleteForGivenLengthTest.ts +8 -4
- package/__tests__/engine/function/system/string/InsertAtGivenPositionTest.ts +6 -6
- package/__tests__/engine/function/system/string/PostPadTest.ts +6 -6
- package/__tests__/engine/function/system/string/PrePadTest.ts +8 -8
- package/__tests__/engine/function/system/string/RegionMatchesTest.ts +15 -6
- package/__tests__/engine/function/system/string/ReverseTest.ts +6 -6
- package/__tests__/engine/function/system/string/SplitTest.ts +8 -4
- package/__tests__/engine/function/system/string/StringFunctionRepoTest2.ts +35 -11
- package/__tests__/engine/function/system/string/StringFunctionRepoTest3.ts +14 -5
- package/__tests__/engine/function/system/string/StringFunctionRepositoryTest.ts +40 -16
- package/__tests__/engine/function/system/string/ToStringTest.ts +6 -6
- package/__tests__/engine/function/system/string/TrimToTest.ts +8 -6
- package/__tests__/engine/runtime/KIRuntimeTest.ts +148 -155
- package/__tests__/engine/runtime/KIRuntimeWithDefinitionTest.ts +89 -0
- package/__tests__/engine/util/LinkedListTest.ts +9 -0
- 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 +267 -109
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/engine/function/AbstractFunction.ts +5 -3
- package/src/engine/function/Function.ts +1 -1
- package/src/engine/function/system/GenerateEvent.ts +1 -1
- package/src/engine/function/system/If.ts +1 -1
- package/src/engine/function/system/array/AbstractArrayFunction.ts +5 -0
- package/src/engine/function/system/array/Add.ts +1 -1
- package/src/engine/function/system/array/AddFirst.ts +1 -1
- package/src/engine/function/system/array/BinarySearch.ts +1 -1
- package/src/engine/function/system/array/Compare.ts +1 -1
- package/src/engine/function/system/array/Copy.ts +1 -1
- package/src/engine/function/system/array/Delete.ts +24 -32
- package/src/engine/function/system/array/DeleteFirst.ts +1 -1
- package/src/engine/function/system/array/DeleteFrom.ts +1 -1
- package/src/engine/function/system/array/DeleteLast.ts +1 -1
- package/src/engine/function/system/array/Disjoint.ts +1 -1
- package/src/engine/function/system/array/Equals.ts +2 -2
- package/src/engine/function/system/array/Fill.ts +1 -1
- package/src/engine/function/system/array/Frequency.ts +1 -1
- package/src/engine/function/system/array/IndexOf.ts +1 -1
- package/src/engine/function/system/array/IndexOfArray.ts +1 -1
- package/src/engine/function/system/array/Insert.ts +1 -1
- package/src/engine/function/system/array/LastIndexOf.ts +1 -1
- package/src/engine/function/system/array/LastIndexOfArray.ts +1 -1
- package/src/engine/function/system/array/Max.ts +1 -1
- package/src/engine/function/system/array/Min.ts +1 -1
- package/src/engine/function/system/array/MisMatch.ts +1 -1
- package/src/engine/function/system/array/Reverse.ts +1 -1
- package/src/engine/function/system/array/Rotate.ts +1 -1
- package/src/engine/function/system/array/Shuffle.ts +1 -1
- package/src/engine/function/system/array/Sort.ts +1 -1
- package/src/engine/function/system/array/SubArray.ts +1 -1
- package/src/engine/function/system/context/Create.ts +1 -1
- package/src/engine/function/system/context/Get.ts +1 -1
- package/src/engine/function/system/context/SetFunction.ts +1 -1
- package/src/engine/function/system/loop/CountLoop.ts +1 -1
- package/src/engine/function/system/loop/RangeLoop.ts +1 -1
- package/src/engine/function/system/math/Add.ts +2 -4
- package/src/engine/function/system/math/GenericMathFunction.ts +2 -4
- package/src/engine/function/system/math/Hypotenuse.ts +2 -6
- package/src/engine/function/system/math/Maximum.ts +2 -4
- package/src/engine/function/system/math/Minimum.ts +2 -4
- package/src/engine/function/system/math/Random.ts +1 -1
- package/src/engine/function/system/math/RandomFloat.ts +56 -0
- package/src/engine/function/system/math/RandomInt.ts +56 -0
- package/src/engine/function/system/string/AbstractStringFunction.ts +24 -8
- package/src/engine/function/system/string/Concatenate.ts +2 -2
- package/src/engine/function/system/string/DeleteForGivenLength.ts +25 -15
- package/src/engine/function/system/string/InsertAtGivenPosition.ts +17 -7
- package/src/engine/function/system/string/PostPad.ts +20 -10
- package/src/engine/function/system/string/PrePad.ts +17 -7
- package/src/engine/function/system/string/RegionMatches.ts +40 -22
- package/src/engine/function/system/string/ReplaceAtGivenPosition.ts +26 -13
- package/src/engine/function/system/string/Reverse.ts +4 -3
- package/src/engine/function/system/string/Split.ts +13 -4
- package/src/engine/function/system/string/ToString.ts +9 -5
- package/src/engine/function/system/string/TrimTo.ts +13 -6
- package/src/engine/json/schema/Schema.ts +1 -0
- package/src/engine/model/Event.ts +15 -0
- package/src/engine/model/FunctionDefinition.ts +76 -29
- package/src/engine/model/Parameter.ts +11 -0
- package/src/engine/model/ParameterReference.ts +8 -1
- package/src/engine/model/Position.ts +5 -0
- package/src/engine/model/Statement.ts +16 -0
- package/src/engine/model/StatementGroup.ts +7 -0
- package/src/engine/runtime/KIRuntime.ts +26 -24
- package/src/index.ts +71 -20
package/dist/types.d.ts
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
export class Tuple2<F, S> {
|
|
2
|
-
constructor(f: F, s: S);
|
|
3
|
-
getT1(): F;
|
|
4
|
-
getT2(): S;
|
|
5
|
-
}
|
|
6
|
-
export class Tuple3<F, S, T> extends Tuple2<F, S> {
|
|
7
|
-
constructor(f: F, s: S, t: T);
|
|
8
|
-
getT3(): T;
|
|
9
|
-
}
|
|
10
|
-
export class Tuple4<F, S, T, FR> extends Tuple3<F, S, T> {
|
|
11
|
-
constructor(f: F, s: S, t: T, fr: FR);
|
|
12
|
-
getT4(): FR;
|
|
13
|
-
}
|
|
14
|
-
export interface Repository<T> {
|
|
15
|
-
find(namespace: string, name: string): T | undefined;
|
|
16
|
-
}
|
|
17
|
-
export class HybridRepository<T> implements Repository<T> {
|
|
18
|
-
repos: Repository<T>[];
|
|
19
|
-
constructor(...repos: Repository<T>[]);
|
|
20
|
-
find(namespace: string, name: string): T | undefined;
|
|
21
|
-
}
|
|
22
1
|
export class Namespaces {
|
|
23
2
|
static readonly SYSTEM: string;
|
|
24
3
|
static readonly SYSTEM_CTX: string;
|
|
@@ -29,7 +8,7 @@ export class Namespaces {
|
|
|
29
8
|
private constructor();
|
|
30
9
|
}
|
|
31
10
|
export function isNullValue(v: any): boolean;
|
|
32
|
-
|
|
11
|
+
export class ArraySchemaType {
|
|
33
12
|
setSingleSchema(schema: Schema): ArraySchemaType;
|
|
34
13
|
setTupleSchema(schemas: Schema[]): ArraySchemaType;
|
|
35
14
|
getSingleSchema(): Schema | undefined;
|
|
@@ -38,14 +17,14 @@ declare class ArraySchemaType {
|
|
|
38
17
|
static of(...schemas: Schema[]): ArraySchemaType;
|
|
39
18
|
static from(obj: any): ArraySchemaType | undefined;
|
|
40
19
|
}
|
|
41
|
-
|
|
20
|
+
export class AdditionalPropertiesType {
|
|
42
21
|
getBooleanValue(): boolean | undefined;
|
|
43
22
|
getSchemaValue(): Schema | undefined;
|
|
44
23
|
setBooleanValue(booleanValue: boolean): AdditionalPropertiesType;
|
|
45
24
|
setSchemaValue(schemaValue: Schema): AdditionalPropertiesType;
|
|
46
25
|
static from(obj: any): AdditionalPropertiesType | undefined;
|
|
47
26
|
}
|
|
48
|
-
enum StringFormat {
|
|
27
|
+
export enum StringFormat {
|
|
49
28
|
DATETIME = "DATETIME",
|
|
50
29
|
TIME = "TIME",
|
|
51
30
|
DATE = "DATE",
|
|
@@ -63,10 +42,32 @@ export enum SchemaType {
|
|
|
63
42
|
BOOLEAN = "Boolean",
|
|
64
43
|
NULL = "Null"
|
|
65
44
|
}
|
|
66
|
-
|
|
45
|
+
export abstract class Type {
|
|
67
46
|
abstract getAllowedSchemaTypes(): Set<SchemaType>;
|
|
68
47
|
abstract contains(type: SchemaType): boolean;
|
|
69
48
|
}
|
|
49
|
+
export class MultipleType extends Type {
|
|
50
|
+
constructor(type: Set<SchemaType>);
|
|
51
|
+
getType(): Set<SchemaType>;
|
|
52
|
+
setType(type: Set<SchemaType>): MultipleType;
|
|
53
|
+
getAllowedSchemaTypes(): Set<SchemaType>;
|
|
54
|
+
contains(type: SchemaType): boolean;
|
|
55
|
+
}
|
|
56
|
+
export class SingleType extends Type {
|
|
57
|
+
constructor(type: SchemaType);
|
|
58
|
+
getType(): SchemaType;
|
|
59
|
+
getAllowedSchemaTypes(): Set<SchemaType>;
|
|
60
|
+
contains(type: SchemaType): boolean;
|
|
61
|
+
}
|
|
62
|
+
export class TypeUtil {
|
|
63
|
+
static of(...types: SchemaType[]): Type;
|
|
64
|
+
static from(types: any): Type | undefined;
|
|
65
|
+
}
|
|
66
|
+
export class SchemaReferenceException extends Error {
|
|
67
|
+
constructor(schemaPath: string, message: string, err?: Error);
|
|
68
|
+
getSchemaPath(): string;
|
|
69
|
+
getCause(): Error | undefined;
|
|
70
|
+
}
|
|
70
71
|
export class Schema {
|
|
71
72
|
static readonly NULL: Schema;
|
|
72
73
|
static readonly SCHEMA: Schema;
|
|
@@ -164,39 +165,33 @@ export class Schema {
|
|
|
164
165
|
getPermission(): string | undefined;
|
|
165
166
|
setPermission(permission: string): Schema;
|
|
166
167
|
}
|
|
167
|
-
export
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
export class StringFormatter {
|
|
172
|
-
static format(formatString: string, ...params: any[]): string;
|
|
173
|
-
private constructor();
|
|
174
|
-
}
|
|
175
|
-
export class StringUtil {
|
|
176
|
-
private constructor();
|
|
177
|
-
static nthIndex(str: string, c: string, from: number | undefined, occurance: number): number;
|
|
178
|
-
static splitAtFirstOccurance(str: string, c: string): [string | undefined, string | undefined];
|
|
179
|
-
static isNullOrBlank(str: string | undefined): boolean;
|
|
168
|
+
export enum ParameterType {
|
|
169
|
+
CONSTANT = "CONSTANT",
|
|
170
|
+
EXPRESSION = "EXPRESSION"
|
|
180
171
|
}
|
|
181
|
-
export class
|
|
182
|
-
static
|
|
183
|
-
static
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
172
|
+
export class Parameter {
|
|
173
|
+
static readonly SCHEMA: Schema;
|
|
174
|
+
static readonly EXPRESSION: Schema;
|
|
175
|
+
constructor(parameterName: string, schema: Schema);
|
|
176
|
+
getSchema(): Schema;
|
|
177
|
+
setSchema(schema: Schema): Parameter;
|
|
178
|
+
getParameterName(): string;
|
|
179
|
+
setParameterName(parameterName: string): Parameter;
|
|
180
|
+
isVariableArgument(): boolean;
|
|
181
|
+
setVariableArgument(variableArgument: boolean): Parameter;
|
|
182
|
+
getType(): ParameterType;
|
|
183
|
+
setType(type: ParameterType): Parameter;
|
|
184
|
+
static ofEntry(name: string, schema: Schema, variableArgument?: boolean, type?: ParameterType): [string, Parameter];
|
|
185
|
+
static of(name: string, schema: Schema, variableArgument?: boolean, type?: ParameterType): Parameter;
|
|
186
|
+
static from(json: any): Parameter;
|
|
188
187
|
}
|
|
189
|
-
export
|
|
190
|
-
|
|
191
|
-
static readonly NAME: String;
|
|
192
|
-
static readonly ID: String;
|
|
193
|
-
private constructor();
|
|
188
|
+
export interface Repository<T> {
|
|
189
|
+
find(namespace: string, name: string): T | undefined;
|
|
194
190
|
}
|
|
195
|
-
export class
|
|
196
|
-
|
|
197
|
-
getCause(): Error | undefined;
|
|
191
|
+
export class KIRunSchemaRepository implements Repository<Schema> {
|
|
192
|
+
find(namespace: string, name: string): Schema | undefined;
|
|
198
193
|
}
|
|
199
|
-
|
|
194
|
+
export class Event {
|
|
200
195
|
static readonly OUTPUT: string;
|
|
201
196
|
static readonly ERROR: string;
|
|
202
197
|
static readonly ITERATION: string;
|
|
@@ -211,8 +206,13 @@ declare class Event {
|
|
|
211
206
|
setParameters(parameters: Map<string, Schema>): Event;
|
|
212
207
|
static outputEventMapEntry(parameters: Map<string, Schema>): [string, Event];
|
|
213
208
|
static eventMapEntry(eventName: string, parameters: Map<string, Schema>): [string, Event];
|
|
209
|
+
static from(json: any): Event;
|
|
210
|
+
}
|
|
211
|
+
export class KIRuntimeException extends Error {
|
|
212
|
+
constructor(message: string, err?: Error);
|
|
213
|
+
getCause(): Error | undefined;
|
|
214
214
|
}
|
|
215
|
-
|
|
215
|
+
export class EventResult {
|
|
216
216
|
constructor(name: string, result: Map<string, any>);
|
|
217
217
|
getName(): string;
|
|
218
218
|
setName(name: string): EventResult;
|
|
@@ -221,34 +221,15 @@ declare class EventResult {
|
|
|
221
221
|
static outputOf(result: Map<string, any>): EventResult;
|
|
222
222
|
static of(eventName: string, result: Map<string, any>): EventResult;
|
|
223
223
|
}
|
|
224
|
-
interface FunctionOutputGenerator {
|
|
224
|
+
export interface FunctionOutputGenerator {
|
|
225
225
|
next(): EventResult | undefined;
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
export class FunctionOutput {
|
|
228
228
|
constructor(arg: EventResult[] | FunctionOutputGenerator);
|
|
229
229
|
next(): EventResult | undefined;
|
|
230
230
|
allResults(): EventResult[];
|
|
231
231
|
}
|
|
232
|
-
|
|
233
|
-
CONSTANT = "CONSTANT",
|
|
234
|
-
EXPRESSION = "EXPRESSION"
|
|
235
|
-
}
|
|
236
|
-
declare class Parameter {
|
|
237
|
-
static readonly SCHEMA: Schema;
|
|
238
|
-
static readonly EXPRESSION: Schema;
|
|
239
|
-
constructor(parameterName: string, schema: Schema);
|
|
240
|
-
getSchema(): Schema;
|
|
241
|
-
setSchema(schema: Schema): Parameter;
|
|
242
|
-
getParameterName(): string;
|
|
243
|
-
setParameterName(parameterName: string): Parameter;
|
|
244
|
-
isVariableArgument(): boolean;
|
|
245
|
-
setVariableArgument(variableArgument: boolean): Parameter;
|
|
246
|
-
getType(): ParameterType;
|
|
247
|
-
setType(type: ParameterType): Parameter;
|
|
248
|
-
static ofEntry(name: string, schema: Schema, variableArgument?: boolean, type?: ParameterType): [string, Parameter];
|
|
249
|
-
static of(name: string, schema: Schema, variableArgument?: boolean, type?: ParameterType): Parameter;
|
|
250
|
-
}
|
|
251
|
-
declare class FunctionSignature {
|
|
232
|
+
export class FunctionSignature {
|
|
252
233
|
static readonly SCHEMA: Schema;
|
|
253
234
|
constructor(name: string);
|
|
254
235
|
getNamespace(): string;
|
|
@@ -260,7 +241,7 @@ declare class FunctionSignature {
|
|
|
260
241
|
getEvents(): Map<string, Event>;
|
|
261
242
|
setEvents(events: Map<string, Event>): FunctionSignature;
|
|
262
243
|
}
|
|
263
|
-
|
|
244
|
+
export class ContextElement {
|
|
264
245
|
static readonly NULL: ContextElement;
|
|
265
246
|
constructor(schema?: Schema, element?: any);
|
|
266
247
|
getSchema(): Schema | undefined;
|
|
@@ -268,6 +249,16 @@ declare class ContextElement {
|
|
|
268
249
|
getElement(): any;
|
|
269
250
|
setElement(element: any): ContextElement;
|
|
270
251
|
}
|
|
252
|
+
export class StringFormatter {
|
|
253
|
+
static format(formatString: string, ...params: any[]): string;
|
|
254
|
+
private constructor();
|
|
255
|
+
}
|
|
256
|
+
export class StringUtil {
|
|
257
|
+
private constructor();
|
|
258
|
+
static nthIndex(str: string, c: string, from: number | undefined, occurance: number): number;
|
|
259
|
+
static splitAtFirstOccurance(str: string, c: string): [string | undefined, string | undefined];
|
|
260
|
+
static isNullOrBlank(str: string | undefined): boolean;
|
|
261
|
+
}
|
|
271
262
|
export class ExpressionEvaluationException extends Error {
|
|
272
263
|
constructor(expression: string, message: string, err?: Error);
|
|
273
264
|
getCause(): Error | undefined;
|
|
@@ -280,7 +271,7 @@ export abstract class TokenValueExtractor {
|
|
|
280
271
|
protected abstract getValueInternal(token: string): any;
|
|
281
272
|
abstract getPrefix(): string;
|
|
282
273
|
}
|
|
283
|
-
|
|
274
|
+
export class Position {
|
|
284
275
|
static readonly SCHEMA_NAME: string;
|
|
285
276
|
static readonly SCHEMA: Schema;
|
|
286
277
|
constructor(left: number, top: number);
|
|
@@ -288,8 +279,9 @@ declare class Position {
|
|
|
288
279
|
setLeft(left: number): Position;
|
|
289
280
|
getTop(): number;
|
|
290
281
|
setTop(top: number): Position;
|
|
282
|
+
static from(json: any): Position;
|
|
291
283
|
}
|
|
292
|
-
|
|
284
|
+
export class AbstractStatement {
|
|
293
285
|
getComment(): string | undefined;
|
|
294
286
|
setComment(comment: string): AbstractStatement;
|
|
295
287
|
getDescription(): string | undefined;
|
|
@@ -297,11 +289,11 @@ declare class AbstractStatement {
|
|
|
297
289
|
getPosition(): Position | undefined;
|
|
298
290
|
setPosition(position: Position): AbstractStatement;
|
|
299
291
|
}
|
|
300
|
-
enum ParameterReferenceType {
|
|
292
|
+
export enum ParameterReferenceType {
|
|
301
293
|
VALUE = "VALUE",
|
|
302
294
|
EXPRESSION = "EXPRESSION"
|
|
303
295
|
}
|
|
304
|
-
|
|
296
|
+
export class ParameterReference {
|
|
305
297
|
static readonly SCHEMA: Schema;
|
|
306
298
|
constructor(type: ParameterReferenceType);
|
|
307
299
|
getType(): ParameterReferenceType;
|
|
@@ -312,8 +304,9 @@ declare class ParameterReference {
|
|
|
312
304
|
setExpression(expression: string): ParameterReference;
|
|
313
305
|
static ofExpression(value: any): ParameterReference;
|
|
314
306
|
static ofValue(value: any): ParameterReference;
|
|
307
|
+
static from(json: any): ParameterReference[];
|
|
315
308
|
}
|
|
316
|
-
|
|
309
|
+
export class Statement extends AbstractStatement {
|
|
317
310
|
static readonly SCHEMA_NAME: string;
|
|
318
311
|
static readonly SCHEMA: Schema;
|
|
319
312
|
constructor(statementName: string, namespace: string, name: string);
|
|
@@ -329,17 +322,18 @@ declare class Statement extends AbstractStatement {
|
|
|
329
322
|
setDependentStatements(dependentStatements: string[]): Statement;
|
|
330
323
|
equals(obj: any): boolean;
|
|
331
324
|
static ofEntry(statement: Statement): [string, Statement];
|
|
325
|
+
static from(json: any): Statement;
|
|
332
326
|
}
|
|
333
|
-
interface GraphVertexType<K> {
|
|
327
|
+
export interface GraphVertexType<K> {
|
|
334
328
|
getUniqueKey(): K;
|
|
335
329
|
getDepenedencies(): Set<string>;
|
|
336
330
|
}
|
|
337
|
-
enum StatementMessageType {
|
|
331
|
+
export enum StatementMessageType {
|
|
338
332
|
ERROR = "ERROR",
|
|
339
333
|
WARNING = "WARNING",
|
|
340
334
|
MESSAGE = "MESSAGE"
|
|
341
335
|
}
|
|
342
|
-
|
|
336
|
+
export class StatementMessage {
|
|
343
337
|
constructor(messageType?: StatementMessageType, message?: string);
|
|
344
338
|
getMessageType(): StatementMessageType | undefined;
|
|
345
339
|
setMessageType(messageType: StatementMessageType): StatementMessage;
|
|
@@ -347,7 +341,7 @@ declare class StatementMessage {
|
|
|
347
341
|
setMessage(message: string): StatementMessage;
|
|
348
342
|
toString(): string;
|
|
349
343
|
}
|
|
350
|
-
|
|
344
|
+
export class StatementExecution implements GraphVertexType<String> {
|
|
351
345
|
constructor(statement: Statement);
|
|
352
346
|
getStatement(): Statement;
|
|
353
347
|
setStatement(statement: Statement): StatementExecution;
|
|
@@ -361,7 +355,25 @@ declare class StatementExecution implements GraphVertexType<String> {
|
|
|
361
355
|
getDepenedencies(): Set<string>;
|
|
362
356
|
equals(obj: Object): boolean;
|
|
363
357
|
}
|
|
364
|
-
|
|
358
|
+
export class ArgumentsTokenValueExtractor extends TokenValueExtractor {
|
|
359
|
+
static readonly PREFIX: string;
|
|
360
|
+
constructor(args: Map<string, any>);
|
|
361
|
+
protected getValueInternal(token: string): any;
|
|
362
|
+
getPrefix(): string;
|
|
363
|
+
}
|
|
364
|
+
export class ContextTokenValueExtractor extends TokenValueExtractor {
|
|
365
|
+
static readonly PREFIX: string;
|
|
366
|
+
constructor(context: Map<string, ContextElement>);
|
|
367
|
+
protected getValueInternal(token: string): any;
|
|
368
|
+
getPrefix(): string;
|
|
369
|
+
}
|
|
370
|
+
export class OutputMapTokenValueExtractor extends TokenValueExtractor {
|
|
371
|
+
static readonly PREFIX: string;
|
|
372
|
+
constructor(output: Map<string, Map<string, Map<string, any>>>);
|
|
373
|
+
protected getValueInternal(token: string): any;
|
|
374
|
+
getPrefix(): string;
|
|
375
|
+
}
|
|
376
|
+
export class FunctionExecutionParameters {
|
|
365
377
|
getContext(): Map<string, ContextElement> | undefined;
|
|
366
378
|
setContext(context: Map<string, ContextElement>): FunctionExecutionParameters;
|
|
367
379
|
getArguments(): Map<string, any> | undefined;
|
|
@@ -379,30 +391,85 @@ declare class FunctionExecutionParameters {
|
|
|
379
391
|
export interface Function {
|
|
380
392
|
getSignature(): FunctionSignature;
|
|
381
393
|
getProbableEventSignature(probableParameters: Map<string, Schema[]>): Map<string, Event>;
|
|
382
|
-
execute(context: FunctionExecutionParameters): FunctionOutput
|
|
394
|
+
execute(context: FunctionExecutionParameters): Promise<FunctionOutput>;
|
|
395
|
+
}
|
|
396
|
+
export class Tuple2<F, S> {
|
|
397
|
+
constructor(f: F, s: S);
|
|
398
|
+
getT1(): F;
|
|
399
|
+
getT2(): S;
|
|
400
|
+
}
|
|
401
|
+
export class Tuple3<F, S, T> extends Tuple2<F, S> {
|
|
402
|
+
constructor(f: F, s: S, t: T);
|
|
403
|
+
getT3(): T;
|
|
404
|
+
}
|
|
405
|
+
export class Tuple4<F, S, T, FR> extends Tuple3<F, S, T> {
|
|
406
|
+
constructor(f: F, s: S, t: T, fr: FR);
|
|
407
|
+
getT4(): FR;
|
|
408
|
+
}
|
|
409
|
+
export class SchemaValidationException extends Error {
|
|
410
|
+
constructor(schemaPath: string, message: string, sve?: SchemaValidationException[], err?: Error);
|
|
411
|
+
getSchemaPath(): string;
|
|
412
|
+
getCause(): Error | undefined;
|
|
413
|
+
}
|
|
414
|
+
export class SchemaUtil {
|
|
415
|
+
static getDefaultValue(s: Schema | undefined, sRepository: Repository<Schema>): any;
|
|
416
|
+
static getSchemaFromRef(schema: Schema, sRepository: Repository<Schema> | undefined, ref: string | undefined, iteration?: number): Schema | undefined;
|
|
417
|
+
private constructor();
|
|
418
|
+
}
|
|
419
|
+
export class AnyOfAllOfOneOfValidator {
|
|
420
|
+
static validate(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, element: any): any;
|
|
421
|
+
private constructor();
|
|
422
|
+
}
|
|
423
|
+
export class ArrayValidator {
|
|
424
|
+
static validate(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, element: any): any;
|
|
425
|
+
static checkContains(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, array: any[]): void;
|
|
426
|
+
static checkUniqueItems(parents: Schema[], schema: Schema, array: any[]): void;
|
|
427
|
+
static checkMinMaxItems(parents: Schema[], schema: Schema, array: any[]): void;
|
|
428
|
+
static checkItems(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, array: any[]): void;
|
|
429
|
+
private constructor();
|
|
430
|
+
}
|
|
431
|
+
export class BooleanValidator {
|
|
432
|
+
static validate(parents: Schema[], schema: Schema, element: any): any;
|
|
433
|
+
private constructor();
|
|
434
|
+
}
|
|
435
|
+
export class NullValidator {
|
|
436
|
+
static validate(parents: Schema[], schema: Schema, element: any): any;
|
|
437
|
+
private constructor();
|
|
438
|
+
}
|
|
439
|
+
export class NumberValidator {
|
|
440
|
+
static validate(type: SchemaType, parents: Schema[], schema: Schema, element: any): any;
|
|
441
|
+
private constructor();
|
|
442
|
+
}
|
|
443
|
+
export class ObjectValidator {
|
|
444
|
+
static validate(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, element: any): void;
|
|
445
|
+
private constructor();
|
|
446
|
+
}
|
|
447
|
+
export class StringValidator {
|
|
448
|
+
static validate(parents: Schema[], schema: Schema, element: any): any;
|
|
449
|
+
private constructor();
|
|
450
|
+
}
|
|
451
|
+
export class TypeValidator {
|
|
452
|
+
static validate(parents: Schema[], type: SchemaType, schema: Schema, repository: Repository<Schema> | undefined, element: any): any;
|
|
453
|
+
private constructor();
|
|
454
|
+
}
|
|
455
|
+
export class SchemaValidator {
|
|
456
|
+
static path(parents: Schema[] | undefined): string;
|
|
457
|
+
static validate(parents: Schema[] | undefined, schema: Schema | undefined, repository: Repository<Schema> | undefined, element: any): any;
|
|
458
|
+
static constantValidation(parents: Schema[], schema: Schema, element: any): any;
|
|
459
|
+
static enumCheck(parents: Schema[], schema: Schema, element: any): any;
|
|
460
|
+
static typeValidation(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, element: any): void;
|
|
461
|
+
private constructor();
|
|
383
462
|
}
|
|
384
463
|
export abstract class AbstractFunction implements Function {
|
|
385
464
|
protected validateArguments(args: Map<string, any>): Map<string, any>;
|
|
386
|
-
execute(context: FunctionExecutionParameters): FunctionOutput
|
|
465
|
+
execute(context: FunctionExecutionParameters): Promise<FunctionOutput>;
|
|
387
466
|
getProbableEventSignature(probableParameters: Map<string, Schema[]>): Map<string, Event>;
|
|
388
|
-
protected abstract internalExecute(context: FunctionExecutionParameters): FunctionOutput
|
|
467
|
+
protected abstract internalExecute(context: FunctionExecutionParameters): Promise<FunctionOutput>;
|
|
389
468
|
abstract getSignature(): FunctionSignature;
|
|
390
469
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
getStatementGroupName(): string;
|
|
395
|
-
setStatementGroupName(statementGroupName: string): StatementGroup;
|
|
396
|
-
}
|
|
397
|
-
declare class FunctionDefinition extends FunctionSignature {
|
|
398
|
-
static readonly SCHEMA: Schema;
|
|
399
|
-
constructor(name: string);
|
|
400
|
-
getVersion(): number;
|
|
401
|
-
setVersion(version: number): FunctionDefinition;
|
|
402
|
-
getSteps(): Map<string, Statement>;
|
|
403
|
-
setSteps(steps: Map<string, Statement>): FunctionDefinition;
|
|
404
|
-
getStepGroups(): Map<string, StatementGroup> | undefined;
|
|
405
|
-
setStepGroups(stepGroups: Map<string, StatementGroup>): FunctionDefinition;
|
|
470
|
+
export class ExecutionException extends Error {
|
|
471
|
+
constructor(message: string, err?: Error);
|
|
472
|
+
getCause(): Error | undefined;
|
|
406
473
|
}
|
|
407
474
|
export class LinkedList<T> {
|
|
408
475
|
length: number;
|
|
@@ -425,6 +492,24 @@ export class LinkedList<T> {
|
|
|
425
492
|
map<U>(callbackfn: (value: T, index: number) => U, thisArg?: any): LinkedList<U>;
|
|
426
493
|
forEach(callbackfn: (value: T, index: number) => void, thisArg?: any): void;
|
|
427
494
|
}
|
|
495
|
+
export class KIRunConstants {
|
|
496
|
+
static readonly NAMESPACE: String;
|
|
497
|
+
static readonly NAME: String;
|
|
498
|
+
static readonly ID: String;
|
|
499
|
+
private constructor();
|
|
500
|
+
}
|
|
501
|
+
export class StringBuilder {
|
|
502
|
+
constructor(str?: string);
|
|
503
|
+
append(x: any): StringBuilder;
|
|
504
|
+
toString(): string;
|
|
505
|
+
trim(): StringBuilder;
|
|
506
|
+
setLength(num: number): StringBuilder;
|
|
507
|
+
length(): number;
|
|
508
|
+
charAt(index: number): string;
|
|
509
|
+
deleteCharAt(index: number): StringBuilder;
|
|
510
|
+
insert(index: number, str: string): StringBuilder;
|
|
511
|
+
substring(start: number, end: number): string;
|
|
512
|
+
}
|
|
428
513
|
export class ExpressionToken {
|
|
429
514
|
expression: string;
|
|
430
515
|
constructor(expression: string);
|
|
@@ -533,6 +618,19 @@ export class BitwiseUnsignedRightShiftOperator extends BinaryOperator {
|
|
|
533
618
|
export class BitwiseXorOperator extends BinaryOperator {
|
|
534
619
|
apply(t: any, u: any): any;
|
|
535
620
|
}
|
|
621
|
+
export class JsonExpression {
|
|
622
|
+
constructor(expression: string);
|
|
623
|
+
getExpression(): string;
|
|
624
|
+
}
|
|
625
|
+
export class PrimitiveUtil {
|
|
626
|
+
static findPrimitiveNullAsBoolean(element: any): Tuple2<SchemaType, any>;
|
|
627
|
+
static findPrimitive(element: any): Tuple2<SchemaType, any>;
|
|
628
|
+
static findPrimitiveNumberType(element: any): Tuple2<SchemaType, any>;
|
|
629
|
+
static compare(a: any, b: any): number;
|
|
630
|
+
static comparePrimitive(oa: any, ob: any): number;
|
|
631
|
+
static toPrimitiveType(e: any): number;
|
|
632
|
+
private constructor();
|
|
633
|
+
}
|
|
536
634
|
export class LogicalAndOperator extends BinaryOperator {
|
|
537
635
|
apply(t: any, u: any): any;
|
|
538
636
|
}
|
|
@@ -576,13 +674,38 @@ export class BitwiseComplementOperator extends UnaryOperator {
|
|
|
576
674
|
export class LogicalNotOperator extends UnaryOperator {
|
|
577
675
|
apply(t: any): any;
|
|
578
676
|
}
|
|
677
|
+
export class LiteralTokenValueExtractor extends TokenValueExtractor {
|
|
678
|
+
static readonly INSTANCE: LiteralTokenValueExtractor;
|
|
679
|
+
protected getValueInternal(token: string): any;
|
|
680
|
+
getPrefix(): string;
|
|
681
|
+
}
|
|
579
682
|
export class ExpressionEvaluator {
|
|
580
683
|
constructor(exp: Expression | string);
|
|
581
684
|
evaluate(valuesMap: Map<string, TokenValueExtractor>): any;
|
|
582
685
|
getExpression(): Expression;
|
|
583
686
|
getExpressionString(): string;
|
|
584
687
|
}
|
|
585
|
-
|
|
688
|
+
export class StatementGroup extends AbstractStatement {
|
|
689
|
+
static readonly SCHEMA: Schema;
|
|
690
|
+
constructor(statementGroupName: string);
|
|
691
|
+
getStatementGroupName(): string;
|
|
692
|
+
setStatementGroupName(statementGroupName: string): StatementGroup;
|
|
693
|
+
static from(json: any): StatementGroup;
|
|
694
|
+
}
|
|
695
|
+
export class FunctionDefinition extends FunctionSignature {
|
|
696
|
+
static readonly SCHEMA: Schema;
|
|
697
|
+
constructor(name: string);
|
|
698
|
+
getVersion(): number;
|
|
699
|
+
setVersion(version: number): FunctionDefinition;
|
|
700
|
+
getSteps(): Map<string, Statement>;
|
|
701
|
+
setSteps(steps: Map<string, Statement>): FunctionDefinition;
|
|
702
|
+
getStepGroups(): Map<string, StatementGroup> | undefined;
|
|
703
|
+
setStepGroups(stepGroups: Map<string, StatementGroup>): FunctionDefinition;
|
|
704
|
+
getParts(): FunctionDefinition[] | undefined;
|
|
705
|
+
setParts(parts: FunctionDefinition[]): FunctionDefinition;
|
|
706
|
+
static from(json: any): FunctionDefinition;
|
|
707
|
+
}
|
|
708
|
+
export class GraphVertex<K, T extends GraphVertexType<K>> {
|
|
586
709
|
constructor(graph: ExecutionGraph<K, T>, data: T);
|
|
587
710
|
getData(): T;
|
|
588
711
|
setData(data: T): GraphVertex<K, T>;
|
|
@@ -600,7 +723,7 @@ declare class GraphVertex<K, T extends GraphVertexType<K>> {
|
|
|
600
723
|
getSubGraphOfType(type: string): ExecutionGraph<K, T>;
|
|
601
724
|
toString(): string;
|
|
602
725
|
}
|
|
603
|
-
|
|
726
|
+
export class ExecutionGraph<K, T extends GraphVertexType<K>> {
|
|
604
727
|
constructor(isSubGrph?: boolean);
|
|
605
728
|
getVerticesData(): T[];
|
|
606
729
|
addVertex(data: T): GraphVertex<K, T>;
|
|
@@ -616,8 +739,43 @@ declare class ExecutionGraph<K, T extends GraphVertexType<K>> {
|
|
|
616
739
|
export class KIRuntime extends AbstractFunction {
|
|
617
740
|
constructor(fd: FunctionDefinition, functionRepository: Repository<Function>, schemaRepository: Repository<Schema>);
|
|
618
741
|
getSignature(): FunctionSignature;
|
|
619
|
-
protected internalExecute(inContext: FunctionExecutionParameters): FunctionOutput
|
|
742
|
+
protected internalExecute(inContext: FunctionExecutionParameters): Promise<FunctionOutput>;
|
|
620
743
|
makeEdges(graph: ExecutionGraph<string, StatementExecution>): Tuple2<string, string>[];
|
|
621
744
|
}
|
|
745
|
+
export class MapUtil {
|
|
746
|
+
static of<K, V>(k1?: K, v1?: V, k2?: K, v2?: V, k3?: K, v3?: V, k4?: K, v4?: V, k5?: K, v5?: V, k6?: K, v6?: V, k7?: K, v7?: V, k8?: K, v8?: V, k9?: K, v9?: V, k10?: K, v10?: V): Map<K, V>;
|
|
747
|
+
static ofArrayEntries<K, V>(...entry: [K, V][]): Map<K, V>;
|
|
748
|
+
static entry<K, V>(k: K, v: V): MapEntry<K, V>;
|
|
749
|
+
static ofEntries<K, V>(...entry: MapEntry<K, V>[]): Map<K, V>;
|
|
750
|
+
private constructor();
|
|
751
|
+
}
|
|
752
|
+
export class MapEntry<K, V> {
|
|
753
|
+
k: K;
|
|
754
|
+
v: V;
|
|
755
|
+
constructor(k: K, v: V);
|
|
756
|
+
}
|
|
757
|
+
export class HybridRepository<T> implements Repository<T> {
|
|
758
|
+
repos: Repository<T>[];
|
|
759
|
+
constructor(...repos: Repository<T>[]);
|
|
760
|
+
find(namespace: string, name: string): T | undefined;
|
|
761
|
+
}
|
|
762
|
+
export class KIRunFunctionRepository extends HybridRepository<Function> {
|
|
763
|
+
constructor();
|
|
764
|
+
}
|
|
765
|
+
export class ArrayUtil {
|
|
766
|
+
static removeAListFrom(source: any[], removeList: any[]): void;
|
|
767
|
+
static of<K>(...k: K[]): K[];
|
|
768
|
+
private constructor();
|
|
769
|
+
}
|
|
770
|
+
export class Argument {
|
|
771
|
+
constructor(argumentIndex: number, name: string, value?: any);
|
|
772
|
+
getArgumentIndex(): number;
|
|
773
|
+
setArgumentIndex(argumentIndex: number): Argument;
|
|
774
|
+
getName(): string;
|
|
775
|
+
setName(name: string): Argument;
|
|
776
|
+
getValue(): any;
|
|
777
|
+
setValue(value: any): Argument;
|
|
778
|
+
static of(name: string, value: any): Argument;
|
|
779
|
+
}
|
|
622
780
|
|
|
623
781
|
//# sourceMappingURL=types.d.ts.map
|