@ewb/mongoose-query-express 0.1.1 → 0.1.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.
- package/lib/declarations.d.ts +2 -14
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/types.d.ts +13 -0
- package/lib/types.js +1 -0
- package/package.json +2 -2
package/lib/declarations.d.ts
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type mongoose from 'mongoose';
|
|
3
|
-
import { IQueryExpressOptions } from './QueryExpress.js';
|
|
1
|
+
import type { QueryExpressType } from './types.js';
|
|
4
2
|
declare global {
|
|
5
3
|
namespace Express {
|
|
6
4
|
interface Request {
|
|
7
|
-
|
|
8
|
-
ewb: {
|
|
9
|
-
query: Query<any>;
|
|
10
|
-
queryHistory?: QueryHistory<any>;
|
|
11
|
-
queryOptions: IQueryExpressOptions;
|
|
12
|
-
queryPostBody?: {
|
|
13
|
-
[key: string]: string | mongoose.Types.ObjectId;
|
|
14
|
-
};
|
|
15
|
-
queryExportJson?: any[];
|
|
16
|
-
querySearchJson?: ISearchPaginate<any>;
|
|
17
|
-
};
|
|
5
|
+
ewb: QueryExpressType<any, any>;
|
|
18
6
|
}
|
|
19
7
|
}
|
|
20
8
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import './declarations.js';
|
|
|
2
2
|
import { NextFunction, Request, Response } from 'express';
|
|
3
3
|
export * from '@ewb/mongoose-query';
|
|
4
4
|
export * from './QueryExpress.js';
|
|
5
|
+
export * from './types.js';
|
|
5
6
|
import { QueryExpress } from './QueryExpress.js';
|
|
6
7
|
export declare function initQueryExpress(req: Request, _res: Response, next: NextFunction): void;
|
|
7
8
|
export default QueryExpress;
|
package/lib/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import './declarations.js';
|
|
|
2
2
|
import { Query } from '@ewb/mongoose-query';
|
|
3
3
|
export * from '@ewb/mongoose-query';
|
|
4
4
|
export * from './QueryExpress.js';
|
|
5
|
+
export * from './types.js';
|
|
5
6
|
import { QueryExpress } from './QueryExpress.js';
|
|
6
7
|
export function initQueryExpress(req, _res, next) {
|
|
7
8
|
req.ewb = {
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ISearchPaginate, Query, QueryHistory } from '@ewb/mongoose-query';
|
|
2
|
+
import mongoose from 'mongoose';
|
|
3
|
+
import type { IQueryExpressOptions } from './QueryExpress.js';
|
|
4
|
+
export interface QueryExpressType<R extends Request, T extends object> {
|
|
5
|
+
query: Query<R, T>;
|
|
6
|
+
queryHistory?: QueryHistory<any>;
|
|
7
|
+
queryOptions: IQueryExpressOptions;
|
|
8
|
+
queryPostBody?: {
|
|
9
|
+
[key: string]: string | mongoose.Types.ObjectId;
|
|
10
|
+
};
|
|
11
|
+
queryExportJson?: any[];
|
|
12
|
+
querySearchJson?: ISearchPaginate<any>;
|
|
13
|
+
}
|
package/lib/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ewb/mongoose-query-express",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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.5",
|
|
21
21
|
"http-status": "^1.6.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|