@balena/odata-parser 2.4.3 → 2.4.4
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/.versionbot/CHANGELOG.yml +12 -1
- package/CHANGELOG.md +5 -0
- package/odata-parser.js +16 -16
- package/odata-parser.pegjs +16 -16
- package/package.json +2 -2
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
- commits:
|
|
2
|
+
- subject: Use shorthand object notation
|
|
3
|
+
hash: 611c0480681965c7af06302264eac79fea18bded
|
|
4
|
+
body: ""
|
|
5
|
+
footer:
|
|
6
|
+
Change-type: patch
|
|
7
|
+
change-type: patch
|
|
8
|
+
author: Pagan Gazzard
|
|
9
|
+
version: 2.4.4
|
|
10
|
+
title: ""
|
|
11
|
+
date: 2023-02-23T16:23:23.783Z
|
|
1
12
|
- commits:
|
|
2
13
|
- subject: Update dependencies
|
|
3
14
|
hash: 25b153aca258347c6742cb8b4efe54c0ae199695
|
|
@@ -8,7 +19,7 @@
|
|
|
8
19
|
author: Pagan Gazzard
|
|
9
20
|
version: 2.4.3
|
|
10
21
|
title: ""
|
|
11
|
-
date: 2023-02-23T16:
|
|
22
|
+
date: 2023-02-23T16:14:13.013Z
|
|
12
23
|
- commits:
|
|
13
24
|
- subject: Test that `/$count` works with a `$filter`containing an 'and'
|
|
14
25
|
hash: cda0a1a54b2830cd393240dd5dddf1e4b42877c4
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file
|
|
|
4
4
|
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
|
7
|
+
# v2.4.4
|
|
8
|
+
## (2023-02-23)
|
|
9
|
+
|
|
10
|
+
* Use shorthand object notation [Pagan Gazzard]
|
|
11
|
+
|
|
7
12
|
# v2.4.3
|
|
8
13
|
## (2023-02-23)
|
|
9
14
|
|
package/odata-parser.js
CHANGED
|
@@ -395,7 +395,7 @@ function peg$parse(input, options) {
|
|
|
395
395
|
var peg$e109 = peg$literalExpectation("%20", false);
|
|
396
396
|
|
|
397
397
|
var peg$f0 = function() {reset(); return true;};
|
|
398
|
-
var peg$f1 = function(tree) { return { tree
|
|
398
|
+
var peg$f1 = function(tree) { return { tree, binds } };
|
|
399
399
|
var peg$f2 = function() {
|
|
400
400
|
reset();
|
|
401
401
|
var tree = eval(`peg$parse${options.rule}()`);
|
|
@@ -416,24 +416,24 @@ function peg$parse(input, options) {
|
|
|
416
416
|
binds['@' + name] = value
|
|
417
417
|
return {
|
|
418
418
|
name: '@' + name,
|
|
419
|
-
value
|
|
419
|
+
value
|
|
420
420
|
}
|
|
421
421
|
};
|
|
422
|
-
var peg$f12 = function(name, value) { return { name
|
|
422
|
+
var peg$f12 = function(name, value) { return { name, value } };
|
|
423
423
|
var peg$f13 = function(property, properties) { return { name: '$orderby', value: { properties: [property, ...properties] } } };
|
|
424
424
|
var peg$f14 = function(property) { return 'desc' };
|
|
425
425
|
var peg$f15 = function(property, order) {
|
|
426
426
|
property.order = order;
|
|
427
427
|
return property
|
|
428
428
|
};
|
|
429
|
-
var peg$f16 = function(value) { return { name: '$top', value
|
|
430
|
-
var peg$f17 = function(value) { return { name: '$skip', value
|
|
429
|
+
var peg$f16 = function(value) { return { name: '$top', value } };
|
|
430
|
+
var peg$f17 = function(value) { return { name: '$skip', value } };
|
|
431
431
|
var peg$f18 = function() { return '' };
|
|
432
|
-
var peg$f19 = function(value) { return { name: '$inlinecount', value
|
|
433
|
-
var peg$f20 = function(value) { return { name: '$count', value
|
|
434
|
-
var peg$f21 = function(properties) { return { name: '$expand', value: { properties
|
|
435
|
-
var peg$f22 = function(properties) { return { properties
|
|
436
|
-
var peg$f23 = function(value) { return { name: '$select', value
|
|
432
|
+
var peg$f19 = function(value) { return { name: '$inlinecount', value } };
|
|
433
|
+
var peg$f20 = function(value) { return { name: '$count', value } };
|
|
434
|
+
var peg$f21 = function(properties) { return { name: '$expand', value: { properties } } };
|
|
435
|
+
var peg$f22 = function(properties) { return { properties } };
|
|
436
|
+
var peg$f23 = function(value) { return { name: '$select', value } };
|
|
437
437
|
var peg$f24 = function(expr) { return { name: '$filter', value: expr } };
|
|
438
438
|
var peg$f25 = function(type, metadata) { return { name: '$format', value: { type, metadata } } };
|
|
439
439
|
var peg$f26 = function(type) { return { name: '$format', value: type } };
|
|
@@ -466,11 +466,11 @@ function peg$parse(input, options) {
|
|
|
466
466
|
var peg$f37 = function(methodName, first, rest) { return [ first, ...rest ] };
|
|
467
467
|
var peg$f38 = function(methodName) { return [] };
|
|
468
468
|
var peg$f39 = function(methodName, args) { return args.length === methods[methodName] || (Array.isArray(methods[methodName]) && methods[methodName].includes(args.length)) };
|
|
469
|
-
var peg$f40 = function(methodName, args) { return [ 'call', { args
|
|
470
|
-
var peg$f41 = function(name, identifier, expression) { return { expression
|
|
469
|
+
var peg$f40 = function(methodName, args) { return [ 'call', { args, method: methodName } ] };
|
|
470
|
+
var peg$f41 = function(name, identifier, expression) { return { expression, identifier, method: name } };
|
|
471
471
|
var peg$f42 = function(methodName, first, rest) { return [ first, ...rest ] };
|
|
472
472
|
var peg$f43 = function(methodName) { return [] };
|
|
473
|
-
var peg$f44 = function(methodName, args) { return [ 'call', { args
|
|
473
|
+
var peg$f44 = function(methodName, args) { return [ 'call', { args, method: methodName } ] };
|
|
474
474
|
var peg$f45 = function(path, paths) { return [path, ...paths] };
|
|
475
475
|
var peg$f46 = function(resource, property, option) { return CollapseObjectArray([option]) };
|
|
476
476
|
var peg$f47 = function(resource, property, optionsObj) { return { count: true, options: optionsObj } };
|
|
@@ -479,10 +479,10 @@ function peg$parse(input, options) {
|
|
|
479
479
|
var peg$f50 = function(resource) { return true };
|
|
480
480
|
var peg$f51 = function(resource, count, option, options) { return CollapseObjectArray([option, ...options]) };
|
|
481
481
|
var peg$f52 = function(resource, count) { return {} };
|
|
482
|
-
var peg$f53 = function(resource, count, optionsObj, next) { return { name: resource, property: next, count
|
|
482
|
+
var peg$f53 = function(resource, count, optionsObj, next) { return { name: resource, property: next, count, options: optionsObj} };
|
|
483
483
|
var peg$f54 = function(resource, next) { return { name: resource, property: next } };
|
|
484
|
-
var peg$f55 = function(resource, lambda) { return { name: resource, lambda
|
|
485
|
-
var peg$f56 = function(resource, method) { return { name: resource, method
|
|
484
|
+
var peg$f55 = function(resource, lambda) { return { name: resource, lambda } };
|
|
485
|
+
var peg$f56 = function(resource, method) { return { name: resource, method } };
|
|
486
486
|
var peg$f57 = function(keyBind, keyBinds) { return CollapseObjectArray([keyBind, ...keyBinds]) };
|
|
487
487
|
var peg$f58 = function(name, value) { return { name, value }};
|
|
488
488
|
var peg$f59 = function(resource) { return { resource } };
|
package/odata-parser.pegjs
CHANGED
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
Process =
|
|
91
91
|
&{reset(); return true;}
|
|
92
92
|
tree:OData
|
|
93
|
-
{ return { tree
|
|
93
|
+
{ return { tree, binds } }
|
|
94
94
|
|
|
95
95
|
ProcessRule =
|
|
96
96
|
'' {
|
|
@@ -153,13 +153,13 @@ ParameterAliasOption =
|
|
|
153
153
|
binds['@' + name] = value
|
|
154
154
|
return {
|
|
155
155
|
name: '@' + name,
|
|
156
|
-
value
|
|
156
|
+
value
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
OperationParam =
|
|
161
161
|
name:Text '=' value:Text
|
|
162
|
-
{ return { name
|
|
162
|
+
{ return { name, value } }
|
|
163
163
|
|
|
164
164
|
SortOption =
|
|
165
165
|
'orderby='
|
|
@@ -188,12 +188,12 @@ SortProperty =
|
|
|
188
188
|
TopOption =
|
|
189
189
|
'top='
|
|
190
190
|
value:UnsignedInteger
|
|
191
|
-
{ return { name: '$top', value
|
|
191
|
+
{ return { name: '$top', value } }
|
|
192
192
|
|
|
193
193
|
SkipOption =
|
|
194
194
|
'skip='
|
|
195
195
|
value:UnsignedInteger
|
|
196
|
-
{ return { name: '$skip', value
|
|
196
|
+
{ return { name: '$skip', value } }
|
|
197
197
|
|
|
198
198
|
InlineCountOption =
|
|
199
199
|
'inlinecount='
|
|
@@ -202,26 +202,26 @@ InlineCountOption =
|
|
|
202
202
|
/ 'none'
|
|
203
203
|
/ Text { return '' }
|
|
204
204
|
)
|
|
205
|
-
{ return { name: '$inlinecount', value
|
|
205
|
+
{ return { name: '$inlinecount', value } }
|
|
206
206
|
|
|
207
207
|
CountOption =
|
|
208
208
|
'count='
|
|
209
209
|
value:Boolean
|
|
210
|
-
{ return { name: '$count', value
|
|
210
|
+
{ return { name: '$count', value } }
|
|
211
211
|
|
|
212
212
|
ExpandOption =
|
|
213
213
|
'expand='
|
|
214
214
|
properties:ExpandPropertyPathList
|
|
215
|
-
{ return { name: '$expand', value: { properties
|
|
215
|
+
{ return { name: '$expand', value: { properties } } }
|
|
216
216
|
|
|
217
217
|
SelectOption =
|
|
218
218
|
'select='
|
|
219
219
|
value:(
|
|
220
220
|
'*'
|
|
221
221
|
/ properties:PropertyPathList
|
|
222
|
-
{ return { properties
|
|
222
|
+
{ return { properties } }
|
|
223
223
|
)
|
|
224
|
-
{ return { name: '$select', value
|
|
224
|
+
{ return { name: '$select', value } }
|
|
225
225
|
|
|
226
226
|
|
|
227
227
|
FilterByOption =
|
|
@@ -410,7 +410,7 @@ FilterMethodCallExpression =
|
|
|
410
410
|
)
|
|
411
411
|
&{ return args.length === methods[methodName] || (Array.isArray(methods[methodName]) && methods[methodName].includes(args.length)) }
|
|
412
412
|
')'
|
|
413
|
-
{ return [ 'call', { args
|
|
413
|
+
{ return [ 'call', { args, method: methodName } ] }
|
|
414
414
|
|
|
415
415
|
LambdaMethodCall =
|
|
416
416
|
name:(
|
|
@@ -424,7 +424,7 @@ LambdaMethodCall =
|
|
|
424
424
|
expression:FilterByExpression
|
|
425
425
|
spaces
|
|
426
426
|
')'
|
|
427
|
-
{ return { expression
|
|
427
|
+
{ return { expression, identifier, method: name } }
|
|
428
428
|
|
|
429
429
|
ResourceMethodCall =
|
|
430
430
|
methodName:ResourceName
|
|
@@ -443,7 +443,7 @@ ResourceMethodCall =
|
|
|
443
443
|
/ '' { return [] }
|
|
444
444
|
)
|
|
445
445
|
')'
|
|
446
|
-
{ return [ 'call', { args
|
|
446
|
+
{ return [ 'call', { args, method: methodName } ] }
|
|
447
447
|
|
|
448
448
|
PropertyPathList =
|
|
449
449
|
path:PropertyPath
|
|
@@ -500,7 +500,7 @@ ExpandPropertyPath =
|
|
|
500
500
|
'/'
|
|
501
501
|
@PropertyPath
|
|
502
502
|
)?
|
|
503
|
-
{ return { name: resource, property: next, count
|
|
503
|
+
{ return { name: resource, property: next, count, options: optionsObj} }
|
|
504
504
|
|
|
505
505
|
LambdaPropertyPath =
|
|
506
506
|
resource:ResourceName
|
|
@@ -508,9 +508,9 @@ LambdaPropertyPath =
|
|
|
508
508
|
@( next:LambdaPropertyPath
|
|
509
509
|
{ return { name: resource, property: next } }
|
|
510
510
|
/ lambda:LambdaMethodCall
|
|
511
|
-
{ return { name: resource, lambda
|
|
511
|
+
{ return { name: resource, lambda } }
|
|
512
512
|
/ method:ResourceMethodCall
|
|
513
|
-
{ return { name: resource, method
|
|
513
|
+
{ return { name: resource, method } }
|
|
514
514
|
)
|
|
515
515
|
Key =
|
|
516
516
|
'('
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/odata-parser",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"description": "An OData parser written in OMeta",
|
|
5
5
|
"main": "odata-parser.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"_": "test/run.js"
|
|
38
38
|
},
|
|
39
39
|
"versionist": {
|
|
40
|
-
"publishedAt": "2023-02-23T16:
|
|
40
|
+
"publishedAt": "2023-02-23T16:23:23.948Z"
|
|
41
41
|
}
|
|
42
42
|
}
|