@jmespath-community/jmespath 1.1.5 → 1.3.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/README.md +175 -68
- package/dist/cli.d.ts +2 -0
- package/dist/cli.mjs +2181 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.cjs +2118 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +412 -0
- package/dist/index.d.ts +412 -0
- package/dist/index.esm.js +2099 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.esm.min.js +2 -0
- package/dist/index.esm.min.js.map +1 -0
- package/dist/index.mjs +2089 -0
- package/dist/index.mjs.map +1 -0
- package/dist/index.umd.js +2133 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/index.umd.min.js +2 -0
- package/dist/index.umd.min.js.map +1 -0
- package/package.json +30 -5
- package/dist/jmespath.esm.js +0 -2351
- package/dist/jmespath.esm.min.js +0 -2
- package/dist/jmespath.esm.min.js.map +0 -1
- package/dist/jmespath.umd.js +0 -2380
- package/dist/jmespath.umd.min.js +0 -2
- package/dist/jmespath.umd.min.js.map +0 -1
- package/dist/lib/AST.type.js +0 -3
- package/dist/lib/AST.type.js.map +0 -1
- package/dist/lib/JSON.type.js +0 -3
- package/dist/lib/JSON.type.js.map +0 -1
- package/dist/lib/Lexer.js +0 -326
- package/dist/lib/Lexer.js.map +0 -1
- package/dist/lib/Lexer.type.js +0 -45
- package/dist/lib/Lexer.type.js.map +0 -1
- package/dist/lib/Parser.js +0 -459
- package/dist/lib/Parser.js.map +0 -1
- package/dist/lib/Parser.type.js +0 -3
- package/dist/lib/Parser.type.js.map +0 -1
- package/dist/lib/Runtime.js +0 -924
- package/dist/lib/Runtime.js.map +0 -1
- package/dist/lib/Scope.js +0 -29
- package/dist/lib/Scope.js.map +0 -1
- package/dist/lib/TreeInterpreter.js +0 -312
- package/dist/lib/TreeInterpreter.js.map +0 -1
- package/dist/lib/index.js +0 -67
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/utils/index.js +0 -144
- package/dist/lib/utils/index.js.map +0 -1
- package/dist/lib/utils/strings.js +0 -92
- package/dist/lib/utils/strings.js.map +0 -1
- package/dist/lib/utils/text.js +0 -44
- package/dist/lib/utils/text.js.map +0 -1
- package/dist/types/AST.type.d.ts +0 -98
- package/dist/types/JSON.type.d.ts +0 -10
- package/dist/types/Lexer.d.ts +0 -19
- package/dist/types/Lexer.type.d.ts +0 -50
- package/dist/types/Parser.d.ts +0 -33
- package/dist/types/Parser.type.d.ts +0 -4
- package/dist/types/Runtime.d.ts +0 -87
- package/dist/types/Scope.d.ts +0 -8
- package/dist/types/TreeInterpreter.d.ts +0 -22
- package/dist/types/index.d.ts +0 -45
- package/dist/types/utils/index.d.ts +0 -16
- package/dist/types/utils/strings.d.ts +0 -11
- package/dist/types/utils/text.d.ts +0 -11
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
type JSONPrimitive = string | number | boolean | null;
|
|
2
|
+
type JSONValue = JSONPrimitive | JSONObject | JSONArray;
|
|
3
|
+
type JSONObject = {
|
|
4
|
+
[member: string]: JSONValue;
|
|
5
|
+
};
|
|
6
|
+
type JSONArray = JSONValue[];
|
|
7
|
+
|
|
8
|
+
declare enum Token {
|
|
9
|
+
TOK_EOF = "EOF",
|
|
10
|
+
TOK_VARIABLE = "Variable",
|
|
11
|
+
TOK_ASSIGN = "Assign",
|
|
12
|
+
TOK_UNQUOTEDIDENTIFIER = "UnquotedIdentifier",
|
|
13
|
+
TOK_QUOTEDIDENTIFIER = "QuotedIdentifier",
|
|
14
|
+
TOK_RBRACKET = "Rbracket",
|
|
15
|
+
TOK_RPAREN = "Rparen",
|
|
16
|
+
TOK_COMMA = "Comma",
|
|
17
|
+
TOK_COLON = "Colon",
|
|
18
|
+
TOK_RBRACE = "Rbrace",
|
|
19
|
+
TOK_NUMBER = "Number",
|
|
20
|
+
TOK_CURRENT = "Current",
|
|
21
|
+
TOK_ROOT = "Root",
|
|
22
|
+
TOK_EXPREF = "Expref",
|
|
23
|
+
TOK_PIPE = "Pipe",
|
|
24
|
+
TOK_OR = "Or",
|
|
25
|
+
TOK_AND = "And",
|
|
26
|
+
TOK_EQ = "EQ",
|
|
27
|
+
TOK_GT = "GT",
|
|
28
|
+
TOK_LT = "LT",
|
|
29
|
+
TOK_GTE = "GTE",
|
|
30
|
+
TOK_LTE = "LTE",
|
|
31
|
+
TOK_NE = "NE",
|
|
32
|
+
TOK_PLUS = "Plus",
|
|
33
|
+
TOK_MINUS = "Minus",
|
|
34
|
+
TOK_MULTIPLY = "Multiply",
|
|
35
|
+
TOK_DIVIDE = "Divide",
|
|
36
|
+
TOK_MODULO = "Modulo",
|
|
37
|
+
TOK_DIV = "Div",
|
|
38
|
+
TOK_FLATTEN = "Flatten",
|
|
39
|
+
TOK_STAR = "Star",
|
|
40
|
+
TOK_FILTER = "Filter",
|
|
41
|
+
TOK_DOT = "Dot",
|
|
42
|
+
TOK_NOT = "Not",
|
|
43
|
+
TOK_LBRACE = "Lbrace",
|
|
44
|
+
TOK_LBRACKET = "Lbracket",
|
|
45
|
+
TOK_LPAREN = "Lparen",
|
|
46
|
+
TOK_LITERAL = "Literal",
|
|
47
|
+
TOK_QUESTION = "Question"
|
|
48
|
+
}
|
|
49
|
+
type LexerTokenValue = JSONValue;
|
|
50
|
+
interface LexerToken {
|
|
51
|
+
type: Token;
|
|
52
|
+
value: LexerTokenValue;
|
|
53
|
+
start: number;
|
|
54
|
+
}
|
|
55
|
+
interface LexerOptions {
|
|
56
|
+
enable_legacy_literals?: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface FieldNode {
|
|
60
|
+
readonly type: 'Field';
|
|
61
|
+
readonly name: string;
|
|
62
|
+
}
|
|
63
|
+
interface LiteralNode {
|
|
64
|
+
readonly type: 'Literal';
|
|
65
|
+
readonly value: JSONValue;
|
|
66
|
+
}
|
|
67
|
+
interface IndexNode {
|
|
68
|
+
readonly type: 'Index';
|
|
69
|
+
readonly value: number;
|
|
70
|
+
}
|
|
71
|
+
interface FilterProjectionNode {
|
|
72
|
+
readonly type: 'FilterProjection';
|
|
73
|
+
readonly left: ExpressionNode;
|
|
74
|
+
readonly right: ExpressionNode;
|
|
75
|
+
readonly condition: ExpressionNode;
|
|
76
|
+
}
|
|
77
|
+
interface SliceNode {
|
|
78
|
+
readonly type: 'Slice';
|
|
79
|
+
readonly start: number | null;
|
|
80
|
+
readonly stop: number | null;
|
|
81
|
+
readonly step: number | null;
|
|
82
|
+
}
|
|
83
|
+
type ComparatorType = 'GT' | 'LT' | 'GTE' | 'LTE' | 'NE' | 'EQ';
|
|
84
|
+
interface ComparatorNode {
|
|
85
|
+
readonly type: 'Comparator';
|
|
86
|
+
readonly name: ComparatorType;
|
|
87
|
+
readonly left: ExpressionNode;
|
|
88
|
+
readonly right: ExpressionNode;
|
|
89
|
+
}
|
|
90
|
+
interface KeyValuePairNode {
|
|
91
|
+
readonly type: 'KeyValuePair';
|
|
92
|
+
readonly name: string;
|
|
93
|
+
readonly value: ExpressionNode;
|
|
94
|
+
}
|
|
95
|
+
interface MultiSelectHashNode {
|
|
96
|
+
type: 'MultiSelectHash';
|
|
97
|
+
children: KeyValuePairNode[];
|
|
98
|
+
}
|
|
99
|
+
interface MultiSelectListNode {
|
|
100
|
+
type: 'MultiSelectList';
|
|
101
|
+
children: ExpressionNode[];
|
|
102
|
+
}
|
|
103
|
+
interface FunctionNode {
|
|
104
|
+
readonly type: 'Function';
|
|
105
|
+
readonly name: string;
|
|
106
|
+
readonly children: ExpressionNode[];
|
|
107
|
+
}
|
|
108
|
+
interface LetExpressionNode {
|
|
109
|
+
readonly type: 'LetExpression';
|
|
110
|
+
readonly bindings: BindingNode[];
|
|
111
|
+
readonly expression: ExpressionNode;
|
|
112
|
+
}
|
|
113
|
+
interface BindingNode {
|
|
114
|
+
readonly type: 'Binding';
|
|
115
|
+
readonly variable: string;
|
|
116
|
+
readonly reference: ExpressionNode;
|
|
117
|
+
}
|
|
118
|
+
interface VariableNode {
|
|
119
|
+
readonly type: 'Variable';
|
|
120
|
+
readonly name: string;
|
|
121
|
+
}
|
|
122
|
+
interface TernaryNode {
|
|
123
|
+
readonly type: 'Ternary';
|
|
124
|
+
readonly condition: ExpressionNode;
|
|
125
|
+
readonly trueExpr: ExpressionNode;
|
|
126
|
+
readonly falseExpr: ExpressionNode;
|
|
127
|
+
}
|
|
128
|
+
type BinaryExpressionType = 'AndExpression' | 'IndexExpression' | 'OrExpression' | 'Pipe' | 'Projection' | 'Subexpression' | 'ValueProjection';
|
|
129
|
+
type UnaryExpressionType = 'ExpressionReference' | 'Flatten' | 'NotExpression';
|
|
130
|
+
type SimpleExpressionType = 'Identity' | 'Current' | 'Root';
|
|
131
|
+
interface SimpleExpressionNode<T extends SimpleExpressionType = SimpleExpressionType> {
|
|
132
|
+
readonly type: T;
|
|
133
|
+
}
|
|
134
|
+
interface UnaryExpressionNode<T extends UnaryExpressionType = UnaryExpressionType> {
|
|
135
|
+
readonly type: T;
|
|
136
|
+
readonly child: ExpressionNode;
|
|
137
|
+
}
|
|
138
|
+
type UnaryOperatorType = 'Plus' | 'Minus';
|
|
139
|
+
interface UnaryArithmeticNode {
|
|
140
|
+
readonly type: 'Unary';
|
|
141
|
+
readonly operator: UnaryOperatorType;
|
|
142
|
+
readonly operand: ExpressionNode;
|
|
143
|
+
}
|
|
144
|
+
interface BinaryExpressionNode<T extends BinaryExpressionType = BinaryExpressionType> {
|
|
145
|
+
readonly type: T;
|
|
146
|
+
readonly left: ExpressionNode;
|
|
147
|
+
readonly right: ExpressionNode;
|
|
148
|
+
}
|
|
149
|
+
type BinaryOperatorType = 'Plus' | 'Minus' | 'Multiply' | Token.TOK_STAR | 'Divide' | 'Modulo' | 'Div';
|
|
150
|
+
interface BinaryArithmeticNode {
|
|
151
|
+
readonly type: 'Arithmetic';
|
|
152
|
+
readonly operator: BinaryOperatorType;
|
|
153
|
+
readonly left: ExpressionNode;
|
|
154
|
+
readonly right: ExpressionNode;
|
|
155
|
+
}
|
|
156
|
+
type ExpressionNode = SimpleExpressionNode | UnaryExpressionNode | UnaryArithmeticNode | BinaryExpressionNode | BinaryArithmeticNode | ComparatorNode | SliceNode | FilterProjectionNode | IndexNode | LiteralNode | FieldNode | MultiSelectHashNode | MultiSelectListNode | FunctionNode | LetExpressionNode | BindingNode | VariableNode | TernaryNode;
|
|
157
|
+
type ExpressionReference = {
|
|
158
|
+
expref: true;
|
|
159
|
+
} & ExpressionNode;
|
|
160
|
+
|
|
161
|
+
type ScopeEntry = JSONObject;
|
|
162
|
+
type Options = LexerOptions;
|
|
163
|
+
|
|
164
|
+
declare enum InputArgument {
|
|
165
|
+
TYPE_NUMBER = 0,
|
|
166
|
+
TYPE_ANY = 1,
|
|
167
|
+
TYPE_STRING = 2,
|
|
168
|
+
TYPE_ARRAY = 3,
|
|
169
|
+
TYPE_OBJECT = 4,
|
|
170
|
+
TYPE_BOOLEAN = 5,
|
|
171
|
+
TYPE_EXPREF = 6,
|
|
172
|
+
TYPE_NULL = 7,
|
|
173
|
+
TYPE_ARRAY_NUMBER = 8,
|
|
174
|
+
TYPE_ARRAY_STRING = 9,
|
|
175
|
+
TYPE_ARRAY_OBJECT = 10,
|
|
176
|
+
TYPE_ARRAY_ARRAY = 11
|
|
177
|
+
}
|
|
178
|
+
interface InputSignature {
|
|
179
|
+
types: InputArgument[];
|
|
180
|
+
variadic?: boolean;
|
|
181
|
+
optional?: boolean;
|
|
182
|
+
}
|
|
183
|
+
type RuntimeFunction<T extends (JSONValue | ExpressionNode)[], U> = (resolvedArgs: T) => U;
|
|
184
|
+
interface FunctionSignature {
|
|
185
|
+
_func: RuntimeFunction<any, JSONValue>;
|
|
186
|
+
_signature: InputSignature[];
|
|
187
|
+
}
|
|
188
|
+
interface FunctionTable {
|
|
189
|
+
[functionName: string]: FunctionSignature;
|
|
190
|
+
}
|
|
191
|
+
type BuiltInFunctionNames = 'abs' | 'avg' | 'ceil' | 'contains' | 'ends_with' | 'find_first' | 'find_last' | 'floor' | 'from_items' | 'group_by' | 'items' | 'join' | 'keys' | 'length' | 'lower' | 'map' | 'max' | 'max_by' | 'merge' | 'min' | 'min_by' | 'not_null' | 'pad_left' | 'pad_right' | 'replace' | 'reverse' | 'sort' | 'sort_by' | 'split' | 'starts_with' | 'sum' | 'to_array' | 'to_number' | 'to_string' | 'type' | 'upper' | 'values' | 'zip';
|
|
192
|
+
interface RegisterOptions {
|
|
193
|
+
/**
|
|
194
|
+
* Allow overriding existing functions. Default: false
|
|
195
|
+
* When true, replaces existing function without error
|
|
196
|
+
* When false, throws error if function already exists (backward compatible)
|
|
197
|
+
*/
|
|
198
|
+
override?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Emit warning when overriding existing functions. Default: false
|
|
201
|
+
* Only applies when override is true
|
|
202
|
+
*/
|
|
203
|
+
warn?: boolean;
|
|
204
|
+
}
|
|
205
|
+
type RegistrationResult = {
|
|
206
|
+
success: true;
|
|
207
|
+
message?: string;
|
|
208
|
+
} | {
|
|
209
|
+
success: false;
|
|
210
|
+
reason: 'already-exists' | 'invalid-signature' | 'invalid-name';
|
|
211
|
+
message: string;
|
|
212
|
+
};
|
|
213
|
+
interface FunctionRegistry {
|
|
214
|
+
/**
|
|
215
|
+
* Register a new function with optional override behavior
|
|
216
|
+
*/
|
|
217
|
+
register<T extends string>(name: T extends BuiltInFunctionNames ? never : T, func: RuntimeFunction<(JSONValue | ExpressionNode)[], JSONValue>, signature: InputSignature[], options?: RegisterOptions): RegistrationResult;
|
|
218
|
+
/**
|
|
219
|
+
* Unregister a custom function (built-in functions cannot be unregistered)
|
|
220
|
+
*/
|
|
221
|
+
unregister<T extends string>(name: T extends BuiltInFunctionNames ? never : T): boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Check if a function is registered
|
|
224
|
+
*/
|
|
225
|
+
isRegistered(name: string): boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Get list of all registered function names
|
|
228
|
+
*/
|
|
229
|
+
getRegistered(): string[];
|
|
230
|
+
/**
|
|
231
|
+
* Get list of custom (non-built-in) function names
|
|
232
|
+
*/
|
|
233
|
+
getCustomFunctions(): string[];
|
|
234
|
+
/**
|
|
235
|
+
* Clear all custom functions (built-in functions remain)
|
|
236
|
+
*/
|
|
237
|
+
clearCustomFunctions(): void;
|
|
238
|
+
}
|
|
239
|
+
declare class Runtime implements FunctionRegistry {
|
|
240
|
+
_interpreter: TreeInterpreter$1;
|
|
241
|
+
_functionTable: FunctionTable;
|
|
242
|
+
private _customFunctions;
|
|
243
|
+
TYPE_NAME_TABLE: Readonly<{
|
|
244
|
+
readonly 0: "number";
|
|
245
|
+
readonly 1: "any";
|
|
246
|
+
readonly 2: "string";
|
|
247
|
+
readonly 3: "array";
|
|
248
|
+
readonly 4: "object";
|
|
249
|
+
readonly 5: "boolean";
|
|
250
|
+
readonly 6: "expression";
|
|
251
|
+
readonly 7: "null";
|
|
252
|
+
readonly 8: "Array<number>";
|
|
253
|
+
readonly 10: "Array<object>";
|
|
254
|
+
readonly 9: "Array<string>";
|
|
255
|
+
readonly 11: "Array<Array<any>>";
|
|
256
|
+
}>;
|
|
257
|
+
constructor(interpreter: TreeInterpreter$1);
|
|
258
|
+
private buildFunctionTable;
|
|
259
|
+
/**
|
|
260
|
+
* Enhanced registerFunction with backward compatibility and new options
|
|
261
|
+
* @deprecated Use register() method for enhanced functionality
|
|
262
|
+
*/
|
|
263
|
+
registerFunction(name: string, customFunction: RuntimeFunction<(JSONValue | ExpressionNode)[], JSONValue>, signature: InputSignature[], options?: RegisterOptions): void;
|
|
264
|
+
/**
|
|
265
|
+
* Internal registration method that bypasses TypeScript type checking
|
|
266
|
+
*/
|
|
267
|
+
private _registerInternal;
|
|
268
|
+
/**
|
|
269
|
+
* Register a new function with enhanced options and type safety
|
|
270
|
+
*/
|
|
271
|
+
register<T extends string>(name: T extends BuiltInFunctionNames ? never : T, customFunction: RuntimeFunction<(JSONValue | ExpressionNode)[], JSONValue>, signature: InputSignature[], options?: RegisterOptions): RegistrationResult;
|
|
272
|
+
/**
|
|
273
|
+
* Unregister a custom function (built-in functions cannot be unregistered)
|
|
274
|
+
*/
|
|
275
|
+
unregister<T extends string>(name: T extends BuiltInFunctionNames ? never : T): boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Check if a function is registered
|
|
278
|
+
*/
|
|
279
|
+
isRegistered(name: string): boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Get list of all registered function names
|
|
282
|
+
*/
|
|
283
|
+
getRegistered(): string[];
|
|
284
|
+
/**
|
|
285
|
+
* Get list of custom (non-built-in) function names
|
|
286
|
+
*/
|
|
287
|
+
getCustomFunctions(): string[];
|
|
288
|
+
/**
|
|
289
|
+
* Clear all custom functions (built-in functions remain)
|
|
290
|
+
*/
|
|
291
|
+
clearCustomFunctions(): void;
|
|
292
|
+
callFunction(name: string, resolvedArgs: (JSONValue | ExpressionNode)[]): JSONValue;
|
|
293
|
+
private validateInputSignatures;
|
|
294
|
+
private validateArgs;
|
|
295
|
+
private validateArity;
|
|
296
|
+
private validateTypes;
|
|
297
|
+
private typeMatches;
|
|
298
|
+
private getTypeName;
|
|
299
|
+
createKeyFunction(exprefNode: ExpressionNode, allowedTypes: InputArgument[]): (x: JSONValue) => JSONValue;
|
|
300
|
+
private functionAvg;
|
|
301
|
+
private functionContains;
|
|
302
|
+
private functionEndsWith;
|
|
303
|
+
private functionFindFirst;
|
|
304
|
+
private functionFindLast;
|
|
305
|
+
private createFindFunction;
|
|
306
|
+
private functionFromItems;
|
|
307
|
+
private functionGroupBy;
|
|
308
|
+
private functionItems;
|
|
309
|
+
private functionJoin;
|
|
310
|
+
private functionLength;
|
|
311
|
+
private functionMap;
|
|
312
|
+
private functionMax;
|
|
313
|
+
private functionMaxBy;
|
|
314
|
+
private functionMerge;
|
|
315
|
+
private functionMin;
|
|
316
|
+
private functionMinBy;
|
|
317
|
+
private functionNotNull;
|
|
318
|
+
private functionPadLeft;
|
|
319
|
+
private functionPadRight;
|
|
320
|
+
private createPadFunction;
|
|
321
|
+
private functionReplace;
|
|
322
|
+
private functionSplit;
|
|
323
|
+
private functionReverse;
|
|
324
|
+
private functionSort;
|
|
325
|
+
private functionSortBy;
|
|
326
|
+
private functionStartsWith;
|
|
327
|
+
private functionSum;
|
|
328
|
+
private functionToArray;
|
|
329
|
+
private functionToNumber;
|
|
330
|
+
private functionToString;
|
|
331
|
+
private functionTrim;
|
|
332
|
+
private functionTrimLeft;
|
|
333
|
+
private functionTrimRight;
|
|
334
|
+
private createTrimFunction;
|
|
335
|
+
private functionType;
|
|
336
|
+
private functionZip;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
declare class TreeInterpreter$1 {
|
|
340
|
+
runtime: Runtime;
|
|
341
|
+
private _rootValue;
|
|
342
|
+
private _scope;
|
|
343
|
+
constructor();
|
|
344
|
+
withScope(scope: ScopeEntry): TreeInterpreter$1;
|
|
345
|
+
search(node: ExpressionNode, value: JSONValue): JSONValue;
|
|
346
|
+
visit(node: ExpressionNode, value: JSONValue | ExpressionNode): JSONValue | ExpressionNode | ExpressionReference;
|
|
347
|
+
computeSliceParams(arrayLength: number, sliceNode: SliceNode): {
|
|
348
|
+
start: number;
|
|
349
|
+
stop: number;
|
|
350
|
+
step: number;
|
|
351
|
+
};
|
|
352
|
+
capSliceRange(arrayLength: number, actualValue: number, step: number): number;
|
|
353
|
+
slice(collection: JSONArray, start: number, end: number, step: number): JSONArray;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
declare class ScopeChain {
|
|
357
|
+
private inner?;
|
|
358
|
+
private data;
|
|
359
|
+
get currentScopeData(): JSONObject;
|
|
360
|
+
withScope(data: JSONObject): ScopeChain;
|
|
361
|
+
getValue(identifier: string): JSONValue;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
declare const TYPE_ANY = InputArgument.TYPE_ANY;
|
|
365
|
+
declare const TYPE_ARRAY = InputArgument.TYPE_ARRAY;
|
|
366
|
+
declare const TYPE_ARRAY_ARRAY = InputArgument.TYPE_ARRAY_ARRAY;
|
|
367
|
+
declare const TYPE_ARRAY_NUMBER = InputArgument.TYPE_ARRAY_NUMBER;
|
|
368
|
+
declare const TYPE_ARRAY_OBJECT = InputArgument.TYPE_ARRAY_OBJECT;
|
|
369
|
+
declare const TYPE_ARRAY_STRING = InputArgument.TYPE_ARRAY_STRING;
|
|
370
|
+
declare const TYPE_BOOLEAN = InputArgument.TYPE_BOOLEAN;
|
|
371
|
+
declare const TYPE_EXPREF = InputArgument.TYPE_EXPREF;
|
|
372
|
+
declare const TYPE_NULL = InputArgument.TYPE_NULL;
|
|
373
|
+
declare const TYPE_NUMBER = InputArgument.TYPE_NUMBER;
|
|
374
|
+
declare const TYPE_OBJECT = InputArgument.TYPE_OBJECT;
|
|
375
|
+
declare const TYPE_STRING = InputArgument.TYPE_STRING;
|
|
376
|
+
declare function compile(expression: string, options?: Options): ExpressionNode;
|
|
377
|
+
declare function tokenize(expression: string, options?: LexerOptions): LexerToken[];
|
|
378
|
+
declare const registerFunction: (functionName: string, customFunction: RuntimeFunction<(JSONValue | ExpressionNode)[], JSONValue>, signature: InputSignature[], options?: RegisterOptions) => void;
|
|
379
|
+
declare const register: <T extends string>(name: T extends BuiltInFunctionNames ? never : T, customFunction: RuntimeFunction<(JSONValue | ExpressionNode)[], JSONValue>, signature: InputSignature[], options?: RegisterOptions) => RegistrationResult;
|
|
380
|
+
declare const unregisterFunction: <T extends string>(name: T extends BuiltInFunctionNames ? never : T) => boolean;
|
|
381
|
+
declare const isRegistered: (name: string) => boolean;
|
|
382
|
+
declare const getRegisteredFunctions: () => string[];
|
|
383
|
+
declare const getCustomFunctions: () => string[];
|
|
384
|
+
declare const clearCustomFunctions: () => void;
|
|
385
|
+
declare function search(data: JSONValue, expression: string, options?: Options): JSONValue;
|
|
386
|
+
declare function Scope(): ScopeChain;
|
|
387
|
+
declare const TreeInterpreter: TreeInterpreter$1;
|
|
388
|
+
declare const jmespath: {
|
|
389
|
+
compile: typeof compile;
|
|
390
|
+
registerFunction: (functionName: string, customFunction: RuntimeFunction<(JSONValue | ExpressionNode)[], JSONValue>, signature: InputSignature[], options?: RegisterOptions) => void;
|
|
391
|
+
register: <T extends string>(name: T extends BuiltInFunctionNames ? never : T, customFunction: RuntimeFunction<(JSONValue | ExpressionNode)[], JSONValue>, signature: InputSignature[], options?: RegisterOptions) => RegistrationResult;
|
|
392
|
+
unregisterFunction: <T extends string>(name: T extends BuiltInFunctionNames ? never : T) => boolean;
|
|
393
|
+
isRegistered: (name: string) => boolean;
|
|
394
|
+
getRegisteredFunctions: () => string[];
|
|
395
|
+
getCustomFunctions: () => string[];
|
|
396
|
+
clearCustomFunctions: () => void;
|
|
397
|
+
search: typeof search;
|
|
398
|
+
tokenize: typeof tokenize;
|
|
399
|
+
TreeInterpreter: TreeInterpreter$1;
|
|
400
|
+
TYPE_ANY: InputArgument;
|
|
401
|
+
TYPE_ARRAY_NUMBER: InputArgument;
|
|
402
|
+
TYPE_ARRAY_STRING: InputArgument;
|
|
403
|
+
TYPE_ARRAY: InputArgument;
|
|
404
|
+
TYPE_BOOLEAN: InputArgument;
|
|
405
|
+
TYPE_EXPREF: InputArgument;
|
|
406
|
+
TYPE_NULL: InputArgument;
|
|
407
|
+
TYPE_NUMBER: InputArgument;
|
|
408
|
+
TYPE_OBJECT: InputArgument;
|
|
409
|
+
TYPE_STRING: InputArgument;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
export { type BuiltInFunctionNames, type FunctionRegistry, type FunctionSignature, type InputSignature, type JSONArray, type JSONObject, type JSONPrimitive, type JSONValue, type Options, type RegisterOptions, type RegistrationResult, type RuntimeFunction, Scope, TYPE_ANY, TYPE_ARRAY, TYPE_ARRAY_ARRAY, TYPE_ARRAY_NUMBER, TYPE_ARRAY_OBJECT, TYPE_ARRAY_STRING, TYPE_BOOLEAN, TYPE_EXPREF, TYPE_NULL, TYPE_NUMBER, TYPE_OBJECT, TYPE_STRING, TreeInterpreter, clearCustomFunctions, compile, jmespath as default, getCustomFunctions, getRegisteredFunctions, isRegistered, jmespath, register, registerFunction, search, tokenize, unregisterFunction };
|