response-standardizer 1.1.4 → 1.1.5
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/dist/types.d.ts +7 -4
- package/package.json +1 -1
- package/src/types.ts +7 -5
package/dist/types.d.ts
CHANGED
|
@@ -8,12 +8,15 @@ export interface StandardResponse<T = any> {
|
|
|
8
8
|
timestamp: string;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
12
|
-
data: T[];
|
|
11
|
+
export interface PaginationMeta {
|
|
13
12
|
total: number;
|
|
14
13
|
page: number;
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
limit: number;
|
|
15
|
+
totalPages: number;
|
|
16
|
+
}
|
|
17
|
+
export interface Pagination<T> {
|
|
18
|
+
data: T[];
|
|
19
|
+
meta: PaginationMeta;
|
|
17
20
|
}
|
|
18
21
|
export type ErrorFields = Record<string, string[]>;
|
|
19
22
|
export type Middleware = (req: Request, res: Response, next: NextFunction) => void;
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -9,13 +9,15 @@ export interface StandardResponse<T = any> {
|
|
|
9
9
|
timestamp: string;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
export interface Pagination<T>{
|
|
14
|
-
data: T[];
|
|
12
|
+
export interface PaginationMeta{
|
|
15
13
|
total: number;
|
|
16
14
|
page: number;
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
limit: number;
|
|
16
|
+
totalPages: number;
|
|
17
|
+
}
|
|
18
|
+
export interface Pagination<T>{
|
|
19
|
+
data: T[];
|
|
20
|
+
meta: PaginationMeta
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export type ErrorFields = Record<string, string[]>;
|