my-q-format-response-aws-lambda 1.0.59 → 1.0.61
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/index.js +7 -6
- package/index.ts +20 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -430,12 +430,13 @@ exports.normaliseMongoFilter = normaliseMongoFilter;
|
|
|
430
430
|
* @param filter
|
|
431
431
|
*/
|
|
432
432
|
const normaliseMongoPaginate = (filter) => {
|
|
433
|
-
let res = {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
433
|
+
let res = {};
|
|
434
|
+
if (filter.hasOwnProperty('limit') && filter.hasOwnProperty('skip')) {
|
|
435
|
+
res = {
|
|
436
|
+
skip: filter.skip ? parseInt(filter.skip, 10) : 0,
|
|
437
|
+
limit: filter.limit ? parseInt(filter.limit, 10) : 50,
|
|
438
|
+
};
|
|
439
|
+
}
|
|
439
440
|
return res;
|
|
440
441
|
};
|
|
441
442
|
exports.normaliseMongoPaginate = normaliseMongoPaginate;
|
package/index.ts
CHANGED
|
@@ -600,10 +600,12 @@ export const normaliseMongoFilter = (
|
|
|
600
600
|
return _filter
|
|
601
601
|
}
|
|
602
602
|
|
|
603
|
-
export
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
603
|
+
export type TMongoPaginate =
|
|
604
|
+
| {
|
|
605
|
+
skip: number
|
|
606
|
+
limit: number
|
|
607
|
+
}
|
|
608
|
+
| {}
|
|
607
609
|
|
|
608
610
|
export type TFieldsGQL =
|
|
609
611
|
| 'create'
|
|
@@ -629,13 +631,14 @@ export type TFieldsGQL =
|
|
|
629
631
|
* @param filter
|
|
630
632
|
*/
|
|
631
633
|
export const normaliseMongoPaginate = (filter: TMongoFilterNormalise): TMongoPaginate => {
|
|
632
|
-
let res: TMongoPaginate = {
|
|
633
|
-
skip: 0,
|
|
634
|
-
limit: 50,
|
|
635
|
-
}
|
|
634
|
+
let res: TMongoPaginate = {}
|
|
636
635
|
|
|
637
|
-
|
|
638
|
-
|
|
636
|
+
if (filter.hasOwnProperty('limit') && filter.hasOwnProperty('skip')) {
|
|
637
|
+
res = {
|
|
638
|
+
skip: filter.skip ? parseInt(filter.skip, 10) : 0,
|
|
639
|
+
limit: filter.limit ? parseInt(filter.limit, 10) : 50,
|
|
640
|
+
}
|
|
641
|
+
}
|
|
639
642
|
|
|
640
643
|
return res
|
|
641
644
|
}
|
|
@@ -733,6 +736,9 @@ export const parseMessageResponse = (message: string, separator: string = '__'):
|
|
|
733
736
|
// ********************** ENTITY INPUT TYPES *************************************
|
|
734
737
|
// **************************************************************************************
|
|
735
738
|
|
|
739
|
+
type TID = string
|
|
740
|
+
type TIDs = string[]
|
|
741
|
+
|
|
736
742
|
// CREATE
|
|
737
743
|
export interface TEntityInputCreate<M> {
|
|
738
744
|
values: M
|
|
@@ -748,23 +754,23 @@ export interface TEntityInputGetList<F, S> {
|
|
|
748
754
|
|
|
749
755
|
// ONE BY ID
|
|
750
756
|
export interface TEntityInputOneByID {
|
|
751
|
-
id:
|
|
757
|
+
id: TID
|
|
752
758
|
}
|
|
753
759
|
|
|
754
760
|
// MANY BY IDs
|
|
755
761
|
export interface TEntityInputManyByIDs {
|
|
756
|
-
ids:
|
|
762
|
+
ids: TIDs
|
|
757
763
|
}
|
|
758
764
|
|
|
759
765
|
// VALUES ONE BY ID
|
|
760
766
|
export interface TEntityInputValuesOneByID<M> {
|
|
761
|
-
id:
|
|
767
|
+
id: TID
|
|
762
768
|
values: M
|
|
763
769
|
}
|
|
764
770
|
|
|
765
771
|
// VALUES MANY BY IDs
|
|
766
772
|
export interface TEntityInputValuesManyByIDs<M> {
|
|
767
|
-
ids:
|
|
773
|
+
ids: TIDs
|
|
768
774
|
values: M
|
|
769
775
|
}
|
|
770
776
|
|
package/package.json
CHANGED