@gabrielbryk/jq-ts 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/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/index.cjs +2040 -0
- package/dist/index.d.cts +324 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +324 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2031 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +102 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
//#region src/span.d.ts
|
|
2
|
+
interface Span {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/ast.d.ts
|
|
8
|
+
type LiteralValue = null | boolean | number | string;
|
|
9
|
+
interface IdentityNode {
|
|
10
|
+
kind: 'Identity';
|
|
11
|
+
span: Span;
|
|
12
|
+
}
|
|
13
|
+
interface LiteralNode {
|
|
14
|
+
kind: 'Literal';
|
|
15
|
+
value: LiteralValue;
|
|
16
|
+
span: Span;
|
|
17
|
+
}
|
|
18
|
+
interface VarNode {
|
|
19
|
+
kind: 'Var';
|
|
20
|
+
name: string;
|
|
21
|
+
span: Span;
|
|
22
|
+
}
|
|
23
|
+
interface FieldAccessNode {
|
|
24
|
+
kind: 'FieldAccess';
|
|
25
|
+
target: FilterNode;
|
|
26
|
+
field: string;
|
|
27
|
+
span: Span;
|
|
28
|
+
}
|
|
29
|
+
interface IndexAccessNode {
|
|
30
|
+
kind: 'IndexAccess';
|
|
31
|
+
target: FilterNode;
|
|
32
|
+
index: FilterNode;
|
|
33
|
+
span: Span;
|
|
34
|
+
}
|
|
35
|
+
interface IterateNode {
|
|
36
|
+
kind: 'Iterate';
|
|
37
|
+
target: FilterNode;
|
|
38
|
+
span: Span;
|
|
39
|
+
}
|
|
40
|
+
interface ArrayNode {
|
|
41
|
+
kind: 'Array';
|
|
42
|
+
items: FilterNode[];
|
|
43
|
+
span: Span;
|
|
44
|
+
}
|
|
45
|
+
interface ObjectEntry {
|
|
46
|
+
key: ObjectKey;
|
|
47
|
+
value: FilterNode;
|
|
48
|
+
}
|
|
49
|
+
interface ObjectNode {
|
|
50
|
+
kind: 'Object';
|
|
51
|
+
entries: ObjectEntry[];
|
|
52
|
+
span: Span;
|
|
53
|
+
}
|
|
54
|
+
type ObjectKey = {
|
|
55
|
+
kind: 'KeyIdentifier';
|
|
56
|
+
name: string;
|
|
57
|
+
span: Span;
|
|
58
|
+
} | {
|
|
59
|
+
kind: 'KeyString';
|
|
60
|
+
value: string;
|
|
61
|
+
span: Span;
|
|
62
|
+
} | {
|
|
63
|
+
kind: 'KeyExpr';
|
|
64
|
+
expr: FilterNode;
|
|
65
|
+
span: Span;
|
|
66
|
+
};
|
|
67
|
+
interface PipeNode {
|
|
68
|
+
kind: 'Pipe';
|
|
69
|
+
left: FilterNode;
|
|
70
|
+
right: FilterNode;
|
|
71
|
+
span: Span;
|
|
72
|
+
}
|
|
73
|
+
interface CommaNode {
|
|
74
|
+
kind: 'Comma';
|
|
75
|
+
left: FilterNode;
|
|
76
|
+
right: FilterNode;
|
|
77
|
+
span: Span;
|
|
78
|
+
}
|
|
79
|
+
interface AltNode {
|
|
80
|
+
kind: 'Alt';
|
|
81
|
+
left: FilterNode;
|
|
82
|
+
right: FilterNode;
|
|
83
|
+
span: Span;
|
|
84
|
+
}
|
|
85
|
+
interface UnaryNode {
|
|
86
|
+
kind: 'Unary';
|
|
87
|
+
op: 'Neg' | 'Not';
|
|
88
|
+
expr: FilterNode;
|
|
89
|
+
span: Span;
|
|
90
|
+
}
|
|
91
|
+
interface BinaryNode {
|
|
92
|
+
kind: 'Binary';
|
|
93
|
+
op: '+' | '-' | '*' | '/' | '%' | 'Eq' | 'Neq' | 'Lt' | 'Lte' | 'Gt' | 'Gte';
|
|
94
|
+
left: FilterNode;
|
|
95
|
+
right: FilterNode;
|
|
96
|
+
span: Span;
|
|
97
|
+
}
|
|
98
|
+
interface BoolNode {
|
|
99
|
+
kind: 'Bool';
|
|
100
|
+
op: 'And' | 'Or';
|
|
101
|
+
left: FilterNode;
|
|
102
|
+
right: FilterNode;
|
|
103
|
+
span: Span;
|
|
104
|
+
}
|
|
105
|
+
interface IfBranch {
|
|
106
|
+
cond: FilterNode;
|
|
107
|
+
then: FilterNode;
|
|
108
|
+
}
|
|
109
|
+
interface IfNode {
|
|
110
|
+
kind: 'If';
|
|
111
|
+
branches: IfBranch[];
|
|
112
|
+
else: FilterNode;
|
|
113
|
+
span: Span;
|
|
114
|
+
}
|
|
115
|
+
interface AsNode {
|
|
116
|
+
kind: 'As';
|
|
117
|
+
bind: FilterNode;
|
|
118
|
+
name: string;
|
|
119
|
+
body: FilterNode;
|
|
120
|
+
span: Span;
|
|
121
|
+
}
|
|
122
|
+
interface CallNode {
|
|
123
|
+
kind: 'Call';
|
|
124
|
+
name: string;
|
|
125
|
+
args: FilterNode[];
|
|
126
|
+
span: Span;
|
|
127
|
+
}
|
|
128
|
+
interface ReduceNode {
|
|
129
|
+
kind: 'Reduce';
|
|
130
|
+
source: FilterNode;
|
|
131
|
+
var: string;
|
|
132
|
+
init: FilterNode;
|
|
133
|
+
update: FilterNode;
|
|
134
|
+
span: Span;
|
|
135
|
+
}
|
|
136
|
+
interface ForeachNode {
|
|
137
|
+
kind: 'Foreach';
|
|
138
|
+
source: FilterNode;
|
|
139
|
+
var: string;
|
|
140
|
+
init: FilterNode;
|
|
141
|
+
update: FilterNode;
|
|
142
|
+
extract?: FilterNode;
|
|
143
|
+
span: Span;
|
|
144
|
+
}
|
|
145
|
+
interface TryNode {
|
|
146
|
+
kind: 'Try';
|
|
147
|
+
body: FilterNode;
|
|
148
|
+
handler?: FilterNode;
|
|
149
|
+
span: Span;
|
|
150
|
+
}
|
|
151
|
+
interface RecurseNode {
|
|
152
|
+
kind: 'Recurse';
|
|
153
|
+
span: Span;
|
|
154
|
+
}
|
|
155
|
+
type FilterNode = IdentityNode | LiteralNode | VarNode | FieldAccessNode | IndexAccessNode | IterateNode | ArrayNode | ObjectNode | PipeNode | CommaNode | AltNode | UnaryNode | BinaryNode | BoolNode | IfNode | AsNode | CallNode | ReduceNode | ForeachNode | TryNode | RecurseNode;
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/parser.d.ts
|
|
158
|
+
/**
|
|
159
|
+
* Parses a jq source string into an Abstract Syntax Tree (AST).
|
|
160
|
+
*
|
|
161
|
+
* @param source - The input jq query string.
|
|
162
|
+
* @returns The root {@link FilterNode} of the AST.
|
|
163
|
+
* @throws {LexError} If the source contains invalid characters.
|
|
164
|
+
* @throws {ParseError} If the syntax is invalid.
|
|
165
|
+
*/
|
|
166
|
+
declare const parse: (source: string) => FilterNode;
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/validate.d.ts
|
|
169
|
+
/**
|
|
170
|
+
* Validates the AST for correctness and supported features.
|
|
171
|
+
* Checks for unknown function calls and arity mismatches.
|
|
172
|
+
*
|
|
173
|
+
* @param node - The root AST node to validate.
|
|
174
|
+
* @throws {ValidationError} If validation fails.
|
|
175
|
+
*/
|
|
176
|
+
declare const validate: (node: FilterNode) => void;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/limits.d.ts
|
|
179
|
+
/**
|
|
180
|
+
* Configuration options for execution limits.
|
|
181
|
+
* All fields are optional and default to safe values if strictly undefined.
|
|
182
|
+
*/
|
|
183
|
+
interface LimitsConfig {
|
|
184
|
+
/** Maximum number of AST nodes to visit during execution. Default: 100,000. */
|
|
185
|
+
maxSteps?: number;
|
|
186
|
+
/** Maximum recursion depth for execution and parsing. Default: 200. */
|
|
187
|
+
maxDepth?: number;
|
|
188
|
+
/** Maximum number of values to yield from a single output emitter. Default: 10,000. */
|
|
189
|
+
maxOutputs?: number;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Fully resolved limits with defaults applied.
|
|
193
|
+
*/
|
|
194
|
+
interface ResolvedLimits {
|
|
195
|
+
maxSteps: number;
|
|
196
|
+
maxDepth: number;
|
|
197
|
+
maxOutputs: number;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Resolves a partial limits configuration into a complete one with defaults.
|
|
201
|
+
*
|
|
202
|
+
* @param config - The user-provided configuration.
|
|
203
|
+
* @returns The resolved limits.
|
|
204
|
+
*/
|
|
205
|
+
declare const resolveLimits: (config?: LimitsConfig) => ResolvedLimits;
|
|
206
|
+
/**
|
|
207
|
+
* Tracks execution usage against defined limits.
|
|
208
|
+
* Throws {@link RuntimeError} if any limit is exceeded.
|
|
209
|
+
*/
|
|
210
|
+
declare class LimitTracker {
|
|
211
|
+
private readonly limits;
|
|
212
|
+
private steps;
|
|
213
|
+
private depth;
|
|
214
|
+
private outputs;
|
|
215
|
+
constructor(limits: ResolvedLimits);
|
|
216
|
+
/**
|
|
217
|
+
* Records a single execution step (AST node visit).
|
|
218
|
+
* @param span - The source span for error reporting.
|
|
219
|
+
*/
|
|
220
|
+
step(span: Span): void;
|
|
221
|
+
/**
|
|
222
|
+
* Enters a new scope/stack frame, incrementing the depth counter.
|
|
223
|
+
* @param span - The source span for error reporting.
|
|
224
|
+
*/
|
|
225
|
+
enter(span: Span): void;
|
|
226
|
+
/**
|
|
227
|
+
* Exits the current scope, decrementing the depth counter.
|
|
228
|
+
*/
|
|
229
|
+
exit(): void;
|
|
230
|
+
/**
|
|
231
|
+
* Records an output value being emitted.
|
|
232
|
+
* @param span - The source span for error reporting.
|
|
233
|
+
*/
|
|
234
|
+
emit(span: Span): void;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/value.d.ts
|
|
238
|
+
/**
|
|
239
|
+
* Represents any valid JSON value supported by the jq-ts runtime.
|
|
240
|
+
* This is a recursive type definition that matches the structure of JSON data.
|
|
241
|
+
*/
|
|
242
|
+
type Value = null | boolean | number | string | ValueArray | ValueObject;
|
|
243
|
+
/**
|
|
244
|
+
* Represents a JSON array containing {@link Value} items.
|
|
245
|
+
*/
|
|
246
|
+
interface ValueArray extends Array<Value> {}
|
|
247
|
+
/**
|
|
248
|
+
* Represents a JSON object with string keys and {@link Value} values.
|
|
249
|
+
*/
|
|
250
|
+
interface ValueObject {
|
|
251
|
+
[key: string]: Value;
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/eval.d.ts
|
|
255
|
+
interface EvalOptions {
|
|
256
|
+
limits?: LimitsConfig;
|
|
257
|
+
}
|
|
258
|
+
declare const runAst: (ast: FilterNode, input: Value, options?: EvalOptions) => Value[];
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/errors.d.ts
|
|
261
|
+
/**
|
|
262
|
+
* Categories of errors that can occur during processing.
|
|
263
|
+
* - `lex`: Errors during lexical analysis (invalid characters).
|
|
264
|
+
* - `parse`: Errors during parsing (syntax errors).
|
|
265
|
+
* - `validate`: Errors during semantics checking (unsupported features).
|
|
266
|
+
* - `runtime`: Errors during execution (type errors, limits).
|
|
267
|
+
*/
|
|
268
|
+
type ErrorKind = 'lex' | 'parse' | 'validate' | 'runtime';
|
|
269
|
+
/**
|
|
270
|
+
* Common interface for all errors thrown by the jq-ts library.
|
|
271
|
+
*/
|
|
272
|
+
interface JqTsError extends Error {
|
|
273
|
+
/** The category of the error. */
|
|
274
|
+
kind: ErrorKind;
|
|
275
|
+
/** The source code span where the error occurred. */
|
|
276
|
+
span: Span;
|
|
277
|
+
}
|
|
278
|
+
declare class BaseError extends Error implements JqTsError {
|
|
279
|
+
kind: ErrorKind;
|
|
280
|
+
span: Span;
|
|
281
|
+
constructor(kind: ErrorKind, message: string, span: Span);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Thrown when the lexer encounters invalid input characters.
|
|
285
|
+
*/
|
|
286
|
+
declare class LexError extends BaseError {
|
|
287
|
+
constructor(message: string, span: Span);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Thrown when the parser encounters invalid syntax.
|
|
291
|
+
*/
|
|
292
|
+
declare class ParseError extends BaseError {
|
|
293
|
+
constructor(message: string, span: Span);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Thrown when the AST contains unsupported or invalid features (e.g., restricted operators).
|
|
297
|
+
*/
|
|
298
|
+
declare class ValidationError extends BaseError {
|
|
299
|
+
constructor(message: string, span: Span);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Thrown during execution for runtime issues (type errors, limits exceeded, user-raised errors).
|
|
303
|
+
*/
|
|
304
|
+
declare class RuntimeError extends BaseError {
|
|
305
|
+
constructor(message: string, span: Span);
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/index.d.ts
|
|
309
|
+
/**
|
|
310
|
+
* Runs a jq query against a JSON input.
|
|
311
|
+
*
|
|
312
|
+
* @param source - The jq query string (e.g., `.foo | .bar`).
|
|
313
|
+
* @param input - The JSON input value (object, array, string, number, boolean, or null).
|
|
314
|
+
* @param options - Execution options including limits.
|
|
315
|
+
* @returns An array of results. jq queries always produce zero or more values.
|
|
316
|
+
* @throws {LexError} If the query contains invalid characters.
|
|
317
|
+
* @throws {ParseError} If the query syntax is invalid.
|
|
318
|
+
* @throws {ValidationError} If the query uses unsupported features.
|
|
319
|
+
* @throws {RuntimeError} If execution fails (e.g., type error) or exceeds limits.
|
|
320
|
+
*/
|
|
321
|
+
declare const run: (source: string, input: Value, options?: EvalOptions) => Value[];
|
|
322
|
+
//#endregion
|
|
323
|
+
export { type EvalOptions, LexError, LimitTracker, type LimitsConfig, ParseError, type ResolvedLimits, RuntimeError, ValidationError, type Value, parse, resolveLimits, run, runAst, validate };
|
|
324
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/span.ts","../src/ast.ts","../src/parser.ts","../src/validate.ts","../src/limits.ts","../src/value.ts","../src/eval.ts","../src/errors.ts","../src/index.ts"],"sourcesContent":[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|
+
end: number;
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/ast.d.ts
|
|
8
|
+
type LiteralValue = null | boolean | number | string;
|
|
9
|
+
interface IdentityNode {
|
|
10
|
+
kind: 'Identity';
|
|
11
|
+
span: Span;
|
|
12
|
+
}
|
|
13
|
+
interface LiteralNode {
|
|
14
|
+
kind: 'Literal';
|
|
15
|
+
value: LiteralValue;
|
|
16
|
+
span: Span;
|
|
17
|
+
}
|
|
18
|
+
interface VarNode {
|
|
19
|
+
kind: 'Var';
|
|
20
|
+
name: string;
|
|
21
|
+
span: Span;
|
|
22
|
+
}
|
|
23
|
+
interface FieldAccessNode {
|
|
24
|
+
kind: 'FieldAccess';
|
|
25
|
+
target: FilterNode;
|
|
26
|
+
field: string;
|
|
27
|
+
span: Span;
|
|
28
|
+
}
|
|
29
|
+
interface IndexAccessNode {
|
|
30
|
+
kind: 'IndexAccess';
|
|
31
|
+
target: FilterNode;
|
|
32
|
+
index: FilterNode;
|
|
33
|
+
span: Span;
|
|
34
|
+
}
|
|
35
|
+
interface IterateNode {
|
|
36
|
+
kind: 'Iterate';
|
|
37
|
+
target: FilterNode;
|
|
38
|
+
span: Span;
|
|
39
|
+
}
|
|
40
|
+
interface ArrayNode {
|
|
41
|
+
kind: 'Array';
|
|
42
|
+
items: FilterNode[];
|
|
43
|
+
span: Span;
|
|
44
|
+
}
|
|
45
|
+
interface ObjectEntry {
|
|
46
|
+
key: ObjectKey;
|
|
47
|
+
value: FilterNode;
|
|
48
|
+
}
|
|
49
|
+
interface ObjectNode {
|
|
50
|
+
kind: 'Object';
|
|
51
|
+
entries: ObjectEntry[];
|
|
52
|
+
span: Span;
|
|
53
|
+
}
|
|
54
|
+
type ObjectKey = {
|
|
55
|
+
kind: 'KeyIdentifier';
|
|
56
|
+
name: string;
|
|
57
|
+
span: Span;
|
|
58
|
+
} | {
|
|
59
|
+
kind: 'KeyString';
|
|
60
|
+
value: string;
|
|
61
|
+
span: Span;
|
|
62
|
+
} | {
|
|
63
|
+
kind: 'KeyExpr';
|
|
64
|
+
expr: FilterNode;
|
|
65
|
+
span: Span;
|
|
66
|
+
};
|
|
67
|
+
interface PipeNode {
|
|
68
|
+
kind: 'Pipe';
|
|
69
|
+
left: FilterNode;
|
|
70
|
+
right: FilterNode;
|
|
71
|
+
span: Span;
|
|
72
|
+
}
|
|
73
|
+
interface CommaNode {
|
|
74
|
+
kind: 'Comma';
|
|
75
|
+
left: FilterNode;
|
|
76
|
+
right: FilterNode;
|
|
77
|
+
span: Span;
|
|
78
|
+
}
|
|
79
|
+
interface AltNode {
|
|
80
|
+
kind: 'Alt';
|
|
81
|
+
left: FilterNode;
|
|
82
|
+
right: FilterNode;
|
|
83
|
+
span: Span;
|
|
84
|
+
}
|
|
85
|
+
interface UnaryNode {
|
|
86
|
+
kind: 'Unary';
|
|
87
|
+
op: 'Neg' | 'Not';
|
|
88
|
+
expr: FilterNode;
|
|
89
|
+
span: Span;
|
|
90
|
+
}
|
|
91
|
+
interface BinaryNode {
|
|
92
|
+
kind: 'Binary';
|
|
93
|
+
op: '+' | '-' | '*' | '/' | '%' | 'Eq' | 'Neq' | 'Lt' | 'Lte' | 'Gt' | 'Gte';
|
|
94
|
+
left: FilterNode;
|
|
95
|
+
right: FilterNode;
|
|
96
|
+
span: Span;
|
|
97
|
+
}
|
|
98
|
+
interface BoolNode {
|
|
99
|
+
kind: 'Bool';
|
|
100
|
+
op: 'And' | 'Or';
|
|
101
|
+
left: FilterNode;
|
|
102
|
+
right: FilterNode;
|
|
103
|
+
span: Span;
|
|
104
|
+
}
|
|
105
|
+
interface IfBranch {
|
|
106
|
+
cond: FilterNode;
|
|
107
|
+
then: FilterNode;
|
|
108
|
+
}
|
|
109
|
+
interface IfNode {
|
|
110
|
+
kind: 'If';
|
|
111
|
+
branches: IfBranch[];
|
|
112
|
+
else: FilterNode;
|
|
113
|
+
span: Span;
|
|
114
|
+
}
|
|
115
|
+
interface AsNode {
|
|
116
|
+
kind: 'As';
|
|
117
|
+
bind: FilterNode;
|
|
118
|
+
name: string;
|
|
119
|
+
body: FilterNode;
|
|
120
|
+
span: Span;
|
|
121
|
+
}
|
|
122
|
+
interface CallNode {
|
|
123
|
+
kind: 'Call';
|
|
124
|
+
name: string;
|
|
125
|
+
args: FilterNode[];
|
|
126
|
+
span: Span;
|
|
127
|
+
}
|
|
128
|
+
interface ReduceNode {
|
|
129
|
+
kind: 'Reduce';
|
|
130
|
+
source: FilterNode;
|
|
131
|
+
var: string;
|
|
132
|
+
init: FilterNode;
|
|
133
|
+
update: FilterNode;
|
|
134
|
+
span: Span;
|
|
135
|
+
}
|
|
136
|
+
interface ForeachNode {
|
|
137
|
+
kind: 'Foreach';
|
|
138
|
+
source: FilterNode;
|
|
139
|
+
var: string;
|
|
140
|
+
init: FilterNode;
|
|
141
|
+
update: FilterNode;
|
|
142
|
+
extract?: FilterNode;
|
|
143
|
+
span: Span;
|
|
144
|
+
}
|
|
145
|
+
interface TryNode {
|
|
146
|
+
kind: 'Try';
|
|
147
|
+
body: FilterNode;
|
|
148
|
+
handler?: FilterNode;
|
|
149
|
+
span: Span;
|
|
150
|
+
}
|
|
151
|
+
interface RecurseNode {
|
|
152
|
+
kind: 'Recurse';
|
|
153
|
+
span: Span;
|
|
154
|
+
}
|
|
155
|
+
type FilterNode = IdentityNode | LiteralNode | VarNode | FieldAccessNode | IndexAccessNode | IterateNode | ArrayNode | ObjectNode | PipeNode | CommaNode | AltNode | UnaryNode | BinaryNode | BoolNode | IfNode | AsNode | CallNode | ReduceNode | ForeachNode | TryNode | RecurseNode;
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/parser.d.ts
|
|
158
|
+
/**
|
|
159
|
+
* Parses a jq source string into an Abstract Syntax Tree (AST).
|
|
160
|
+
*
|
|
161
|
+
* @param source - The input jq query string.
|
|
162
|
+
* @returns The root {@link FilterNode} of the AST.
|
|
163
|
+
* @throws {LexError} If the source contains invalid characters.
|
|
164
|
+
* @throws {ParseError} If the syntax is invalid.
|
|
165
|
+
*/
|
|
166
|
+
declare const parse: (source: string) => FilterNode;
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/validate.d.ts
|
|
169
|
+
/**
|
|
170
|
+
* Validates the AST for correctness and supported features.
|
|
171
|
+
* Checks for unknown function calls and arity mismatches.
|
|
172
|
+
*
|
|
173
|
+
* @param node - The root AST node to validate.
|
|
174
|
+
* @throws {ValidationError} If validation fails.
|
|
175
|
+
*/
|
|
176
|
+
declare const validate: (node: FilterNode) => void;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/limits.d.ts
|
|
179
|
+
/**
|
|
180
|
+
* Configuration options for execution limits.
|
|
181
|
+
* All fields are optional and default to safe values if strictly undefined.
|
|
182
|
+
*/
|
|
183
|
+
interface LimitsConfig {
|
|
184
|
+
/** Maximum number of AST nodes to visit during execution. Default: 100,000. */
|
|
185
|
+
maxSteps?: number;
|
|
186
|
+
/** Maximum recursion depth for execution and parsing. Default: 200. */
|
|
187
|
+
maxDepth?: number;
|
|
188
|
+
/** Maximum number of values to yield from a single output emitter. Default: 10,000. */
|
|
189
|
+
maxOutputs?: number;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Fully resolved limits with defaults applied.
|
|
193
|
+
*/
|
|
194
|
+
interface ResolvedLimits {
|
|
195
|
+
maxSteps: number;
|
|
196
|
+
maxDepth: number;
|
|
197
|
+
maxOutputs: number;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Resolves a partial limits configuration into a complete one with defaults.
|
|
201
|
+
*
|
|
202
|
+
* @param config - The user-provided configuration.
|
|
203
|
+
* @returns The resolved limits.
|
|
204
|
+
*/
|
|
205
|
+
declare const resolveLimits: (config?: LimitsConfig) => ResolvedLimits;
|
|
206
|
+
/**
|
|
207
|
+
* Tracks execution usage against defined limits.
|
|
208
|
+
* Throws {@link RuntimeError} if any limit is exceeded.
|
|
209
|
+
*/
|
|
210
|
+
declare class LimitTracker {
|
|
211
|
+
private readonly limits;
|
|
212
|
+
private steps;
|
|
213
|
+
private depth;
|
|
214
|
+
private outputs;
|
|
215
|
+
constructor(limits: ResolvedLimits);
|
|
216
|
+
/**
|
|
217
|
+
* Records a single execution step (AST node visit).
|
|
218
|
+
* @param span - The source span for error reporting.
|
|
219
|
+
*/
|
|
220
|
+
step(span: Span): void;
|
|
221
|
+
/**
|
|
222
|
+
* Enters a new scope/stack frame, incrementing the depth counter.
|
|
223
|
+
* @param span - The source span for error reporting.
|
|
224
|
+
*/
|
|
225
|
+
enter(span: Span): void;
|
|
226
|
+
/**
|
|
227
|
+
* Exits the current scope, decrementing the depth counter.
|
|
228
|
+
*/
|
|
229
|
+
exit(): void;
|
|
230
|
+
/**
|
|
231
|
+
* Records an output value being emitted.
|
|
232
|
+
* @param span - The source span for error reporting.
|
|
233
|
+
*/
|
|
234
|
+
emit(span: Span): void;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/value.d.ts
|
|
238
|
+
/**
|
|
239
|
+
* Represents any valid JSON value supported by the jq-ts runtime.
|
|
240
|
+
* This is a recursive type definition that matches the structure of JSON data.
|
|
241
|
+
*/
|
|
242
|
+
type Value = null | boolean | number | string | ValueArray | ValueObject;
|
|
243
|
+
/**
|
|
244
|
+
* Represents a JSON array containing {@link Value} items.
|
|
245
|
+
*/
|
|
246
|
+
interface ValueArray extends Array<Value> {}
|
|
247
|
+
/**
|
|
248
|
+
* Represents a JSON object with string keys and {@link Value} values.
|
|
249
|
+
*/
|
|
250
|
+
interface ValueObject {
|
|
251
|
+
[key: string]: Value;
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/eval.d.ts
|
|
255
|
+
interface EvalOptions {
|
|
256
|
+
limits?: LimitsConfig;
|
|
257
|
+
}
|
|
258
|
+
declare const runAst: (ast: FilterNode, input: Value, options?: EvalOptions) => Value[];
|
|
259
|
+
//#endregion
|
|
260
|
+
//#region src/errors.d.ts
|
|
261
|
+
/**
|
|
262
|
+
* Categories of errors that can occur during processing.
|
|
263
|
+
* - `lex`: Errors during lexical analysis (invalid characters).
|
|
264
|
+
* - `parse`: Errors during parsing (syntax errors).
|
|
265
|
+
* - `validate`: Errors during semantics checking (unsupported features).
|
|
266
|
+
* - `runtime`: Errors during execution (type errors, limits).
|
|
267
|
+
*/
|
|
268
|
+
type ErrorKind = 'lex' | 'parse' | 'validate' | 'runtime';
|
|
269
|
+
/**
|
|
270
|
+
* Common interface for all errors thrown by the jq-ts library.
|
|
271
|
+
*/
|
|
272
|
+
interface JqTsError extends Error {
|
|
273
|
+
/** The category of the error. */
|
|
274
|
+
kind: ErrorKind;
|
|
275
|
+
/** The source code span where the error occurred. */
|
|
276
|
+
span: Span;
|
|
277
|
+
}
|
|
278
|
+
declare class BaseError extends Error implements JqTsError {
|
|
279
|
+
kind: ErrorKind;
|
|
280
|
+
span: Span;
|
|
281
|
+
constructor(kind: ErrorKind, message: string, span: Span);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Thrown when the lexer encounters invalid input characters.
|
|
285
|
+
*/
|
|
286
|
+
declare class LexError extends BaseError {
|
|
287
|
+
constructor(message: string, span: Span);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Thrown when the parser encounters invalid syntax.
|
|
291
|
+
*/
|
|
292
|
+
declare class ParseError extends BaseError {
|
|
293
|
+
constructor(message: string, span: Span);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Thrown when the AST contains unsupported or invalid features (e.g., restricted operators).
|
|
297
|
+
*/
|
|
298
|
+
declare class ValidationError extends BaseError {
|
|
299
|
+
constructor(message: string, span: Span);
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Thrown during execution for runtime issues (type errors, limits exceeded, user-raised errors).
|
|
303
|
+
*/
|
|
304
|
+
declare class RuntimeError extends BaseError {
|
|
305
|
+
constructor(message: string, span: Span);
|
|
306
|
+
}
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/index.d.ts
|
|
309
|
+
/**
|
|
310
|
+
* Runs a jq query against a JSON input.
|
|
311
|
+
*
|
|
312
|
+
* @param source - The jq query string (e.g., `.foo | .bar`).
|
|
313
|
+
* @param input - The JSON input value (object, array, string, number, boolean, or null).
|
|
314
|
+
* @param options - Execution options including limits.
|
|
315
|
+
* @returns An array of results. jq queries always produce zero or more values.
|
|
316
|
+
* @throws {LexError} If the query contains invalid characters.
|
|
317
|
+
* @throws {ParseError} If the query syntax is invalid.
|
|
318
|
+
* @throws {ValidationError} If the query uses unsupported features.
|
|
319
|
+
* @throws {RuntimeError} If execution fails (e.g., type error) or exceeds limits.
|
|
320
|
+
*/
|
|
321
|
+
declare const run: (source: string, input: Value, options?: EvalOptions) => Value[];
|
|
322
|
+
//#endregion
|
|
323
|
+
export { type EvalOptions, LexError, LimitTracker, type LimitsConfig, ParseError, type ResolvedLimits, RuntimeError, ValidationError, type Value, parse, resolveLimits, run, runAst, validate };
|
|
324
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/span.ts","../src/ast.ts","../src/parser.ts","../src/validate.ts","../src/limits.ts","../src/value.ts","../src/eval.ts","../src/errors.ts","../src/index.ts"],"sourcesContent":[],"mappings":";UAAiB,IAAA;EAAA,KAAA,EAAI,MAAA;;;;;AAAJ,KCEL,YAAA,GDFS,IAAA,GAAA,OAAA,GAAA,MAAA,GAAA,MAAA;UCIJ,YAAA;;QAET;AAJR;AAEiB,UAKA,WAAA,CALY;EAKZ,IAAA,EAAA,SAAW;EAMX,KAAA,EAJR,YAIe;EAMP,IAAA,EATT,IASS;AAOjB;AAEU,UAfO,OAAA,CAeP;EACD,IAAA,EAAA,KAAA;EACD,IAAA,EAAA,MAAA;EAAI,IAAA,EAdJ,IAcI;AAGZ;AAMiB,UApBA,eAAA,CAsBR;EAIQ,IAAA,EAAA,aAAW;EAKX,MAAA,EA7BP,UA6BiB;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