@fincity/kirun-js 1.0.5 → 1.1.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/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 +10 -10
- 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/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/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 +258 -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/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 +1 -1
- 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/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/runtime/KIRuntime.ts +26 -24
- package/src/index.ts +100 -21
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,27 @@ 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
|
+
}
|
|
70
66
|
export class Schema {
|
|
71
67
|
static readonly NULL: Schema;
|
|
72
68
|
static readonly SCHEMA: Schema;
|
|
@@ -164,39 +160,32 @@ export class Schema {
|
|
|
164
160
|
getPermission(): string | undefined;
|
|
165
161
|
setPermission(permission: string): Schema;
|
|
166
162
|
}
|
|
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;
|
|
163
|
+
export enum ParameterType {
|
|
164
|
+
CONSTANT = "CONSTANT",
|
|
165
|
+
EXPRESSION = "EXPRESSION"
|
|
180
166
|
}
|
|
181
|
-
export class
|
|
182
|
-
static
|
|
183
|
-
static
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
167
|
+
export class Parameter {
|
|
168
|
+
static readonly SCHEMA: Schema;
|
|
169
|
+
static readonly EXPRESSION: Schema;
|
|
170
|
+
constructor(parameterName: string, schema: Schema);
|
|
171
|
+
getSchema(): Schema;
|
|
172
|
+
setSchema(schema: Schema): Parameter;
|
|
173
|
+
getParameterName(): string;
|
|
174
|
+
setParameterName(parameterName: string): Parameter;
|
|
175
|
+
isVariableArgument(): boolean;
|
|
176
|
+
setVariableArgument(variableArgument: boolean): Parameter;
|
|
177
|
+
getType(): ParameterType;
|
|
178
|
+
setType(type: ParameterType): Parameter;
|
|
179
|
+
static ofEntry(name: string, schema: Schema, variableArgument?: boolean, type?: ParameterType): [string, Parameter];
|
|
180
|
+
static of(name: string, schema: Schema, variableArgument?: boolean, type?: ParameterType): Parameter;
|
|
188
181
|
}
|
|
189
|
-
export
|
|
190
|
-
|
|
191
|
-
static readonly NAME: String;
|
|
192
|
-
static readonly ID: String;
|
|
193
|
-
private constructor();
|
|
182
|
+
export interface Repository<T> {
|
|
183
|
+
find(namespace: string, name: string): T | undefined;
|
|
194
184
|
}
|
|
195
|
-
export class
|
|
196
|
-
|
|
197
|
-
getCause(): Error | undefined;
|
|
185
|
+
export class KIRunSchemaRepository implements Repository<Schema> {
|
|
186
|
+
find(namespace: string, name: string): Schema | undefined;
|
|
198
187
|
}
|
|
199
|
-
|
|
188
|
+
export class Event {
|
|
200
189
|
static readonly OUTPUT: string;
|
|
201
190
|
static readonly ERROR: string;
|
|
202
191
|
static readonly ITERATION: string;
|
|
@@ -212,7 +201,11 @@ declare class Event {
|
|
|
212
201
|
static outputEventMapEntry(parameters: Map<string, Schema>): [string, Event];
|
|
213
202
|
static eventMapEntry(eventName: string, parameters: Map<string, Schema>): [string, Event];
|
|
214
203
|
}
|
|
215
|
-
|
|
204
|
+
export class KIRuntimeException extends Error {
|
|
205
|
+
constructor(message: string, err?: Error);
|
|
206
|
+
getCause(): Error | undefined;
|
|
207
|
+
}
|
|
208
|
+
export class EventResult {
|
|
216
209
|
constructor(name: string, result: Map<string, any>);
|
|
217
210
|
getName(): string;
|
|
218
211
|
setName(name: string): EventResult;
|
|
@@ -221,34 +214,15 @@ declare class EventResult {
|
|
|
221
214
|
static outputOf(result: Map<string, any>): EventResult;
|
|
222
215
|
static of(eventName: string, result: Map<string, any>): EventResult;
|
|
223
216
|
}
|
|
224
|
-
interface FunctionOutputGenerator {
|
|
217
|
+
export interface FunctionOutputGenerator {
|
|
225
218
|
next(): EventResult | undefined;
|
|
226
219
|
}
|
|
227
|
-
|
|
220
|
+
export class FunctionOutput {
|
|
228
221
|
constructor(arg: EventResult[] | FunctionOutputGenerator);
|
|
229
222
|
next(): EventResult | undefined;
|
|
230
223
|
allResults(): EventResult[];
|
|
231
224
|
}
|
|
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 {
|
|
225
|
+
export class FunctionSignature {
|
|
252
226
|
static readonly SCHEMA: Schema;
|
|
253
227
|
constructor(name: string);
|
|
254
228
|
getNamespace(): string;
|
|
@@ -260,7 +234,7 @@ declare class FunctionSignature {
|
|
|
260
234
|
getEvents(): Map<string, Event>;
|
|
261
235
|
setEvents(events: Map<string, Event>): FunctionSignature;
|
|
262
236
|
}
|
|
263
|
-
|
|
237
|
+
export class ContextElement {
|
|
264
238
|
static readonly NULL: ContextElement;
|
|
265
239
|
constructor(schema?: Schema, element?: any);
|
|
266
240
|
getSchema(): Schema | undefined;
|
|
@@ -268,6 +242,16 @@ declare class ContextElement {
|
|
|
268
242
|
getElement(): any;
|
|
269
243
|
setElement(element: any): ContextElement;
|
|
270
244
|
}
|
|
245
|
+
export class StringFormatter {
|
|
246
|
+
static format(formatString: string, ...params: any[]): string;
|
|
247
|
+
private constructor();
|
|
248
|
+
}
|
|
249
|
+
export class StringUtil {
|
|
250
|
+
private constructor();
|
|
251
|
+
static nthIndex(str: string, c: string, from: number | undefined, occurance: number): number;
|
|
252
|
+
static splitAtFirstOccurance(str: string, c: string): [string | undefined, string | undefined];
|
|
253
|
+
static isNullOrBlank(str: string | undefined): boolean;
|
|
254
|
+
}
|
|
271
255
|
export class ExpressionEvaluationException extends Error {
|
|
272
256
|
constructor(expression: string, message: string, err?: Error);
|
|
273
257
|
getCause(): Error | undefined;
|
|
@@ -280,7 +264,7 @@ export abstract class TokenValueExtractor {
|
|
|
280
264
|
protected abstract getValueInternal(token: string): any;
|
|
281
265
|
abstract getPrefix(): string;
|
|
282
266
|
}
|
|
283
|
-
|
|
267
|
+
export class Position {
|
|
284
268
|
static readonly SCHEMA_NAME: string;
|
|
285
269
|
static readonly SCHEMA: Schema;
|
|
286
270
|
constructor(left: number, top: number);
|
|
@@ -289,7 +273,7 @@ declare class Position {
|
|
|
289
273
|
getTop(): number;
|
|
290
274
|
setTop(top: number): Position;
|
|
291
275
|
}
|
|
292
|
-
|
|
276
|
+
export class AbstractStatement {
|
|
293
277
|
getComment(): string | undefined;
|
|
294
278
|
setComment(comment: string): AbstractStatement;
|
|
295
279
|
getDescription(): string | undefined;
|
|
@@ -297,11 +281,11 @@ declare class AbstractStatement {
|
|
|
297
281
|
getPosition(): Position | undefined;
|
|
298
282
|
setPosition(position: Position): AbstractStatement;
|
|
299
283
|
}
|
|
300
|
-
enum ParameterReferenceType {
|
|
284
|
+
export enum ParameterReferenceType {
|
|
301
285
|
VALUE = "VALUE",
|
|
302
286
|
EXPRESSION = "EXPRESSION"
|
|
303
287
|
}
|
|
304
|
-
|
|
288
|
+
export class ParameterReference {
|
|
305
289
|
static readonly SCHEMA: Schema;
|
|
306
290
|
constructor(type: ParameterReferenceType);
|
|
307
291
|
getType(): ParameterReferenceType;
|
|
@@ -313,7 +297,7 @@ declare class ParameterReference {
|
|
|
313
297
|
static ofExpression(value: any): ParameterReference;
|
|
314
298
|
static ofValue(value: any): ParameterReference;
|
|
315
299
|
}
|
|
316
|
-
|
|
300
|
+
export class Statement extends AbstractStatement {
|
|
317
301
|
static readonly SCHEMA_NAME: string;
|
|
318
302
|
static readonly SCHEMA: Schema;
|
|
319
303
|
constructor(statementName: string, namespace: string, name: string);
|
|
@@ -330,16 +314,16 @@ declare class Statement extends AbstractStatement {
|
|
|
330
314
|
equals(obj: any): boolean;
|
|
331
315
|
static ofEntry(statement: Statement): [string, Statement];
|
|
332
316
|
}
|
|
333
|
-
interface GraphVertexType<K> {
|
|
317
|
+
export interface GraphVertexType<K> {
|
|
334
318
|
getUniqueKey(): K;
|
|
335
319
|
getDepenedencies(): Set<string>;
|
|
336
320
|
}
|
|
337
|
-
enum StatementMessageType {
|
|
321
|
+
export enum StatementMessageType {
|
|
338
322
|
ERROR = "ERROR",
|
|
339
323
|
WARNING = "WARNING",
|
|
340
324
|
MESSAGE = "MESSAGE"
|
|
341
325
|
}
|
|
342
|
-
|
|
326
|
+
export class StatementMessage {
|
|
343
327
|
constructor(messageType?: StatementMessageType, message?: string);
|
|
344
328
|
getMessageType(): StatementMessageType | undefined;
|
|
345
329
|
setMessageType(messageType: StatementMessageType): StatementMessage;
|
|
@@ -347,7 +331,7 @@ declare class StatementMessage {
|
|
|
347
331
|
setMessage(message: string): StatementMessage;
|
|
348
332
|
toString(): string;
|
|
349
333
|
}
|
|
350
|
-
|
|
334
|
+
export class StatementExecution implements GraphVertexType<String> {
|
|
351
335
|
constructor(statement: Statement);
|
|
352
336
|
getStatement(): Statement;
|
|
353
337
|
setStatement(statement: Statement): StatementExecution;
|
|
@@ -361,7 +345,25 @@ declare class StatementExecution implements GraphVertexType<String> {
|
|
|
361
345
|
getDepenedencies(): Set<string>;
|
|
362
346
|
equals(obj: Object): boolean;
|
|
363
347
|
}
|
|
364
|
-
|
|
348
|
+
export class ArgumentsTokenValueExtractor extends TokenValueExtractor {
|
|
349
|
+
static readonly PREFIX: string;
|
|
350
|
+
constructor(args: Map<string, any>);
|
|
351
|
+
protected getValueInternal(token: string): any;
|
|
352
|
+
getPrefix(): string;
|
|
353
|
+
}
|
|
354
|
+
export class ContextTokenValueExtractor extends TokenValueExtractor {
|
|
355
|
+
static readonly PREFIX: string;
|
|
356
|
+
constructor(context: Map<string, ContextElement>);
|
|
357
|
+
protected getValueInternal(token: string): any;
|
|
358
|
+
getPrefix(): string;
|
|
359
|
+
}
|
|
360
|
+
export class OutputMapTokenValueExtractor extends TokenValueExtractor {
|
|
361
|
+
static readonly PREFIX: string;
|
|
362
|
+
constructor(output: Map<string, Map<string, Map<string, any>>>);
|
|
363
|
+
protected getValueInternal(token: string): any;
|
|
364
|
+
getPrefix(): string;
|
|
365
|
+
}
|
|
366
|
+
export class FunctionExecutionParameters {
|
|
365
367
|
getContext(): Map<string, ContextElement> | undefined;
|
|
366
368
|
setContext(context: Map<string, ContextElement>): FunctionExecutionParameters;
|
|
367
369
|
getArguments(): Map<string, any> | undefined;
|
|
@@ -379,30 +381,90 @@ declare class FunctionExecutionParameters {
|
|
|
379
381
|
export interface Function {
|
|
380
382
|
getSignature(): FunctionSignature;
|
|
381
383
|
getProbableEventSignature(probableParameters: Map<string, Schema[]>): Map<string, Event>;
|
|
382
|
-
execute(context: FunctionExecutionParameters): FunctionOutput
|
|
384
|
+
execute(context: FunctionExecutionParameters): Promise<FunctionOutput>;
|
|
385
|
+
}
|
|
386
|
+
export class Tuple2<F, S> {
|
|
387
|
+
constructor(f: F, s: S);
|
|
388
|
+
getT1(): F;
|
|
389
|
+
getT2(): S;
|
|
390
|
+
}
|
|
391
|
+
export class Tuple3<F, S, T> extends Tuple2<F, S> {
|
|
392
|
+
constructor(f: F, s: S, t: T);
|
|
393
|
+
getT3(): T;
|
|
394
|
+
}
|
|
395
|
+
export class Tuple4<F, S, T, FR> extends Tuple3<F, S, T> {
|
|
396
|
+
constructor(f: F, s: S, t: T, fr: FR);
|
|
397
|
+
getT4(): FR;
|
|
398
|
+
}
|
|
399
|
+
export class SchemaReferenceException extends Error {
|
|
400
|
+
constructor(schemaPath: string, message: string, err?: Error);
|
|
401
|
+
getSchemaPath(): string;
|
|
402
|
+
getCause(): Error | undefined;
|
|
403
|
+
}
|
|
404
|
+
export class SchemaValidationException extends Error {
|
|
405
|
+
constructor(schemaPath: string, message: string, sve?: SchemaValidationException[], err?: Error);
|
|
406
|
+
getSchemaPath(): string;
|
|
407
|
+
getCause(): Error | undefined;
|
|
408
|
+
}
|
|
409
|
+
export class SchemaUtil {
|
|
410
|
+
static getDefaultValue(s: Schema | undefined, sRepository: Repository<Schema>): any;
|
|
411
|
+
static getSchemaFromRef(schema: Schema, sRepository: Repository<Schema> | undefined, ref: string | undefined, iteration?: number): Schema | undefined;
|
|
412
|
+
private constructor();
|
|
413
|
+
}
|
|
414
|
+
export class AnyOfAllOfOneOfValidator {
|
|
415
|
+
static validate(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, element: any): any;
|
|
416
|
+
private constructor();
|
|
417
|
+
}
|
|
418
|
+
export class ArrayValidator {
|
|
419
|
+
static validate(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, element: any): any;
|
|
420
|
+
static checkContains(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, array: any[]): void;
|
|
421
|
+
static checkUniqueItems(parents: Schema[], schema: Schema, array: any[]): void;
|
|
422
|
+
static checkMinMaxItems(parents: Schema[], schema: Schema, array: any[]): void;
|
|
423
|
+
static checkItems(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, array: any[]): void;
|
|
424
|
+
private constructor();
|
|
425
|
+
}
|
|
426
|
+
export class BooleanValidator {
|
|
427
|
+
static validate(parents: Schema[], schema: Schema, element: any): any;
|
|
428
|
+
private constructor();
|
|
429
|
+
}
|
|
430
|
+
export class NullValidator {
|
|
431
|
+
static validate(parents: Schema[], schema: Schema, element: any): any;
|
|
432
|
+
private constructor();
|
|
433
|
+
}
|
|
434
|
+
export class NumberValidator {
|
|
435
|
+
static validate(type: SchemaType, parents: Schema[], schema: Schema, element: any): any;
|
|
436
|
+
private constructor();
|
|
437
|
+
}
|
|
438
|
+
export class ObjectValidator {
|
|
439
|
+
static validate(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, element: any): void;
|
|
440
|
+
private constructor();
|
|
441
|
+
}
|
|
442
|
+
export class StringValidator {
|
|
443
|
+
static validate(parents: Schema[], schema: Schema, element: any): any;
|
|
444
|
+
private constructor();
|
|
445
|
+
}
|
|
446
|
+
export class TypeValidator {
|
|
447
|
+
static validate(parents: Schema[], type: SchemaType, schema: Schema, repository: Repository<Schema> | undefined, element: any): any;
|
|
448
|
+
private constructor();
|
|
449
|
+
}
|
|
450
|
+
export class SchemaValidator {
|
|
451
|
+
static path(parents: Schema[] | undefined): string;
|
|
452
|
+
static validate(parents: Schema[] | undefined, schema: Schema | undefined, repository: Repository<Schema> | undefined, element: any): any;
|
|
453
|
+
static constantValidation(parents: Schema[], schema: Schema, element: any): any;
|
|
454
|
+
static enumCheck(parents: Schema[], schema: Schema, element: any): any;
|
|
455
|
+
static typeValidation(parents: Schema[], schema: Schema, repository: Repository<Schema> | undefined, element: any): void;
|
|
456
|
+
private constructor();
|
|
383
457
|
}
|
|
384
458
|
export abstract class AbstractFunction implements Function {
|
|
385
459
|
protected validateArguments(args: Map<string, any>): Map<string, any>;
|
|
386
|
-
execute(context: FunctionExecutionParameters): FunctionOutput
|
|
460
|
+
execute(context: FunctionExecutionParameters): Promise<FunctionOutput>;
|
|
387
461
|
getProbableEventSignature(probableParameters: Map<string, Schema[]>): Map<string, Event>;
|
|
388
|
-
protected abstract internalExecute(context: FunctionExecutionParameters): FunctionOutput
|
|
462
|
+
protected abstract internalExecute(context: FunctionExecutionParameters): Promise<FunctionOutput>;
|
|
389
463
|
abstract getSignature(): FunctionSignature;
|
|
390
464
|
}
|
|
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;
|
|
465
|
+
export class ExecutionException extends Error {
|
|
466
|
+
constructor(message: string, err?: Error);
|
|
467
|
+
getCause(): Error | undefined;
|
|
406
468
|
}
|
|
407
469
|
export class LinkedList<T> {
|
|
408
470
|
length: number;
|
|
@@ -425,6 +487,24 @@ export class LinkedList<T> {
|
|
|
425
487
|
map<U>(callbackfn: (value: T, index: number) => U, thisArg?: any): LinkedList<U>;
|
|
426
488
|
forEach(callbackfn: (value: T, index: number) => void, thisArg?: any): void;
|
|
427
489
|
}
|
|
490
|
+
export class KIRunConstants {
|
|
491
|
+
static readonly NAMESPACE: String;
|
|
492
|
+
static readonly NAME: String;
|
|
493
|
+
static readonly ID: String;
|
|
494
|
+
private constructor();
|
|
495
|
+
}
|
|
496
|
+
export class StringBuilder {
|
|
497
|
+
constructor(str?: string);
|
|
498
|
+
append(x: any): StringBuilder;
|
|
499
|
+
toString(): string;
|
|
500
|
+
trim(): StringBuilder;
|
|
501
|
+
setLength(num: number): StringBuilder;
|
|
502
|
+
length(): number;
|
|
503
|
+
charAt(index: number): string;
|
|
504
|
+
deleteCharAt(index: number): StringBuilder;
|
|
505
|
+
insert(index: number, str: string): StringBuilder;
|
|
506
|
+
substring(start: number, end: number): string;
|
|
507
|
+
}
|
|
428
508
|
export class ExpressionToken {
|
|
429
509
|
expression: string;
|
|
430
510
|
constructor(expression: string);
|
|
@@ -533,6 +613,19 @@ export class BitwiseUnsignedRightShiftOperator extends BinaryOperator {
|
|
|
533
613
|
export class BitwiseXorOperator extends BinaryOperator {
|
|
534
614
|
apply(t: any, u: any): any;
|
|
535
615
|
}
|
|
616
|
+
export class JsonExpression {
|
|
617
|
+
constructor(expression: string);
|
|
618
|
+
getExpression(): string;
|
|
619
|
+
}
|
|
620
|
+
export class PrimitiveUtil {
|
|
621
|
+
static findPrimitiveNullAsBoolean(element: any): Tuple2<SchemaType, any>;
|
|
622
|
+
static findPrimitive(element: any): Tuple2<SchemaType, any>;
|
|
623
|
+
static findPrimitiveNumberType(element: any): Tuple2<SchemaType, any>;
|
|
624
|
+
static compare(a: any, b: any): number;
|
|
625
|
+
static comparePrimitive(oa: any, ob: any): number;
|
|
626
|
+
static toPrimitiveType(e: any): number;
|
|
627
|
+
private constructor();
|
|
628
|
+
}
|
|
536
629
|
export class LogicalAndOperator extends BinaryOperator {
|
|
537
630
|
apply(t: any, u: any): any;
|
|
538
631
|
}
|
|
@@ -576,13 +669,34 @@ export class BitwiseComplementOperator extends UnaryOperator {
|
|
|
576
669
|
export class LogicalNotOperator extends UnaryOperator {
|
|
577
670
|
apply(t: any): any;
|
|
578
671
|
}
|
|
672
|
+
export class LiteralTokenValueExtractor extends TokenValueExtractor {
|
|
673
|
+
static readonly INSTANCE: LiteralTokenValueExtractor;
|
|
674
|
+
protected getValueInternal(token: string): any;
|
|
675
|
+
getPrefix(): string;
|
|
676
|
+
}
|
|
579
677
|
export class ExpressionEvaluator {
|
|
580
678
|
constructor(exp: Expression | string);
|
|
581
679
|
evaluate(valuesMap: Map<string, TokenValueExtractor>): any;
|
|
582
680
|
getExpression(): Expression;
|
|
583
681
|
getExpressionString(): string;
|
|
584
682
|
}
|
|
585
|
-
|
|
683
|
+
export class StatementGroup extends AbstractStatement {
|
|
684
|
+
static readonly SCHEMA: Schema;
|
|
685
|
+
constructor(statementGroupName: string);
|
|
686
|
+
getStatementGroupName(): string;
|
|
687
|
+
setStatementGroupName(statementGroupName: string): StatementGroup;
|
|
688
|
+
}
|
|
689
|
+
export class FunctionDefinition extends FunctionSignature {
|
|
690
|
+
static readonly SCHEMA: Schema;
|
|
691
|
+
constructor(name: string);
|
|
692
|
+
getVersion(): number;
|
|
693
|
+
setVersion(version: number): FunctionDefinition;
|
|
694
|
+
getSteps(): Map<string, Statement>;
|
|
695
|
+
setSteps(steps: Map<string, Statement>): FunctionDefinition;
|
|
696
|
+
getStepGroups(): Map<string, StatementGroup> | undefined;
|
|
697
|
+
setStepGroups(stepGroups: Map<string, StatementGroup>): FunctionDefinition;
|
|
698
|
+
}
|
|
699
|
+
export class GraphVertex<K, T extends GraphVertexType<K>> {
|
|
586
700
|
constructor(graph: ExecutionGraph<K, T>, data: T);
|
|
587
701
|
getData(): T;
|
|
588
702
|
setData(data: T): GraphVertex<K, T>;
|
|
@@ -600,7 +714,7 @@ declare class GraphVertex<K, T extends GraphVertexType<K>> {
|
|
|
600
714
|
getSubGraphOfType(type: string): ExecutionGraph<K, T>;
|
|
601
715
|
toString(): string;
|
|
602
716
|
}
|
|
603
|
-
|
|
717
|
+
export class ExecutionGraph<K, T extends GraphVertexType<K>> {
|
|
604
718
|
constructor(isSubGrph?: boolean);
|
|
605
719
|
getVerticesData(): T[];
|
|
606
720
|
addVertex(data: T): GraphVertex<K, T>;
|
|
@@ -616,8 +730,43 @@ declare class ExecutionGraph<K, T extends GraphVertexType<K>> {
|
|
|
616
730
|
export class KIRuntime extends AbstractFunction {
|
|
617
731
|
constructor(fd: FunctionDefinition, functionRepository: Repository<Function>, schemaRepository: Repository<Schema>);
|
|
618
732
|
getSignature(): FunctionSignature;
|
|
619
|
-
protected internalExecute(inContext: FunctionExecutionParameters): FunctionOutput
|
|
733
|
+
protected internalExecute(inContext: FunctionExecutionParameters): Promise<FunctionOutput>;
|
|
620
734
|
makeEdges(graph: ExecutionGraph<string, StatementExecution>): Tuple2<string, string>[];
|
|
621
735
|
}
|
|
736
|
+
export class MapUtil {
|
|
737
|
+
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>;
|
|
738
|
+
static ofArrayEntries<K, V>(...entry: [K, V][]): Map<K, V>;
|
|
739
|
+
static entry<K, V>(k: K, v: V): MapEntry<K, V>;
|
|
740
|
+
static ofEntries<K, V>(...entry: MapEntry<K, V>[]): Map<K, V>;
|
|
741
|
+
private constructor();
|
|
742
|
+
}
|
|
743
|
+
export class MapEntry<K, V> {
|
|
744
|
+
k: K;
|
|
745
|
+
v: V;
|
|
746
|
+
constructor(k: K, v: V);
|
|
747
|
+
}
|
|
748
|
+
export class HybridRepository<T> implements Repository<T> {
|
|
749
|
+
repos: Repository<T>[];
|
|
750
|
+
constructor(...repos: Repository<T>[]);
|
|
751
|
+
find(namespace: string, name: string): T | undefined;
|
|
752
|
+
}
|
|
753
|
+
export class KIRunFunctionRepository extends HybridRepository<Function> {
|
|
754
|
+
constructor();
|
|
755
|
+
}
|
|
756
|
+
export class ArrayUtil {
|
|
757
|
+
static removeAListFrom(source: any[], removeList: any[]): void;
|
|
758
|
+
static of<K>(...k: K[]): K[];
|
|
759
|
+
private constructor();
|
|
760
|
+
}
|
|
761
|
+
export class Argument {
|
|
762
|
+
constructor(argumentIndex: number, name: string, value?: any);
|
|
763
|
+
getArgumentIndex(): number;
|
|
764
|
+
setArgumentIndex(argumentIndex: number): Argument;
|
|
765
|
+
getName(): string;
|
|
766
|
+
setName(name: string): Argument;
|
|
767
|
+
getValue(): any;
|
|
768
|
+
setValue(value: any): Argument;
|
|
769
|
+
static of(name: string, value: any): Argument;
|
|
770
|
+
}
|
|
622
771
|
|
|
623
772
|
//# sourceMappingURL=types.d.ts.map
|