@jarenjs/json 0.9.2 → 0.34.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/ARCHITECTURE.md +86 -13
- package/README.md +248 -23
- package/dist/types/canonical.d.ts +37 -0
- package/dist/types/cow.d.ts +28 -0
- package/dist/types/errors.d.ts +45 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/jslt/errors.d.ts +15 -8
- package/dist/types/jslt/index.d.ts +22 -0
- package/dist/types/jslt/packs/finance.d.ts +119 -0
- package/dist/types/jslt/packs/index.d.ts +310 -0
- package/dist/types/jslt/packs/math.d.ts +159 -0
- package/dist/types/jslt/packs/stats.d.ts +48 -0
- package/dist/types/jslt/registry.d.ts +65 -0
- package/dist/types/jtlt/errors.d.ts +3 -6
- package/dist/types/option-variants.d.ts +29 -0
- package/dist/types/patch.d.ts +214 -0
- package/dist/types/path.d.ts +139 -9
- package/dist/types/pointer.d.ts +100 -9
- package/dist/types/query/compile.d.ts +12 -0
- package/dist/types/query/errors.d.ts +72 -8
- package/dist/types/query/index.d.ts +317 -25
- package/dist/types/query/normalize.d.ts +24 -0
- package/dist/types/query/operators.d.ts +241 -1
- package/dist/types/query/runtime.d.ts +5 -8
- package/dist/types/query/types.d.ts +34 -0
- package/dist/types/segments.d.ts +31 -0
- package/dist/types/write.d.ts +204 -0
- package/dist/types/xquery/parse.d.ts +2 -3
- package/docs/JSLT-FORMAT.md +74 -3
- package/docs/JSLT-PRELUDE.md +1 -1
- package/docs/QUERY-FORMAT.md +695 -33
- package/package.json +18 -4
- package/schemas/geojson.draft-07.schema.json +323 -0
- package/schemas/geojson.jaren.schema.json +863 -0
- package/schemas/geojson.schema.json +172 -0
- package/schemas/jaren-jslt.authoring.schema.json +142 -0
- package/schemas/jaren-jslt.draft-07.schema.json +152 -11
- package/schemas/jaren-jslt.llm-profile.schema.json +782 -0
- package/schemas/jaren-jslt.schema.json +152 -11
- package/schemas/jaren-query.draft-07.schema.json +152 -11
- package/schemas/jaren-query.llm-profile.schema.json +619 -0
- package/schemas/jaren-query.schema.json +82 -15
- package/src/basic.js +1 -1
- package/src/canonical.js +170 -0
- package/src/cow.js +106 -0
- package/src/errors.js +68 -0
- package/src/index.js +3 -0
- package/src/jslt/dispatch.js +178 -28
- package/src/jslt/errors.js +19 -14
- package/src/jslt/index.js +37 -29
- package/src/jslt/packs/finance.js +49 -0
- package/src/jslt/packs/index.js +18 -0
- package/src/jslt/packs/math.js +46 -0
- package/src/jslt/packs/stats.js +65 -0
- package/src/jslt/registry.js +200 -0
- package/src/jslt/stylesheet.js +14 -23
- package/src/jtlt/desugar.js +2 -3
- package/src/jtlt/errors.js +6 -12
- package/src/jtlt/index.js +12 -29
- package/src/jtlt/template.js +9 -18
- package/src/option-variants.js +54 -0
- package/src/patch.js +1052 -0
- package/src/path.js +319 -52
- package/src/pointer.js +225 -44
- package/src/query/compile.js +790 -75
- package/src/query/errors.js +72 -12
- package/src/query/index.js +274 -42
- package/src/query/normalize.js +489 -78
- package/src/query/operators.js +620 -23
- package/src/query/runtime.js +5 -19
- package/src/query/types.js +213 -0
- package/src/segments.js +409 -64
- package/src/write.js +660 -0
- package/src/xquery/parse.js +37 -53
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The finance pack — parameterized aggregators over a sequence of
|
|
3
|
+
* numbers, wrapping the pure functions of `@jarenjs/core/finance`. Each
|
|
4
|
+
* `agg` entry declares which operands are folded sequences (`seq`) and
|
|
5
|
+
* which are scalars; the registry gathers the `seq` operands into arrays
|
|
6
|
+
* before the call (the fold contract). Whole-series functions (`irr`,
|
|
7
|
+
* `npv`, moving averages) are `pushable: false` — they run in the engine
|
|
8
|
+
* or the db residual, never as an index-eligible SQLite scalar UDF.
|
|
9
|
+
*/
|
|
10
|
+
export declare const financePack: {
|
|
11
|
+
name: string;
|
|
12
|
+
entries: {
|
|
13
|
+
$npv: {
|
|
14
|
+
kind: string;
|
|
15
|
+
signature: any;
|
|
16
|
+
result: string;
|
|
17
|
+
fn: any;
|
|
18
|
+
pushable: boolean;
|
|
19
|
+
};
|
|
20
|
+
$irr: {
|
|
21
|
+
kind: string;
|
|
22
|
+
signature: any;
|
|
23
|
+
result: string;
|
|
24
|
+
fn: any;
|
|
25
|
+
pushable: boolean;
|
|
26
|
+
};
|
|
27
|
+
$mirr: {
|
|
28
|
+
kind: string;
|
|
29
|
+
signature: any;
|
|
30
|
+
result: string;
|
|
31
|
+
fn: any;
|
|
32
|
+
pushable: boolean;
|
|
33
|
+
};
|
|
34
|
+
$fv: {
|
|
35
|
+
kind: string;
|
|
36
|
+
signature: any[];
|
|
37
|
+
result: string;
|
|
38
|
+
fn: any;
|
|
39
|
+
pushable: boolean;
|
|
40
|
+
};
|
|
41
|
+
$pv: {
|
|
42
|
+
kind: string;
|
|
43
|
+
signature: any[];
|
|
44
|
+
result: string;
|
|
45
|
+
fn: any;
|
|
46
|
+
pushable: boolean;
|
|
47
|
+
};
|
|
48
|
+
$pmt: {
|
|
49
|
+
kind: string;
|
|
50
|
+
signature: any[];
|
|
51
|
+
result: string;
|
|
52
|
+
fn: any;
|
|
53
|
+
pushable: boolean;
|
|
54
|
+
};
|
|
55
|
+
$cagr: {
|
|
56
|
+
kind: string;
|
|
57
|
+
signature: any[];
|
|
58
|
+
result: string;
|
|
59
|
+
fn: any;
|
|
60
|
+
pushable: boolean;
|
|
61
|
+
};
|
|
62
|
+
$sma: {
|
|
63
|
+
kind: string;
|
|
64
|
+
signature: any;
|
|
65
|
+
result: string;
|
|
66
|
+
fn: any;
|
|
67
|
+
pushable: boolean;
|
|
68
|
+
};
|
|
69
|
+
$ema: {
|
|
70
|
+
kind: string;
|
|
71
|
+
signature: any;
|
|
72
|
+
result: string;
|
|
73
|
+
fn: any;
|
|
74
|
+
pushable: boolean;
|
|
75
|
+
};
|
|
76
|
+
$wma: {
|
|
77
|
+
kind: string;
|
|
78
|
+
signature: any;
|
|
79
|
+
result: string;
|
|
80
|
+
fn: any;
|
|
81
|
+
pushable: boolean;
|
|
82
|
+
};
|
|
83
|
+
$rsi: {
|
|
84
|
+
kind: string;
|
|
85
|
+
signature: any;
|
|
86
|
+
result: string;
|
|
87
|
+
fn: any;
|
|
88
|
+
pushable: boolean;
|
|
89
|
+
};
|
|
90
|
+
$roc: {
|
|
91
|
+
kind: string;
|
|
92
|
+
signature: any;
|
|
93
|
+
result: string;
|
|
94
|
+
fn: any;
|
|
95
|
+
pushable: boolean;
|
|
96
|
+
};
|
|
97
|
+
$volatility: {
|
|
98
|
+
kind: string;
|
|
99
|
+
signature: any;
|
|
100
|
+
result: string;
|
|
101
|
+
fn: any;
|
|
102
|
+
pushable: boolean;
|
|
103
|
+
};
|
|
104
|
+
$sharpe: {
|
|
105
|
+
kind: string;
|
|
106
|
+
signature: any;
|
|
107
|
+
result: string;
|
|
108
|
+
fn: any;
|
|
109
|
+
pushable: boolean;
|
|
110
|
+
};
|
|
111
|
+
$maxDrawdown: {
|
|
112
|
+
kind: string;
|
|
113
|
+
signature: any;
|
|
114
|
+
result: string;
|
|
115
|
+
fn: any;
|
|
116
|
+
pushable: boolean;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
};
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The built-in operator packs, plain data wrapping `@jarenjs/core`.
|
|
3
|
+
* A caller composes them into a registry: `createJsltRegistry().use(
|
|
4
|
+
* mathPack).use(financePack)`. `allPacks` is the convenience array for
|
|
5
|
+
* "register everything".
|
|
6
|
+
*/
|
|
7
|
+
export { mathPack } from './math.js';
|
|
8
|
+
export { financePack } from './finance.js';
|
|
9
|
+
export { statsPack } from './stats.js';
|
|
10
|
+
/** Every built-in pack, in a stable order. */
|
|
11
|
+
export declare const allPacks: readonly ({
|
|
12
|
+
name: string;
|
|
13
|
+
entries: {
|
|
14
|
+
$abs: {
|
|
15
|
+
kind: string;
|
|
16
|
+
signature: string[];
|
|
17
|
+
result: string;
|
|
18
|
+
fn: any;
|
|
19
|
+
pushable: string;
|
|
20
|
+
};
|
|
21
|
+
$sign: {
|
|
22
|
+
kind: string;
|
|
23
|
+
signature: string[];
|
|
24
|
+
result: string;
|
|
25
|
+
fn: any;
|
|
26
|
+
pushable: string;
|
|
27
|
+
};
|
|
28
|
+
$sqrt: {
|
|
29
|
+
kind: string;
|
|
30
|
+
signature: string[];
|
|
31
|
+
result: string;
|
|
32
|
+
fn: any;
|
|
33
|
+
pushable: string;
|
|
34
|
+
};
|
|
35
|
+
$cbrt: {
|
|
36
|
+
kind: string;
|
|
37
|
+
signature: string[];
|
|
38
|
+
result: string;
|
|
39
|
+
fn: any;
|
|
40
|
+
pushable: string;
|
|
41
|
+
};
|
|
42
|
+
$pow: {
|
|
43
|
+
kind: string;
|
|
44
|
+
signature: string[];
|
|
45
|
+
result: string;
|
|
46
|
+
fn: any;
|
|
47
|
+
pushable: string;
|
|
48
|
+
};
|
|
49
|
+
$hypot: {
|
|
50
|
+
kind: string;
|
|
51
|
+
signature: string[];
|
|
52
|
+
result: string;
|
|
53
|
+
fn: any;
|
|
54
|
+
pushable: string;
|
|
55
|
+
};
|
|
56
|
+
$exp: {
|
|
57
|
+
kind: string;
|
|
58
|
+
signature: string[];
|
|
59
|
+
result: string;
|
|
60
|
+
fn: any;
|
|
61
|
+
pushable: string;
|
|
62
|
+
};
|
|
63
|
+
$expm1: {
|
|
64
|
+
kind: string;
|
|
65
|
+
signature: string[];
|
|
66
|
+
result: string;
|
|
67
|
+
fn: any;
|
|
68
|
+
pushable: string;
|
|
69
|
+
};
|
|
70
|
+
$log: {
|
|
71
|
+
kind: string;
|
|
72
|
+
signature: string[];
|
|
73
|
+
result: string;
|
|
74
|
+
fn: any;
|
|
75
|
+
pushable: string;
|
|
76
|
+
};
|
|
77
|
+
$log2: {
|
|
78
|
+
kind: string;
|
|
79
|
+
signature: string[];
|
|
80
|
+
result: string;
|
|
81
|
+
fn: any;
|
|
82
|
+
pushable: string;
|
|
83
|
+
};
|
|
84
|
+
$log10: {
|
|
85
|
+
kind: string;
|
|
86
|
+
signature: string[];
|
|
87
|
+
result: string;
|
|
88
|
+
fn: any;
|
|
89
|
+
pushable: string;
|
|
90
|
+
};
|
|
91
|
+
$sin: {
|
|
92
|
+
kind: string;
|
|
93
|
+
signature: string[];
|
|
94
|
+
result: string;
|
|
95
|
+
fn: any;
|
|
96
|
+
pushable: string;
|
|
97
|
+
};
|
|
98
|
+
$cos: {
|
|
99
|
+
kind: string;
|
|
100
|
+
signature: string[];
|
|
101
|
+
result: string;
|
|
102
|
+
fn: any;
|
|
103
|
+
pushable: string;
|
|
104
|
+
};
|
|
105
|
+
$tan: {
|
|
106
|
+
kind: string;
|
|
107
|
+
signature: string[];
|
|
108
|
+
result: string;
|
|
109
|
+
fn: any;
|
|
110
|
+
pushable: string;
|
|
111
|
+
};
|
|
112
|
+
$asin: {
|
|
113
|
+
kind: string;
|
|
114
|
+
signature: string[];
|
|
115
|
+
result: string;
|
|
116
|
+
fn: any;
|
|
117
|
+
pushable: string;
|
|
118
|
+
};
|
|
119
|
+
$acos: {
|
|
120
|
+
kind: string;
|
|
121
|
+
signature: string[];
|
|
122
|
+
result: string;
|
|
123
|
+
fn: any;
|
|
124
|
+
pushable: string;
|
|
125
|
+
};
|
|
126
|
+
$atan: {
|
|
127
|
+
kind: string;
|
|
128
|
+
signature: string[];
|
|
129
|
+
result: string;
|
|
130
|
+
fn: any;
|
|
131
|
+
pushable: string;
|
|
132
|
+
};
|
|
133
|
+
$atan2: {
|
|
134
|
+
kind: string;
|
|
135
|
+
signature: string[];
|
|
136
|
+
result: string;
|
|
137
|
+
fn: any;
|
|
138
|
+
pushable: string;
|
|
139
|
+
};
|
|
140
|
+
$sinh: {
|
|
141
|
+
kind: string;
|
|
142
|
+
signature: string[];
|
|
143
|
+
result: string;
|
|
144
|
+
fn: any;
|
|
145
|
+
pushable: string;
|
|
146
|
+
};
|
|
147
|
+
$cosh: {
|
|
148
|
+
kind: string;
|
|
149
|
+
signature: string[];
|
|
150
|
+
result: string;
|
|
151
|
+
fn: any;
|
|
152
|
+
pushable: string;
|
|
153
|
+
};
|
|
154
|
+
$tanh: {
|
|
155
|
+
kind: string;
|
|
156
|
+
signature: string[];
|
|
157
|
+
result: string;
|
|
158
|
+
fn: any;
|
|
159
|
+
pushable: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
} | {
|
|
163
|
+
name: string;
|
|
164
|
+
entries: {
|
|
165
|
+
$npv: {
|
|
166
|
+
kind: string;
|
|
167
|
+
signature: any;
|
|
168
|
+
result: string;
|
|
169
|
+
fn: any;
|
|
170
|
+
pushable: boolean;
|
|
171
|
+
};
|
|
172
|
+
$irr: {
|
|
173
|
+
kind: string;
|
|
174
|
+
signature: any;
|
|
175
|
+
result: string;
|
|
176
|
+
fn: any;
|
|
177
|
+
pushable: boolean;
|
|
178
|
+
};
|
|
179
|
+
$mirr: {
|
|
180
|
+
kind: string;
|
|
181
|
+
signature: any;
|
|
182
|
+
result: string;
|
|
183
|
+
fn: any;
|
|
184
|
+
pushable: boolean;
|
|
185
|
+
};
|
|
186
|
+
$fv: {
|
|
187
|
+
kind: string;
|
|
188
|
+
signature: any[];
|
|
189
|
+
result: string;
|
|
190
|
+
fn: any;
|
|
191
|
+
pushable: boolean;
|
|
192
|
+
};
|
|
193
|
+
$pv: {
|
|
194
|
+
kind: string;
|
|
195
|
+
signature: any[];
|
|
196
|
+
result: string;
|
|
197
|
+
fn: any;
|
|
198
|
+
pushable: boolean;
|
|
199
|
+
};
|
|
200
|
+
$pmt: {
|
|
201
|
+
kind: string;
|
|
202
|
+
signature: any[];
|
|
203
|
+
result: string;
|
|
204
|
+
fn: any;
|
|
205
|
+
pushable: boolean;
|
|
206
|
+
};
|
|
207
|
+
$cagr: {
|
|
208
|
+
kind: string;
|
|
209
|
+
signature: any[];
|
|
210
|
+
result: string;
|
|
211
|
+
fn: any;
|
|
212
|
+
pushable: boolean;
|
|
213
|
+
};
|
|
214
|
+
$sma: {
|
|
215
|
+
kind: string;
|
|
216
|
+
signature: any;
|
|
217
|
+
result: string;
|
|
218
|
+
fn: any;
|
|
219
|
+
pushable: boolean;
|
|
220
|
+
};
|
|
221
|
+
$ema: {
|
|
222
|
+
kind: string;
|
|
223
|
+
signature: any;
|
|
224
|
+
result: string;
|
|
225
|
+
fn: any;
|
|
226
|
+
pushable: boolean;
|
|
227
|
+
};
|
|
228
|
+
$wma: {
|
|
229
|
+
kind: string;
|
|
230
|
+
signature: any;
|
|
231
|
+
result: string;
|
|
232
|
+
fn: any;
|
|
233
|
+
pushable: boolean;
|
|
234
|
+
};
|
|
235
|
+
$rsi: {
|
|
236
|
+
kind: string;
|
|
237
|
+
signature: any;
|
|
238
|
+
result: string;
|
|
239
|
+
fn: any;
|
|
240
|
+
pushable: boolean;
|
|
241
|
+
};
|
|
242
|
+
$roc: {
|
|
243
|
+
kind: string;
|
|
244
|
+
signature: any;
|
|
245
|
+
result: string;
|
|
246
|
+
fn: any;
|
|
247
|
+
pushable: boolean;
|
|
248
|
+
};
|
|
249
|
+
$volatility: {
|
|
250
|
+
kind: string;
|
|
251
|
+
signature: any;
|
|
252
|
+
result: string;
|
|
253
|
+
fn: any;
|
|
254
|
+
pushable: boolean;
|
|
255
|
+
};
|
|
256
|
+
$sharpe: {
|
|
257
|
+
kind: string;
|
|
258
|
+
signature: any;
|
|
259
|
+
result: string;
|
|
260
|
+
fn: any;
|
|
261
|
+
pushable: boolean;
|
|
262
|
+
};
|
|
263
|
+
$maxDrawdown: {
|
|
264
|
+
kind: string;
|
|
265
|
+
signature: any;
|
|
266
|
+
result: string;
|
|
267
|
+
fn: any;
|
|
268
|
+
pushable: boolean;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
} | {
|
|
272
|
+
name: string;
|
|
273
|
+
entries: {
|
|
274
|
+
$mean: {
|
|
275
|
+
kind: string;
|
|
276
|
+
signature: any;
|
|
277
|
+
result: string;
|
|
278
|
+
fn: any;
|
|
279
|
+
pushable: boolean;
|
|
280
|
+
};
|
|
281
|
+
$median: {
|
|
282
|
+
kind: string;
|
|
283
|
+
signature: any;
|
|
284
|
+
result: string;
|
|
285
|
+
fn: any;
|
|
286
|
+
pushable: boolean;
|
|
287
|
+
};
|
|
288
|
+
$variance: {
|
|
289
|
+
kind: string;
|
|
290
|
+
signature: any;
|
|
291
|
+
result: string;
|
|
292
|
+
fn: any;
|
|
293
|
+
pushable: boolean;
|
|
294
|
+
};
|
|
295
|
+
$stddev: {
|
|
296
|
+
kind: string;
|
|
297
|
+
signature: any;
|
|
298
|
+
result: string;
|
|
299
|
+
fn: any;
|
|
300
|
+
pushable: boolean;
|
|
301
|
+
};
|
|
302
|
+
$percentile: {
|
|
303
|
+
kind: string;
|
|
304
|
+
signature: any;
|
|
305
|
+
result: string;
|
|
306
|
+
fn: any;
|
|
307
|
+
pushable: boolean;
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
})[];
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The math pack — scalar `$`-operators the core query vocabulary
|
|
3
|
+
* lacks, wrapping the pure f64 functions of `@jarenjs/core/math`. Every
|
|
4
|
+
* entry is `kind: 'op'` (scalar operands, scalar result). `pushable:
|
|
5
|
+
* 'scalar'` marks the ones Ring 3 MAY register as a SQLite UDF; it is
|
|
6
|
+
* ignored in Rings 1–2.
|
|
7
|
+
*/
|
|
8
|
+
export declare const mathPack: {
|
|
9
|
+
name: string;
|
|
10
|
+
entries: {
|
|
11
|
+
$abs: {
|
|
12
|
+
kind: string;
|
|
13
|
+
signature: string[];
|
|
14
|
+
result: string;
|
|
15
|
+
fn: any;
|
|
16
|
+
pushable: string;
|
|
17
|
+
};
|
|
18
|
+
$sign: {
|
|
19
|
+
kind: string;
|
|
20
|
+
signature: string[];
|
|
21
|
+
result: string;
|
|
22
|
+
fn: any;
|
|
23
|
+
pushable: string;
|
|
24
|
+
};
|
|
25
|
+
$sqrt: {
|
|
26
|
+
kind: string;
|
|
27
|
+
signature: string[];
|
|
28
|
+
result: string;
|
|
29
|
+
fn: any;
|
|
30
|
+
pushable: string;
|
|
31
|
+
};
|
|
32
|
+
$cbrt: {
|
|
33
|
+
kind: string;
|
|
34
|
+
signature: string[];
|
|
35
|
+
result: string;
|
|
36
|
+
fn: any;
|
|
37
|
+
pushable: string;
|
|
38
|
+
};
|
|
39
|
+
$pow: {
|
|
40
|
+
kind: string;
|
|
41
|
+
signature: string[];
|
|
42
|
+
result: string;
|
|
43
|
+
fn: any;
|
|
44
|
+
pushable: string;
|
|
45
|
+
};
|
|
46
|
+
$hypot: {
|
|
47
|
+
kind: string;
|
|
48
|
+
signature: string[];
|
|
49
|
+
result: string;
|
|
50
|
+
fn: any;
|
|
51
|
+
pushable: string;
|
|
52
|
+
};
|
|
53
|
+
$exp: {
|
|
54
|
+
kind: string;
|
|
55
|
+
signature: string[];
|
|
56
|
+
result: string;
|
|
57
|
+
fn: any;
|
|
58
|
+
pushable: string;
|
|
59
|
+
};
|
|
60
|
+
$expm1: {
|
|
61
|
+
kind: string;
|
|
62
|
+
signature: string[];
|
|
63
|
+
result: string;
|
|
64
|
+
fn: any;
|
|
65
|
+
pushable: string;
|
|
66
|
+
};
|
|
67
|
+
$log: {
|
|
68
|
+
kind: string;
|
|
69
|
+
signature: string[];
|
|
70
|
+
result: string;
|
|
71
|
+
fn: any;
|
|
72
|
+
pushable: string;
|
|
73
|
+
};
|
|
74
|
+
$log2: {
|
|
75
|
+
kind: string;
|
|
76
|
+
signature: string[];
|
|
77
|
+
result: string;
|
|
78
|
+
fn: any;
|
|
79
|
+
pushable: string;
|
|
80
|
+
};
|
|
81
|
+
$log10: {
|
|
82
|
+
kind: string;
|
|
83
|
+
signature: string[];
|
|
84
|
+
result: string;
|
|
85
|
+
fn: any;
|
|
86
|
+
pushable: string;
|
|
87
|
+
};
|
|
88
|
+
$sin: {
|
|
89
|
+
kind: string;
|
|
90
|
+
signature: string[];
|
|
91
|
+
result: string;
|
|
92
|
+
fn: any;
|
|
93
|
+
pushable: string;
|
|
94
|
+
};
|
|
95
|
+
$cos: {
|
|
96
|
+
kind: string;
|
|
97
|
+
signature: string[];
|
|
98
|
+
result: string;
|
|
99
|
+
fn: any;
|
|
100
|
+
pushable: string;
|
|
101
|
+
};
|
|
102
|
+
$tan: {
|
|
103
|
+
kind: string;
|
|
104
|
+
signature: string[];
|
|
105
|
+
result: string;
|
|
106
|
+
fn: any;
|
|
107
|
+
pushable: string;
|
|
108
|
+
};
|
|
109
|
+
$asin: {
|
|
110
|
+
kind: string;
|
|
111
|
+
signature: string[];
|
|
112
|
+
result: string;
|
|
113
|
+
fn: any;
|
|
114
|
+
pushable: string;
|
|
115
|
+
};
|
|
116
|
+
$acos: {
|
|
117
|
+
kind: string;
|
|
118
|
+
signature: string[];
|
|
119
|
+
result: string;
|
|
120
|
+
fn: any;
|
|
121
|
+
pushable: string;
|
|
122
|
+
};
|
|
123
|
+
$atan: {
|
|
124
|
+
kind: string;
|
|
125
|
+
signature: string[];
|
|
126
|
+
result: string;
|
|
127
|
+
fn: any;
|
|
128
|
+
pushable: string;
|
|
129
|
+
};
|
|
130
|
+
$atan2: {
|
|
131
|
+
kind: string;
|
|
132
|
+
signature: string[];
|
|
133
|
+
result: string;
|
|
134
|
+
fn: any;
|
|
135
|
+
pushable: string;
|
|
136
|
+
};
|
|
137
|
+
$sinh: {
|
|
138
|
+
kind: string;
|
|
139
|
+
signature: string[];
|
|
140
|
+
result: string;
|
|
141
|
+
fn: any;
|
|
142
|
+
pushable: string;
|
|
143
|
+
};
|
|
144
|
+
$cosh: {
|
|
145
|
+
kind: string;
|
|
146
|
+
signature: string[];
|
|
147
|
+
result: string;
|
|
148
|
+
fn: any;
|
|
149
|
+
pushable: string;
|
|
150
|
+
};
|
|
151
|
+
$tanh: {
|
|
152
|
+
kind: string;
|
|
153
|
+
signature: string[];
|
|
154
|
+
result: string;
|
|
155
|
+
fn: any;
|
|
156
|
+
pushable: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The statistics pack — aggregators core does not ship as
|
|
3
|
+
* operators. `sum`/`min`/`max`/`avg`/`count` are ALREADY core query
|
|
4
|
+
* operators and are NOT re-registered here; this pack adds the summaries
|
|
5
|
+
* they don't cover. The helpers are small pure functions defined in this
|
|
6
|
+
* file (their natural home — core carries no statistics module), each a
|
|
7
|
+
* deterministic function of its array argument.
|
|
8
|
+
*/
|
|
9
|
+
export declare const statsPack: {
|
|
10
|
+
name: string;
|
|
11
|
+
entries: {
|
|
12
|
+
$mean: {
|
|
13
|
+
kind: string;
|
|
14
|
+
signature: any;
|
|
15
|
+
result: string;
|
|
16
|
+
fn: any;
|
|
17
|
+
pushable: boolean;
|
|
18
|
+
};
|
|
19
|
+
$median: {
|
|
20
|
+
kind: string;
|
|
21
|
+
signature: any;
|
|
22
|
+
result: string;
|
|
23
|
+
fn: any;
|
|
24
|
+
pushable: boolean;
|
|
25
|
+
};
|
|
26
|
+
$variance: {
|
|
27
|
+
kind: string;
|
|
28
|
+
signature: any;
|
|
29
|
+
result: string;
|
|
30
|
+
fn: any;
|
|
31
|
+
pushable: boolean;
|
|
32
|
+
};
|
|
33
|
+
$stddev: {
|
|
34
|
+
kind: string;
|
|
35
|
+
signature: any;
|
|
36
|
+
result: string;
|
|
37
|
+
fn: any;
|
|
38
|
+
pushable: boolean;
|
|
39
|
+
};
|
|
40
|
+
$percentile: {
|
|
41
|
+
kind: string;
|
|
42
|
+
signature: any;
|
|
43
|
+
result: string;
|
|
44
|
+
fn: any;
|
|
45
|
+
pushable: boolean;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The JSLT operator/aggregator registry (Ring 1): the
|
|
3
|
+
* `@jarenjs/formats` + `JarenValidator.addFormats` experience for the
|
|
4
|
+
* query/JSLT vocabulary. A caller composes packs of pure functions
|
|
5
|
+
* (`@jarenjs/core` math, finance, statistics) into a registry and gets
|
|
6
|
+
* a compiler bound to them — the operators then work in JSLT, in the
|
|
7
|
+
* query engine, and in linq-over-memory (which compiles to query
|
|
8
|
+
* documents).
|
|
9
|
+
*
|
|
10
|
+
* The mechanism is the engine's existing `options.extensions` seam (the
|
|
11
|
+
* same one the JSLT layer uses internally for `$apply`) plus
|
|
12
|
+
* `options.functions` (the `$call` registry). This file only TRANSLATES
|
|
13
|
+
* plain-data pack entries into those two shapes and holds them in an
|
|
14
|
+
* immutable-by-copy builder — so a pack never imports the operator ABI,
|
|
15
|
+
* exactly the decoupling `@jarenjs/formats` has from `@jarenjs/validate`.
|
|
16
|
+
*
|
|
17
|
+
* Entry kinds: `op` (scalar `$`-operator over scalar
|
|
18
|
+
* operands), `agg` (an operator whose declared `seq` operands are folded
|
|
19
|
+
* to arrays before the call — the generalization of core `$sum`'s fold),
|
|
20
|
+
* and `fn` (a bare `$call` function, the low-level escape). The published
|
|
21
|
+
* closed vocabulary is unchanged: without a registry a document using a
|
|
22
|
+
* pack operator fails `JQ0002` exactly as before.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Build an immutable JSLT operator registry. `.use(pack)` returns a NEW
|
|
26
|
+
* registry with the pack merged (a value, not a mutable singleton, so
|
|
27
|
+
* the functional spirit of the compilers is preserved). A name that
|
|
28
|
+
* collides with the core vocabulary, or with an already-registered name,
|
|
29
|
+
* throws a `TypeError` at `.use()` time — a host programming error, never
|
|
30
|
+
* a `JQ` document error.
|
|
31
|
+
* @param {{ extensions: Record<string, any>, functions: Record<string, Function>,
|
|
32
|
+
* meta: Record<string, any>, packs: string[] }} [state]
|
|
33
|
+
*/
|
|
34
|
+
export declare function createJsltRegistry(state?: {
|
|
35
|
+
extensions: Record<string, any>;
|
|
36
|
+
functions: Record<string, Function>;
|
|
37
|
+
meta: Record<string, any>;
|
|
38
|
+
packs: string[];
|
|
39
|
+
}): Readonly<{
|
|
40
|
+
use: (pack: any) => Readonly</*elided*/ any>;
|
|
41
|
+
/** Every registered operator/function name (for docs, AI, errors). */
|
|
42
|
+
names: () => string[];
|
|
43
|
+
/** The raw `{ extensions, functions }` for a manual compile call. */
|
|
44
|
+
toOptions: () => {
|
|
45
|
+
extensions: {
|
|
46
|
+
[x: string]: any;
|
|
47
|
+
};
|
|
48
|
+
functions: {
|
|
49
|
+
[x: string]: Function;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/** The SQL-pushable subset, as `{ name -> meta }` (consumed by the db
|
|
53
|
+
* in Rings 2–3; here it is just the data). */
|
|
54
|
+
forSql: () => {
|
|
55
|
+
[k: string]: any;
|
|
56
|
+
};
|
|
57
|
+
/** The full registration metadata (Rings 2–3, tooling). */
|
|
58
|
+
describe: () => {
|
|
59
|
+
[x: string]: any;
|
|
60
|
+
};
|
|
61
|
+
/** Compile a JSLT stylesheet bound to this registry. */
|
|
62
|
+
compile: (stylesheet: any, opts: any) => Function;
|
|
63
|
+
/** Compile a bare query document bound to this registry (linq-over-memory). */
|
|
64
|
+
compileQuery: (document: any, opts: any) => import("../query/index.js").CompiledJsonQuery;
|
|
65
|
+
}>;
|