gg-express 1.0.36 → 1.0.38
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/GGApi.js +6 -0
- package/dist/GGExpress.d.ts +19 -14
- package/dist/GGExpress.js +8 -2
- package/dist/staticRouteInterface.d.ts +2 -2
- package/dist/test.js +3 -1
- package/package.json +1 -1
- package/src/GGApi.ts +6 -0
- package/src/GGExpress.ts +45 -25
- package/src/staticRouteInterface.ts +28 -17
- package/src/test.ts +3 -1
package/dist/GGApi.js
CHANGED
package/dist/GGExpress.d.ts
CHANGED
|
@@ -20,29 +20,34 @@ interface requireParamsStructure {
|
|
|
20
20
|
structure: {
|
|
21
21
|
[key: string]: paramType;
|
|
22
22
|
};
|
|
23
|
+
isPartialStructure?: boolean;
|
|
23
24
|
}
|
|
24
25
|
type numberOrString<T> = T extends "number" ? number : T extends "string" ? string : T extends "any" ? any : T extends string[] ? Unarray<T> : T extends number[] ? Unarray<T> : "error-type";
|
|
25
|
-
type singleOrArrayObject<DT extends requireParamsStructure["dataType"], T extends requireParamsStructure["structure"], K extends keyof T, P extends requireParamsStructure["parameter"]> = DT extends "arrayObject" ? {
|
|
26
|
+
type singleOrArrayObject<DT extends requireParamsStructure["dataType"], T extends requireParamsStructure["structure"], K extends keyof T, P extends requireParamsStructure["parameter"], J extends requireParamsStructure["isPartialStructure"]> = DT extends "arrayObject" ? {
|
|
26
27
|
data: {
|
|
27
28
|
parameter: {
|
|
28
29
|
[Key in keyof P]: numberOrString<P[Key]>;
|
|
29
30
|
};
|
|
30
|
-
data: {
|
|
31
|
+
data: (J extends true ? Partial<{
|
|
31
32
|
[Key in K]: numberOrString<T[Key]>;
|
|
32
|
-
}
|
|
33
|
+
}> : {
|
|
34
|
+
[Key in K]: numberOrString<T[Key]>;
|
|
35
|
+
})[];
|
|
33
36
|
};
|
|
34
37
|
} : {
|
|
35
38
|
data: {
|
|
36
39
|
parameter: {
|
|
37
40
|
[Key in keyof P]: numberOrString<P[Key]>;
|
|
38
41
|
};
|
|
39
|
-
data: {
|
|
42
|
+
data: J extends true ? Partial<{
|
|
43
|
+
[Key in K]: numberOrString<T[Key]>;
|
|
44
|
+
}> : {
|
|
40
45
|
[Key in K]: numberOrString<T[Key]>;
|
|
41
46
|
};
|
|
42
47
|
};
|
|
43
48
|
};
|
|
44
|
-
type MyRequest<DT extends requireParamsStructure["dataType"], T extends requireParamsStructure["structure"], K extends keyof T, P extends requireParamsStructure["parameter"]> = Request<{}, {}, singleOrArrayObject<DT, T, K, P>, singleOrArrayObject<DT, T, K, P>, {}>;
|
|
45
|
-
type MyResponse<DT extends responseStructure["dataType"], T extends responseStructure["structure"], K extends keyof T, P extends responseStructure["parameter"]> = Response<{
|
|
49
|
+
type MyRequest<DT extends requireParamsStructure["dataType"], T extends requireParamsStructure["structure"], K extends keyof T, P extends requireParamsStructure["parameter"], J extends requireParamsStructure["isPartialStructure"]> = Request<{}, {}, singleOrArrayObject<DT, T, K, P, J>, singleOrArrayObject<DT, T, K, P, J>, {}>;
|
|
50
|
+
type MyResponse<DT extends responseStructure["dataType"], T extends responseStructure["structure"], K extends keyof T, P extends responseStructure["parameter"], J extends requireParamsStructure["isPartialStructure"]> = Response<{
|
|
46
51
|
status: "SUCCESS" | "ERROR";
|
|
47
52
|
message: string;
|
|
48
53
|
parameter: {
|
|
@@ -59,22 +64,22 @@ export default class GGExpress {
|
|
|
59
64
|
private outputPath;
|
|
60
65
|
constructor(app: Express.Express, outputPath: string[]);
|
|
61
66
|
private rootMethod;
|
|
62
|
-
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: {
|
|
67
|
+
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"], J extends M["isPartialStructure"]>(url: `/api/${string}`, options: {
|
|
63
68
|
requireParams: M;
|
|
64
69
|
responseStructure: R;
|
|
65
|
-
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P>, res: MyResponse<R["dataType"], RS, KR, PP>, next: NextFunction) => any>): Express.Express;
|
|
66
|
-
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: {
|
|
70
|
+
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P, J>, res: MyResponse<R["dataType"], RS, KR, PP, J>, next: NextFunction) => any>): Express.Express;
|
|
71
|
+
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"], J extends M["isPartialStructure"]>(url: `/api/${string}`, options: {
|
|
67
72
|
requireParams: M;
|
|
68
73
|
responseStructure: R;
|
|
69
|
-
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P>, res: MyResponse<R["dataType"], RS, KR, PP>, next: NextFunction) => any>): Express.Express;
|
|
70
|
-
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: {
|
|
74
|
+
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P, J>, res: MyResponse<R["dataType"], RS, KR, PP, J>, next: NextFunction) => any>): Express.Express;
|
|
75
|
+
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"], J extends M["isPartialStructure"]>(url: `/api/${string}`, options: {
|
|
71
76
|
requireParams: M;
|
|
72
77
|
responseStructure: R;
|
|
73
|
-
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P>, res: MyResponse<R["dataType"], RS, KR, PP>, next: NextFunction) => any>): Express.Express;
|
|
74
|
-
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: {
|
|
78
|
+
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P, J>, res: MyResponse<R["dataType"], RS, KR, PP, J>, next: NextFunction) => any>): Express.Express;
|
|
79
|
+
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"], J extends M["isPartialStructure"]>(url: `/api/${string}`, options: {
|
|
75
80
|
requireParams: M;
|
|
76
81
|
responseStructure: R;
|
|
77
|
-
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P>, res: MyResponse<R["dataType"], RS, KR, PP>, next: NextFunction) => any>): Express.Express;
|
|
82
|
+
}, ...middlewares: Array<(req: MyRequest<M["dataType"], T, K, P, J>, res: MyResponse<R["dataType"], RS, KR, PP, J>, next: NextFunction) => any>): Express.Express;
|
|
78
83
|
generateAPIFiles(): void;
|
|
79
84
|
private generateStaticRouteFile;
|
|
80
85
|
private generateGGApi;
|
package/dist/GGExpress.js
CHANGED
|
@@ -125,7 +125,13 @@ class GGExpress {
|
|
|
125
125
|
rawString = filterDuplicateUrlOut
|
|
126
126
|
.map((row) => {
|
|
127
127
|
const parameterCode = genParamCodeParameter(row.requireParams);
|
|
128
|
-
|
|
128
|
+
let parameterDataCode = genDataParamCode(row.requireParams);
|
|
129
|
+
const isPartial = (code) => {
|
|
130
|
+
if (row.requireParams.isPartialStructure === true)
|
|
131
|
+
return `Partial<${code}>`;
|
|
132
|
+
else
|
|
133
|
+
return code;
|
|
134
|
+
};
|
|
129
135
|
const requireParameterCode = () => {
|
|
130
136
|
if (parameterCode === "")
|
|
131
137
|
return "";
|
|
@@ -136,7 +142,7 @@ class GGExpress {
|
|
|
136
142
|
if (parameterDataCode === "")
|
|
137
143
|
return "";
|
|
138
144
|
else
|
|
139
|
-
return ` data
|
|
145
|
+
return ` data:${isPartial(`{${parameterDataCode}}`)}${isArray(row.requireParams)}`;
|
|
140
146
|
};
|
|
141
147
|
let requireParamCode = `{${[requireParameterCode(), requireDataCode()]
|
|
142
148
|
.filter((row) => row.length > 0)
|
package/dist/test.js
CHANGED
|
@@ -40,7 +40,8 @@ function run() {
|
|
|
40
40
|
parameter: {
|
|
41
41
|
lotNumber: "number",
|
|
42
42
|
},
|
|
43
|
-
|
|
43
|
+
isPartialStructure: true,
|
|
44
|
+
dataType: "singleObject",
|
|
44
45
|
structure: {
|
|
45
46
|
id: "number",
|
|
46
47
|
name: "string",
|
|
@@ -56,6 +57,7 @@ function run() {
|
|
|
56
57
|
},
|
|
57
58
|
},
|
|
58
59
|
}, (req, res, next) => {
|
|
60
|
+
req.body.data.data;
|
|
59
61
|
// in body or query, you can access only requireParams that you declare at start
|
|
60
62
|
const data = req.body.data;
|
|
61
63
|
/* data structure
|
package/package.json
CHANGED
package/src/GGApi.ts
CHANGED
package/src/GGExpress.ts
CHANGED
|
@@ -28,6 +28,7 @@ interface requireParamsStructure {
|
|
|
28
28
|
structure: {
|
|
29
29
|
[key: string]: paramType
|
|
30
30
|
}
|
|
31
|
+
isPartialStructure?: boolean
|
|
31
32
|
}
|
|
32
33
|
type numberOrString<T> = T extends "number"
|
|
33
34
|
? number
|
|
@@ -45,18 +46,23 @@ type singleOrArrayObject<
|
|
|
45
46
|
DT extends requireParamsStructure["dataType"],
|
|
46
47
|
T extends requireParamsStructure["structure"],
|
|
47
48
|
K extends keyof T,
|
|
48
|
-
P extends requireParamsStructure["parameter"]
|
|
49
|
+
P extends requireParamsStructure["parameter"],
|
|
50
|
+
J extends requireParamsStructure["isPartialStructure"]
|
|
49
51
|
> = DT extends "arrayObject"
|
|
50
52
|
? {
|
|
51
53
|
data: {
|
|
52
54
|
parameter: { [Key in keyof P]: numberOrString<P[Key]> }
|
|
53
|
-
data:
|
|
55
|
+
data: (J extends true
|
|
56
|
+
? Partial<{ [Key in K]: numberOrString<T[Key]> }>
|
|
57
|
+
: { [Key in K]: numberOrString<T[Key]> })[]
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
: {
|
|
57
61
|
data: {
|
|
58
62
|
parameter: { [Key in keyof P]: numberOrString<P[Key]> }
|
|
59
|
-
data:
|
|
63
|
+
data: J extends true
|
|
64
|
+
? Partial<{ [Key in K]: numberOrString<T[Key]> }>
|
|
65
|
+
: { [Key in K]: numberOrString<T[Key]> }
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
|
|
@@ -64,12 +70,13 @@ type MyRequest<
|
|
|
64
70
|
DT extends requireParamsStructure["dataType"],
|
|
65
71
|
T extends requireParamsStructure["structure"],
|
|
66
72
|
K extends keyof T,
|
|
67
|
-
P extends requireParamsStructure["parameter"]
|
|
73
|
+
P extends requireParamsStructure["parameter"],
|
|
74
|
+
J extends requireParamsStructure["isPartialStructure"]
|
|
68
75
|
> = Request<
|
|
69
76
|
{},
|
|
70
77
|
{},
|
|
71
|
-
singleOrArrayObject<DT, T, K, P>,
|
|
72
|
-
singleOrArrayObject<DT, T, K, P>,
|
|
78
|
+
singleOrArrayObject<DT, T, K, P, J>,
|
|
79
|
+
singleOrArrayObject<DT, T, K, P, J>,
|
|
73
80
|
{}
|
|
74
81
|
>
|
|
75
82
|
|
|
@@ -77,7 +84,8 @@ type MyResponse<
|
|
|
77
84
|
DT extends responseStructure["dataType"],
|
|
78
85
|
T extends responseStructure["structure"],
|
|
79
86
|
K extends keyof T,
|
|
80
|
-
P extends responseStructure["parameter"]
|
|
87
|
+
P extends responseStructure["parameter"],
|
|
88
|
+
J extends requireParamsStructure["isPartialStructure"]
|
|
81
89
|
> = Response<{
|
|
82
90
|
status: "SUCCESS" | "ERROR"
|
|
83
91
|
message: string
|
|
@@ -110,7 +118,8 @@ export default class GGExpress {
|
|
|
110
118
|
RS extends R["structure"],
|
|
111
119
|
KR extends keyof RS,
|
|
112
120
|
P extends M["parameter"],
|
|
113
|
-
PP extends R["parameter"]
|
|
121
|
+
PP extends R["parameter"],
|
|
122
|
+
J extends M["isPartialStructure"]
|
|
114
123
|
>(
|
|
115
124
|
method: "get" | "post" | "put" | "delete",
|
|
116
125
|
url: string,
|
|
@@ -120,8 +129,8 @@ export default class GGExpress {
|
|
|
120
129
|
},
|
|
121
130
|
...middlewares: Array<
|
|
122
131
|
(
|
|
123
|
-
req: MyRequest<M["dataType"], T, K, P>,
|
|
124
|
-
res: MyResponse<R["dataType"], RS, KR, PP>,
|
|
132
|
+
req: MyRequest<M["dataType"], T, K, P, J>,
|
|
133
|
+
res: MyResponse<R["dataType"], RS, KR, PP, J>,
|
|
125
134
|
next: NextFunction
|
|
126
135
|
) => any
|
|
127
136
|
>
|
|
@@ -136,7 +145,7 @@ export default class GGExpress {
|
|
|
136
145
|
return this.express[method](
|
|
137
146
|
url,
|
|
138
147
|
(
|
|
139
|
-
req: MyRequest<M["dataType"], T, K, P>,
|
|
148
|
+
req: MyRequest<M["dataType"], T, K, P, J>,
|
|
140
149
|
res: Response,
|
|
141
150
|
next: NextFunction
|
|
142
151
|
) => {
|
|
@@ -153,7 +162,8 @@ export default class GGExpress {
|
|
|
153
162
|
RS extends R["structure"],
|
|
154
163
|
KR extends keyof RS,
|
|
155
164
|
P extends M["parameter"],
|
|
156
|
-
PP extends R["parameter"]
|
|
165
|
+
PP extends R["parameter"],
|
|
166
|
+
J extends M["isPartialStructure"]
|
|
157
167
|
>(
|
|
158
168
|
url: `/api/${string}`,
|
|
159
169
|
options: {
|
|
@@ -162,8 +172,8 @@ export default class GGExpress {
|
|
|
162
172
|
},
|
|
163
173
|
...middlewares: Array<
|
|
164
174
|
(
|
|
165
|
-
req: MyRequest<M["dataType"], T, K, P>,
|
|
166
|
-
res: MyResponse<R["dataType"], RS, KR, PP>,
|
|
175
|
+
req: MyRequest<M["dataType"], T, K, P, J>,
|
|
176
|
+
res: MyResponse<R["dataType"], RS, KR, PP, J>,
|
|
167
177
|
next: NextFunction
|
|
168
178
|
) => any
|
|
169
179
|
>
|
|
@@ -179,7 +189,8 @@ export default class GGExpress {
|
|
|
179
189
|
RS extends R["structure"],
|
|
180
190
|
KR extends keyof RS,
|
|
181
191
|
P extends M["parameter"],
|
|
182
|
-
PP extends R["parameter"]
|
|
192
|
+
PP extends R["parameter"],
|
|
193
|
+
J extends M["isPartialStructure"]
|
|
183
194
|
>(
|
|
184
195
|
url: `/api/${string}`,
|
|
185
196
|
options: {
|
|
@@ -188,8 +199,8 @@ export default class GGExpress {
|
|
|
188
199
|
},
|
|
189
200
|
...middlewares: Array<
|
|
190
201
|
(
|
|
191
|
-
req: MyRequest<M["dataType"], T, K, P>,
|
|
192
|
-
res: MyResponse<R["dataType"], RS, KR, PP>,
|
|
202
|
+
req: MyRequest<M["dataType"], T, K, P, J>,
|
|
203
|
+
res: MyResponse<R["dataType"], RS, KR, PP, J>,
|
|
193
204
|
next: NextFunction
|
|
194
205
|
) => any
|
|
195
206
|
>
|
|
@@ -204,7 +215,8 @@ export default class GGExpress {
|
|
|
204
215
|
RS extends R["structure"],
|
|
205
216
|
KR extends keyof RS,
|
|
206
217
|
P extends M["parameter"],
|
|
207
|
-
PP extends R["parameter"]
|
|
218
|
+
PP extends R["parameter"],
|
|
219
|
+
J extends M["isPartialStructure"]
|
|
208
220
|
>(
|
|
209
221
|
url: `/api/${string}`,
|
|
210
222
|
options: {
|
|
@@ -213,8 +225,8 @@ export default class GGExpress {
|
|
|
213
225
|
},
|
|
214
226
|
...middlewares: Array<
|
|
215
227
|
(
|
|
216
|
-
req: MyRequest<M["dataType"], T, K, P>,
|
|
217
|
-
res: MyResponse<R["dataType"], RS, KR, PP>,
|
|
228
|
+
req: MyRequest<M["dataType"], T, K, P, J>,
|
|
229
|
+
res: MyResponse<R["dataType"], RS, KR, PP, J>,
|
|
218
230
|
next: NextFunction
|
|
219
231
|
) => any
|
|
220
232
|
>
|
|
@@ -229,7 +241,8 @@ export default class GGExpress {
|
|
|
229
241
|
RS extends R["structure"],
|
|
230
242
|
KR extends keyof RS,
|
|
231
243
|
P extends M["parameter"],
|
|
232
|
-
PP extends R["parameter"]
|
|
244
|
+
PP extends R["parameter"],
|
|
245
|
+
J extends M["isPartialStructure"]
|
|
233
246
|
>(
|
|
234
247
|
url: `/api/${string}`,
|
|
235
248
|
options: {
|
|
@@ -238,8 +251,8 @@ export default class GGExpress {
|
|
|
238
251
|
},
|
|
239
252
|
...middlewares: Array<
|
|
240
253
|
(
|
|
241
|
-
req: MyRequest<M["dataType"], T, K, P>,
|
|
242
|
-
res: MyResponse<R["dataType"], RS, KR, PP>,
|
|
254
|
+
req: MyRequest<M["dataType"], T, K, P, J>,
|
|
255
|
+
res: MyResponse<R["dataType"], RS, KR, PP, J>,
|
|
243
256
|
next: NextFunction
|
|
244
257
|
) => any
|
|
245
258
|
>
|
|
@@ -326,8 +339,13 @@ export default class GGExpress {
|
|
|
326
339
|
rawString = filterDuplicateUrlOut
|
|
327
340
|
.map((row) => {
|
|
328
341
|
const parameterCode = genParamCodeParameter(row.requireParams)
|
|
329
|
-
|
|
342
|
+
let parameterDataCode = genDataParamCode(row.requireParams)
|
|
330
343
|
|
|
344
|
+
const isPartial = (code: string) => {
|
|
345
|
+
if (row.requireParams.isPartialStructure === true)
|
|
346
|
+
return `Partial<${code}>`
|
|
347
|
+
else return code
|
|
348
|
+
}
|
|
331
349
|
const requireParameterCode = () => {
|
|
332
350
|
if (parameterCode === "") return ""
|
|
333
351
|
else return ` parameter:{${parameterCode}} `
|
|
@@ -335,7 +353,9 @@ export default class GGExpress {
|
|
|
335
353
|
const requireDataCode = () => {
|
|
336
354
|
if (parameterDataCode === "") return ""
|
|
337
355
|
else
|
|
338
|
-
return ` data
|
|
356
|
+
return ` data:${isPartial(`{${parameterDataCode}}`)}${isArray(
|
|
357
|
+
row.requireParams
|
|
358
|
+
)}`
|
|
339
359
|
}
|
|
340
360
|
let requireParamCode = `{${[requireParameterCode(), requireDataCode()]
|
|
341
361
|
.filter((row) => row.length > 0)
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
export interface staticRouteInterface {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
2
|
+
get: {
|
|
3
|
+
"/api/users/id": {
|
|
4
|
+
requireParams: { data: { id: number }[] }
|
|
5
|
+
responseStructure: {
|
|
6
|
+
status: "SUCCESS" | "ERROR"
|
|
7
|
+
message: string
|
|
8
|
+
parameter: { numberOfPeople: number; itemName: string }
|
|
9
|
+
data: { id: number; name: string }[]
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
post: {
|
|
14
|
+
"/api/item": {
|
|
15
|
+
requireParams: {
|
|
16
|
+
parameter: { lotNumber: number }
|
|
17
|
+
data: Partial<{ id: number; name: string; price: number }>
|
|
18
|
+
}
|
|
19
|
+
responseStructure: {
|
|
20
|
+
status: "SUCCESS" | "ERROR"
|
|
21
|
+
message: string
|
|
22
|
+
parameter: { numberOfPeople: number; itemName: string }
|
|
23
|
+
data: { id: number; name: string }[]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
put: {}
|
|
28
|
+
delete: {}
|
|
29
|
+
}
|
package/src/test.ts
CHANGED
|
@@ -42,7 +42,8 @@ function run() {
|
|
|
42
42
|
parameter: {
|
|
43
43
|
lotNumber: "number",
|
|
44
44
|
},
|
|
45
|
-
|
|
45
|
+
isPartialStructure: true,
|
|
46
|
+
dataType: "singleObject",
|
|
46
47
|
structure: {
|
|
47
48
|
id: "number",
|
|
48
49
|
name: "string",
|
|
@@ -59,6 +60,7 @@ function run() {
|
|
|
59
60
|
},
|
|
60
61
|
},
|
|
61
62
|
(req, res, next) => {
|
|
63
|
+
req.body.data.data
|
|
62
64
|
// in body or query, you can access only requireParams that you declare at start
|
|
63
65
|
const data = req.body.data
|
|
64
66
|
/* data structure
|