@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.
@@ -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
- configFn: () => iRest<
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 = configFn();
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
- | AxiosPromise<Response>
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";