@bool-ts/core 1.4.0 → 1.4.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/decorators/arguments.d.ts +15 -3
- package/dist/decorators/arguments.js +31 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +1 -1
- package/dist/hooks/factory.js +35 -12
- package/package.json +1 -1
- package/src/decorators/arguments.ts +62 -4
- package/src/decorators/index.ts +1 -1
- package/src/hooks/factory.ts +47 -13
|
@@ -3,7 +3,9 @@ export declare enum EArgumentTypes {
|
|
|
3
3
|
headers = "HEADERS",
|
|
4
4
|
body = "BODY",
|
|
5
5
|
params = "PARAMS",
|
|
6
|
-
|
|
6
|
+
param = "PARAM",
|
|
7
|
+
query = "QUERY",
|
|
8
|
+
request = "REQUEST"
|
|
7
9
|
}
|
|
8
10
|
export type TMetadata = {
|
|
9
11
|
index: number;
|
|
@@ -17,15 +19,25 @@ export type TMetadata = {
|
|
|
17
19
|
} | {
|
|
18
20
|
index: number;
|
|
19
21
|
type: EArgumentTypes.params;
|
|
20
|
-
|
|
22
|
+
zodSchema?: Zod.Schema;
|
|
23
|
+
} | {
|
|
24
|
+
index: number;
|
|
25
|
+
type: EArgumentTypes.param;
|
|
26
|
+
key: string;
|
|
21
27
|
zodSchema?: Zod.Schema;
|
|
22
28
|
} | {
|
|
23
29
|
index: number;
|
|
24
30
|
type: EArgumentTypes.query;
|
|
25
31
|
zodSchema?: Zod.Schema;
|
|
32
|
+
} | {
|
|
33
|
+
index: number;
|
|
34
|
+
type: EArgumentTypes.request;
|
|
35
|
+
zodSchema?: Zod.Schema;
|
|
26
36
|
};
|
|
27
37
|
export declare const controllerActionArgumentsKey: unique symbol;
|
|
28
38
|
export declare const Headers: (zodSchema?: Zod.Schema) => (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
29
39
|
export declare const Body: (zodSchema?: Zod.Schema, parser?: "arrayBuffer" | "blob" | "formData" | "json" | "text") => (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
30
|
-
export declare const Params: (
|
|
40
|
+
export declare const Params: (zodSchema?: Zod.Schema) => (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
41
|
+
export declare const Param: (key: string, zodSchema?: Zod.Schema) => (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
31
42
|
export declare const Query: (zodSchema?: Zod.Schema) => (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
43
|
+
export declare const Request: (zodSchema?: Zod.Schema) => (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => void;
|
|
@@ -4,7 +4,9 @@ export var EArgumentTypes;
|
|
|
4
4
|
EArgumentTypes["headers"] = "HEADERS";
|
|
5
5
|
EArgumentTypes["body"] = "BODY";
|
|
6
6
|
EArgumentTypes["params"] = "PARAMS";
|
|
7
|
+
EArgumentTypes["param"] = "PARAM";
|
|
7
8
|
EArgumentTypes["query"] = "QUERY";
|
|
9
|
+
EArgumentTypes["request"] = "REQUEST";
|
|
8
10
|
})(EArgumentTypes || (EArgumentTypes = {}));
|
|
9
11
|
export const controllerActionArgumentsKey = Symbol.for("__bool:controller.action::arguments__");
|
|
10
12
|
export const Headers = (zodSchema) => {
|
|
@@ -36,7 +38,7 @@ export const Body = (zodSchema, parser) => {
|
|
|
36
38
|
Reflect.defineMetadata(controllerActionArgumentsKey, bodyMetadata, target.constructor, methodName);
|
|
37
39
|
};
|
|
38
40
|
};
|
|
39
|
-
export const Params = (
|
|
41
|
+
export const Params = (zodSchema) => {
|
|
40
42
|
return (target, methodName, parameterIndex) => {
|
|
41
43
|
if (!methodName) {
|
|
42
44
|
return;
|
|
@@ -45,6 +47,20 @@ export const Params = (key, zodSchema) => {
|
|
|
45
47
|
paramsMetadata[`argumentIndexes.${parameterIndex}`] = {
|
|
46
48
|
index: parameterIndex,
|
|
47
49
|
type: EArgumentTypes.params,
|
|
50
|
+
zodSchema: zodSchema
|
|
51
|
+
};
|
|
52
|
+
Reflect.defineMetadata(controllerActionArgumentsKey, paramsMetadata, target.constructor, methodName);
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export const Param = (key, zodSchema) => {
|
|
56
|
+
return (target, methodName, parameterIndex) => {
|
|
57
|
+
if (!methodName) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const paramsMetadata = Reflect.getOwnMetadata(controllerActionArgumentsKey, target.constructor, methodName) || {};
|
|
61
|
+
paramsMetadata[`argumentIndexes.${parameterIndex}`] = {
|
|
62
|
+
index: parameterIndex,
|
|
63
|
+
type: EArgumentTypes.param,
|
|
48
64
|
key: key,
|
|
49
65
|
zodSchema: zodSchema
|
|
50
66
|
};
|
|
@@ -65,3 +81,17 @@ export const Query = (zodSchema) => {
|
|
|
65
81
|
Reflect.defineMetadata(controllerActionArgumentsKey, queryMetadata, target.constructor, methodName);
|
|
66
82
|
};
|
|
67
83
|
};
|
|
84
|
+
export const Request = (zodSchema) => {
|
|
85
|
+
return (target, methodName, parameterIndex) => {
|
|
86
|
+
if (!methodName) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const queryMetadata = Reflect.getOwnMetadata(controllerActionArgumentsKey, target.constructor, methodName) || {};
|
|
90
|
+
queryMetadata[`argumentIndexes.${parameterIndex}`] = {
|
|
91
|
+
index: parameterIndex,
|
|
92
|
+
type: EArgumentTypes.request,
|
|
93
|
+
zodSchema: zodSchema
|
|
94
|
+
};
|
|
95
|
+
Reflect.defineMetadata(controllerActionArgumentsKey, queryMetadata, target.constructor, methodName);
|
|
96
|
+
};
|
|
97
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Headers, Body, Params, Query, EArgumentTypes } from "./arguments";
|
|
1
|
+
export { Headers, Body, Params, Param, Query, EArgumentTypes } from "./arguments";
|
|
2
2
|
export { Controller, controllerKey } from "./controller";
|
|
3
3
|
export { Inject, injectKey } from "./inject";
|
|
4
4
|
export { Injectable, injectableKey } from "./injectable";
|
package/dist/decorators/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Headers, Body, Params, Query, EArgumentTypes } from "./arguments";
|
|
1
|
+
export { Headers, Body, Params, Param, Query, EArgumentTypes } from "./arguments";
|
|
2
2
|
export { Controller, controllerKey } from "./controller";
|
|
3
3
|
export { Inject, injectKey } from "./inject";
|
|
4
4
|
export { Injectable, injectableKey } from "./injectable";
|
package/dist/hooks/factory.js
CHANGED
|
@@ -103,9 +103,8 @@ export const BoolFactory = (target, options) => {
|
|
|
103
103
|
const start = performance.now();
|
|
104
104
|
const url = new URL(request.url);
|
|
105
105
|
try {
|
|
106
|
-
const
|
|
107
|
-
const origin =
|
|
108
|
-
const response = new Response();
|
|
106
|
+
const reqHeaders = request.headers;
|
|
107
|
+
const origin = reqHeaders.get("origin");
|
|
109
108
|
if (!allowOrigins.includes("*")) {
|
|
110
109
|
if (!origin) {
|
|
111
110
|
throw new HttpClientError({
|
|
@@ -132,10 +131,6 @@ export const BoolFactory = (target, options) => {
|
|
|
132
131
|
});
|
|
133
132
|
}
|
|
134
133
|
}
|
|
135
|
-
response.headers.set("Access-Control-Allow-Origin", origin || "*");
|
|
136
|
-
response.headers.set("Access-Control-Allow-Headers", "*");
|
|
137
|
-
response.headers.set("Access-Control-Allow-Credentials", "true");
|
|
138
|
-
response.headers.set("Access-Control-Allow-Methods", allowMethods.join(", "));
|
|
139
134
|
if (!allowMethods.includes(request.method.toUpperCase())) {
|
|
140
135
|
throw new HttpClientError({
|
|
141
136
|
httpCode: 405,
|
|
@@ -153,6 +148,7 @@ export const BoolFactory = (target, options) => {
|
|
|
153
148
|
}
|
|
154
149
|
const params = result.params;
|
|
155
150
|
const query = Qs.parse(url.search, options.queryParser);
|
|
151
|
+
let responseBody = undefined;
|
|
156
152
|
for (let i = 0; i < result.handlers.length; i++) {
|
|
157
153
|
const handler = result.handlers[i];
|
|
158
154
|
const handlerMetadata = (Reflect.getOwnMetadata(controllerActionArgumentsKey, handler.constructor, handler.funcName) || {});
|
|
@@ -162,8 +158,8 @@ export const BoolFactory = (target, options) => {
|
|
|
162
158
|
switch (argsMetadata.type) {
|
|
163
159
|
case EArgumentTypes.headers:
|
|
164
160
|
controllerActionArguments[argsMetadata.index] = !argsMetadata.zodSchema
|
|
165
|
-
?
|
|
166
|
-
: await controllerActionArgumentsResolution(
|
|
161
|
+
? reqHeaders
|
|
162
|
+
: await controllerActionArgumentsResolution(reqHeaders, argsMetadata.zodSchema, argsMetadata.index, handler.funcName);
|
|
167
163
|
break;
|
|
168
164
|
case EArgumentTypes.body:
|
|
169
165
|
controllerActionArguments[argsMetadata.index] = !argsMetadata.zodSchema
|
|
@@ -180,14 +176,41 @@ export const BoolFactory = (target, options) => {
|
|
|
180
176
|
? query
|
|
181
177
|
: await controllerActionArgumentsResolution(query, argsMetadata.zodSchema, argsMetadata.index, handler.funcName);
|
|
182
178
|
break;
|
|
179
|
+
case EArgumentTypes.param:
|
|
180
|
+
controllerActionArguments[argsMetadata.index] = !argsMetadata.zodSchema
|
|
181
|
+
? !(argsMetadata.key in params)
|
|
182
|
+
? undefined
|
|
183
|
+
: params[argsMetadata.key]
|
|
184
|
+
: await controllerActionArgumentsResolution(query, argsMetadata.zodSchema, argsMetadata.index, handler.funcName);
|
|
185
|
+
break;
|
|
186
|
+
case EArgumentTypes.request:
|
|
187
|
+
controllerActionArguments[argsMetadata.index] = request;
|
|
188
|
+
break;
|
|
183
189
|
}
|
|
184
190
|
}
|
|
185
191
|
}
|
|
186
|
-
const
|
|
187
|
-
if (
|
|
188
|
-
return
|
|
192
|
+
const responseData = await handler.func(...controllerActionArguments);
|
|
193
|
+
if (responseData instanceof Response) {
|
|
194
|
+
return responseData;
|
|
189
195
|
}
|
|
196
|
+
responseBody = responseData;
|
|
190
197
|
}
|
|
198
|
+
const resHeaders = new Headers({
|
|
199
|
+
"Access-Control-Allow-Origin": origin || "*",
|
|
200
|
+
"Access-Control-Allow-Headers": "*",
|
|
201
|
+
"Access-Control-Allow-Credentials": "true",
|
|
202
|
+
"Access-Control-Allow-Methods": allowMethods.join(", "),
|
|
203
|
+
"Content-Type": "application/json"
|
|
204
|
+
});
|
|
205
|
+
const response = new Response(JSON.stringify({
|
|
206
|
+
httpCode: 200,
|
|
207
|
+
message: "Success",
|
|
208
|
+
data: responseBody
|
|
209
|
+
}), {
|
|
210
|
+
status: 200,
|
|
211
|
+
statusText: "Success",
|
|
212
|
+
headers: resHeaders
|
|
213
|
+
});
|
|
191
214
|
return response;
|
|
192
215
|
}
|
|
193
216
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -4,7 +4,9 @@ export enum EArgumentTypes {
|
|
|
4
4
|
headers = "HEADERS",
|
|
5
5
|
body = "BODY",
|
|
6
6
|
params = "PARAMS",
|
|
7
|
-
|
|
7
|
+
param = "PARAM",
|
|
8
|
+
query = "QUERY",
|
|
9
|
+
request = "REQUEST"
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
export type TMetadata =
|
|
@@ -22,13 +24,23 @@ export type TMetadata =
|
|
|
22
24
|
| {
|
|
23
25
|
index: number;
|
|
24
26
|
type: EArgumentTypes.params;
|
|
25
|
-
|
|
27
|
+
zodSchema?: Zod.Schema;
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
index: number;
|
|
31
|
+
type: EArgumentTypes.param;
|
|
32
|
+
key: string;
|
|
26
33
|
zodSchema?: Zod.Schema;
|
|
27
34
|
}
|
|
28
35
|
| {
|
|
29
36
|
index: number;
|
|
30
37
|
type: EArgumentTypes.query;
|
|
31
38
|
zodSchema?: Zod.Schema;
|
|
39
|
+
}
|
|
40
|
+
| {
|
|
41
|
+
index: number;
|
|
42
|
+
type: EArgumentTypes.request;
|
|
43
|
+
zodSchema?: Zod.Schema;
|
|
32
44
|
};
|
|
33
45
|
|
|
34
46
|
export const controllerActionArgumentsKey = Symbol.for("__bool:controller.action::arguments__");
|
|
@@ -80,7 +92,7 @@ export const Body = (zodSchema?: Zod.Schema, parser?: "arrayBuffer" | "blob" | "
|
|
|
80
92
|
};
|
|
81
93
|
};
|
|
82
94
|
|
|
83
|
-
export const Params = (
|
|
95
|
+
export const Params = (zodSchema?: Zod.Schema) => {
|
|
84
96
|
return (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => {
|
|
85
97
|
if (!methodName) {
|
|
86
98
|
return;
|
|
@@ -91,7 +103,6 @@ export const Params = (key?: string, zodSchema?: Zod.Schema) => {
|
|
|
91
103
|
paramsMetadata[`argumentIndexes.${parameterIndex}`] = {
|
|
92
104
|
index: parameterIndex,
|
|
93
105
|
type: EArgumentTypes.params,
|
|
94
|
-
key: key,
|
|
95
106
|
zodSchema: zodSchema
|
|
96
107
|
} satisfies Extract<
|
|
97
108
|
TMetadata,
|
|
@@ -104,6 +115,30 @@ export const Params = (key?: string, zodSchema?: Zod.Schema) => {
|
|
|
104
115
|
};
|
|
105
116
|
};
|
|
106
117
|
|
|
118
|
+
export const Param = (key: string, zodSchema?: Zod.Schema) => {
|
|
119
|
+
return (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => {
|
|
120
|
+
if (!methodName) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const paramsMetadata = Reflect.getOwnMetadata(controllerActionArgumentsKey, target.constructor, methodName) || {};
|
|
125
|
+
|
|
126
|
+
paramsMetadata[`argumentIndexes.${parameterIndex}`] = {
|
|
127
|
+
index: parameterIndex,
|
|
128
|
+
type: EArgumentTypes.param,
|
|
129
|
+
key: key,
|
|
130
|
+
zodSchema: zodSchema
|
|
131
|
+
} satisfies Extract<
|
|
132
|
+
TMetadata,
|
|
133
|
+
{
|
|
134
|
+
type: EArgumentTypes.param;
|
|
135
|
+
}
|
|
136
|
+
>;
|
|
137
|
+
|
|
138
|
+
Reflect.defineMetadata(controllerActionArgumentsKey, paramsMetadata, target.constructor, methodName);
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
|
|
107
142
|
export const Query = (zodSchema?: Zod.Schema) => {
|
|
108
143
|
return (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => {
|
|
109
144
|
if (!methodName) {
|
|
@@ -126,3 +161,26 @@ export const Query = (zodSchema?: Zod.Schema) => {
|
|
|
126
161
|
Reflect.defineMetadata(controllerActionArgumentsKey, queryMetadata, target.constructor, methodName);
|
|
127
162
|
};
|
|
128
163
|
};
|
|
164
|
+
|
|
165
|
+
export const Request = (zodSchema?: Zod.Schema) => {
|
|
166
|
+
return (target: Object, methodName: string | symbol | undefined, parameterIndex: number) => {
|
|
167
|
+
if (!methodName) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const queryMetadata = Reflect.getOwnMetadata(controllerActionArgumentsKey, target.constructor, methodName) || {};
|
|
172
|
+
|
|
173
|
+
queryMetadata[`argumentIndexes.${parameterIndex}`] = {
|
|
174
|
+
index: parameterIndex,
|
|
175
|
+
type: EArgumentTypes.request,
|
|
176
|
+
zodSchema: zodSchema
|
|
177
|
+
} satisfies Extract<
|
|
178
|
+
TMetadata,
|
|
179
|
+
{
|
|
180
|
+
type: EArgumentTypes.request;
|
|
181
|
+
}
|
|
182
|
+
>;
|
|
183
|
+
|
|
184
|
+
Reflect.defineMetadata(controllerActionArgumentsKey, queryMetadata, target.constructor, methodName);
|
|
185
|
+
};
|
|
186
|
+
};
|
package/src/decorators/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Headers, Body, Params, Query, EArgumentTypes } from "./arguments";
|
|
1
|
+
export { Headers, Body, Params, Param, Query, EArgumentTypes } from "./arguments";
|
|
2
2
|
export { Controller, controllerKey } from "./controller";
|
|
3
3
|
export { Inject, injectKey } from "./inject";
|
|
4
4
|
export { Injectable, injectableKey } from "./injectable";
|
package/src/hooks/factory.ts
CHANGED
|
@@ -139,9 +139,8 @@ export const BoolFactory = (target: new (...args: any[]) => unknown, options: TB
|
|
|
139
139
|
const url = new URL(request.url);
|
|
140
140
|
|
|
141
141
|
try {
|
|
142
|
-
const
|
|
143
|
-
const origin =
|
|
144
|
-
const response = new Response();
|
|
142
|
+
const reqHeaders = request.headers;
|
|
143
|
+
const origin = reqHeaders.get("origin");
|
|
145
144
|
|
|
146
145
|
if (!allowOrigins.includes("*")) {
|
|
147
146
|
if (!origin) {
|
|
@@ -171,11 +170,6 @@ export const BoolFactory = (target: new (...args: any[]) => unknown, options: TB
|
|
|
171
170
|
}
|
|
172
171
|
}
|
|
173
172
|
|
|
174
|
-
response.headers.set("Access-Control-Allow-Origin", origin || "*");
|
|
175
|
-
response.headers.set("Access-Control-Allow-Headers", "*");
|
|
176
|
-
response.headers.set("Access-Control-Allow-Credentials", "true");
|
|
177
|
-
response.headers.set("Access-Control-Allow-Methods", allowMethods.join(", "));
|
|
178
|
-
|
|
179
173
|
if (!allowMethods.includes(request.method.toUpperCase())) {
|
|
180
174
|
throw new HttpClientError({
|
|
181
175
|
httpCode: 405,
|
|
@@ -197,6 +191,8 @@ export const BoolFactory = (target: new (...args: any[]) => unknown, options: TB
|
|
|
197
191
|
const params = result.params;
|
|
198
192
|
const query = Qs.parse(url.search, options.queryParser);
|
|
199
193
|
|
|
194
|
+
let responseBody = undefined;
|
|
195
|
+
|
|
200
196
|
for (let i = 0; i < result.handlers.length; i++) {
|
|
201
197
|
const handler = result.handlers[i];
|
|
202
198
|
const handlerMetadata = (Reflect.getOwnMetadata(
|
|
@@ -212,9 +208,9 @@ export const BoolFactory = (target: new (...args: any[]) => unknown, options: TB
|
|
|
212
208
|
switch (argsMetadata.type) {
|
|
213
209
|
case EArgumentTypes.headers:
|
|
214
210
|
controllerActionArguments[argsMetadata.index] = !argsMetadata.zodSchema
|
|
215
|
-
?
|
|
211
|
+
? reqHeaders
|
|
216
212
|
: await controllerActionArgumentsResolution(
|
|
217
|
-
|
|
213
|
+
reqHeaders,
|
|
218
214
|
argsMetadata.zodSchema,
|
|
219
215
|
argsMetadata.index,
|
|
220
216
|
handler.funcName
|
|
@@ -250,17 +246,55 @@ export const BoolFactory = (target: new (...args: any[]) => unknown, options: TB
|
|
|
250
246
|
handler.funcName
|
|
251
247
|
);
|
|
252
248
|
break;
|
|
249
|
+
case EArgumentTypes.param:
|
|
250
|
+
controllerActionArguments[argsMetadata.index] = !argsMetadata.zodSchema
|
|
251
|
+
? !(argsMetadata.key in params)
|
|
252
|
+
? undefined
|
|
253
|
+
: params[argsMetadata.key]
|
|
254
|
+
: await controllerActionArgumentsResolution(
|
|
255
|
+
query,
|
|
256
|
+
argsMetadata.zodSchema,
|
|
257
|
+
argsMetadata.index,
|
|
258
|
+
handler.funcName
|
|
259
|
+
);
|
|
260
|
+
break;
|
|
261
|
+
case EArgumentTypes.request:
|
|
262
|
+
controllerActionArguments[argsMetadata.index] = request;
|
|
263
|
+
break;
|
|
253
264
|
}
|
|
254
265
|
}
|
|
255
266
|
}
|
|
256
267
|
|
|
257
|
-
const
|
|
268
|
+
const responseData = await handler.func(...controllerActionArguments);
|
|
258
269
|
|
|
259
|
-
if (
|
|
260
|
-
return
|
|
270
|
+
if (responseData instanceof Response) {
|
|
271
|
+
return responseData;
|
|
261
272
|
}
|
|
273
|
+
|
|
274
|
+
responseBody = responseData;
|
|
262
275
|
}
|
|
263
276
|
|
|
277
|
+
const resHeaders = new Headers({
|
|
278
|
+
"Access-Control-Allow-Origin": origin || "*",
|
|
279
|
+
"Access-Control-Allow-Headers": "*",
|
|
280
|
+
"Access-Control-Allow-Credentials": "true",
|
|
281
|
+
"Access-Control-Allow-Methods": allowMethods.join(", "),
|
|
282
|
+
"Content-Type": "application/json"
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
const response = new Response(
|
|
286
|
+
JSON.stringify({
|
|
287
|
+
httpCode: 200,
|
|
288
|
+
message: "Success",
|
|
289
|
+
data: responseBody
|
|
290
|
+
}),
|
|
291
|
+
{
|
|
292
|
+
status: 200,
|
|
293
|
+
statusText: "Success",
|
|
294
|
+
headers: resHeaders
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
|
|
264
298
|
return response;
|
|
265
299
|
} catch (error) {
|
|
266
300
|
return jsonErrorInfer(error);
|