@ewb/mongoose-query-express 0.0.2 → 0.0.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/README.md +0 -3
- package/lib/QueryExpress.d.ts +2 -2
- package/lib/QueryExpress.js +1 -1
- package/lib/QueryExpressSub.d.ts +2 -2
- package/lib/QueryExpressSub.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,6 +22,3 @@ user.post('/', userQuery.post);
|
|
|
22
22
|
user.patch('/:id', userQuery.patch);
|
|
23
23
|
user.delete('/:id', userQuery.delete); // Can also use userQuery.archive if archive option set.
|
|
24
24
|
```
|
|
25
|
-
|
|
26
|
-
// This is used to set some logic for query to that model. Model for query is set in the controllers.
|
|
27
|
-
|
package/lib/QueryExpress.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryModel } from '@ewb/mongoose-query';
|
|
2
2
|
import { NextFunction, Request, Response } from 'express';
|
|
3
3
|
import mongoose from 'mongoose';
|
|
4
4
|
import { QueryExpressSub } from './QueryExpressSub.js';
|
|
@@ -20,7 +20,7 @@ export declare class QueryExpress<R extends Request, T extends mongoose.Document
|
|
|
20
20
|
private param;
|
|
21
21
|
private handler;
|
|
22
22
|
readonly options: IQueryExpressHandlerOptions<T>;
|
|
23
|
-
constructor(param: keyof R, handler:
|
|
23
|
+
constructor(param: keyof R, handler: QueryModel<T>, options?: IQueryExpressHandlerOptions<T>);
|
|
24
24
|
post(req: R, res: Response, next: NextFunction): Promise<void>;
|
|
25
25
|
findOne(req: R, _res: Response, next: NextFunction): Promise<void>;
|
|
26
26
|
search(req: R, res: Response, next: NextFunction): Promise<void | Response<any, Record<string, any>>>;
|
package/lib/QueryExpress.js
CHANGED
|
@@ -2,7 +2,7 @@ import { QueryError } from '@ewb/mongoose-query';
|
|
|
2
2
|
import httpStatus from 'http-status';
|
|
3
3
|
import mongoose from 'mongoose';
|
|
4
4
|
import { QueryExpressSub } from './QueryExpressSub.js';
|
|
5
|
-
import { pageLinkHeader } from './utils';
|
|
5
|
+
import { pageLinkHeader } from './utils.js';
|
|
6
6
|
export class QueryExpress {
|
|
7
7
|
constructor(param, handler, options = {}) {
|
|
8
8
|
this.param = param;
|
package/lib/QueryExpressSub.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryModel } from '@ewb/mongoose-query';
|
|
2
2
|
import { NextFunction, Request, Response } from 'express';
|
|
3
3
|
import mongoose from 'mongoose';
|
|
4
4
|
import { QueryExpress } from './QueryExpress.js';
|
|
@@ -7,7 +7,7 @@ export declare class QueryExpressSub<R extends Request, T extends mongoose.Docum
|
|
|
7
7
|
private express;
|
|
8
8
|
private reqKey;
|
|
9
9
|
private param;
|
|
10
|
-
constructor(handler:
|
|
10
|
+
constructor(handler: QueryModel<T>, express: QueryExpress<R, T>, reqKey: keyof R, param: K);
|
|
11
11
|
post(req: R, _res: Response, next: NextFunction): Promise<void>;
|
|
12
12
|
search(req: R, res: Response, next: NextFunction): Promise<Response<any, Record<string, any>>>;
|
|
13
13
|
findOne(req: R, _res: Response, next: NextFunction): Promise<void>;
|
package/lib/QueryExpressSub.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { QueryError } from '@ewb/mongoose-query';
|
|
2
2
|
import httpStatus from 'http-status';
|
|
3
3
|
import mongoose from 'mongoose';
|
|
4
|
-
import { pageLinkHeader } from './utils';
|
|
4
|
+
import { pageLinkHeader } from './utils.js';
|
|
5
5
|
export class QueryExpressSub {
|
|
6
6
|
constructor(handler, express, reqKey, param) {
|
|
7
7
|
this.handler = handler;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ewb/mongoose-query-express",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Routes and controllers for express to handle mongoose queries",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"preversion": "yarn build"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ewb/mongoose-query": "^1.0.
|
|
20
|
+
"@ewb/mongoose-query": "^1.0.4",
|
|
21
21
|
"http-status": "^1.6.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|