gg-express 1.0.19 → 1.0.20
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/GGExpress.d.ts +4 -4
- package/dist/test.js +9 -1
- package/package.json +1 -1
- package/src/GGExpress.ts +5 -5
- package/src/test.ts +9 -1
package/dist/GGExpress.d.ts
CHANGED
|
@@ -55,19 +55,19 @@ export default class GGExpress {
|
|
|
55
55
|
private outputPath;
|
|
56
56
|
constructor(app: Express.Express, outputPath: string[]);
|
|
57
57
|
private rootMethod;
|
|
58
|
-
get<M extends requireParamsStructure, T extends M["structure"], K extends keyof T, R extends responseStructure, RS extends R["structure"], KR extends keyof RS, P extends M["parameter"], PP extends
|
|
58
|
+
get<M extends requireParamsStructure, T extends M["structure"], K extends keyof T, R extends responseStructure, RS extends R["structure"], KR extends keyof RS, P extends M["parameter"], PP extends R["parameter"]>(url: `/api/${string}`, options: {
|
|
59
59
|
requireParams: M;
|
|
60
60
|
responseStructure: R;
|
|
61
61
|
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P>, res: MyResponse<R["dataType"], RS, KR, PP>, next: NextFunction) => any>): Express.Express;
|
|
62
|
-
post<M extends requireParamsStructure, T extends M["structure"], K extends keyof T, R extends responseStructure, RS extends R["structure"], KR extends keyof RS, P extends M["parameter"], PP extends
|
|
62
|
+
post<M extends requireParamsStructure, T extends M["structure"], K extends keyof T, R extends responseStructure, RS extends R["structure"], KR extends keyof RS, P extends M["parameter"], PP extends R["parameter"]>(url: `/api/${string}`, options: {
|
|
63
63
|
requireParams: M;
|
|
64
64
|
responseStructure: R;
|
|
65
65
|
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P>, res: MyResponse<R["dataType"], RS, KR, PP>, next: NextFunction) => any>): Express.Express;
|
|
66
|
-
put<M extends requireParamsStructure, T extends M["structure"], K extends keyof T, R extends responseStructure, RS extends R["structure"], KR extends keyof RS, P extends M["parameter"], PP extends
|
|
66
|
+
put<M extends requireParamsStructure, T extends M["structure"], K extends keyof T, R extends responseStructure, RS extends R["structure"], KR extends keyof RS, P extends M["parameter"], PP extends R["parameter"]>(url: `/api/${string}`, options: {
|
|
67
67
|
requireParams: M;
|
|
68
68
|
responseStructure: R;
|
|
69
69
|
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P>, res: MyResponse<R["dataType"], RS, KR, PP>, next: NextFunction) => any>): Express.Express;
|
|
70
|
-
delete<M extends requireParamsStructure, T extends M["structure"], K extends keyof T, R extends responseStructure, RS extends R["structure"], KR extends keyof RS, P extends M["parameter"], PP extends
|
|
70
|
+
delete<M extends requireParamsStructure, T extends M["structure"], K extends keyof T, R extends responseStructure, RS extends R["structure"], KR extends keyof RS, P extends M["parameter"], PP extends R["parameter"]>(url: `/api/${string}`, options: {
|
|
71
71
|
requireParams: M;
|
|
72
72
|
responseStructure: R;
|
|
73
73
|
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P>, res: MyResponse<R["dataType"], RS, KR, PP>, next: NextFunction) => any>): Express.Express;
|
package/dist/test.js
CHANGED
|
@@ -28,7 +28,15 @@ function run() {
|
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
}, (req, res, next) => {
|
|
31
|
-
|
|
31
|
+
return res.json({
|
|
32
|
+
message: "",
|
|
33
|
+
status: "SUCCESS",
|
|
34
|
+
data: [],
|
|
35
|
+
parameter: {
|
|
36
|
+
itemName: "",
|
|
37
|
+
numberOfPeople: 2,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
32
40
|
});
|
|
33
41
|
app.listen(3000, () => {
|
|
34
42
|
ggapp.generateAPIFiles();
|
package/package.json
CHANGED
package/src/GGExpress.ts
CHANGED
|
@@ -101,7 +101,7 @@ export default class GGExpress {
|
|
|
101
101
|
RS extends R["structure"],
|
|
102
102
|
KR extends keyof RS,
|
|
103
103
|
P extends M["parameter"],
|
|
104
|
-
PP extends
|
|
104
|
+
PP extends R["parameter"]
|
|
105
105
|
>(
|
|
106
106
|
method: "get" | "post" | "put" | "delete",
|
|
107
107
|
url: string,
|
|
@@ -144,7 +144,7 @@ export default class GGExpress {
|
|
|
144
144
|
RS extends R["structure"],
|
|
145
145
|
KR extends keyof RS,
|
|
146
146
|
P extends M["parameter"],
|
|
147
|
-
PP extends
|
|
147
|
+
PP extends R["parameter"]
|
|
148
148
|
>(
|
|
149
149
|
url: `/api/${string}`,
|
|
150
150
|
options: {
|
|
@@ -170,7 +170,7 @@ export default class GGExpress {
|
|
|
170
170
|
RS extends R["structure"],
|
|
171
171
|
KR extends keyof RS,
|
|
172
172
|
P extends M["parameter"],
|
|
173
|
-
PP extends
|
|
173
|
+
PP extends R["parameter"]
|
|
174
174
|
>(
|
|
175
175
|
url: `/api/${string}`,
|
|
176
176
|
options: {
|
|
@@ -195,7 +195,7 @@ export default class GGExpress {
|
|
|
195
195
|
RS extends R["structure"],
|
|
196
196
|
KR extends keyof RS,
|
|
197
197
|
P extends M["parameter"],
|
|
198
|
-
PP extends
|
|
198
|
+
PP extends R["parameter"]
|
|
199
199
|
>(
|
|
200
200
|
url: `/api/${string}`,
|
|
201
201
|
options: {
|
|
@@ -220,7 +220,7 @@ export default class GGExpress {
|
|
|
220
220
|
RS extends R["structure"],
|
|
221
221
|
KR extends keyof RS,
|
|
222
222
|
P extends M["parameter"],
|
|
223
|
-
PP extends
|
|
223
|
+
PP extends R["parameter"]
|
|
224
224
|
>(
|
|
225
225
|
url: `/api/${string}`,
|
|
226
226
|
options: {
|
package/src/test.ts
CHANGED
|
@@ -26,7 +26,15 @@ function run() {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
(req, res, next) => {
|
|
29
|
-
|
|
29
|
+
return res.json({
|
|
30
|
+
message: "",
|
|
31
|
+
status: "SUCCESS",
|
|
32
|
+
data: [],
|
|
33
|
+
parameter: {
|
|
34
|
+
itemName: "",
|
|
35
|
+
numberOfPeople: 2,
|
|
36
|
+
},
|
|
37
|
+
})
|
|
30
38
|
}
|
|
31
39
|
)
|
|
32
40
|
app.listen(3000, () => {
|