@aifabrix/miso-client 2.1.0 → 2.1.1
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 +47 -0
- package/package.json +2 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Express Response Type Extensions
|
|
3
|
+
* Extends Express Response with standardized response helper methods
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { PaginationMeta } from "./response-helper";
|
|
7
|
+
|
|
8
|
+
declare global {
|
|
9
|
+
namespace Express {
|
|
10
|
+
interface Response {
|
|
11
|
+
/**
|
|
12
|
+
* Success response with data (200)
|
|
13
|
+
* @param data - Response data
|
|
14
|
+
* @param message - Optional success message
|
|
15
|
+
*/
|
|
16
|
+
success: <T>(data: T, message?: string) => Response;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Created response (201)
|
|
20
|
+
* @param data - Created resource data
|
|
21
|
+
* @param message - Optional success message
|
|
22
|
+
*/
|
|
23
|
+
created: <T>(data: T, message?: string) => Response;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Paginated list response (200)
|
|
27
|
+
* @param items - Array of items
|
|
28
|
+
* @param meta - Pagination metadata
|
|
29
|
+
*/
|
|
30
|
+
paginated: <T>(items: T[], meta: PaginationMeta) => Response;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* No content response (204)
|
|
34
|
+
*/
|
|
35
|
+
noContent: () => Response;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Accepted response (202)
|
|
39
|
+
* @param data - Optional data about the accepted request
|
|
40
|
+
* @param message - Optional message
|
|
41
|
+
*/
|
|
42
|
+
accepted: <T>(data?: T, message?: string) => Response;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aifabrix/miso-client",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "AI Fabrix Client SDK - Authentication, authorization, logging, and Express.js utilities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
8
|
+
"build": "tsc && node -e \"require('fs').copyFileSync('src/express/express.d.ts', 'dist/express/express.d.ts')\"",
|
|
9
9
|
"test": "node --unhandled-rejections=warn -r ./tests/setup-rejection-handler.js node_modules/jest/bin/jest.js",
|
|
10
10
|
"test:watch": "node --unhandled-rejections=warn -r ./tests/setup-rejection-handler.js node_modules/jest/bin/jest.js --watch",
|
|
11
11
|
"test:coverage": "node --unhandled-rejections=warn -r ./tests/setup-rejection-handler.js node_modules/jest/bin/jest.js --coverage",
|