mtmsdk 0.0.47 → 0.0.49

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.
Files changed (236) hide show
  1. package/dist/gomtmapi/@tanstack/react-query.gen.d.ts +2 -80
  2. package/dist/gomtmapi/@tanstack/react-query.gen.d.ts.map +1 -1
  3. package/dist/gomtmapi/@tanstack/react-query.gen.js +2 -176
  4. package/dist/gomtmapi/@tanstack/react-query.gen.js.map +1 -1
  5. package/dist/gomtmapi/index.d.ts +2 -2
  6. package/dist/gomtmapi/index.d.ts.map +1 -1
  7. package/dist/gomtmapi/index.js +1 -1
  8. package/dist/gomtmapi/index.js.map +1 -1
  9. package/dist/gomtmapi/schemas.gen.d.ts +14 -328
  10. package/dist/gomtmapi/schemas.gen.d.ts.map +1 -1
  11. package/dist/gomtmapi/schemas.gen.js +14 -341
  12. package/dist/gomtmapi/schemas.gen.js.map +1 -1
  13. package/dist/gomtmapi/sdk.gen.d.ts +2 -80
  14. package/dist/gomtmapi/sdk.gen.d.ts.map +1 -1
  15. package/dist/gomtmapi/sdk.gen.js +1 -135
  16. package/dist/gomtmapi/sdk.gen.js.map +1 -1
  17. package/dist/gomtmapi/types.gen.d.ts +10 -437
  18. package/dist/gomtmapi/types.gen.d.ts.map +1 -1
  19. package/dist/gomtmapi/zod.gen.d.ts +8 -308
  20. package/dist/gomtmapi/zod.gen.d.ts.map +1 -1
  21. package/dist/gomtmapi/zod.gen.js +4 -232
  22. package/dist/gomtmapi/zod.gen.js.map +1 -1
  23. package/dist/mtgate_api/@tanstack/react-query.gen.d.ts +1 -29
  24. package/dist/mtgate_api/@tanstack/react-query.gen.d.ts.map +1 -1
  25. package/dist/mtgate_api/@tanstack/react-query.gen.js +1 -17
  26. package/dist/mtgate_api/@tanstack/react-query.gen.js.map +1 -1
  27. package/dist/mtgate_api/index.d.ts +2 -2
  28. package/dist/mtgate_api/index.d.ts.map +1 -1
  29. package/dist/mtgate_api/index.js +1 -1
  30. package/dist/mtgate_api/index.js.map +1 -1
  31. package/dist/mtgate_api/sdk.gen.d.ts +1 -5
  32. package/dist/mtgate_api/sdk.gen.d.ts.map +1 -1
  33. package/dist/mtgate_api/sdk.gen.js +0 -4
  34. package/dist/mtgate_api/sdk.gen.js.map +1 -1
  35. package/dist/mtgate_api/types.gen.d.ts +0 -6
  36. package/dist/mtgate_api/types.gen.d.ts.map +1 -1
  37. package/dist/mtgate_api/zod.gen.d.ts +0 -5
  38. package/dist/mtgate_api/zod.gen.d.ts.map +1 -1
  39. package/dist/mtgate_api/zod.gen.js +0 -5
  40. package/dist/mtgate_api/zod.gen.js.map +1 -1
  41. package/dist/mtmai_api/index.d.ts +2 -2
  42. package/dist/mtmai_api/index.d.ts.map +1 -1
  43. package/dist/mtmai_api/index.js +1 -1
  44. package/dist/mtmai_api/index.js.map +1 -1
  45. package/dist/mtmai_api/zod.gen.d.ts +96 -96
  46. package/dist/openclaw/client-info.d.ts +0 -18
  47. package/dist/openclaw/client-info.d.ts.map +1 -1
  48. package/dist/openclaw/client-info.js +0 -6
  49. package/dist/openclaw/client-info.js.map +1 -1
  50. package/dist/openclaw/device-auth-utils.d.ts +3 -4
  51. package/dist/openclaw/device-auth-utils.d.ts.map +1 -1
  52. package/dist/openclaw/device-auth-utils.js +4 -8
  53. package/dist/openclaw/device-auth-utils.js.map +1 -1
  54. package/dist/openclaw/device-auth.d.ts.map +1 -1
  55. package/dist/openclaw/device-auth.js +5 -2
  56. package/dist/openclaw/device-auth.js.map +1 -1
  57. package/dist/openclaw/device-identity.js +2 -2
  58. package/dist/openclaw/device-identity.js.map +1 -1
  59. package/dist/openclaw/gateway.d.ts +19 -5
  60. package/dist/openclaw/gateway.d.ts.map +1 -1
  61. package/dist/openclaw/gateway.js +75 -37
  62. package/dist/openclaw/gateway.js.map +1 -1
  63. package/dist/sbmng/@tanstack/react-query.gen.d.ts +36 -8
  64. package/dist/sbmng/@tanstack/react-query.gen.d.ts.map +1 -1
  65. package/dist/sbmng/@tanstack/react-query.gen.js +22 -6
  66. package/dist/sbmng/@tanstack/react-query.gen.js.map +1 -1
  67. package/dist/sbmng/index.d.ts +2 -2
  68. package/dist/sbmng/index.d.ts.map +1 -1
  69. package/dist/sbmng/index.js +1 -1
  70. package/dist/sbmng/index.js.map +1 -1
  71. package/dist/sbmng/schemas.gen.d.ts +97 -34
  72. package/dist/sbmng/schemas.gen.d.ts.map +1 -1
  73. package/dist/sbmng/schemas.gen.js +120 -49
  74. package/dist/sbmng/schemas.gen.js.map +1 -1
  75. package/dist/sbmng/sdk.gen.d.ts +7 -3
  76. package/dist/sbmng/sdk.gen.d.ts.map +1 -1
  77. package/dist/sbmng/sdk.gen.js +11 -3
  78. package/dist/sbmng/sdk.gen.js.map +1 -1
  79. package/dist/sbmng/types.gen.d.ts +82 -30
  80. package/dist/sbmng/types.gen.d.ts.map +1 -1
  81. package/dist/supabase/schema/index.d.ts +0 -8
  82. package/dist/supabase/schema/index.d.ts.map +1 -1
  83. package/dist/supabase/schema/index.js +0 -5
  84. package/dist/supabase/schema/index.js.map +1 -1
  85. package/dist/supabase/supabase-client.d.ts +900 -719
  86. package/dist/supabase/supabase-client.d.ts.map +1 -1
  87. package/dist/supabase/supabase.d.ts +1836 -1474
  88. package/dist/supabase/supabase.d.ts.map +1 -1
  89. package/dist/supabase/use-sb-query/use-rpc-query.d.ts.map +1 -1
  90. package/dist/supabase/use-sb-query/use-rpc-query.js +2 -1
  91. package/dist/supabase/use-sb-query/use-rpc-query.js.map +1 -1
  92. package/dist/types/database.schemas.d.ts +999 -920
  93. package/dist/types/database.schemas.d.ts.map +1 -1
  94. package/dist/types/database.schemas.js +739 -435
  95. package/dist/types/database.schemas.js.map +1 -1
  96. package/dist/types/database.types.d.ts +919 -736
  97. package/dist/types/database.types.d.ts.map +1 -1
  98. package/dist/types/database.types.js +18 -2
  99. package/dist/types/database.types.js.map +1 -1
  100. package/dist/types/index.d.ts +35 -3
  101. package/dist/types/index.d.ts.map +1 -1
  102. package/dist/types/index.js +4 -1
  103. package/dist/types/index.js.map +1 -1
  104. package/package.json +4 -3
  105. package/src/gomtmapi/@tanstack/react-query.gen.ts +3 -185
  106. package/src/gomtmapi/index.ts +2 -2
  107. package/src/gomtmapi/schemas.gen.ts +14 -356
  108. package/src/gomtmapi/sdk.gen.ts +2 -144
  109. package/src/gomtmapi/types.gen.ts +10 -492
  110. package/src/gomtmapi/zod.gen.ts +4 -263
  111. package/src/mtgate_api/@tanstack/react-query.gen.ts +2 -20
  112. package/src/mtgate_api/index.ts +2 -2
  113. package/src/mtgate_api/sdk.gen.ts +1 -6
  114. package/src/mtgate_api/types.gen.ts +0 -7
  115. package/src/mtgate_api/zod.gen.ts +0 -6
  116. package/src/mtmai_api/index.ts +2 -2
  117. package/src/openclaw/client-info.ts +0 -9
  118. package/src/openclaw/device-auth-utils.ts +7 -12
  119. package/src/openclaw/device-auth.ts +5 -2
  120. package/src/openclaw/device-identity.ts +2 -2
  121. package/src/openclaw/gateway.ts +96 -50
  122. package/src/sbmng/@tanstack/react-query.gen.ts +25 -7
  123. package/src/sbmng/index.ts +2 -2
  124. package/src/sbmng/schemas.gen.ts +121 -49
  125. package/src/sbmng/sdk.gen.ts +13 -4
  126. package/src/sbmng/types.gen.ts +87 -30
  127. package/src/supabase/schema/index.ts +0 -5
  128. package/src/supabase/use-sb-query/use-rpc-query.ts +2 -1
  129. package/src/types/database.schemas.ts +948 -598
  130. package/src/types/database.types.ts +864 -674
  131. package/src/types/index.ts +20 -4
  132. package/dist/api_hatchet/@tanstack/react-query.gen.d.ts +0 -3017
  133. package/dist/api_hatchet/@tanstack/react-query.gen.d.ts.map +0 -1
  134. package/dist/api_hatchet/@tanstack/react-query.gen.js +0 -2776
  135. package/dist/api_hatchet/@tanstack/react-query.gen.js.map +0 -1
  136. package/dist/api_hatchet/client/client.gen.d.ts +0 -3
  137. package/dist/api_hatchet/client/client.gen.d.ts.map +0 -1
  138. package/dist/api_hatchet/client/client.gen.js +0 -236
  139. package/dist/api_hatchet/client/client.gen.js.map +0 -1
  140. package/dist/api_hatchet/client/index.d.ts +0 -9
  141. package/dist/api_hatchet/client/index.d.ts.map +0 -1
  142. package/dist/api_hatchet/client/index.js +0 -7
  143. package/dist/api_hatchet/client/index.js.map +0 -1
  144. package/dist/api_hatchet/client/types.gen.d.ts +0 -118
  145. package/dist/api_hatchet/client/types.gen.d.ts.map +0 -1
  146. package/dist/api_hatchet/client/types.gen.js +0 -3
  147. package/dist/api_hatchet/client/types.gen.js.map +0 -1
  148. package/dist/api_hatchet/client/utils.gen.d.ts +0 -34
  149. package/dist/api_hatchet/client/utils.gen.d.ts.map +0 -1
  150. package/dist/api_hatchet/client/utils.gen.js +0 -232
  151. package/dist/api_hatchet/client/utils.gen.js.map +0 -1
  152. package/dist/api_hatchet/client.gen.d.ts +0 -13
  153. package/dist/api_hatchet/client.gen.d.ts.map +0 -1
  154. package/dist/api_hatchet/client.gen.js +0 -4
  155. package/dist/api_hatchet/client.gen.js.map +0 -1
  156. package/dist/api_hatchet/core/auth.gen.d.ts +0 -19
  157. package/dist/api_hatchet/core/auth.gen.d.ts.map +0 -1
  158. package/dist/api_hatchet/core/auth.gen.js +0 -15
  159. package/dist/api_hatchet/core/auth.gen.js.map +0 -1
  160. package/dist/api_hatchet/core/bodySerializer.gen.d.ts +0 -26
  161. package/dist/api_hatchet/core/bodySerializer.gen.d.ts.map +0 -1
  162. package/dist/api_hatchet/core/bodySerializer.gen.js +0 -58
  163. package/dist/api_hatchet/core/bodySerializer.gen.js.map +0 -1
  164. package/dist/api_hatchet/core/params.gen.d.ts +0 -44
  165. package/dist/api_hatchet/core/params.gen.d.ts.map +0 -1
  166. package/dist/api_hatchet/core/params.gen.js +0 -101
  167. package/dist/api_hatchet/core/params.gen.js.map +0 -1
  168. package/dist/api_hatchet/core/pathSerializer.gen.d.ts +0 -34
  169. package/dist/api_hatchet/core/pathSerializer.gen.d.ts.map +0 -1
  170. package/dist/api_hatchet/core/pathSerializer.gen.js +0 -115
  171. package/dist/api_hatchet/core/pathSerializer.gen.js.map +0 -1
  172. package/dist/api_hatchet/core/queryKeySerializer.gen.d.ts +0 -19
  173. package/dist/api_hatchet/core/queryKeySerializer.gen.d.ts.map +0 -1
  174. package/dist/api_hatchet/core/queryKeySerializer.gen.js +0 -100
  175. package/dist/api_hatchet/core/queryKeySerializer.gen.js.map +0 -1
  176. package/dist/api_hatchet/core/serverSentEvents.gen.d.ts +0 -72
  177. package/dist/api_hatchet/core/serverSentEvents.gen.d.ts.map +0 -1
  178. package/dist/api_hatchet/core/serverSentEvents.gen.js +0 -138
  179. package/dist/api_hatchet/core/serverSentEvents.gen.js.map +0 -1
  180. package/dist/api_hatchet/core/types.gen.d.ts +0 -79
  181. package/dist/api_hatchet/core/types.gen.d.ts.map +0 -1
  182. package/dist/api_hatchet/core/types.gen.js +0 -3
  183. package/dist/api_hatchet/core/types.gen.js.map +0 -1
  184. package/dist/api_hatchet/core/utils.gen.d.ts +0 -20
  185. package/dist/api_hatchet/core/utils.gen.d.ts.map +0 -1
  186. package/dist/api_hatchet/core/utils.gen.js +0 -88
  187. package/dist/api_hatchet/core/utils.gen.js.map +0 -1
  188. package/dist/api_hatchet/index.d.ts +0 -3
  189. package/dist/api_hatchet/index.d.ts.map +0 -1
  190. package/dist/api_hatchet/index.js +0 -4
  191. package/dist/api_hatchet/index.js.map +0 -1
  192. package/dist/api_hatchet/schemas.gen.d.ts +0 -4068
  193. package/dist/api_hatchet/schemas.gen.d.ts.map +0 -1
  194. package/dist/api_hatchet/schemas.gen.js +0 -4743
  195. package/dist/api_hatchet/schemas.gen.js.map +0 -1
  196. package/dist/api_hatchet/sdk.gen.d.ts +0 -784
  197. package/dist/api_hatchet/sdk.gen.d.ts.map +0 -1
  198. package/dist/api_hatchet/sdk.gen.js +0 -1849
  199. package/dist/api_hatchet/sdk.gen.js.map +0 -1
  200. package/dist/api_hatchet/types.gen.d.ts +0 -6861
  201. package/dist/api_hatchet/types.gen.d.ts.map +0 -1
  202. package/dist/api_hatchet/types.gen.js +0 -209
  203. package/dist/api_hatchet/types.gen.js.map +0 -1
  204. package/dist/api_hatchet/zod.gen.d.ts +0 -10429
  205. package/dist/api_hatchet/zod.gen.d.ts.map +0 -1
  206. package/dist/api_hatchet/zod.gen.js +0 -2766
  207. package/dist/api_hatchet/zod.gen.js.map +0 -1
  208. package/dist/openclaw/uuid.d.ts +0 -6
  209. package/dist/openclaw/uuid.d.ts.map +0 -1
  210. package/dist/openclaw/uuid.js +0 -39
  211. package/dist/openclaw/uuid.js.map +0 -1
  212. package/dist/types/rpc.schemas.d.ts +0 -52
  213. package/dist/types/rpc.schemas.d.ts.map +0 -1
  214. package/dist/types/rpc.schemas.js +0 -108
  215. package/dist/types/rpc.schemas.js.map +0 -1
  216. package/src/api_hatchet/@tanstack/react-query.gen.ts +0 -3025
  217. package/src/api_hatchet/client/client.gen.ts +0 -311
  218. package/src/api_hatchet/client/index.ts +0 -25
  219. package/src/api_hatchet/client/types.gen.ts +0 -241
  220. package/src/api_hatchet/client/utils.gen.ts +0 -332
  221. package/src/api_hatchet/client.gen.ts +0 -16
  222. package/src/api_hatchet/core/auth.gen.ts +0 -42
  223. package/src/api_hatchet/core/bodySerializer.gen.ts +0 -100
  224. package/src/api_hatchet/core/params.gen.ts +0 -176
  225. package/src/api_hatchet/core/pathSerializer.gen.ts +0 -181
  226. package/src/api_hatchet/core/queryKeySerializer.gen.ts +0 -136
  227. package/src/api_hatchet/core/serverSentEvents.gen.ts +0 -266
  228. package/src/api_hatchet/core/types.gen.ts +0 -118
  229. package/src/api_hatchet/core/utils.gen.ts +0 -143
  230. package/src/api_hatchet/index.ts +0 -4
  231. package/src/api_hatchet/schemas.gen.ts +0 -4961
  232. package/src/api_hatchet/sdk.gen.ts +0 -1994
  233. package/src/api_hatchet/types.gen.ts +0 -7688
  234. package/src/api_hatchet/zod.gen.ts +0 -3230
  235. package/src/openclaw/uuid.ts +0 -48
  236. package/src/types/rpc.schemas.ts +0 -142
@@ -1,311 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- import { createSseClient } from '../core/serverSentEvents.gen';
4
- import type { HttpMethod } from '../core/types.gen';
5
- import { getValidRequestBody } from '../core/utils.gen';
6
- import type {
7
- Client,
8
- Config,
9
- RequestOptions,
10
- ResolvedRequestOptions,
11
- } from './types.gen';
12
- import {
13
- buildUrl,
14
- createConfig,
15
- createInterceptors,
16
- getParseAs,
17
- mergeConfigs,
18
- mergeHeaders,
19
- setAuthParams,
20
- } from './utils.gen';
21
-
22
- type ReqInit = Omit<RequestInit, 'body' | 'headers'> & {
23
- body?: any;
24
- headers: ReturnType<typeof mergeHeaders>;
25
- };
26
-
27
- export const createClient = (config: Config = {}): Client => {
28
- let _config = mergeConfigs(createConfig(), config);
29
-
30
- const getConfig = (): Config => ({ ..._config });
31
-
32
- const setConfig = (config: Config): Config => {
33
- _config = mergeConfigs(_config, config);
34
- return getConfig();
35
- };
36
-
37
- const interceptors = createInterceptors<
38
- Request,
39
- Response,
40
- unknown,
41
- ResolvedRequestOptions
42
- >();
43
-
44
- const beforeRequest = async (options: RequestOptions) => {
45
- const opts = {
46
- ..._config,
47
- ...options,
48
- fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
49
- headers: mergeHeaders(_config.headers, options.headers),
50
- serializedBody: undefined,
51
- };
52
-
53
- if (opts.security) {
54
- await setAuthParams({
55
- ...opts,
56
- security: opts.security,
57
- });
58
- }
59
-
60
- if (opts.requestValidator) {
61
- await opts.requestValidator(opts);
62
- }
63
-
64
- if (opts.body !== undefined && opts.bodySerializer) {
65
- opts.serializedBody = opts.bodySerializer(opts.body);
66
- }
67
-
68
- // remove Content-Type header if body is empty to avoid sending invalid requests
69
- if (opts.body === undefined || opts.serializedBody === '') {
70
- opts.headers.delete('Content-Type');
71
- }
72
-
73
- const url = buildUrl(opts);
74
-
75
- return { opts, url };
76
- };
77
-
78
- const request: Client['request'] = async (options) => {
79
- // @ts-expect-error
80
- const { opts, url } = await beforeRequest(options);
81
- const requestInit: ReqInit = {
82
- redirect: 'follow',
83
- ...opts,
84
- body: getValidRequestBody(opts),
85
- };
86
-
87
- let request = new Request(url, requestInit);
88
-
89
- for (const fn of interceptors.request.fns) {
90
- if (fn) {
91
- request = await fn(request, opts);
92
- }
93
- }
94
-
95
- // fetch must be assigned here, otherwise it would throw the error:
96
- // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
97
- const _fetch = opts.fetch!;
98
- let response: Response;
99
-
100
- try {
101
- response = await _fetch(request);
102
- } catch (error) {
103
- // Handle fetch exceptions (AbortError, network errors, etc.)
104
- let finalError = error;
105
-
106
- for (const fn of interceptors.error.fns) {
107
- if (fn) {
108
- finalError = (await fn(
109
- error,
110
- undefined as any,
111
- request,
112
- opts,
113
- )) as unknown;
114
- }
115
- }
116
-
117
- finalError = finalError || ({} as unknown);
118
-
119
- if (opts.throwOnError) {
120
- throw finalError;
121
- }
122
-
123
- // Return error response
124
- return opts.responseStyle === 'data'
125
- ? undefined
126
- : {
127
- error: finalError,
128
- request,
129
- response: undefined as any,
130
- };
131
- }
132
-
133
- for (const fn of interceptors.response.fns) {
134
- if (fn) {
135
- response = await fn(response, request, opts);
136
- }
137
- }
138
-
139
- const result = {
140
- request,
141
- response,
142
- };
143
-
144
- if (response.ok) {
145
- const parseAs =
146
- (opts.parseAs === 'auto'
147
- ? getParseAs(response.headers.get('Content-Type'))
148
- : opts.parseAs) ?? 'json';
149
-
150
- if (
151
- response.status === 204 ||
152
- response.headers.get('Content-Length') === '0'
153
- ) {
154
- let emptyData: any;
155
- switch (parseAs) {
156
- case 'arrayBuffer':
157
- case 'blob':
158
- case 'text':
159
- emptyData = await response[parseAs]();
160
- break;
161
- case 'formData':
162
- emptyData = new FormData();
163
- break;
164
- case 'stream':
165
- emptyData = response.body;
166
- break;
167
- case 'json':
168
- default:
169
- emptyData = {};
170
- break;
171
- }
172
- return opts.responseStyle === 'data'
173
- ? emptyData
174
- : {
175
- data: emptyData,
176
- ...result,
177
- };
178
- }
179
-
180
- let data: any;
181
- switch (parseAs) {
182
- case 'arrayBuffer':
183
- case 'blob':
184
- case 'formData':
185
- case 'text':
186
- data = await response[parseAs]();
187
- break;
188
- case 'json': {
189
- // Some servers return 200 with no Content-Length and empty body.
190
- // response.json() would throw; read as text and parse if non-empty.
191
- const text = await response.text();
192
- data = text ? JSON.parse(text) : {};
193
- break;
194
- }
195
- case 'stream':
196
- return opts.responseStyle === 'data'
197
- ? response.body
198
- : {
199
- data: response.body,
200
- ...result,
201
- };
202
- }
203
-
204
- if (parseAs === 'json') {
205
- if (opts.responseValidator) {
206
- await opts.responseValidator(data);
207
- }
208
-
209
- if (opts.responseTransformer) {
210
- data = await opts.responseTransformer(data);
211
- }
212
- }
213
-
214
- return opts.responseStyle === 'data'
215
- ? data
216
- : {
217
- data,
218
- ...result,
219
- };
220
- }
221
-
222
- const textError = await response.text();
223
- let jsonError: unknown;
224
-
225
- try {
226
- jsonError = JSON.parse(textError);
227
- } catch {
228
- // noop
229
- }
230
-
231
- const error = jsonError ?? textError;
232
- let finalError = error;
233
-
234
- for (const fn of interceptors.error.fns) {
235
- if (fn) {
236
- finalError = (await fn(error, response, request, opts)) as string;
237
- }
238
- }
239
-
240
- finalError = finalError || ({} as string);
241
-
242
- if (opts.throwOnError) {
243
- throw finalError;
244
- }
245
-
246
- // TODO: we probably want to return error and improve types
247
- return opts.responseStyle === 'data'
248
- ? undefined
249
- : {
250
- error: finalError,
251
- ...result,
252
- };
253
- };
254
-
255
- const makeMethodFn =
256
- (method: Uppercase<HttpMethod>) => (options: RequestOptions) =>
257
- request({ ...options, method });
258
-
259
- const makeSseFn =
260
- (method: Uppercase<HttpMethod>) => async (options: RequestOptions) => {
261
- const { opts, url } = await beforeRequest(options);
262
- return createSseClient({
263
- ...opts,
264
- body: opts.body as BodyInit | null | undefined,
265
- headers: opts.headers as unknown as Record<string, string>,
266
- method,
267
- onRequest: async (url, init) => {
268
- let request = new Request(url, init);
269
- for (const fn of interceptors.request.fns) {
270
- if (fn) {
271
- request = await fn(request, opts);
272
- }
273
- }
274
- return request;
275
- },
276
- serializedBody: getValidRequestBody(opts) as
277
- | BodyInit
278
- | null
279
- | undefined,
280
- url,
281
- });
282
- };
283
-
284
- return {
285
- buildUrl,
286
- connect: makeMethodFn('CONNECT'),
287
- delete: makeMethodFn('DELETE'),
288
- get: makeMethodFn('GET'),
289
- getConfig,
290
- head: makeMethodFn('HEAD'),
291
- interceptors,
292
- options: makeMethodFn('OPTIONS'),
293
- patch: makeMethodFn('PATCH'),
294
- post: makeMethodFn('POST'),
295
- put: makeMethodFn('PUT'),
296
- request,
297
- setConfig,
298
- sse: {
299
- connect: makeSseFn('CONNECT'),
300
- delete: makeSseFn('DELETE'),
301
- get: makeSseFn('GET'),
302
- head: makeSseFn('HEAD'),
303
- options: makeSseFn('OPTIONS'),
304
- patch: makeSseFn('PATCH'),
305
- post: makeSseFn('POST'),
306
- put: makeSseFn('PUT'),
307
- trace: makeSseFn('TRACE'),
308
- },
309
- trace: makeMethodFn('TRACE'),
310
- } as Client;
311
- };
@@ -1,25 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- export type { Auth } from '../core/auth.gen';
4
- export type { QuerySerializerOptions } from '../core/bodySerializer.gen';
5
- export {
6
- formDataBodySerializer,
7
- jsonBodySerializer,
8
- urlSearchParamsBodySerializer,
9
- } from '../core/bodySerializer.gen';
10
- export { buildClientParams } from '../core/params.gen';
11
- export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen';
12
- export { createClient } from './client.gen';
13
- export type {
14
- Client,
15
- ClientOptions,
16
- Config,
17
- CreateClientConfig,
18
- Options,
19
- RequestOptions,
20
- RequestResult,
21
- ResolvedRequestOptions,
22
- ResponseStyle,
23
- TDataShape,
24
- } from './types.gen';
25
- export { createConfig, mergeHeaders } from './utils.gen';
@@ -1,241 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- import type { Auth } from '../core/auth.gen';
4
- import type {
5
- ServerSentEventsOptions,
6
- ServerSentEventsResult,
7
- } from '../core/serverSentEvents.gen';
8
- import type {
9
- Client as CoreClient,
10
- Config as CoreConfig,
11
- } from '../core/types.gen';
12
- import type { Middleware } from './utils.gen';
13
-
14
- export type ResponseStyle = 'data' | 'fields';
15
-
16
- export interface Config<T extends ClientOptions = ClientOptions>
17
- extends Omit<RequestInit, 'body' | 'headers' | 'method'>,
18
- CoreConfig {
19
- /**
20
- * Base URL for all requests made by this client.
21
- */
22
- baseUrl?: T['baseUrl'];
23
- /**
24
- * Fetch API implementation. You can use this option to provide a custom
25
- * fetch instance.
26
- *
27
- * @default globalThis.fetch
28
- */
29
- fetch?: typeof fetch;
30
- /**
31
- * Please don't use the Fetch client for Next.js applications. The `next`
32
- * options won't have any effect.
33
- *
34
- * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
35
- */
36
- next?: never;
37
- /**
38
- * Return the response data parsed in a specified format. By default, `auto`
39
- * will infer the appropriate method from the `Content-Type` response header.
40
- * You can override this behavior with any of the {@link Body} methods.
41
- * Select `stream` if you don't want to parse response data at all.
42
- *
43
- * @default 'auto'
44
- */
45
- parseAs?:
46
- | 'arrayBuffer'
47
- | 'auto'
48
- | 'blob'
49
- | 'formData'
50
- | 'json'
51
- | 'stream'
52
- | 'text';
53
- /**
54
- * Should we return only data or multiple fields (data, error, response, etc.)?
55
- *
56
- * @default 'fields'
57
- */
58
- responseStyle?: ResponseStyle;
59
- /**
60
- * Throw an error instead of returning it in the response?
61
- *
62
- * @default false
63
- */
64
- throwOnError?: T['throwOnError'];
65
- }
66
-
67
- export interface RequestOptions<
68
- TData = unknown,
69
- TResponseStyle extends ResponseStyle = 'fields',
70
- ThrowOnError extends boolean = boolean,
71
- Url extends string = string,
72
- > extends Config<{
73
- responseStyle: TResponseStyle;
74
- throwOnError: ThrowOnError;
75
- }>,
76
- Pick<
77
- ServerSentEventsOptions<TData>,
78
- | 'onSseError'
79
- | 'onSseEvent'
80
- | 'sseDefaultRetryDelay'
81
- | 'sseMaxRetryAttempts'
82
- | 'sseMaxRetryDelay'
83
- > {
84
- /**
85
- * Any body that you want to add to your request.
86
- *
87
- * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
88
- */
89
- body?: unknown;
90
- path?: Record<string, unknown>;
91
- query?: Record<string, unknown>;
92
- /**
93
- * Security mechanism(s) to use for the request.
94
- */
95
- security?: ReadonlyArray<Auth>;
96
- url: Url;
97
- }
98
-
99
- export interface ResolvedRequestOptions<
100
- TResponseStyle extends ResponseStyle = 'fields',
101
- ThrowOnError extends boolean = boolean,
102
- Url extends string = string,
103
- > extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
104
- serializedBody?: string;
105
- }
106
-
107
- export type RequestResult<
108
- TData = unknown,
109
- TError = unknown,
110
- ThrowOnError extends boolean = boolean,
111
- TResponseStyle extends ResponseStyle = 'fields',
112
- > = ThrowOnError extends true
113
- ? Promise<
114
- TResponseStyle extends 'data'
115
- ? TData extends Record<string, unknown>
116
- ? TData[keyof TData]
117
- : TData
118
- : {
119
- data: TData extends Record<string, unknown>
120
- ? TData[keyof TData]
121
- : TData;
122
- request: Request;
123
- response: Response;
124
- }
125
- >
126
- : Promise<
127
- TResponseStyle extends 'data'
128
- ?
129
- | (TData extends Record<string, unknown>
130
- ? TData[keyof TData]
131
- : TData)
132
- | undefined
133
- : (
134
- | {
135
- data: TData extends Record<string, unknown>
136
- ? TData[keyof TData]
137
- : TData;
138
- error: undefined;
139
- }
140
- | {
141
- data: undefined;
142
- error: TError extends Record<string, unknown>
143
- ? TError[keyof TError]
144
- : TError;
145
- }
146
- ) & {
147
- request: Request;
148
- response: Response;
149
- }
150
- >;
151
-
152
- export interface ClientOptions {
153
- baseUrl?: string;
154
- responseStyle?: ResponseStyle;
155
- throwOnError?: boolean;
156
- }
157
-
158
- type MethodFn = <
159
- TData = unknown,
160
- TError = unknown,
161
- ThrowOnError extends boolean = false,
162
- TResponseStyle extends ResponseStyle = 'fields',
163
- >(
164
- options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>,
165
- ) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
166
-
167
- type SseFn = <
168
- TData = unknown,
169
- TError = unknown,
170
- ThrowOnError extends boolean = false,
171
- TResponseStyle extends ResponseStyle = 'fields',
172
- >(
173
- options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>,
174
- ) => Promise<ServerSentEventsResult<TData, TError>>;
175
-
176
- type RequestFn = <
177
- TData = unknown,
178
- TError = unknown,
179
- ThrowOnError extends boolean = false,
180
- TResponseStyle extends ResponseStyle = 'fields',
181
- >(
182
- options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> &
183
- Pick<
184
- Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>,
185
- 'method'
186
- >,
187
- ) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
188
-
189
- type BuildUrlFn = <
190
- TData extends {
191
- body?: unknown;
192
- path?: Record<string, unknown>;
193
- query?: Record<string, unknown>;
194
- url: string;
195
- },
196
- >(
197
- options: TData & Options<TData>,
198
- ) => string;
199
-
200
- export type Client = CoreClient<
201
- RequestFn,
202
- Config,
203
- MethodFn,
204
- BuildUrlFn,
205
- SseFn
206
- > & {
207
- interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
208
- };
209
-
210
- /**
211
- * The `createClientConfig()` function will be called on client initialization
212
- * and the returned object will become the client's initial configuration.
213
- *
214
- * You may want to initialize your client this way instead of calling
215
- * `setConfig()`. This is useful for example if you're using Next.js
216
- * to ensure your client always has the correct values.
217
- */
218
- export type CreateClientConfig<T extends ClientOptions = ClientOptions> = (
219
- override?: Config<ClientOptions & T>,
220
- ) => Config<Required<ClientOptions> & T>;
221
-
222
- export interface TDataShape {
223
- body?: unknown;
224
- headers?: unknown;
225
- path?: unknown;
226
- query?: unknown;
227
- url: string;
228
- }
229
-
230
- type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
231
-
232
- export type Options<
233
- TData extends TDataShape = TDataShape,
234
- ThrowOnError extends boolean = boolean,
235
- TResponse = unknown,
236
- TResponseStyle extends ResponseStyle = 'fields',
237
- > = OmitKeys<
238
- RequestOptions<TResponse, TResponseStyle, ThrowOnError>,
239
- 'body' | 'path' | 'query' | 'url'
240
- > &
241
- ([TData] extends [never] ? unknown : Omit<TData, 'url'>);