@aifabrix/miso-client 2.1.1 → 2.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/dist/express/express.d.ts +15 -4
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Express Response Type Extensions
|
|
3
3
|
* Extends Express Response with standardized response helper methods
|
|
4
|
+
*
|
|
5
|
+
* Note: PaginationMeta is inlined to avoid `import type` syntax which
|
|
6
|
+
* causes Jest parsing issues in consuming projects (Jest tries to parse
|
|
7
|
+
* .d.ts files as JavaScript in CommonJS mode).
|
|
4
8
|
*/
|
|
5
9
|
|
|
6
|
-
import type { PaginationMeta } from "./response-helper";
|
|
7
|
-
|
|
8
10
|
declare global {
|
|
9
11
|
namespace Express {
|
|
10
12
|
interface Response {
|
|
@@ -25,9 +27,18 @@ declare global {
|
|
|
25
27
|
/**
|
|
26
28
|
* Paginated list response (200)
|
|
27
29
|
* @param items - Array of items
|
|
28
|
-
* @param meta - Pagination metadata
|
|
30
|
+
* @param meta - Pagination metadata (currentPage, pageSize, totalItems, totalPages?, type)
|
|
29
31
|
*/
|
|
30
|
-
paginated: <T>(
|
|
32
|
+
paginated: <T>(
|
|
33
|
+
items: T[],
|
|
34
|
+
meta: {
|
|
35
|
+
currentPage: number;
|
|
36
|
+
pageSize: number;
|
|
37
|
+
totalItems: number;
|
|
38
|
+
totalPages?: number;
|
|
39
|
+
type: string;
|
|
40
|
+
},
|
|
41
|
+
) => Response;
|
|
31
42
|
|
|
32
43
|
/**
|
|
33
44
|
* No content response (204)
|
package/package.json
CHANGED