@cloudcommerce/api 2.21.3 → 2.21.5
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/lib/api.d.ts +16 -16
- package/package.json +1 -1
package/lib/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Endpoint, Config, ResponseBody, RequestBody, ErrorBody } from '../types.d';
|
|
1
|
+
import type { ResourceOpQuery, Endpoint, Config, ResponseBody, RequestBody, ErrorBody } from '../types.d';
|
|
2
2
|
declare global {
|
|
3
3
|
var $apiMergeConfig: Partial<Config> | undefined;
|
|
4
4
|
var __apiCache: Record<string, {
|
|
@@ -50,8 +50,8 @@ declare const api: {
|
|
|
50
50
|
}>;
|
|
51
51
|
post: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
|
|
52
52
|
endpoint: E;
|
|
53
|
-
method:
|
|
54
|
-
}>, config?: E extends
|
|
53
|
+
method: "post";
|
|
54
|
+
}>, config?: E extends "login" | "authenticate" ? AbstractedConfig : C) => Promise<Response & {
|
|
55
55
|
config: Config;
|
|
56
56
|
data: E extends "login" ? {
|
|
57
57
|
_id: import("../types.d").ResourceId;
|
|
@@ -65,17 +65,17 @@ declare const api: {
|
|
|
65
65
|
_id: import("../types.d").ResourceId;
|
|
66
66
|
};
|
|
67
67
|
}>;
|
|
68
|
-
put: <
|
|
69
|
-
endpoint:
|
|
70
|
-
method:
|
|
71
|
-
}>, config?:
|
|
68
|
+
put: <E extends Exclude<Endpoint, ResourceOpQuery>, C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
|
|
69
|
+
endpoint: E;
|
|
70
|
+
method: "put";
|
|
71
|
+
}>, config?: C) => Promise<Response & {
|
|
72
72
|
config: Config;
|
|
73
73
|
data: null;
|
|
74
74
|
}>;
|
|
75
|
-
patch: <
|
|
76
|
-
endpoint:
|
|
77
|
-
method:
|
|
78
|
-
}>, config?:
|
|
75
|
+
patch: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
|
|
76
|
+
endpoint: E;
|
|
77
|
+
method: "patch";
|
|
78
|
+
}>, config?: C) => Promise<Response & {
|
|
79
79
|
config: Config;
|
|
80
80
|
data: null;
|
|
81
81
|
}>;
|
|
@@ -97,8 +97,8 @@ declare const get: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E,
|
|
|
97
97
|
}>;
|
|
98
98
|
declare const post: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
|
|
99
99
|
endpoint: E;
|
|
100
|
-
method:
|
|
101
|
-
}>, config?: E extends
|
|
100
|
+
method: "post";
|
|
101
|
+
}>, config?: E extends "login" | "authenticate" ? AbstractedConfig : C) => Promise<Response & {
|
|
102
102
|
config: Config;
|
|
103
103
|
data: E extends "login" ? {
|
|
104
104
|
_id: import("../types.d").ResourceId;
|
|
@@ -112,16 +112,16 @@ declare const post: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E
|
|
|
112
112
|
_id: import("../types.d").ResourceId;
|
|
113
113
|
};
|
|
114
114
|
}>;
|
|
115
|
-
declare const put: <E extends
|
|
115
|
+
declare const put: <E extends Exclude<Endpoint, ResourceOpQuery>, C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
|
|
116
116
|
endpoint: E;
|
|
117
|
-
method:
|
|
117
|
+
method: "put";
|
|
118
118
|
}>, config?: C) => Promise<Response & {
|
|
119
119
|
config: Config;
|
|
120
120
|
data: null;
|
|
121
121
|
}>;
|
|
122
122
|
declare const patch: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E, body: RequestBody<{
|
|
123
123
|
endpoint: E;
|
|
124
|
-
method:
|
|
124
|
+
method: "patch";
|
|
125
125
|
}>, config?: C) => Promise<Response & {
|
|
126
126
|
config: Config;
|
|
127
127
|
data: null;
|