nestjs-prisma-querybuilder-interface 1.0.1 → 1.0.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 (67) hide show
  1. package/README.md +156 -53
  2. package/dist/index.d.ts +3 -1
  3. package/dist/index.js +3 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/FilterParse.d.ts +2 -0
  6. package/dist/lib/FilterParse.js +18 -0
  7. package/dist/lib/FilterParse.js.map +1 -0
  8. package/dist/lib/FiltersFields.d.ts +13 -0
  9. package/dist/lib/FiltersFields.js +3 -0
  10. package/dist/lib/FiltersFields.js.map +1 -0
  11. package/dist/lib/Populate.d.ts +6 -0
  12. package/dist/lib/Populate.js +3 -0
  13. package/dist/lib/Populate.js.map +1 -0
  14. package/dist/lib/Query.d.ts +7 -16
  15. package/dist/lib/Querybuilder.d.ts +2 -3
  16. package/dist/lib/Querybuilder.js +11 -8
  17. package/dist/lib/Querybuilder.js.map +1 -1
  18. package/dist/lib/SortFields.d.ts +4 -0
  19. package/dist/lib/SortFields.js +3 -0
  20. package/dist/lib/SortFields.js.map +1 -0
  21. package/dist/lib/functions/FilterObjectParse.d.ts +3 -0
  22. package/dist/lib/functions/FilterObjectParse.js +37 -0
  23. package/dist/lib/functions/FilterObjectParse.js.map +1 -0
  24. package/dist/lib/functions/FilterParse.d.ts +1 -0
  25. package/dist/lib/functions/FilterParse.js +20 -0
  26. package/dist/lib/functions/FilterParse.js.map +1 -0
  27. package/dist/lib/functions/GetType.d.ts +1 -0
  28. package/dist/lib/functions/GetType.js +21 -0
  29. package/dist/lib/functions/GetType.js.map +1 -0
  30. package/dist/lib/functions/ObjectParse.d.ts +3 -0
  31. package/dist/lib/functions/ObjectParse.js +33 -0
  32. package/dist/lib/functions/ObjectParse.js.map +1 -0
  33. package/dist/lib/functions/QueryParse.d.ts +1 -0
  34. package/dist/lib/functions/QueryParse.js +20 -0
  35. package/dist/lib/functions/QueryParse.js.map +1 -0
  36. package/dist/lib/interfaces/And.d.ts +4 -0
  37. package/dist/lib/interfaces/And.js +3 -0
  38. package/dist/lib/interfaces/And.js.map +1 -0
  39. package/dist/lib/interfaces/Filter.d.ts +8 -0
  40. package/dist/lib/interfaces/Filter.js +3 -0
  41. package/dist/lib/interfaces/Filter.js.map +1 -0
  42. package/dist/lib/interfaces/FiltersFields.d.ts +4 -0
  43. package/dist/lib/interfaces/FiltersFields.js +3 -0
  44. package/dist/lib/interfaces/FiltersFields.js.map +1 -0
  45. package/dist/lib/interfaces/Operator.d.ts +1 -0
  46. package/dist/lib/interfaces/Operator.js +3 -0
  47. package/dist/lib/interfaces/Operator.js.map +1 -0
  48. package/dist/lib/interfaces/Or.d.ts +4 -0
  49. package/dist/lib/interfaces/Or.js +3 -0
  50. package/dist/lib/interfaces/Or.js.map +1 -0
  51. package/dist/lib/interfaces/ParsedFilter.d.ts +7 -0
  52. package/dist/lib/interfaces/ParsedFilter.js +3 -0
  53. package/dist/lib/interfaces/ParsedFilter.js.map +1 -0
  54. package/dist/lib/interfaces/Populate.d.ts +6 -0
  55. package/dist/lib/interfaces/Populate.js +3 -0
  56. package/dist/lib/interfaces/Populate.js.map +1 -0
  57. package/dist/lib/interfaces/Query.d.ts +11 -0
  58. package/dist/lib/interfaces/Query.js +3 -0
  59. package/dist/lib/interfaces/Query.js.map +1 -0
  60. package/dist/lib/interfaces/SortFields.d.ts +4 -0
  61. package/dist/lib/interfaces/SortFields.js +3 -0
  62. package/dist/lib/interfaces/SortFields.js.map +1 -0
  63. package/dist/teste.d.ts +1 -0
  64. package/dist/teste.js +42 -0
  65. package/dist/teste.js.map +1 -0
  66. package/dist/tsconfig.tsbuildinfo +1 -1
  67. package/package.json +2 -1
package/README.md CHANGED
@@ -4,12 +4,13 @@
4
4
 
5
5
  <br/>
6
6
 
7
- ### Documentação / Documentation
7
+ ## Use case
8
+
9
+ ### this is a frontend interface to [nestjs-prisma-querybuilder](https://github.com/HarielThums/nestjs-prisma-querybuilder)
8
10
 
9
- - [Português](#português)
10
- - [English](#english)
11
+ <br/>
11
12
 
12
- ### English
13
+ ### Documentação / Documentation
13
14
 
14
15
  - **How to install it?**
15
16
 
@@ -21,67 +22,169 @@
21
22
 
22
23
  - **How to use it?**
23
24
 
24
- ```tsx
25
- import { Querybuilder } from 'nestjs-prisma-querybuilder-interface';
25
+ - use in PARAMS with **AXIOS**
26
26
 
27
- const query = QueryToUrl({
28
- select: 'message title date',
29
- populate: [
30
- {
31
- path: 'user',
32
- select: 'name email'
33
- }
34
- ],
35
- sort: 'asc',
36
- sortField: 'date',
37
- limit: 20
38
- });
27
+ <br/>
39
28
 
40
- fetch(`http://example.com/movies.json?${query}`).then(res =>
41
- console.log(res)
42
- );
29
+ ```tsx
30
+ import { QueryString, Query } from 'nestjs-prisma-querybuilder-interface';
43
31
 
44
- // with axios
32
+ const query: Query = {
33
+ select: 'message title date',
34
+ populate: [
35
+ {
36
+ path: 'user',
37
+ select: 'name email'
38
+ }
39
+ ],
40
+ sort: { field: name, criteria: 'asc' },
41
+ page: 1,
42
+ limit: 20
43
+ };
45
44
 
46
- axios
47
- .get(`http://example.com/movies.json?${query}`)
48
- .then(res => console.log(res));
49
- ```
45
+ axios.get('http://example.com/movies', {
46
+ params: query,
47
+ paramsSerializer: params => QueryString(params)
48
+ });
49
+ ```
50
+
51
+ <br/>
52
+
53
+ - use in URL
54
+
55
+ <br/>
56
+
57
+ ```tsx
58
+ import { QueryString } from 'nestjs-prisma-querybuilder-interface';
59
+
60
+ const query = QueryString({
61
+ select: 'message title date',
62
+ populate: [
63
+ {
64
+ path: 'user',
65
+ select: 'name email'
66
+ }
67
+ ],
68
+ sort: 'asc',
69
+ sortField: 'date',
70
+ limit: 20
71
+ });
72
+
73
+ fetch(`http://example.com/movies?${query}`);
74
+
75
+ // with axios
76
+
77
+ axios.get(`http://example.com/movies?${query}`);
78
+ ```
79
+
80
+ <br/>
81
+
82
+ - **Property**
83
+
84
+ - Usage
85
+
86
+ | Name | Type | exemple |
87
+ | -------- | ----------------- | ------------------------------------------------ |
88
+ | select | string | select: 'name email', |
89
+ | page | number | page: 2, |
90
+ | limit | number | limit: 20, |
91
+ | sort | SortFields | sort: {field: string, criteria: 'asc'}, |
92
+ | populate | Populate [ ] | populate: [{path: 'car', select: 'model plate'}] |
93
+ | filter | FiltersFields [ ] | filter: [{name: 'jonas'}, {value: { gte: 4 }}] |
94
+
95
+ <br/>
50
96
 
51
- - **Properts**
97
+ - **Exported Interfaces**
52
98
 
53
- | Name | Type | exemple |
54
- | --------- | ---------------------- | ------------------------------------------------ |
55
- | select | string | select: 'name email', |
56
- | page | number | page: 2, |
57
- | limit | number | limit: 20, |
58
- | sort | 'asc' or 'desc' | sort: 'asc', |
59
- | sortField | string | sortField: 'name', |
60
- | populate | Populate | populate: [{path: 'car', select: 'model plate'}] |
61
- | operator | 'and' or 'or' or 'not' | operator: 'and' ` => use with filter` |
62
- | filter | FiltersFields[] | filter: [{path: 'name', value: 'willian'}] |
99
+ - **Query**
63
100
 
64
- - **Populate**
101
+ is a full types
65
102
 
66
- | Name | Type | exemple |
67
- | -------- | -------- | ------------------------------------------- |
68
- | path | string | path: 'picture' |
69
- | select | string | select: 'url extencion', |
70
- | populate | Populate | populate: [{path: 'post', select: 'title'}] |
103
+ - **Populate**
71
104
 
72
- - **FilterFields**
105
+ | Name | Type | exemple |
106
+ | -------- | ------------ | ------------------------------------------- |
107
+ | path | string | path: 'picture' |
108
+ | select | string | select: 'url extension', |
109
+ | populate | Populate [ ] | populate: [{path: 'post', select: 'title'}] |
73
110
 
74
- | Name | Type | exemple |
75
- | -------- | ------------------------------------------- | ------------------------------------ |
76
- | path | string | path: 'picture' |
77
- | value | string | value: 'url', |
78
- | type | 'string' or 'boolean' or 'number' or 'date' | type: 'number', ` => default string` |
79
- | operator | string | operator: 'equals', |
111
+ <br/>
80
112
 
81
- - **Operators**
113
+ - **FilterFields**
82
114
 
83
- contains, endsWith, startsWith, equals, gt, gte, in, lt, lte ,not, notIn
115
+ | Name | Type | exemple |
116
+ | ---- | ---------- | ------------------------------------------------------------------- |
117
+ | x | Filter | {name: { contains: 'Jonas' } } |
118
+ | and | Filter [ ] | {and: [{name: { contains: 'Jonas' }, {active: true }}]} |
119
+ | or | Filter [ ] | {or: [{post: { contains: 'hello' }, {post: { contains: 'world' }}]} |
84
120
 
85
- # END
121
+ - **Filter**
122
+
123
+ { key: value } with Operator 'equals'
124
+
125
+ exemple: { postId: 147 }
126
+
127
+ or
128
+
129
+ { key: { operator: value } }
130
+
131
+ exemple: { postId: { startsWith : 147 } }
132
+
133
+ <br/>
134
+
135
+ - **Operators**
136
+
137
+ contains, endsWith, startsWith, equals, gt, gte, in, lt, lte ,not, notIn
138
+
139
+ <br/>
140
+
141
+ - **Full usage exemple**
142
+
143
+ ```tsx
144
+ QueryString({
145
+ select: 'firstName picture',
146
+ populate: [
147
+ {
148
+ path: 'car',
149
+ select: 'model plate',
150
+ populate: [
151
+ {
152
+ path: 'brand',
153
+ select: 'name'
154
+ }
155
+ ]
156
+ }
157
+ ],
158
+ filter: [
159
+ {
160
+ createdAt: { lte: new Date() }
161
+ },
162
+ {
163
+ or: [
164
+ {
165
+ role: 'admin'
166
+ },
167
+ {
168
+ active: true
169
+ }
170
+ ]
171
+ },
172
+ {
173
+ and: [
174
+ {
175
+ firstName: 'Matt'
176
+ },
177
+ {
178
+ lastName: { contains: 'Ryan' }
179
+ }
180
+ ]
181
+ }
182
+ ]
183
+ });
184
+ ```
185
+
186
+ ### END
86
187
 
87
188
  - Nestjs/Prisma Querybuilder Interface is ISC licensed.
189
+
190
+ [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FWillian-Rodrigues%2Fnestjs-prisma-querybuilder-interface&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- export * from './lib/Query';
1
+ export * from './lib/interfaces/FiltersFields';
2
+ export * from './lib/interfaces/Query';
3
+ export * from './lib/interfaces/Populate';
2
4
  export * from './lib/Querybuilder';
package/dist/index.js CHANGED
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./lib/Query"), exports);
17
+ __exportStar(require("./lib/interfaces/FiltersFields"), exports);
18
+ __exportStar(require("./lib/interfaces/Query"), exports);
19
+ __exportStar(require("./lib/interfaces/Populate"), exports);
18
20
  __exportStar(require("./lib/Querybuilder"), exports);
19
21
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,yDAAuC;AACvC,4DAA0C;AAC1C,qDAAmC"}
@@ -0,0 +1,2 @@
1
+ import { FiltersFields } from './FiltersFields';
2
+ export declare const FilterParse: (filter: FiltersFields | any, filterGroup: 'and' | 'or') => any;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FilterParse = void 0;
4
+ const FilterParse = (filter, filterGroup) => {
5
+ if (filter?.length) {
6
+ return filter.map(filter => {
7
+ if (filter?.and) {
8
+ return (0, exports.FilterParse)(filter.and, 'and');
9
+ }
10
+ if (filter?.or) {
11
+ return (0, exports.FilterParse)(filter.or, 'or');
12
+ }
13
+ return { ...filter, filterGroup };
14
+ });
15
+ }
16
+ };
17
+ exports.FilterParse = FilterParse;
18
+ //# sourceMappingURL=FilterParse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterParse.js","sourceRoot":"","sources":["../../lib/FilterParse.ts"],"names":[],"mappings":";;;AAEO,MAAM,WAAW,GAAG,CACzB,MAA2B,EAC3B,WAAyB,EACzB,EAAE;IACF,IAAI,MAAM,EAAE,MAAM,EAAE;QAClB,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACzB,IAAI,MAAM,EAAE,GAAG,EAAE;gBACf,OAAO,IAAA,mBAAW,EAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;aACvC;YACD,IAAI,MAAM,EAAE,EAAE,EAAE;gBACd,OAAO,IAAA,mBAAW,EAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;aACrC;YACD,OAAO,EAAE,GAAG,MAAM,EAAE,WAAW,EAAE,CAAC;QACpC,CAAC,CAAC,CAAC;KACJ;AACH,CAAC,CAAC;AAfW,QAAA,WAAW,eAetB"}
@@ -0,0 +1,13 @@
1
+ declare type Filter = {
2
+ path: string;
3
+ value: string;
4
+ operator?: 'contains' | 'endsWith' | 'startsWith' | 'equals' | 'gt' | 'gte' | 'in' | 'lt' | 'lte' | 'not' | 'notIn';
5
+ };
6
+ declare type Or = {
7
+ or: Filter[];
8
+ };
9
+ declare type And = {
10
+ and: Filter[];
11
+ };
12
+ export declare type FiltersFields = Array<Filter | Or | And>;
13
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=FiltersFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FiltersFields.js","sourceRoot":"","sources":["../../lib/FiltersFields.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface Populate {
2
+ path: string;
3
+ select: string;
4
+ primaryKey?: string;
5
+ populate?: Populate[];
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Populate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Populate.js","sourceRoot":"","sources":["../../lib/Populate.ts"],"names":[],"mappings":""}
@@ -1,22 +1,13 @@
1
- interface Populate {
2
- path: string;
3
- select: string;
4
- populate?: Populate;
5
- }
6
- interface FiltersFields {
7
- path: string;
8
- value: string;
9
- type?: 'string' | 'boolean' | 'number' | 'date';
10
- operator?: 'contains' | 'endsWith' | 'startsWith' | 'equals' | 'gt' | 'gte' | 'in' | 'lt' | 'lte' | 'not' | 'notIn';
11
- }
1
+ import { FiltersFields } from './FiltersFields';
2
+ import { Populate } from './Populate';
3
+ import { SortFields } from './SortFields';
12
4
  export interface Query {
13
5
  select: string;
14
6
  page?: number;
15
7
  limit?: number;
16
- sort?: 'asc' | 'desc';
17
- sortField?: string;
8
+ sort?: SortFields;
18
9
  populate?: Populate[];
19
- operator?: 'and' | 'or' | 'not';
20
- filter?: FiltersFields[];
10
+ and?: FiltersFields;
11
+ or?: FiltersFields;
12
+ [x: string]: any;
21
13
  }
22
- export {};
@@ -1,3 +1,2 @@
1
- import { Query } from './Query';
2
- export declare function QueryToParam(query: Query): any;
3
- export declare function QueryToUrl(query: Query): any;
1
+ import { Query } from './interfaces/Query';
2
+ export declare function QueryString(query: Query): string;
@@ -1,13 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueryToUrl = exports.QueryToParam = void 0;
3
+ exports.QueryString = void 0;
4
4
  const qs_1 = require("qs");
5
- function QueryToParam(query) {
6
- return (0, qs_1.stringify)(query);
5
+ const QueryParse_1 = require("./functions/QueryParse");
6
+ function QueryString(query) {
7
+ if (query?.filter) {
8
+ const filters = (0, QueryParse_1.QueryParse)(query.filter);
9
+ return (0, qs_1.stringify)({ ...query, filters });
10
+ }
11
+ else {
12
+ return (0, qs_1.stringify)(query);
13
+ }
7
14
  }
8
- exports.QueryToParam = QueryToParam;
9
- function QueryToUrl(query) {
10
- return (0, qs_1.stringify)(query);
11
- }
12
- exports.QueryToUrl = QueryToUrl;
15
+ exports.QueryString = QueryString;
13
16
  //# sourceMappingURL=Querybuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Querybuilder.js","sourceRoot":"","sources":["../../lib/Querybuilder.ts"],"names":[],"mappings":";;;AAAA,2BAA+B;AAG/B,SAAgB,YAAY,CAAC,KAAY;IACvC,OAAO,IAAA,cAAS,EAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAFD,oCAEC;AAED,SAAgB,UAAU,CAAC,KAAY;IACrC,OAAO,IAAA,cAAS,EAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAFD,gCAEC"}
1
+ {"version":3,"file":"Querybuilder.js","sourceRoot":"","sources":["../../lib/Querybuilder.ts"],"names":[],"mappings":";;;AAAA,2BAA+B;AAC/B,uDAAoD;AAGpD,SAAgB,WAAW,CAAC,KAAY;IACtC,IAAI,KAAK,EAAE,MAAM,EAAE;QACjB,MAAM,OAAO,GAAG,IAAA,uBAAU,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,IAAA,cAAS,EAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;KACzC;SAAM;QACL,OAAO,IAAA,cAAS,EAAC,KAAK,CAAC,CAAC;KACzB;AACH,CAAC;AAPD,kCAOC"}
@@ -0,0 +1,4 @@
1
+ export interface SortFields {
2
+ field: string;
3
+ criteria?: 'asc' | 'desc';
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=SortFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortFields.js","sourceRoot":"","sources":["../../lib/SortFields.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { Filter } from 'lib/interfaces/Filter';
2
+ import { ParsedFilter } from 'lib/interfaces/ParsedFilter';
3
+ export declare const ObjectParse: (query: Filter) => ParsedFilter[];
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ObjectParse = void 0;
4
+ const GetType_1 = require("./GetType");
5
+ const objects = {
6
+ select: 'select',
7
+ page: 'page',
8
+ limit: 'limit',
9
+ sort: 'sort',
10
+ populate: 'populate',
11
+ and: 'and',
12
+ or: 'or'
13
+ };
14
+ const ObjectParse = (query) => {
15
+ const filters = [];
16
+ console.log(query);
17
+ Object.keys(query)?.map((key, index) => {
18
+ if (!objects[key]) {
19
+ const type = (0, GetType_1.getType)(Object.values(query)[index]);
20
+ filters.push({
21
+ path: key,
22
+ value: type === 'object'
23
+ ? Object.values(Object.values(query)[index])[0]
24
+ : Object.values(query)[index],
25
+ operator: type === 'object'
26
+ ? Object.keys(Object.values(query)[index])[0]
27
+ : 'equals',
28
+ type: type === 'object'
29
+ ? (0, GetType_1.getType)(Object.values(Object.values(query)[index])[0])
30
+ : type
31
+ });
32
+ }
33
+ });
34
+ return filters;
35
+ };
36
+ exports.ObjectParse = ObjectParse;
37
+ //# sourceMappingURL=FilterObjectParse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterObjectParse.js","sourceRoot":"","sources":["../../../lib/functions/FilterObjectParse.ts"],"names":[],"mappings":";;;AAGA,uCAAoC;AAEpC,MAAM,OAAO,GAAG;IACd,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,IAAI;CACT,CAAC;AAEK,MAAM,WAAW,GAAG,CAAC,KAAa,EAAkB,EAAE;IAC3D,MAAM,OAAO,GAAmB,EAAE,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACrC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACjB,MAAM,IAAI,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC;gBACX,IAAI,EAAE,GAAG;gBACT,KAAK,EACH,IAAI,KAAK,QAAQ;oBACf,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC/C,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;gBACjC,QAAQ,EACN,IAAI,KAAK,QAAQ;oBACf,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC7C,CAAC,CAAC,QAAQ;gBACd,IAAI,EACF,IAAI,KAAK,QAAQ;oBACf,CAAC,CAAC,IAAA,iBAAO,EAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACxD,CAAC,CAAC,IAAI;aACX,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAxBW,QAAA,WAAW,eAwBtB"}
@@ -0,0 +1 @@
1
+ export declare const FilterParse: (filter: any, filterGroup: 'and' | 'or') => any;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FilterParse = void 0;
4
+ const ObjectParse_1 = require("./ObjectParse");
5
+ const FilterParse = (filter, filterGroup) => {
6
+ if (filter?.length) {
7
+ return filter.map(filter => {
8
+ if (filter?.and) {
9
+ return (0, exports.FilterParse)(filter.and, 'and');
10
+ }
11
+ if (filter?.or) {
12
+ return (0, exports.FilterParse)(filter.or, 'or');
13
+ }
14
+ const parsedObject = (0, ObjectParse_1.ObjectParse)(filter)[0];
15
+ return { ...parsedObject, filterGroup };
16
+ });
17
+ }
18
+ };
19
+ exports.FilterParse = FilterParse;
20
+ //# sourceMappingURL=FilterParse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterParse.js","sourceRoot":"","sources":["../../../lib/functions/FilterParse.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAErC,MAAM,WAAW,GAAG,CAAC,MAAW,EAAE,WAAyB,EAAE,EAAE;IACpE,IAAI,MAAM,EAAE,MAAM,EAAE;QAClB,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACzB,IAAI,MAAM,EAAE,GAAG,EAAE;gBACf,OAAO,IAAA,mBAAW,EAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;aACvC;YACD,IAAI,MAAM,EAAE,EAAE,EAAE;gBACd,OAAO,IAAA,mBAAW,EAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;aACrC;YACD,MAAM,YAAY,GAAG,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5C,OAAO,EAAE,GAAG,YAAY,EAAE,WAAW,EAAE,CAAC;QAC1C,CAAC,CAAC,CAAC;KACJ;AACH,CAAC,CAAC;AAbW,QAAA,WAAW,eAatB"}
@@ -0,0 +1 @@
1
+ export declare const getType: (value: any) => "string" | "number" | "boolean" | "date" | "object";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getType = void 0;
4
+ const getType = (value) => {
5
+ switch (typeof value) {
6
+ case 'string':
7
+ return 'string';
8
+ case 'number':
9
+ return 'number';
10
+ case 'boolean':
11
+ return 'boolean';
12
+ default: {
13
+ if (value instanceof Date) {
14
+ return 'date';
15
+ }
16
+ return 'object';
17
+ }
18
+ }
19
+ };
20
+ exports.getType = getType;
21
+ //# sourceMappingURL=GetType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetType.js","sourceRoot":"","sources":["../../../lib/functions/GetType.ts"],"names":[],"mappings":";;;AAAO,MAAM,OAAO,GAAG,CAAC,KAAU,EAAE,EAAE;IACpC,QAAQ,OAAO,KAAK,EAAE;QACpB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,OAAO,CAAC,CAAC;YACP,IAAI,KAAK,YAAY,IAAI,EAAE;gBACzB,OAAO,MAAM,CAAC;aACf;YACD,OAAO,QAAQ,CAAC;SACjB;KACF;AACH,CAAC,CAAC;AAfW,QAAA,OAAO,WAelB"}
@@ -0,0 +1,3 @@
1
+ import { FiltersFields } from 'lib/interfaces/FiltersFields';
2
+ import { ParsedFilter } from 'lib/interfaces/ParsedFilter';
3
+ export declare const ObjectParse: (filter: FiltersFields) => ParsedFilter[];
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ObjectParse = void 0;
4
+ const FilterParse_1 = require("./FilterParse");
5
+ const GetType_1 = require("./GetType");
6
+ const objects = {
7
+ and: 'and',
8
+ or: 'or'
9
+ };
10
+ const ObjectParse = (filter) => {
11
+ return Object.keys(filter)?.map((key, index) => {
12
+ if (!objects[key]) {
13
+ const type = (0, GetType_1.getType)(Object.values(filter)[index]);
14
+ return {
15
+ path: key,
16
+ value: type === 'object'
17
+ ? Object.values(Object.values(filter)[index])[0]
18
+ : Object.values(filter)[index],
19
+ operator: type === 'object'
20
+ ? Object.keys(Object.values(filter)[index])[0]
21
+ : 'equals',
22
+ type: type === 'object'
23
+ ? (0, GetType_1.getType)(Object.values(Object.values(filter)[index])[0])
24
+ : type
25
+ };
26
+ }
27
+ else {
28
+ return (0, FilterParse_1.FilterParse)(filter, key);
29
+ }
30
+ });
31
+ };
32
+ exports.ObjectParse = ObjectParse;
33
+ //# sourceMappingURL=ObjectParse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectParse.js","sourceRoot":"","sources":["../../../lib/functions/ObjectParse.ts"],"names":[],"mappings":";;;AAEA,+CAA4C;AAC5C,uCAAoC;AAEpC,MAAM,OAAO,GAAG;IACd,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,IAAI;CACT,CAAC;AAEK,MAAM,WAAW,GAAG,CAAC,MAAqB,EAAkB,EAAE;IACnE,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC7C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACjB,MAAM,IAAI,GAAG,IAAA,iBAAO,EAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACnD,OAAO;gBACL,IAAI,EAAE,GAAG;gBACT,KAAK,EACH,IAAI,KAAK,QAAQ;oBACf,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;oBAChD,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;gBAClC,QAAQ,EACN,IAAI,KAAK,QAAQ;oBACf,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC9C,CAAC,CAAC,QAAQ;gBACd,IAAI,EACF,IAAI,KAAK,QAAQ;oBACf,CAAC,CAAC,IAAA,iBAAO,EAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACzD,CAAC,CAAC,IAAI;aACX,CAAC;SACH;aAAM;YACL,OAAO,IAAA,yBAAW,EAAC,MAAa,EAAE,GAAU,CAAC,CAAC;SAC/C;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAvBW,QAAA,WAAW,eAuBtB"}
@@ -0,0 +1 @@
1
+ export declare const QueryParse: (filters: any) => any[];
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueryParse = void 0;
4
+ const FilterParse_1 = require("./FilterParse");
5
+ const ObjectParse_1 = require("./ObjectParse");
6
+ const QueryParse = (filters) => {
7
+ const parsedFilter = [];
8
+ filters.forEach(filter => {
9
+ if (filter?.and) {
10
+ return parsedFilter.push(...(0, FilterParse_1.FilterParse)(filter.and, 'and'));
11
+ }
12
+ if (filter?.or) {
13
+ return parsedFilter.push(...(0, FilterParse_1.FilterParse)(filter.or, 'or'));
14
+ }
15
+ return parsedFilter.push(...(0, ObjectParse_1.ObjectParse)(filter));
16
+ });
17
+ return parsedFilter;
18
+ };
19
+ exports.QueryParse = QueryParse;
20
+ //# sourceMappingURL=QueryParse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryParse.js","sourceRoot":"","sources":["../../../lib/functions/QueryParse.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,+CAA4C;AAErC,MAAM,UAAU,GAAG,CAAC,OAAY,EAAE,EAAE;IACzC,MAAM,YAAY,GAAG,EAAE,CAAC;IACxB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACvB,IAAI,MAAM,EAAE,GAAG,EAAE;YACf,OAAO,YAAY,CAAC,IAAI,CAAC,GAAG,IAAA,yBAAW,EAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;SAC7D;QACD,IAAI,MAAM,EAAE,EAAE,EAAE;YACd,OAAO,YAAY,CAAC,IAAI,CAAC,GAAG,IAAA,yBAAW,EAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;SAC3D;QACD,OAAO,YAAY,CAAC,IAAI,CAAC,GAAG,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IACH,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB"}
@@ -0,0 +1,4 @@
1
+ import { Filter } from './Filter';
2
+ export declare type And = {
3
+ and: Filter[];
4
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=And.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"And.js","sourceRoot":"","sources":["../../../lib/interfaces/And.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { Operator } from './Operator';
2
+ declare type FilterObject = {
3
+ [x in Operator]: string | Date | boolean | number;
4
+ };
5
+ export declare type Filter = {
6
+ [x: string]: string | Date | boolean | number | FilterObject | object;
7
+ };
8
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../../lib/interfaces/Filter.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { And } from './And';
2
+ import { Filter } from './Filter';
3
+ import { Or } from './Or';
4
+ export declare type FiltersFields = Array<Filter | Or | And>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=FiltersFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FiltersFields.js","sourceRoot":"","sources":["../../../lib/interfaces/FiltersFields.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare type Operator = 'contains' | 'endsWith' | 'startsWith' | 'equals' | 'gt' | 'gte' | 'in' | 'lt' | 'lte' | 'not' | 'notIn';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Operator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Operator.js","sourceRoot":"","sources":["../../../lib/interfaces/Operator.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { Filter } from './Filter';
2
+ export declare type Or = {
3
+ or: Filter[];
4
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Or.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Or.js","sourceRoot":"","sources":["../../../lib/interfaces/Or.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { Filter } from './Filter';
2
+ export interface ParsedFilter extends Filter {
3
+ path: string;
4
+ value: any;
5
+ type: any;
6
+ operator: any;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ParsedFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParsedFilter.js","sourceRoot":"","sources":["../../../lib/interfaces/ParsedFilter.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface Populate {
2
+ path: string;
3
+ select: string;
4
+ primaryKey?: string;
5
+ populate?: Populate[];
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Populate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Populate.js","sourceRoot":"","sources":["../../../lib/interfaces/Populate.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { FiltersFields } from './FiltersFields';
2
+ import { Populate } from './Populate';
3
+ import { SortFields } from './SortFields';
4
+ export interface Query {
5
+ select: string;
6
+ page?: number;
7
+ limit?: number;
8
+ sort?: SortFields;
9
+ populate?: Populate[];
10
+ filter?: FiltersFields;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../lib/interfaces/Query.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export interface SortFields {
2
+ field: string;
3
+ criteria?: 'asc' | 'desc';
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=SortFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SortFields.js","sourceRoot":"","sources":["../../../lib/interfaces/SortFields.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export {};
package/dist/teste.js ADDED
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Querybuilder_1 = require("./lib/Querybuilder");
4
+ console.log((0, Querybuilder_1.QueryString)({
5
+ select: 'name role createdAt',
6
+ filter: [
7
+ {
8
+ coxinha: new Date()
9
+ },
10
+ {
11
+ or: [
12
+ {
13
+ kibe: 'frito'
14
+ },
15
+ {
16
+ risole: 2
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ and: [
22
+ {
23
+ kibe: 'frito'
24
+ },
25
+ {
26
+ risole: 2
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ or: [
32
+ {
33
+ kibe: 'frito'
34
+ },
35
+ {
36
+ risole: 2
37
+ }
38
+ ]
39
+ }
40
+ ]
41
+ }));
42
+ //# sourceMappingURL=teste.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teste.js","sourceRoot":"","sources":["../teste.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AACjD,OAAO,CAAC,GAAG,CACT,IAAA,0BAAW,EAAC;IACV,MAAM,EAAE,qBAAqB;IAC7B,MAAM,EAAE;QACN;YACE,OAAO,EAAE,IAAI,IAAI,EAAE;SACpB;QACD;YACE,EAAE,EAAE;gBACF;oBACE,IAAI,EAAE,OAAO;iBACd;gBACD;oBACE,MAAM,EAAE,CAAC;iBACV;aACF;SACF;QACD;YACE,GAAG,EAAE;gBACH;oBACE,IAAI,EAAE,OAAO;iBACd;gBACD;oBACE,MAAM,EAAE,CAAC;iBACV;aACF;SACF;QACD;YACE,EAAE,EAAE;gBACF;oBACE,IAAI,EAAE,OAAO;iBACd;gBACD;oBACE,MAAM,EAAE,CAAC;iBACV;aACF;SACF;KACF;CACF,CAAC,CACH,CAAC"}
@@ -1 +1 @@
1
- {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2021.full.d.ts","../lib/query.ts","../lib/querybuilder.ts","../index.ts"],"fileInfos":[{"version":"3ac1b83264055b28c0165688fda6dfcc39001e9e7828f649299101c23ad0a0c3","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f",{"version":"72704b10d97777e15f1a581b73f88273037ef752d2e50b72287bd0a90af64fe6","affectsGlobalScope":true},{"version":"dbb73d4d99be496175cb432c74c2615f78c76f4272f1d83cba11ee0ed6dbddf0","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"5075b36ab861c8c0c45377cb8c96270d7c65f0eeaf105d53fac6850da61f1027","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"e8c9f4e445a489991ca1a4232667de3ac36b07ba75ea335971fbeacf2d26fe67","affectsGlobalScope":true},"0ce99fa68940b918945c445a958e2568a5b7593f7e3a0eeef9f0f79d45651b91","a77e28529431ef82d39f6b07ea2c44d82ae8802628298c704547673a227e5708","67fbd6f3abc0fb6945b8b3ef0702e6e9fe5cb37d8b3ea1042f7276db976869a4","c8a4225f1013e791bc7a7bf1c2e04d79422ef9a76ff739000734e1d9e5624925"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"module":1,"outDir":"./","removeComments":true,"sourceMap":true,"target":8},"fileIdsList":[[48,49],[48]],"referencedMap":[[50,1],[49,2]],"exportedModulesMap":[[50,1],[49,2]],"semanticDiagnosticsPerFile":[50,48,49,9,10,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,34,35,36,37,7,42,38,39,40,41,8,47,46,43,44,45,1,12,11]},"version":"4.6.4"}
1
+ {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2021.full.d.ts","../lib/interfaces/operator.ts","../lib/interfaces/filter.ts","../lib/interfaces/and.ts","../lib/interfaces/or.ts","../lib/interfaces/filtersfields.ts","../lib/interfaces/populate.ts","../lib/interfaces/sortfields.ts","../lib/interfaces/query.ts","../node_modules/@types/qs/index.d.ts","../lib/interfaces/parsedfilter.ts","../lib/functions/gettype.ts","../lib/functions/objectparse.ts","../lib/functions/filterparse.ts","../lib/functions/queryparse.ts","../lib/querybuilder.ts","../index.ts","../teste.ts"],"fileInfos":[{"version":"3ac1b83264055b28c0165688fda6dfcc39001e9e7828f649299101c23ad0a0c3","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f",{"version":"72704b10d97777e15f1a581b73f88273037ef752d2e50b72287bd0a90af64fe6","affectsGlobalScope":true},{"version":"dbb73d4d99be496175cb432c74c2615f78c76f4272f1d83cba11ee0ed6dbddf0","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"5075b36ab861c8c0c45377cb8c96270d7c65f0eeaf105d53fac6850da61f1027","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"e8c9f4e445a489991ca1a4232667de3ac36b07ba75ea335971fbeacf2d26fe67","affectsGlobalScope":true},"0ce99fa68940b918945c445a958e2568a5b7593f7e3a0eeef9f0f79d45651b91",{"version":"9ec08b7c87d843e26d8c371d8234955c747f998638760946c5eeb8296b34c783","signature":"e3f4eab8905e386fac5e7afd43189c3b0b7950920e3bc0ee8f15c51db5dbba5b"},{"version":"8494163d9e4b5e7575d1a2603ecd590be8021585d3e994288cd7149f5d25c0fa","signature":"a1f62fb6d95b3175b6f8ce236a61f7601b11a56a0f3fa8ee70249d50cd01d273"},{"version":"2eb6814ef4c565b6481f36e339b7e4e13810b6fd2d10ffc0a129de36fb89508c","signature":"1f8c2bbe2bd680011db9530b663fdbd66e0a60dcf827c921d96550fff4ec8ec6"},{"version":"4f4fe40dd8faf10255a46258dab4895c569e9f6b57fe284d9a1cafc204d0ac87","signature":"a5c9d23f969863fa1a3228daca81c483dfefb3fcf1c6b0803f95c64afd38afa3"},{"version":"ea9f5a5982b06f89006fab682eec49ca138b91b86524675b5729fe4519a264ed","signature":"148735f962d020cd65ec5a2af43c3281047862196f7e785d2cd93ab6a9ce54f2"},{"version":"359d451021b822a6d98933b80f78ba24b544ec9cdd67547634627a57db290dd4","signature":"4e981cc658fe6d48a8c5cdecce9cbe34693bfb2a6d78584d764a5ec7e920fb97"},{"version":"1687d1bb2a596cfbe84ca0bedc14a4b099d7488fe7cf4e0cd84ec55dab5697d4","signature":"10c723d50b6752fd0cec5815a7ebe4e4e5f7aa58a308748c3233bc64ed08adb3"},{"version":"37ecd7faa1beb0254eae822d50d4a909794b575b330fedd004a93794a4fc3125","signature":"4a5e12455adb0f3747abfc138d5e23524df76264f0ebb86eea5db71cc7244180"},"ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc",{"version":"d5c8e6dbbd3fb2e5e8e6a6badb81d5738d4b39d418f7e810836a92bee016008b","signature":"c0810a8d9c5c4b8518e4220f8a8c8c6c783d31800506afe66eec0fb5fdc6425e"},{"version":"7d8ffafd00e33781b36628cff24159f8a6ba665211f555569f5f3da041c15adc","signature":"b05f509d8cc6243d6b2a95b10bc3fbbc255abe7a79ada4f82d6d3350016bc5ed"},{"version":"36af49645e8ad675fadcc7b8c8c50f826b3f030f3a327161473175a778a8ac4a","signature":"ec2d190a8989929df0979c146e1d0fb93e9cd1f758edc78feb25f090f346072b"},{"version":"78c03ce3990b4e75899906f8fb0d7504ba876cc1d5c7e5416a31eb2265f49036","signature":"ab3805210479b8982ca658fbed9d8e5f24504f41c124f0940c689ead0f305e1b"},{"version":"d4e581d329f5ec0ab948a61bb2fa80336ffd7ed77225426b3537b4e5336e2bf6","signature":"7344382c89ea2f73cb953233c80ac78879be293802b6691e54de8fba83a13f71"},{"version":"9a861f9463b507410e49ceda4288259684f88c445cb2949944f94c79d57bf910","signature":"f1b4d7e012d8c6651d25ee44cfe1e3b82ce63c8ce484574fad79a79f73c80f87"},"1d2ec3dbf453347e42046fe00eedf5739cec0413c74d7109225575b9ec210d94",{"version":"586e2b7db26f5b331a2799030d62c0ac676fa26697a7ec5f70497a5b85848464","signature":"f761c91419d0a89422a0004ef1a92929dd4d2d5e5c16758654d8b0467d1998c6"}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"experimentalDecorators":true,"module":1,"outDir":"./","removeComments":true,"sourceMap":true,"target":8},"fileIdsList":[[52,53,55,62],[59],[52,57,58,60],[59,60],[49],[48],[49,50,51],[52,53,54],[55,56,61],[62],[52,57],[55]],"referencedMap":[[63,1],[60,2],[59,3],[61,4],[50,5],[49,6],[52,7],[51,5],[57,5],[55,8],[62,9],[64,10]],"exportedModulesMap":[[63,1],[59,11],[50,5],[49,6],[52,7],[51,5],[57,5],[55,8],[62,12]],"semanticDiagnosticsPerFile":[63,60,58,59,61,50,49,52,48,51,57,53,55,54,62,56,9,10,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,34,35,36,37,7,42,38,39,40,41,8,47,46,43,44,45,1,12,11,64]},"version":"4.6.4"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestjs-prisma-querybuilder-interface",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Frontend interface to nestjs-prisma-querybuilder",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -34,6 +34,7 @@
34
34
  "qs": "^6.10.3"
35
35
  },
36
36
  "devDependencies": {
37
+ "@types/qs": "^6.9.7",
37
38
  "typescript": "^4.6.4"
38
39
  }
39
40
  }