@oino-ts/db 0.10.1 → 0.10.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.
|
@@ -68,6 +68,11 @@ class OINODbSqlFilter {
|
|
|
68
68
|
/**
|
|
69
69
|
* Constructor for `OINODbSqlFilter` as parser of http parameter.
|
|
70
70
|
*
|
|
71
|
+
* Supports three types of statements:
|
|
72
|
+
* - comparison: (field)-lt|le|eq|ge|gt|like(value)
|
|
73
|
+
* - negation: -not(filter)
|
|
74
|
+
* - conjunction/disjunction: (filter)-and|or(filter)
|
|
75
|
+
*
|
|
71
76
|
* @param filterString string representation of filter from HTTP-request
|
|
72
77
|
*
|
|
73
78
|
*/
|
|
@@ -214,7 +219,12 @@ class OINODbSqlOrder {
|
|
|
214
219
|
/**
|
|
215
220
|
* Constructor for `OINODbSqlOrder` as parser of http parameter.
|
|
216
221
|
*
|
|
217
|
-
*
|
|
222
|
+
* Supports comma separated list of column orders formatted as :
|
|
223
|
+
* - `column` - order by column in ascending order
|
|
224
|
+
* - `column ASC|DESC` - order by single either ascending or descending order
|
|
225
|
+
* - `column+|-` - order by single either ascending or descending order
|
|
226
|
+
*
|
|
227
|
+
* @param orderString string representation of order from HTTP-request
|
|
218
228
|
*
|
|
219
229
|
*/
|
|
220
230
|
static parse(orderString) {
|
|
@@ -276,7 +286,7 @@ exports.OINODbSqlOrder = OINODbSqlOrder;
|
|
|
276
286
|
*
|
|
277
287
|
*/
|
|
278
288
|
class OINODbSqlLimit {
|
|
279
|
-
static _limitRegex = /^(\d+)(\spage\s)?(\d+)?$/i;
|
|
289
|
+
static _limitRegex = /^(\d+)(\spage\s|\.)?(\d+)?$/i;
|
|
280
290
|
_limit;
|
|
281
291
|
_page;
|
|
282
292
|
/**
|
|
@@ -293,6 +303,11 @@ class OINODbSqlLimit {
|
|
|
293
303
|
/**
|
|
294
304
|
* Constructor for `OINODbSqlLimit` as parser of http parameter.
|
|
295
305
|
*
|
|
306
|
+
* Supports limit and page formatted as:
|
|
307
|
+
* - `limit` - limit number of items to return
|
|
308
|
+
* - `limit page n` - limit number of items to return and return page n (starting from 1)
|
|
309
|
+
* - `limit.n` - limit number of items to return and return page n (starting from 1)
|
|
310
|
+
*
|
|
296
311
|
* @param limitString string representation of limit from HTTP-request
|
|
297
312
|
*
|
|
298
313
|
*/
|
|
@@ -368,6 +383,11 @@ class OINODbSqlAggregate {
|
|
|
368
383
|
/**
|
|
369
384
|
* Constructor for `OINODbSqlAggregate` as parser of http parameter.
|
|
370
385
|
*
|
|
386
|
+
* Supports comma separated list of aggregates formatted as:
|
|
387
|
+
* - `function(field)`
|
|
388
|
+
*
|
|
389
|
+
* Supported functions are count, sum, avg, min, max.
|
|
390
|
+
*
|
|
371
391
|
* @param aggregatorString string representation of limit from HTTP-request
|
|
372
392
|
*
|
|
373
393
|
*/
|
|
@@ -468,7 +488,7 @@ class OINODbSqlSelect {
|
|
|
468
488
|
/**
|
|
469
489
|
* Constructor for `OINODbSqlSelect` as parser of http parameter.
|
|
470
490
|
*
|
|
471
|
-
* @param columns comma
|
|
491
|
+
* @param columns comma separated string selected columns from HTTP-request
|
|
472
492
|
*
|
|
473
493
|
*/
|
|
474
494
|
static parse(columns) {
|
|
@@ -65,6 +65,11 @@ export class OINODbSqlFilter {
|
|
|
65
65
|
/**
|
|
66
66
|
* Constructor for `OINODbSqlFilter` as parser of http parameter.
|
|
67
67
|
*
|
|
68
|
+
* Supports three types of statements:
|
|
69
|
+
* - comparison: (field)-lt|le|eq|ge|gt|like(value)
|
|
70
|
+
* - negation: -not(filter)
|
|
71
|
+
* - conjunction/disjunction: (filter)-and|or(filter)
|
|
72
|
+
*
|
|
68
73
|
* @param filterString string representation of filter from HTTP-request
|
|
69
74
|
*
|
|
70
75
|
*/
|
|
@@ -210,7 +215,12 @@ export class OINODbSqlOrder {
|
|
|
210
215
|
/**
|
|
211
216
|
* Constructor for `OINODbSqlOrder` as parser of http parameter.
|
|
212
217
|
*
|
|
213
|
-
*
|
|
218
|
+
* Supports comma separated list of column orders formatted as :
|
|
219
|
+
* - `column` - order by column in ascending order
|
|
220
|
+
* - `column ASC|DESC` - order by single either ascending or descending order
|
|
221
|
+
* - `column+|-` - order by single either ascending or descending order
|
|
222
|
+
*
|
|
223
|
+
* @param orderString string representation of order from HTTP-request
|
|
214
224
|
*
|
|
215
225
|
*/
|
|
216
226
|
static parse(orderString) {
|
|
@@ -271,7 +281,7 @@ export class OINODbSqlOrder {
|
|
|
271
281
|
*
|
|
272
282
|
*/
|
|
273
283
|
export class OINODbSqlLimit {
|
|
274
|
-
static _limitRegex = /^(\d+)(\spage\s)?(\d+)?$/i;
|
|
284
|
+
static _limitRegex = /^(\d+)(\spage\s|\.)?(\d+)?$/i;
|
|
275
285
|
_limit;
|
|
276
286
|
_page;
|
|
277
287
|
/**
|
|
@@ -288,6 +298,11 @@ export class OINODbSqlLimit {
|
|
|
288
298
|
/**
|
|
289
299
|
* Constructor for `OINODbSqlLimit` as parser of http parameter.
|
|
290
300
|
*
|
|
301
|
+
* Supports limit and page formatted as:
|
|
302
|
+
* - `limit` - limit number of items to return
|
|
303
|
+
* - `limit page n` - limit number of items to return and return page n (starting from 1)
|
|
304
|
+
* - `limit.n` - limit number of items to return and return page n (starting from 1)
|
|
305
|
+
*
|
|
291
306
|
* @param limitString string representation of limit from HTTP-request
|
|
292
307
|
*
|
|
293
308
|
*/
|
|
@@ -362,6 +377,11 @@ export class OINODbSqlAggregate {
|
|
|
362
377
|
/**
|
|
363
378
|
* Constructor for `OINODbSqlAggregate` as parser of http parameter.
|
|
364
379
|
*
|
|
380
|
+
* Supports comma separated list of aggregates formatted as:
|
|
381
|
+
* - `function(field)`
|
|
382
|
+
*
|
|
383
|
+
* Supported functions are count, sum, avg, min, max.
|
|
384
|
+
*
|
|
365
385
|
* @param aggregatorString string representation of limit from HTTP-request
|
|
366
386
|
*
|
|
367
387
|
*/
|
|
@@ -461,7 +481,7 @@ export class OINODbSqlSelect {
|
|
|
461
481
|
/**
|
|
462
482
|
* Constructor for `OINODbSqlSelect` as parser of http parameter.
|
|
463
483
|
*
|
|
464
|
-
* @param columns comma
|
|
484
|
+
* @param columns comma separated string selected columns from HTTP-request
|
|
465
485
|
*
|
|
466
486
|
*/
|
|
467
487
|
static parse(columns) {
|
|
@@ -46,6 +46,11 @@ export declare class OINODbSqlFilter {
|
|
|
46
46
|
/**
|
|
47
47
|
* Constructor for `OINODbSqlFilter` as parser of http parameter.
|
|
48
48
|
*
|
|
49
|
+
* Supports three types of statements:
|
|
50
|
+
* - comparison: (field)-lt|le|eq|ge|gt|like(value)
|
|
51
|
+
* - negation: -not(filter)
|
|
52
|
+
* - conjunction/disjunction: (filter)-and|or(filter)
|
|
53
|
+
*
|
|
49
54
|
* @param filterString string representation of filter from HTTP-request
|
|
50
55
|
*
|
|
51
56
|
*/
|
|
@@ -92,7 +97,12 @@ export declare class OINODbSqlOrder {
|
|
|
92
97
|
/**
|
|
93
98
|
* Constructor for `OINODbSqlOrder` as parser of http parameter.
|
|
94
99
|
*
|
|
95
|
-
*
|
|
100
|
+
* Supports comma separated list of column orders formatted as :
|
|
101
|
+
* - `column` - order by column in ascending order
|
|
102
|
+
* - `column ASC|DESC` - order by single either ascending or descending order
|
|
103
|
+
* - `column+|-` - order by single either ascending or descending order
|
|
104
|
+
*
|
|
105
|
+
* @param orderString string representation of order from HTTP-request
|
|
96
106
|
*
|
|
97
107
|
*/
|
|
98
108
|
static parse(orderString: string): OINODbSqlOrder;
|
|
@@ -128,6 +138,11 @@ export declare class OINODbSqlLimit {
|
|
|
128
138
|
/**
|
|
129
139
|
* Constructor for `OINODbSqlLimit` as parser of http parameter.
|
|
130
140
|
*
|
|
141
|
+
* Supports limit and page formatted as:
|
|
142
|
+
* - `limit` - limit number of items to return
|
|
143
|
+
* - `limit page n` - limit number of items to return and return page n (starting from 1)
|
|
144
|
+
* - `limit.n` - limit number of items to return and return page n (starting from 1)
|
|
145
|
+
*
|
|
131
146
|
* @param limitString string representation of limit from HTTP-request
|
|
132
147
|
*
|
|
133
148
|
*/
|
|
@@ -175,6 +190,11 @@ export declare class OINODbSqlAggregate {
|
|
|
175
190
|
/**
|
|
176
191
|
* Constructor for `OINODbSqlAggregate` as parser of http parameter.
|
|
177
192
|
*
|
|
193
|
+
* Supports comma separated list of aggregates formatted as:
|
|
194
|
+
* - `function(field)`
|
|
195
|
+
*
|
|
196
|
+
* Supported functions are count, sum, avg, min, max.
|
|
197
|
+
*
|
|
178
198
|
* @param aggregatorString string representation of limit from HTTP-request
|
|
179
199
|
*
|
|
180
200
|
*/
|
|
@@ -223,7 +243,7 @@ export declare class OINODbSqlSelect {
|
|
|
223
243
|
/**
|
|
224
244
|
* Constructor for `OINODbSqlSelect` as parser of http parameter.
|
|
225
245
|
*
|
|
226
|
-
* @param columns comma
|
|
246
|
+
* @param columns comma separated string selected columns from HTTP-request
|
|
227
247
|
*
|
|
228
248
|
*/
|
|
229
249
|
static parse(columns: string): OINODbSqlSelect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oino-ts/db",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "OINO TS library package for publishing an SQL database tables as a REST API.",
|
|
5
5
|
"author": "Matias Kiviniemi (pragmatta)",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"module": "./dist/esm/index.js",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@oino-ts/common": "0.10.
|
|
22
|
+
"@oino-ts/common": "0.10.2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^20.14.10",
|
|
26
26
|
"@types/bun": "^1.1.14",
|
|
27
|
-
"@oino-ts/types": "0.10.
|
|
27
|
+
"@oino-ts/types": "0.10.2",
|
|
28
28
|
"typedoc": "^0.25.13"
|
|
29
29
|
},
|
|
30
30
|
"files": [
|
package/src/OINODbSqlParams.ts
CHANGED
|
@@ -62,6 +62,11 @@ export class OINODbSqlFilter {
|
|
|
62
62
|
/**
|
|
63
63
|
* Constructor for `OINODbSqlFilter` as parser of http parameter.
|
|
64
64
|
*
|
|
65
|
+
* Supports three types of statements:
|
|
66
|
+
* - comparison: (field)-lt|le|eq|ge|gt|like(value)
|
|
67
|
+
* - negation: -not(filter)
|
|
68
|
+
* - conjunction/disjunction: (filter)-and|or(filter)
|
|
69
|
+
*
|
|
65
70
|
* @param filterString string representation of filter from HTTP-request
|
|
66
71
|
*
|
|
67
72
|
*/
|
|
@@ -210,7 +215,12 @@ export class OINODbSqlOrder {
|
|
|
210
215
|
/**
|
|
211
216
|
* Constructor for `OINODbSqlOrder` as parser of http parameter.
|
|
212
217
|
*
|
|
213
|
-
*
|
|
218
|
+
* Supports comma separated list of column orders formatted as :
|
|
219
|
+
* - `column` - order by column in ascending order
|
|
220
|
+
* - `column ASC|DESC` - order by single either ascending or descending order
|
|
221
|
+
* - `column+|-` - order by single either ascending or descending order
|
|
222
|
+
*
|
|
223
|
+
* @param orderString string representation of order from HTTP-request
|
|
214
224
|
*
|
|
215
225
|
*/
|
|
216
226
|
static parse(orderString: string):OINODbSqlOrder {
|
|
@@ -275,7 +285,7 @@ export class OINODbSqlOrder {
|
|
|
275
285
|
*
|
|
276
286
|
*/
|
|
277
287
|
export class OINODbSqlLimit {
|
|
278
|
-
private static _limitRegex = /^(\d+)(\spage\s)?(\d+)?$/i
|
|
288
|
+
private static _limitRegex = /^(\d+)(\spage\s|\.)?(\d+)?$/i
|
|
279
289
|
|
|
280
290
|
private _limit: number
|
|
281
291
|
private _page: number
|
|
@@ -294,6 +304,11 @@ export class OINODbSqlLimit {
|
|
|
294
304
|
/**
|
|
295
305
|
* Constructor for `OINODbSqlLimit` as parser of http parameter.
|
|
296
306
|
*
|
|
307
|
+
* Supports limit and page formatted as:
|
|
308
|
+
* - `limit` - limit number of items to return
|
|
309
|
+
* - `limit page n` - limit number of items to return and return page n (starting from 1)
|
|
310
|
+
* - `limit.n` - limit number of items to return and return page n (starting from 1)
|
|
311
|
+
*
|
|
297
312
|
* @param limitString string representation of limit from HTTP-request
|
|
298
313
|
*
|
|
299
314
|
*/
|
|
@@ -365,6 +380,11 @@ export class OINODbSqlAggregate {
|
|
|
365
380
|
/**
|
|
366
381
|
* Constructor for `OINODbSqlAggregate` as parser of http parameter.
|
|
367
382
|
*
|
|
383
|
+
* Supports comma separated list of aggregates formatted as:
|
|
384
|
+
* - `function(field)`
|
|
385
|
+
*
|
|
386
|
+
* Supported functions are count, sum, avg, min, max.
|
|
387
|
+
*
|
|
368
388
|
* @param aggregatorString string representation of limit from HTTP-request
|
|
369
389
|
*
|
|
370
390
|
*/
|
|
@@ -471,7 +491,7 @@ export class OINODbSqlSelect {
|
|
|
471
491
|
/**
|
|
472
492
|
* Constructor for `OINODbSqlSelect` as parser of http parameter.
|
|
473
493
|
*
|
|
474
|
-
* @param columns comma
|
|
494
|
+
* @param columns comma separated string selected columns from HTTP-request
|
|
475
495
|
*
|
|
476
496
|
*/
|
|
477
497
|
static parse(columns: string):OINODbSqlSelect {
|