@carbonorm/carbonnode 3.0.8 → 3.0.10
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/api/executors/SqlExecutor.d.ts +8 -12
- package/dist/api/handlers/ExpressHandler.d.ts +7 -0
- package/dist/api/restOrm.d.ts +1 -4
- package/dist/api/restRequest.d.ts +1 -1
- package/dist/api/types/ormInterfaces.d.ts +1 -1
- package/dist/index.cjs.js +544 -453
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +544 -454
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/api/executors/HttpExecutor.ts +5 -3
- package/src/api/executors/SqlExecutor.ts +60 -57
- package/src/api/handlers/ExpressHandler.ts +55 -0
- package/src/api/restOrm.ts +20 -57
- package/src/api/restRequest.ts +6 -2
- package/src/api/types/ormInterfaces.ts +1 -1
- package/src/index.ts +1 -0
package/src/api/restRequest.ts
CHANGED
|
@@ -15,7 +15,11 @@ export default function restRequest<
|
|
|
15
15
|
CustomAndRequiredFields extends { [key: string]: any } = any,
|
|
16
16
|
RequestTableOverrides extends { [key in keyof RestTableInterface]: any } = { [key in keyof RestTableInterface]: any }
|
|
17
17
|
>(
|
|
18
|
-
|
|
18
|
+
configX: (() => iRest<
|
|
19
|
+
RestShortTableName,
|
|
20
|
+
RestTableInterface,
|
|
21
|
+
PrimaryKey
|
|
22
|
+
>) | iRest<
|
|
19
23
|
RestShortTableName,
|
|
20
24
|
RestTableInterface,
|
|
21
25
|
PrimaryKey
|
|
@@ -30,7 +34,7 @@ export default function restRequest<
|
|
|
30
34
|
>,
|
|
31
35
|
): Promise<apiReturn<DetermineResponseDataType<RequestMethod, RestTableInterface>>> => {
|
|
32
36
|
|
|
33
|
-
const config =
|
|
37
|
+
const config = typeof configX === "function" ? configX() : configX;
|
|
34
38
|
|
|
35
39
|
// SQL path if on Node with a provided pool
|
|
36
40
|
if (isNode && config.mysqlPool) {
|
|
@@ -114,7 +114,7 @@ export type iGetC6RestResponse<ResponseDataType, ResponseDataOverrides = {}> = i
|
|
|
114
114
|
export type apiReturn<Response> =
|
|
115
115
|
| null
|
|
116
116
|
| undefined
|
|
117
|
-
|
|
|
117
|
+
| Response
|
|
118
118
|
| (Response extends iPutC6RestResponse | iDeleteC6RestResponse | iPostC6RestResponse ? null : () => apiReturn<Response>);
|
|
119
119
|
|
|
120
120
|
export type DetermineResponseDataType<
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from "./api/builders/sqlBuilder";
|
|
|
16
16
|
export * from "./api/executors/Executor";
|
|
17
17
|
export * from "./api/executors/HttpExecutor";
|
|
18
18
|
export * from "./api/executors/SqlExecutor";
|
|
19
|
+
export * from "./api/handlers/ExpressHandler";
|
|
19
20
|
export * from "./api/types/dynamicFetching";
|
|
20
21
|
export * from "./api/types/modifyTypes";
|
|
21
22
|
export * from "./api/types/mysqlTypes";
|