@jarenjs/json 0.9.2 → 0.34.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/ARCHITECTURE.md +86 -13
  2. package/README.md +248 -23
  3. package/dist/types/canonical.d.ts +37 -0
  4. package/dist/types/cow.d.ts +28 -0
  5. package/dist/types/errors.d.ts +45 -0
  6. package/dist/types/index.d.ts +3 -0
  7. package/dist/types/jslt/errors.d.ts +15 -8
  8. package/dist/types/jslt/index.d.ts +22 -0
  9. package/dist/types/jslt/packs/finance.d.ts +119 -0
  10. package/dist/types/jslt/packs/index.d.ts +310 -0
  11. package/dist/types/jslt/packs/math.d.ts +159 -0
  12. package/dist/types/jslt/packs/stats.d.ts +48 -0
  13. package/dist/types/jslt/registry.d.ts +65 -0
  14. package/dist/types/jtlt/errors.d.ts +3 -6
  15. package/dist/types/option-variants.d.ts +29 -0
  16. package/dist/types/patch.d.ts +214 -0
  17. package/dist/types/path.d.ts +139 -9
  18. package/dist/types/pointer.d.ts +100 -9
  19. package/dist/types/query/compile.d.ts +12 -0
  20. package/dist/types/query/errors.d.ts +72 -8
  21. package/dist/types/query/index.d.ts +317 -25
  22. package/dist/types/query/normalize.d.ts +24 -0
  23. package/dist/types/query/operators.d.ts +241 -1
  24. package/dist/types/query/runtime.d.ts +5 -8
  25. package/dist/types/query/types.d.ts +34 -0
  26. package/dist/types/segments.d.ts +31 -0
  27. package/dist/types/write.d.ts +204 -0
  28. package/dist/types/xquery/parse.d.ts +2 -3
  29. package/docs/JSLT-FORMAT.md +74 -3
  30. package/docs/JSLT-PRELUDE.md +1 -1
  31. package/docs/QUERY-FORMAT.md +695 -33
  32. package/package.json +18 -4
  33. package/schemas/geojson.draft-07.schema.json +323 -0
  34. package/schemas/geojson.jaren.schema.json +863 -0
  35. package/schemas/geojson.schema.json +172 -0
  36. package/schemas/jaren-jslt.authoring.schema.json +142 -0
  37. package/schemas/jaren-jslt.draft-07.schema.json +152 -11
  38. package/schemas/jaren-jslt.llm-profile.schema.json +782 -0
  39. package/schemas/jaren-jslt.schema.json +152 -11
  40. package/schemas/jaren-query.draft-07.schema.json +152 -11
  41. package/schemas/jaren-query.llm-profile.schema.json +619 -0
  42. package/schemas/jaren-query.schema.json +82 -15
  43. package/src/basic.js +1 -1
  44. package/src/canonical.js +170 -0
  45. package/src/cow.js +106 -0
  46. package/src/errors.js +68 -0
  47. package/src/index.js +3 -0
  48. package/src/jslt/dispatch.js +178 -28
  49. package/src/jslt/errors.js +19 -14
  50. package/src/jslt/index.js +37 -29
  51. package/src/jslt/packs/finance.js +49 -0
  52. package/src/jslt/packs/index.js +18 -0
  53. package/src/jslt/packs/math.js +46 -0
  54. package/src/jslt/packs/stats.js +65 -0
  55. package/src/jslt/registry.js +200 -0
  56. package/src/jslt/stylesheet.js +14 -23
  57. package/src/jtlt/desugar.js +2 -3
  58. package/src/jtlt/errors.js +6 -12
  59. package/src/jtlt/index.js +12 -29
  60. package/src/jtlt/template.js +9 -18
  61. package/src/option-variants.js +54 -0
  62. package/src/patch.js +1052 -0
  63. package/src/path.js +319 -52
  64. package/src/pointer.js +225 -44
  65. package/src/query/compile.js +790 -75
  66. package/src/query/errors.js +72 -12
  67. package/src/query/index.js +274 -42
  68. package/src/query/normalize.js +489 -78
  69. package/src/query/operators.js +620 -23
  70. package/src/query/runtime.js +5 -19
  71. package/src/query/types.js +213 -0
  72. package/src/segments.js +409 -64
  73. package/src/write.js +660 -0
  74. package/src/xquery/parse.js +37 -53
@@ -220,9 +220,10 @@
220
220
  "format": "json-path"
221
221
  },
222
222
  "variablePathString": {
223
- "description": "A variable-rooted path: '$name' with name matching [A-Za-z_][A-Za-z0-9_]*, optionally followed by RFC 9535 segments. Only the head is pattern-checked; the full segment grammar is enforced by the compiler (JQ0004).",
223
+ "description": "A variable-rooted path: '$name' with name matching [A-Za-z_][A-Za-z0-9_]*, optionally followed by RFC 9535 segments. The pattern checks the head; the json-path-segments format asserts the full segment grammar where format assertion is enabled (the compiler enforces it either way, JQ0004).",
224
224
  "type": "string",
225
- "pattern": "^\\$[A-Za-z_][A-Za-z0-9_]*($|[.\\[])"
225
+ "pattern": "^\\$[A-Za-z_][A-Za-z0-9_]*($|[.\\[])",
226
+ "format": "json-path-segments"
226
227
  },
227
228
  "arrayConstructor": {
228
229
  "description": "An array in expression position constructs an array; element results are concatenated per XQuery sequence flattening.",
@@ -243,6 +244,9 @@
243
244
  {
244
245
  "$ref": "#/$defs/mapPhrase"
245
246
  },
247
+ {
248
+ "$ref": "#/$defs/callPhrase"
249
+ },
246
250
  {
247
251
  "$ref": "#/$defs/flworPhrase"
248
252
  },
@@ -270,6 +274,12 @@
270
274
  {
271
275
  "$ref": "#/$defs/stringJoinPhrase"
272
276
  },
277
+ {
278
+ "$ref": "#/$defs/geohashPhrase"
279
+ },
280
+ {
281
+ "$ref": "#/$defs/ternaryOperatorPhrase"
282
+ },
273
283
  {
274
284
  "$ref": "#/$defs/replacePhrase"
275
285
  },
@@ -328,9 +338,12 @@
328
338
  "maxItems": 2
329
339
  },
330
340
  "flworPhrase": {
331
- "description": "FLWOR phrase. Clauses apply in the fixed semantic order $for, $let, $as, $where, $groupby, $orderby, $count, $return regardless of JSON key order (D7); interleavings are expressed by nesting phrases. $return is required, plus at least one of $for/$let.",
341
+ "description": "FLWOR phrase. Clauses apply in the fixed semantic order $fold, $for, $let, $as, $where, $groupby, $orderby, $count, $return regardless of JSON key order (D7); interleavings are expressed by nesting phrases. $return is required, plus at least one of $fold/$for/$let. With $fold the phrase evaluates to the final accumulator instead of the collected $return sequence.",
332
342
  "type": "object",
333
343
  "properties": {
344
+ "$fold": {
345
+ "$ref": "#/$defs/foldBinding"
346
+ },
334
347
  "$for": {
335
348
  "$ref": "#/$defs/forBindings"
336
349
  },
@@ -369,6 +382,11 @@
369
382
  "required": [
370
383
  "$let"
371
384
  ]
385
+ },
386
+ {
387
+ "required": [
388
+ "$fold"
389
+ ]
372
390
  }
373
391
  ],
374
392
  "additionalProperties": false
@@ -378,7 +396,7 @@
378
396
  "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
379
397
  },
380
398
  "forBindings": {
381
- "description": "Iteration bindings: variable name to source expression or extended {$in, $at} binding. Bindings nest left-to-right in document key order and may be correlated; key-order-hostile producers should nest phrases instead.",
399
+ "description": "Iteration bindings: variable name to source expression or extended $in binding. Bindings nest left-to-right in document key order and may be correlated; key-order-hostile producers should nest phrases instead.",
382
400
  "type": "object",
383
401
  "minProperties": 1,
384
402
  "propertyNames": {
@@ -399,7 +417,7 @@
399
417
  ]
400
418
  },
401
419
  "extendedForBinding": {
402
- "description": "Extended $for binding: iterates $in and binds $at to the 0-based (D6) position variable.",
420
+ "description": "Extended $for binding. $in is the source; $at binds the 0-based (D6) position variable; $allowing-empty emits one tuple with the variable bound to the empty sequence (position -1) when the source yields no tuple; $window with $size, and optionally $step, iterates tumbling or sliding windows instead of items. Only $in is structurally required: the compiler rejects $size/$step without $window, and $window without $size (JQ0003).",
403
421
  "type": "object",
404
422
  "properties": {
405
423
  "$in": {
@@ -407,11 +425,27 @@
407
425
  },
408
426
  "$at": {
409
427
  "$ref": "#/$defs/variableName"
428
+ },
429
+ "$allowing-empty": {
430
+ "type": "boolean"
431
+ },
432
+ "$window": {
433
+ "enum": [
434
+ "tumbling",
435
+ "sliding"
436
+ ]
437
+ },
438
+ "$size": {
439
+ "type": "integer",
440
+ "minimum": 1
441
+ },
442
+ "$step": {
443
+ "type": "integer",
444
+ "minimum": 1
410
445
  }
411
446
  },
412
447
  "required": [
413
- "$in",
414
- "$at"
448
+ "$in"
415
449
  ],
416
450
  "additionalProperties": false
417
451
  },
@@ -469,7 +503,7 @@
469
503
  ]
470
504
  },
471
505
  "orderByKeySpec": {
472
- "description": "Explicit order key: direction defaults to 'asc', empty-sequence placement to 'least'.",
506
+ "description": "Explicit order key: direction defaults to 'asc', empty-sequence placement to 'least'. A $collation names a registered pure compare function (options.collations, JQ0010) applied to string keys; the default stays code-point order.",
473
507
  "type": "object",
474
508
  "properties": {
475
509
  "$key": {
@@ -486,6 +520,10 @@
486
520
  "least",
487
521
  "greatest"
488
522
  ]
523
+ },
524
+ "$collation": {
525
+ "type": "string",
526
+ "minLength": 1
489
527
  }
490
528
  },
491
529
  "required": [
@@ -548,6 +586,8 @@
548
586
  "$sort",
549
587
  "$head",
550
588
  "$tail",
589
+ "$entries",
590
+ "$from-entries",
551
591
  "$upper",
552
592
  "$lower",
553
593
  "$string-length",
@@ -560,7 +600,28 @@
560
600
  "$is-boolean",
561
601
  "$is-null",
562
602
  "$is-array",
563
- "$is-object"
603
+ "$is-object",
604
+ "$is-date",
605
+ "$is-time",
606
+ "$is-datetime",
607
+ "$is-duration",
608
+ "$year",
609
+ "$month",
610
+ "$day",
611
+ "$hours",
612
+ "$minutes",
613
+ "$seconds",
614
+ "$offset",
615
+ "$epoch",
616
+ "$datetime",
617
+ "$week",
618
+ "$week-year",
619
+ "$quarter",
620
+ "$weekday",
621
+ "$bbox",
622
+ "$area",
623
+ "$length",
624
+ "$centroid"
564
625
  ]
565
626
  },
566
627
  "additionalProperties": {
@@ -594,6 +655,12 @@
594
655
  "$index-of",
595
656
  "$range",
596
657
  "$get",
658
+ "$start-of",
659
+ "$end-of",
660
+ "$date-format",
661
+ "$distance",
662
+ "$within",
663
+ "$bbox-intersects",
597
664
  "$default"
598
665
  ]
599
666
  },
@@ -645,7 +712,7 @@
645
712
  }
646
713
  },
647
714
  "conditionalArityOperatorPhrase": {
648
- "description": "Operators taking two or three operand expressions: $if [cond, then, else?], $substring [str, start, len?], $subsequence [seq, start, len?].",
715
+ "description": "Operators taking two or three operand expressions: $if [cond, then, else?], $substring [str, start, len?], $subsequence [seq, start, len?], $date-add / $date-sub [date, duration] or [date, amount, unit].",
649
716
  "type": "object",
650
717
  "minProperties": 1,
651
718
  "maxProperties": 1,
@@ -653,7 +720,9 @@
653
720
  "enum": [
654
721
  "$if",
655
722
  "$substring",
656
- "$subsequence"
723
+ "$subsequence",
724
+ "$date-add",
725
+ "$date-sub"
657
726
  ]
658
727
  },
659
728
  "additionalProperties": {
@@ -771,6 +840,78 @@
771
840
  "$apply"
772
841
  ],
773
842
  "additionalProperties": false
843
+ },
844
+ "callPhrase": {
845
+ "description": "A registered trusted host function call: ['name', ...argument expressions]. The name must be registered at compile time (options.functions, JQ0010); sequences cross the boundary as arrays, a returned undefined is the empty sequence, a throwing function is JQ2010.",
846
+ "type": "object",
847
+ "properties": {
848
+ "$call": {
849
+ "type": "array",
850
+ "minItems": 1,
851
+ "prefixItems": [
852
+ {
853
+ "type": "string",
854
+ "minLength": 1
855
+ }
856
+ ],
857
+ "items": {
858
+ "$ref": "#/$defs/expression"
859
+ }
860
+ }
861
+ },
862
+ "required": [
863
+ "$call"
864
+ ],
865
+ "additionalProperties": false
866
+ },
867
+ "foldBinding": {
868
+ "description": "The $fold accumulator: exactly one variable name mapped to the accumulator's initial value, evaluated once in the enclosing scope before the tuple stream starts. $return then names the accumulator's next value per surviving tuple.",
869
+ "type": "object",
870
+ "minProperties": 1,
871
+ "maxProperties": 1,
872
+ "propertyNames": {
873
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
874
+ },
875
+ "additionalProperties": {
876
+ "$ref": "#/$defs/expression"
877
+ }
878
+ },
879
+ "ternaryOperatorPhrase": {
880
+ "description": "Operators whose value is an array of exactly three operand expressions: $date-diff [from, to, unit].",
881
+ "type": "object",
882
+ "minProperties": 1,
883
+ "maxProperties": 1,
884
+ "propertyNames": {
885
+ "enum": [
886
+ "$date-diff"
887
+ ]
888
+ },
889
+ "additionalProperties": {
890
+ "type": "array",
891
+ "items": {
892
+ "$ref": "#/$defs/expression"
893
+ },
894
+ "minItems": 3,
895
+ "maxItems": 3
896
+ }
897
+ },
898
+ "geohashPhrase": {
899
+ "description": "$geohash [value] or [value, precision]: a GeoJSON value as a base-32 cell string. Precision is an integer from 1 to 12 (default 9); a value that is not a bare position is represented by its centroid.",
900
+ "type": "object",
901
+ "properties": {
902
+ "$geohash": {
903
+ "type": "array",
904
+ "items": {
905
+ "$ref": "#/$defs/expression"
906
+ },
907
+ "minItems": 1,
908
+ "maxItems": 2
909
+ }
910
+ },
911
+ "required": [
912
+ "$geohash"
913
+ ],
914
+ "additionalProperties": false
774
915
  }
775
916
  }
776
917
  }
@@ -97,9 +97,10 @@
97
97
  "format": "json-path"
98
98
  },
99
99
  "variablePathString": {
100
- "description": "A variable-rooted path: '$name' with name matching [A-Za-z_][A-Za-z0-9_]*, optionally followed by RFC 9535 segments. Only the head is pattern-checked; the full segment grammar is enforced by the compiler (JQ0004).",
100
+ "description": "A variable-rooted path: '$name' with name matching [A-Za-z_][A-Za-z0-9_]*, optionally followed by RFC 9535 segments. The pattern checks the head; the json-path-segments format asserts the full segment grammar where format assertion is enabled (the compiler enforces it either way, JQ0004).",
101
101
  "type": "string",
102
- "pattern": "^\\$[A-Za-z_][A-Za-z0-9_]*($|[.\\[])"
102
+ "pattern": "^\\$[A-Za-z_][A-Za-z0-9_]*($|[.\\[])",
103
+ "format": "json-path-segments"
103
104
  },
104
105
  "arrayConstructor": {
105
106
  "description": "An array in expression position constructs an array; element results are concatenated per XQuery sequence flattening.",
@@ -120,6 +121,9 @@
120
121
  {
121
122
  "$ref": "#/definitions/mapPhrase"
122
123
  },
124
+ {
125
+ "$ref": "#/definitions/callPhrase"
126
+ },
123
127
  {
124
128
  "$ref": "#/definitions/flworPhrase"
125
129
  },
@@ -147,6 +151,12 @@
147
151
  {
148
152
  "$ref": "#/definitions/stringJoinPhrase"
149
153
  },
154
+ {
155
+ "$ref": "#/definitions/geohashPhrase"
156
+ },
157
+ {
158
+ "$ref": "#/definitions/ternaryOperatorPhrase"
159
+ },
150
160
  {
151
161
  "$ref": "#/definitions/replacePhrase"
152
162
  },
@@ -201,10 +211,36 @@
201
211
  "minItems": 2,
202
212
  "maxItems": 2
203
213
  },
214
+ "callPhrase": {
215
+ "description": "A registered trusted host function call: ['name', ...argument expressions]. The name must be registered at compile time (options.functions, JQ0010); sequences cross the boundary as arrays, a returned undefined is the empty sequence, a throwing function is JQ2010.",
216
+ "type": "object",
217
+ "properties": {
218
+ "$call": {
219
+ "type": "array",
220
+ "minItems": 1,
221
+ "items": [
222
+ {
223
+ "type": "string",
224
+ "minLength": 1
225
+ }
226
+ ],
227
+ "additionalItems": {
228
+ "$ref": "#/definitions/expression"
229
+ }
230
+ }
231
+ },
232
+ "required": [
233
+ "$call"
234
+ ],
235
+ "additionalProperties": false
236
+ },
204
237
  "flworPhrase": {
205
- "description": "FLWOR phrase. Clauses apply in the fixed semantic order $for, $let, $as, $where, $groupby, $orderby, $count, $return regardless of JSON key order (D7); interleavings are expressed by nesting phrases. $return is required, plus at least one of $for/$let.",
238
+ "description": "FLWOR phrase. Clauses apply in the fixed semantic order $fold, $for, $let, $as, $where, $groupby, $orderby, $count, $return regardless of JSON key order (D7); interleavings are expressed by nesting phrases. $return is required, plus at least one of $fold/$for/$let. With $fold the phrase evaluates to the final accumulator instead of the collected $return sequence.",
206
239
  "type": "object",
207
240
  "properties": {
241
+ "$fold": {
242
+ "$ref": "#/definitions/foldBinding"
243
+ },
208
244
  "$for": {
209
245
  "$ref": "#/definitions/forBindings"
210
246
  },
@@ -243,16 +279,33 @@
243
279
  "required": [
244
280
  "$let"
245
281
  ]
282
+ },
283
+ {
284
+ "required": [
285
+ "$fold"
286
+ ]
246
287
  }
247
288
  ],
248
289
  "additionalProperties": false
249
290
  },
291
+ "foldBinding": {
292
+ "description": "The $fold accumulator: exactly one variable name mapped to the accumulator's initial value, evaluated once in the enclosing scope before the tuple stream starts. $return then names the accumulator's next value per surviving tuple.",
293
+ "type": "object",
294
+ "minProperties": 1,
295
+ "maxProperties": 1,
296
+ "propertyNames": {
297
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
298
+ },
299
+ "additionalProperties": {
300
+ "$ref": "#/definitions/expression"
301
+ }
302
+ },
250
303
  "variableName": {
251
304
  "type": "string",
252
305
  "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
253
306
  },
254
307
  "forBindings": {
255
- "description": "Iteration bindings: variable name to source expression or extended {$in, $at} binding. Bindings nest left-to-right in document key order and may be correlated; key-order-hostile producers should nest phrases instead.",
308
+ "description": "Iteration bindings: variable name to source expression or extended $in binding. Bindings nest left-to-right in document key order and may be correlated; key-order-hostile producers should nest phrases instead.",
256
309
  "type": "object",
257
310
  "minProperties": 1,
258
311
  "propertyNames": {
@@ -273,7 +326,7 @@
273
326
  ]
274
327
  },
275
328
  "extendedForBinding": {
276
- "description": "Extended $for binding: iterates $in and binds $at to the 0-based (D6) position variable.",
329
+ "description": "Extended $for binding. $in is the source; $at binds the 0-based (D6) position variable; $allowing-empty emits one tuple with the variable bound to the empty sequence (position -1) when the source yields no tuple; $window with $size, and optionally $step, iterates tumbling or sliding windows instead of items. Only $in is structurally required: the compiler rejects $size/$step without $window, and $window without $size (JQ0003).",
277
330
  "type": "object",
278
331
  "properties": {
279
332
  "$in": {
@@ -281,11 +334,27 @@
281
334
  },
282
335
  "$at": {
283
336
  "$ref": "#/definitions/variableName"
337
+ },
338
+ "$allowing-empty": {
339
+ "type": "boolean"
340
+ },
341
+ "$window": {
342
+ "enum": [
343
+ "tumbling",
344
+ "sliding"
345
+ ]
346
+ },
347
+ "$size": {
348
+ "type": "integer",
349
+ "minimum": 1
350
+ },
351
+ "$step": {
352
+ "type": "integer",
353
+ "minimum": 1
284
354
  }
285
355
  },
286
356
  "required": [
287
- "$in",
288
- "$at"
357
+ "$in"
289
358
  ],
290
359
  "additionalProperties": false
291
360
  },
@@ -343,7 +412,7 @@
343
412
  ]
344
413
  },
345
414
  "orderByKeySpec": {
346
- "description": "Explicit order key: direction defaults to 'asc', empty-sequence placement to 'least'.",
415
+ "description": "Explicit order key: direction defaults to 'asc', empty-sequence placement to 'least'. A $collation names a registered pure compare function (options.collations, JQ0010) applied to string keys; the default stays code-point order.",
347
416
  "type": "object",
348
417
  "properties": {
349
418
  "$key": {
@@ -360,6 +429,10 @@
360
429
  "least",
361
430
  "greatest"
362
431
  ]
432
+ },
433
+ "$collation": {
434
+ "type": "string",
435
+ "minLength": 1
363
436
  }
364
437
  },
365
438
  "required": [
@@ -422,6 +495,8 @@
422
495
  "$sort",
423
496
  "$head",
424
497
  "$tail",
498
+ "$entries",
499
+ "$from-entries",
425
500
  "$upper",
426
501
  "$lower",
427
502
  "$string-length",
@@ -434,7 +509,28 @@
434
509
  "$is-boolean",
435
510
  "$is-null",
436
511
  "$is-array",
437
- "$is-object"
512
+ "$is-object",
513
+ "$is-date",
514
+ "$is-time",
515
+ "$is-datetime",
516
+ "$is-duration",
517
+ "$year",
518
+ "$month",
519
+ "$day",
520
+ "$hours",
521
+ "$minutes",
522
+ "$seconds",
523
+ "$offset",
524
+ "$epoch",
525
+ "$datetime",
526
+ "$week",
527
+ "$week-year",
528
+ "$quarter",
529
+ "$weekday",
530
+ "$bbox",
531
+ "$area",
532
+ "$length",
533
+ "$centroid"
438
534
  ]
439
535
  },
440
536
  "additionalProperties": {
@@ -468,6 +564,12 @@
468
564
  "$index-of",
469
565
  "$range",
470
566
  "$get",
567
+ "$start-of",
568
+ "$end-of",
569
+ "$date-format",
570
+ "$distance",
571
+ "$within",
572
+ "$bbox-intersects",
471
573
  "$default"
472
574
  ]
473
575
  },
@@ -519,7 +621,7 @@
519
621
  }
520
622
  },
521
623
  "conditionalArityOperatorPhrase": {
522
- "description": "Operators taking two or three operand expressions: $if [cond, then, else?], $substring [str, start, len?], $subsequence [seq, start, len?].",
624
+ "description": "Operators taking two or three operand expressions: $if [cond, then, else?], $substring [str, start, len?], $subsequence [seq, start, len?], $date-add / $date-sub [date, duration] or [date, amount, unit].",
523
625
  "type": "object",
524
626
  "minProperties": 1,
525
627
  "maxProperties": 1,
@@ -527,7 +629,9 @@
527
629
  "enum": [
528
630
  "$if",
529
631
  "$substring",
530
- "$subsequence"
632
+ "$subsequence",
633
+ "$date-add",
634
+ "$date-sub"
531
635
  ]
532
636
  },
533
637
  "additionalProperties": {
@@ -539,6 +643,24 @@
539
643
  "maxItems": 3
540
644
  }
541
645
  },
646
+ "geohashPhrase": {
647
+ "description": "$geohash [value] or [value, precision]: a GeoJSON value as a base-32 cell string. Precision is an integer from 1 to 12 (default 9); a value that is not a bare position is represented by its centroid.",
648
+ "type": "object",
649
+ "properties": {
650
+ "$geohash": {
651
+ "type": "array",
652
+ "items": {
653
+ "$ref": "#/definitions/expression"
654
+ },
655
+ "minItems": 1,
656
+ "maxItems": 2
657
+ }
658
+ },
659
+ "required": [
660
+ "$geohash"
661
+ ],
662
+ "additionalProperties": false
663
+ },
542
664
  "stringJoinPhrase": {
543
665
  "description": "$string-join [seq, separator?]: one or two operand expressions.",
544
666
  "type": "object",
@@ -557,6 +679,25 @@
557
679
  ],
558
680
  "additionalProperties": false
559
681
  },
682
+ "ternaryOperatorPhrase": {
683
+ "description": "Operators whose value is an array of exactly three operand expressions: $date-diff [from, to, unit].",
684
+ "type": "object",
685
+ "minProperties": 1,
686
+ "maxProperties": 1,
687
+ "propertyNames": {
688
+ "enum": [
689
+ "$date-diff"
690
+ ]
691
+ },
692
+ "additionalProperties": {
693
+ "type": "array",
694
+ "items": {
695
+ "$ref": "#/definitions/expression"
696
+ },
697
+ "minItems": 3,
698
+ "maxItems": 3
699
+ }
700
+ },
560
701
  "replacePhrase": {
561
702
  "description": "$replace [input, pattern, replacement]: exactly three operand expressions (I-Regexp has no flags argument, D5).",
562
703
  "type": "object",