@carbonorm/carbonnode 3.4.7 → 3.4.8
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/restOrm.d.ts +25 -25
- package/package.json +1 -1
- package/src/api/restOrm.ts +5 -5
package/dist/api/restOrm.d.ts
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
import { OrmGenerics } from "./types/ormGenerics";
|
|
2
2
|
import { iRest } from "./types/ormInterfaces";
|
|
3
|
-
export declare function restOrm<G extends Omit<OrmGenerics, "
|
|
3
|
+
export declare function restOrm<G extends Omit<OrmGenerics, "RequestMethod">>(configFn: () => Omit<iRest<G['RestShortTableName'], G['RestTableInterface'], G['PrimaryKey']>, "requestMethod">): {
|
|
4
4
|
Get: (request: import("./types/ormInterfaces").RequestQueryBody<(G & {
|
|
5
|
-
|
|
5
|
+
RequestMethod: "GET";
|
|
6
6
|
})["RequestMethod"], (G & {
|
|
7
|
-
|
|
7
|
+
RequestMethod: "GET";
|
|
8
8
|
})["RestTableInterface"], (G & {
|
|
9
|
-
|
|
9
|
+
RequestMethod: "GET";
|
|
10
10
|
})["CustomAndRequiredFields"], (G & {
|
|
11
|
-
|
|
11
|
+
RequestMethod: "GET";
|
|
12
12
|
})["RequestTableOverrides"]>) => Promise<import("./types/ormInterfaces").DetermineResponseDataType<(G & {
|
|
13
|
-
|
|
13
|
+
RequestMethod: "GET";
|
|
14
14
|
})["RequestMethod"], (G & {
|
|
15
|
-
|
|
15
|
+
RequestMethod: "GET";
|
|
16
16
|
})["RestTableInterface"]>>;
|
|
17
17
|
Put: (request: import("./types/ormInterfaces").RequestQueryBody<(G & {
|
|
18
|
-
|
|
18
|
+
RequestMethod: "PUT";
|
|
19
19
|
})["RequestMethod"], (G & {
|
|
20
|
-
|
|
20
|
+
RequestMethod: "PUT";
|
|
21
21
|
})["RestTableInterface"], (G & {
|
|
22
|
-
|
|
22
|
+
RequestMethod: "PUT";
|
|
23
23
|
})["CustomAndRequiredFields"], (G & {
|
|
24
|
-
|
|
24
|
+
RequestMethod: "PUT";
|
|
25
25
|
})["RequestTableOverrides"]>) => Promise<import("./types/ormInterfaces").DetermineResponseDataType<(G & {
|
|
26
|
-
|
|
26
|
+
RequestMethod: "PUT";
|
|
27
27
|
})["RequestMethod"], (G & {
|
|
28
|
-
|
|
28
|
+
RequestMethod: "PUT";
|
|
29
29
|
})["RestTableInterface"]>>;
|
|
30
30
|
Post: (request: import("./types/ormInterfaces").RequestQueryBody<(G & {
|
|
31
|
-
|
|
31
|
+
RequestMethod: "POST";
|
|
32
32
|
})["RequestMethod"], (G & {
|
|
33
|
-
|
|
33
|
+
RequestMethod: "POST";
|
|
34
34
|
})["RestTableInterface"], (G & {
|
|
35
|
-
|
|
35
|
+
RequestMethod: "POST";
|
|
36
36
|
})["CustomAndRequiredFields"], (G & {
|
|
37
|
-
|
|
37
|
+
RequestMethod: "POST";
|
|
38
38
|
})["RequestTableOverrides"]>) => Promise<import("./types/ormInterfaces").DetermineResponseDataType<(G & {
|
|
39
|
-
|
|
39
|
+
RequestMethod: "POST";
|
|
40
40
|
})["RequestMethod"], (G & {
|
|
41
|
-
|
|
41
|
+
RequestMethod: "POST";
|
|
42
42
|
})["RestTableInterface"]>>;
|
|
43
43
|
Delete: (request: import("./types/ormInterfaces").RequestQueryBody<(G & {
|
|
44
|
-
|
|
44
|
+
RequestMethod: "DELETE";
|
|
45
45
|
})["RequestMethod"], (G & {
|
|
46
|
-
|
|
46
|
+
RequestMethod: "DELETE";
|
|
47
47
|
})["RestTableInterface"], (G & {
|
|
48
|
-
|
|
48
|
+
RequestMethod: "DELETE";
|
|
49
49
|
})["CustomAndRequiredFields"], (G & {
|
|
50
|
-
|
|
50
|
+
RequestMethod: "DELETE";
|
|
51
51
|
})["RequestTableOverrides"]>) => Promise<import("./types/ormInterfaces").DetermineResponseDataType<(G & {
|
|
52
|
-
|
|
52
|
+
RequestMethod: "DELETE";
|
|
53
53
|
})["RequestMethod"], (G & {
|
|
54
|
-
|
|
54
|
+
RequestMethod: "DELETE";
|
|
55
55
|
})["RestTableInterface"]>>;
|
|
56
56
|
};
|
package/package.json
CHANGED
package/src/api/restOrm.ts
CHANGED
|
@@ -3,26 +3,26 @@ import {OrmGenerics} from "./types/ormGenerics";
|
|
|
3
3
|
import {iRest} from "./types/ormInterfaces";
|
|
4
4
|
|
|
5
5
|
export function restOrm<
|
|
6
|
-
G extends Omit<OrmGenerics, "
|
|
6
|
+
G extends Omit<OrmGenerics, "RequestMethod">
|
|
7
7
|
>(
|
|
8
8
|
configFn: () =>
|
|
9
9
|
Omit<iRest<G['RestShortTableName'], G['RestTableInterface'], G['PrimaryKey']>, "requestMethod">
|
|
10
10
|
) {
|
|
11
11
|
|
|
12
12
|
return {
|
|
13
|
-
Get: restRequest<G & {
|
|
13
|
+
Get: restRequest<G & { RequestMethod: "GET" }>(() => ({
|
|
14
14
|
...configFn(),
|
|
15
15
|
requestMethod: "GET"
|
|
16
16
|
})),
|
|
17
|
-
Put: restRequest<G & {
|
|
17
|
+
Put: restRequest<G & { RequestMethod: "PUT" }>(() => ({
|
|
18
18
|
...configFn(),
|
|
19
19
|
requestMethod: "PUT"
|
|
20
20
|
})),
|
|
21
|
-
Post: restRequest<G & {
|
|
21
|
+
Post: restRequest<G & { RequestMethod: "POST" }>(() => ({
|
|
22
22
|
...configFn(),
|
|
23
23
|
requestMethod: "POST"
|
|
24
24
|
})),
|
|
25
|
-
Delete: restRequest<G & {
|
|
25
|
+
Delete: restRequest<G & { RequestMethod: "DELETE" }>(() => ({
|
|
26
26
|
...configFn(),
|
|
27
27
|
requestMethod: "DELETE"
|
|
28
28
|
}))
|