@zennify/sdk-js 1.47.1 → 2.0.0
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/.github/workflows/npm-publish-package-ofc.yml +4 -7
- package/dist/lib/api/client/client.gen.js +221 -0
- package/dist/lib/api/client/index.js +17 -0
- package/dist/{interfaces/Products.js → lib/api/client/types.gen.js} +1 -0
- package/dist/lib/api/client/utils.gen.js +242 -0
- package/dist/lib/api/client.gen.js +6 -0
- package/dist/lib/api/core/auth.gen.js +18 -0
- package/dist/lib/api/core/bodySerializer.gen.js +60 -0
- package/dist/lib/api/core/params.gen.js +107 -0
- package/dist/lib/api/core/pathSerializer.gen.js +123 -0
- package/dist/lib/api/core/queryKeySerializer.gen.js +105 -0
- package/dist/lib/api/core/serverSentEvents.gen.js +139 -0
- package/dist/{errors.js → lib/api/core/types.gen.js} +1 -0
- package/dist/lib/api/core/utils.gen.js +93 -0
- package/dist/lib/api/index.js +61 -0
- package/dist/lib/api/sdk.gen.js +610 -0
- package/dist/{interfaces/Media.js → lib/api/types.gen.js} +1 -0
- package/dist/main.js +1 -10
- package/package.json +1 -1
- package/src/lib/api/client/client.gen.ts +303 -0
- package/src/lib/api/client/index.ts +25 -0
- package/src/lib/api/client/types.gen.ts +247 -0
- package/src/lib/api/client/utils.gen.ts +337 -0
- package/src/lib/api/client.gen.ts +25 -0
- package/src/lib/api/core/auth.gen.ts +42 -0
- package/src/lib/api/core/bodySerializer.gen.ts +96 -0
- package/src/lib/api/core/params.gen.ts +181 -0
- package/src/lib/api/core/pathSerializer.gen.ts +180 -0
- package/src/lib/api/core/queryKeySerializer.gen.ts +136 -0
- package/src/lib/api/core/serverSentEvents.gen.ts +265 -0
- package/src/lib/api/core/types.gen.ts +118 -0
- package/src/lib/api/core/utils.gen.ts +143 -0
- package/src/lib/api/index.ts +325 -0
- package/src/lib/api/sdk.gen.ts +1188 -0
- package/src/lib/api/types.gen.ts +3328 -0
- package/src/main.ts +42 -13
- package/types/lib/api/client/client.gen.d.ts +2 -0
- package/types/lib/api/client/index.d.ts +8 -0
- package/types/lib/api/client/types.gen.d.ts +120 -0
- package/types/lib/api/client/utils.gen.d.ts +37 -0
- package/types/lib/api/client.gen.d.ts +12 -0
- package/types/lib/api/core/auth.gen.d.ts +18 -0
- package/types/lib/api/core/bodySerializer.gen.d.ts +25 -0
- package/types/lib/api/core/params.gen.d.ts +43 -0
- package/types/lib/api/core/pathSerializer.gen.d.ts +33 -0
- package/types/lib/api/core/queryKeySerializer.gen.d.ts +18 -0
- package/types/lib/api/core/serverSentEvents.gen.d.ts +71 -0
- package/types/lib/api/core/types.gen.d.ts +78 -0
- package/types/lib/api/core/utils.gen.d.ts +19 -0
- package/types/lib/api/index.d.ts +2 -0
- package/types/lib/api/sdk.gen.d.ts +235 -0
- package/types/lib/api/types.gen.d.ts +2910 -0
- package/types/main.d.ts +19 -12
- package/dist/RequestError.js +0 -55
- package/dist/interfaces/Panels.js +0 -2
- package/dist/interfaces/Statistics.js +0 -2
- package/dist/interfaces/Stores.js +0 -2
- package/dist/interfaces/Transactions.js +0 -2
- package/dist/utils.js +0 -13
- package/dist/var.js +0 -8
- package/src/RequestError.ts +0 -66
- package/src/errors.ts +0 -224
- package/src/interfaces/Media.ts +0 -5
- package/src/interfaces/Panels.ts +0 -18
- package/src/interfaces/Products.ts +0 -29
- package/src/interfaces/Statistics.ts +0 -21
- package/src/interfaces/Stores.ts +0 -58
- package/src/interfaces/Transactions.ts +0 -80
- package/src/utils.ts +0 -19
- package/src/var.ts +0 -5
- package/types/RequestError.d.ts +0 -11
- package/types/errors.d.ts +0 -214
- package/types/interfaces/Media.d.ts +0 -5
- package/types/interfaces/Panels.d.ts +0 -17
- package/types/interfaces/Products.d.ts +0 -28
- package/types/interfaces/Statistics.d.ts +0 -19
- package/types/interfaces/Stores.d.ts +0 -47
- package/types/interfaces/Transactions.d.ts +0 -78
- package/types/utils.d.ts +0 -5
- package/types/var.d.ts +0 -3
|
@@ -0,0 +1,1188 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type Client,
|
|
5
|
+
formDataBodySerializer,
|
|
6
|
+
type Options as Options2,
|
|
7
|
+
type TDataShape,
|
|
8
|
+
} from "./client";
|
|
9
|
+
import { client } from "./client.gen";
|
|
10
|
+
import type {
|
|
11
|
+
AddModeratorToStoreData,
|
|
12
|
+
AddModeratorToStoreErrors,
|
|
13
|
+
AddModeratorToStoreResponses,
|
|
14
|
+
CreateStoreCouponData,
|
|
15
|
+
CreateStoreCouponErrors,
|
|
16
|
+
CreateStoreCouponResponses,
|
|
17
|
+
CreateStoreData,
|
|
18
|
+
CreateStoreDiscordEmojisData,
|
|
19
|
+
CreateStoreDiscordEmojisErrors,
|
|
20
|
+
CreateStoreDiscordEmojisResponses,
|
|
21
|
+
CreateStoreDiscordPanelData,
|
|
22
|
+
CreateStoreDiscordPanelErrors,
|
|
23
|
+
CreateStoreDiscordPanelResponses,
|
|
24
|
+
CreateStoreEditOrderData,
|
|
25
|
+
CreateStoreEditOrderErrors,
|
|
26
|
+
CreateStoreEditOrderResponses,
|
|
27
|
+
CreateStoreErrors,
|
|
28
|
+
CreateStoreProductData,
|
|
29
|
+
CreateStoreProductErrors,
|
|
30
|
+
CreateStoreProductResponses,
|
|
31
|
+
CreateStoreRenewOrderData,
|
|
32
|
+
CreateStoreRenewOrderErrors,
|
|
33
|
+
CreateStoreRenewOrderResponses,
|
|
34
|
+
CreateStoreResponses,
|
|
35
|
+
DeleteStoreCouponData,
|
|
36
|
+
DeleteStoreCouponErrors,
|
|
37
|
+
DeleteStoreCouponResponses,
|
|
38
|
+
DeleteStoreDiscordPanelData,
|
|
39
|
+
DeleteStoreDiscordPanelErrors,
|
|
40
|
+
DeleteStoreDiscordPanelResponses,
|
|
41
|
+
DeleteStoreDiscordServerData,
|
|
42
|
+
DeleteStoreDiscordServerErrors,
|
|
43
|
+
DeleteStoreDiscordServerResponses,
|
|
44
|
+
DeleteStoreMediaData,
|
|
45
|
+
DeleteStoreMediaErrors,
|
|
46
|
+
DeleteStoreMediaResponses,
|
|
47
|
+
DeleteStoreProductData,
|
|
48
|
+
DeleteStoreProductErrors,
|
|
49
|
+
DeleteStoreProductResponses,
|
|
50
|
+
EditStoreModeratorData,
|
|
51
|
+
EditStoreModeratorErrors,
|
|
52
|
+
EditStoreModeratorResponses,
|
|
53
|
+
EditUserData,
|
|
54
|
+
EditUserErrors,
|
|
55
|
+
EditUserResponses,
|
|
56
|
+
GetApiReferenceData,
|
|
57
|
+
GetApiReferenceResponses,
|
|
58
|
+
GetServiceApiSchemaData,
|
|
59
|
+
GetServiceApiSchemaResponses,
|
|
60
|
+
GetServiceDataData,
|
|
61
|
+
GetServiceDataResponses,
|
|
62
|
+
GetServiceHealthData,
|
|
63
|
+
GetServiceHealthResponses,
|
|
64
|
+
GetStoreCouponData,
|
|
65
|
+
GetStoreCouponErrors,
|
|
66
|
+
GetStoreCouponResponses,
|
|
67
|
+
GetStoreCouponsData,
|
|
68
|
+
GetStoreCouponsErrors,
|
|
69
|
+
GetStoreCouponsResponses,
|
|
70
|
+
GetStoreData,
|
|
71
|
+
GetStoreDiscordBotData,
|
|
72
|
+
GetStoreDiscordBotErrors,
|
|
73
|
+
GetStoreDiscordBotResponses,
|
|
74
|
+
GetStoreDiscordPanelsData,
|
|
75
|
+
GetStoreDiscordPanelsErrors,
|
|
76
|
+
GetStoreDiscordPanelsResponses,
|
|
77
|
+
GetStoreDiscordServersData,
|
|
78
|
+
GetStoreDiscordServersErrors,
|
|
79
|
+
GetStoreDiscordServersResponses,
|
|
80
|
+
GetStoreErrors,
|
|
81
|
+
GetStoreProductData,
|
|
82
|
+
GetStoreProductErrors,
|
|
83
|
+
GetStoreProductResponses,
|
|
84
|
+
GetStoreProductStockData,
|
|
85
|
+
GetStoreProductStockErrors,
|
|
86
|
+
GetStoreProductStockResponses,
|
|
87
|
+
GetStoreRankingCustomersData,
|
|
88
|
+
GetStoreRankingCustomersErrors,
|
|
89
|
+
GetStoreRankingCustomersResponses,
|
|
90
|
+
GetStoreResponses,
|
|
91
|
+
GetStoresData,
|
|
92
|
+
GetStoresErrors,
|
|
93
|
+
GetStoresResponses,
|
|
94
|
+
GetStoreStatsProductsData,
|
|
95
|
+
GetStoreStatsProductsErrors,
|
|
96
|
+
GetStoreStatsProductsResponses,
|
|
97
|
+
GetTransactionData,
|
|
98
|
+
GetTransactionErrors,
|
|
99
|
+
GetTransactionResponses,
|
|
100
|
+
GetUserByIdData,
|
|
101
|
+
GetUserByIdErrors,
|
|
102
|
+
GetUserByIdResponses,
|
|
103
|
+
GetUserData,
|
|
104
|
+
GetUserErrors,
|
|
105
|
+
GetUserResponses,
|
|
106
|
+
ListStoreProductsData,
|
|
107
|
+
ListStoreProductsErrors,
|
|
108
|
+
ListStoreProductsResponses,
|
|
109
|
+
ListTransactionsData,
|
|
110
|
+
ListTransactionsErrors,
|
|
111
|
+
ListTransactionsResponses,
|
|
112
|
+
PostStoreDiscordPanelMessageData,
|
|
113
|
+
PostStoreDiscordPanelMessageErrors,
|
|
114
|
+
PostStoreDiscordPanelMessageResponses,
|
|
115
|
+
PostStoreProductDiscordMessageData,
|
|
116
|
+
PostStoreProductDiscordMessageErrors,
|
|
117
|
+
PostStoreProductDiscordMessageResponses,
|
|
118
|
+
RemoveStoreModeratorData,
|
|
119
|
+
RemoveStoreModeratorErrors,
|
|
120
|
+
RemoveStoreModeratorResponses,
|
|
121
|
+
SetupEfiData,
|
|
122
|
+
SetupEfiErrors,
|
|
123
|
+
SetupEfiResponses,
|
|
124
|
+
SetupWebhookData,
|
|
125
|
+
SetupWebhookErrors,
|
|
126
|
+
SetupWebhookResponses,
|
|
127
|
+
UpdatePaymentMethodData,
|
|
128
|
+
UpdatePaymentMethodErrors,
|
|
129
|
+
UpdatePaymentMethodResponses,
|
|
130
|
+
UpdatePixKeyData,
|
|
131
|
+
UpdatePixKeyErrors,
|
|
132
|
+
UpdatePixKeyResponses,
|
|
133
|
+
UpdateStoreCouponData,
|
|
134
|
+
UpdateStoreCouponErrors,
|
|
135
|
+
UpdateStoreCouponResponses,
|
|
136
|
+
UpdateStoreData,
|
|
137
|
+
UpdateStoreDiscordBotTokenData,
|
|
138
|
+
UpdateStoreDiscordBotTokenErrors,
|
|
139
|
+
UpdateStoreDiscordBotTokenResponses,
|
|
140
|
+
UpdateStoreDiscordChannelsData,
|
|
141
|
+
UpdateStoreDiscordChannelsErrors,
|
|
142
|
+
UpdateStoreDiscordChannelsResponses,
|
|
143
|
+
UpdateStoreDiscordPanelData,
|
|
144
|
+
UpdateStoreDiscordPanelErrors,
|
|
145
|
+
UpdateStoreDiscordPanelResponses,
|
|
146
|
+
UpdateStoreErrors,
|
|
147
|
+
UpdateStoreProductData,
|
|
148
|
+
UpdateStoreProductErrors,
|
|
149
|
+
UpdateStoreProductResponses,
|
|
150
|
+
UpdateStoreProductStockData,
|
|
151
|
+
UpdateStoreProductStockErrors,
|
|
152
|
+
UpdateStoreProductStockItemData,
|
|
153
|
+
UpdateStoreProductStockItemErrors,
|
|
154
|
+
UpdateStoreProductStockItemResponses,
|
|
155
|
+
UpdateStoreProductStockResponses,
|
|
156
|
+
UpdateStoreResponses,
|
|
157
|
+
UpdateTransactionData,
|
|
158
|
+
UpdateTransactionErrors,
|
|
159
|
+
UpdateTransactionResponses,
|
|
160
|
+
UpdateUserAvatarData,
|
|
161
|
+
UpdateUserAvatarErrors,
|
|
162
|
+
UpdateUserAvatarResponses,
|
|
163
|
+
UploadStoreMediaData,
|
|
164
|
+
UploadStoreMediaErrors,
|
|
165
|
+
UploadStoreMediaResponses,
|
|
166
|
+
WalletBalanceData,
|
|
167
|
+
WalletBalanceErrors,
|
|
168
|
+
WalletBalanceResponses,
|
|
169
|
+
WalletWithdrawData,
|
|
170
|
+
WalletWithdrawErrors,
|
|
171
|
+
WalletWithdrawResponses,
|
|
172
|
+
} from "./types.gen";
|
|
173
|
+
|
|
174
|
+
export type Options<
|
|
175
|
+
TData extends TDataShape = TDataShape,
|
|
176
|
+
ThrowOnError extends boolean = boolean,
|
|
177
|
+
TResponse = unknown,
|
|
178
|
+
> = Options2<TData, ThrowOnError, TResponse> & {
|
|
179
|
+
/**
|
|
180
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
181
|
+
* individual options. This might be also useful if you want to implement a
|
|
182
|
+
* custom client.
|
|
183
|
+
*/
|
|
184
|
+
client?: Client;
|
|
185
|
+
/**
|
|
186
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
187
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
188
|
+
*/
|
|
189
|
+
meta?: Record<string, unknown>;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Return service health data, including cache and database status.
|
|
194
|
+
*/
|
|
195
|
+
export const getServiceHealth = <ThrowOnError extends boolean = false>(
|
|
196
|
+
options?: Options<GetServiceHealthData, ThrowOnError>,
|
|
197
|
+
) =>
|
|
198
|
+
(options?.client ?? client).get<
|
|
199
|
+
GetServiceHealthResponses,
|
|
200
|
+
unknown,
|
|
201
|
+
ThrowOnError
|
|
202
|
+
>({ url: "/health", ...options });
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Return current OpenAPI specification.
|
|
206
|
+
*/
|
|
207
|
+
export const getServiceApiSchema = <ThrowOnError extends boolean = false>(
|
|
208
|
+
options?: Options<GetServiceApiSchemaData, ThrowOnError>,
|
|
209
|
+
) =>
|
|
210
|
+
(options?.client ?? client).get<
|
|
211
|
+
GetServiceApiSchemaResponses,
|
|
212
|
+
unknown,
|
|
213
|
+
ThrowOnError
|
|
214
|
+
>({ url: "/openapi.json", ...options });
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Delete a store Discord sale panel.
|
|
218
|
+
*/
|
|
219
|
+
export const deleteStoreDiscordPanel = <ThrowOnError extends boolean = false>(
|
|
220
|
+
options: Options<DeleteStoreDiscordPanelData, ThrowOnError>,
|
|
221
|
+
) =>
|
|
222
|
+
(options.client ?? client).delete<
|
|
223
|
+
DeleteStoreDiscordPanelResponses,
|
|
224
|
+
DeleteStoreDiscordPanelErrors,
|
|
225
|
+
ThrowOnError
|
|
226
|
+
>({
|
|
227
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
228
|
+
url: "/stores/{storeId}/discord_panels/{panelId}",
|
|
229
|
+
...options,
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Update a store Discord sale panel.
|
|
234
|
+
*/
|
|
235
|
+
export const updateStoreDiscordPanel = <ThrowOnError extends boolean = false>(
|
|
236
|
+
options: Options<UpdateStoreDiscordPanelData, ThrowOnError>,
|
|
237
|
+
) =>
|
|
238
|
+
(options.client ?? client).patch<
|
|
239
|
+
UpdateStoreDiscordPanelResponses,
|
|
240
|
+
UpdateStoreDiscordPanelErrors,
|
|
241
|
+
ThrowOnError
|
|
242
|
+
>({
|
|
243
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
244
|
+
url: "/stores/{storeId}/discord_panels/{panelId}",
|
|
245
|
+
...options,
|
|
246
|
+
headers: {
|
|
247
|
+
"Content-Type": "application/json",
|
|
248
|
+
...options.headers,
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* List store Discord sale panels.
|
|
254
|
+
*/
|
|
255
|
+
export const getStoreDiscordPanels = <ThrowOnError extends boolean = false>(
|
|
256
|
+
options: Options<GetStoreDiscordPanelsData, ThrowOnError>,
|
|
257
|
+
) =>
|
|
258
|
+
(options.client ?? client).get<
|
|
259
|
+
GetStoreDiscordPanelsResponses,
|
|
260
|
+
GetStoreDiscordPanelsErrors,
|
|
261
|
+
ThrowOnError
|
|
262
|
+
>({
|
|
263
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
264
|
+
url: "/stores/{storeId}/discord_panels",
|
|
265
|
+
...options,
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Create a store Discord sale panel.
|
|
270
|
+
*/
|
|
271
|
+
export const createStoreDiscordPanel = <ThrowOnError extends boolean = false>(
|
|
272
|
+
options: Options<CreateStoreDiscordPanelData, ThrowOnError>,
|
|
273
|
+
) =>
|
|
274
|
+
(options.client ?? client).post<
|
|
275
|
+
CreateStoreDiscordPanelResponses,
|
|
276
|
+
CreateStoreDiscordPanelErrors,
|
|
277
|
+
ThrowOnError
|
|
278
|
+
>({
|
|
279
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
280
|
+
url: "/stores/{storeId}/discord_panels",
|
|
281
|
+
...options,
|
|
282
|
+
headers: {
|
|
283
|
+
"Content-Type": "application/json",
|
|
284
|
+
...options.headers,
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Ask the store Discord bot to post a panel message in a channel.
|
|
290
|
+
*/
|
|
291
|
+
export const postStoreDiscordPanelMessage = <
|
|
292
|
+
ThrowOnError extends boolean = false,
|
|
293
|
+
>(
|
|
294
|
+
options: Options<PostStoreDiscordPanelMessageData, ThrowOnError>,
|
|
295
|
+
) =>
|
|
296
|
+
(options.client ?? client).post<
|
|
297
|
+
PostStoreDiscordPanelMessageResponses,
|
|
298
|
+
PostStoreDiscordPanelMessageErrors,
|
|
299
|
+
ThrowOnError
|
|
300
|
+
>({
|
|
301
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
302
|
+
url: "/stores/{storeId}/discord_panels/{panelId}/discord_messages",
|
|
303
|
+
...options,
|
|
304
|
+
headers: {
|
|
305
|
+
"Content-Type": "application/json",
|
|
306
|
+
...options.headers,
|
|
307
|
+
},
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Ask the store Discord bot to post a product message in a channel.
|
|
312
|
+
*/
|
|
313
|
+
export const postStoreProductDiscordMessage = <
|
|
314
|
+
ThrowOnError extends boolean = false,
|
|
315
|
+
>(
|
|
316
|
+
options: Options<PostStoreProductDiscordMessageData, ThrowOnError>,
|
|
317
|
+
) =>
|
|
318
|
+
(options.client ?? client).post<
|
|
319
|
+
PostStoreProductDiscordMessageResponses,
|
|
320
|
+
PostStoreProductDiscordMessageErrors,
|
|
321
|
+
ThrowOnError
|
|
322
|
+
>({
|
|
323
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
324
|
+
url: "/stores/{storeId}/products/{productId}/discord_messages",
|
|
325
|
+
...options,
|
|
326
|
+
headers: {
|
|
327
|
+
"Content-Type": "application/json",
|
|
328
|
+
...options.headers,
|
|
329
|
+
},
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Delete a store product.
|
|
334
|
+
*/
|
|
335
|
+
export const deleteStoreProduct = <ThrowOnError extends boolean = false>(
|
|
336
|
+
options: Options<DeleteStoreProductData, ThrowOnError>,
|
|
337
|
+
) =>
|
|
338
|
+
(options.client ?? client).delete<
|
|
339
|
+
DeleteStoreProductResponses,
|
|
340
|
+
DeleteStoreProductErrors,
|
|
341
|
+
ThrowOnError
|
|
342
|
+
>({
|
|
343
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
344
|
+
url: "/stores/{storeId}/products/{productId}",
|
|
345
|
+
...options,
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Access a store product.
|
|
350
|
+
*/
|
|
351
|
+
export const getStoreProduct = <ThrowOnError extends boolean = false>(
|
|
352
|
+
options: Options<GetStoreProductData, ThrowOnError>,
|
|
353
|
+
) =>
|
|
354
|
+
(options.client ?? client).get<
|
|
355
|
+
GetStoreProductResponses,
|
|
356
|
+
GetStoreProductErrors,
|
|
357
|
+
ThrowOnError
|
|
358
|
+
>({
|
|
359
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
360
|
+
url: "/stores/{storeId}/products/{productId}",
|
|
361
|
+
...options,
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Update a store product.
|
|
366
|
+
*/
|
|
367
|
+
export const updateStoreProduct = <ThrowOnError extends boolean = false>(
|
|
368
|
+
options: Options<UpdateStoreProductData, ThrowOnError>,
|
|
369
|
+
) =>
|
|
370
|
+
(options.client ?? client).patch<
|
|
371
|
+
UpdateStoreProductResponses,
|
|
372
|
+
UpdateStoreProductErrors,
|
|
373
|
+
ThrowOnError
|
|
374
|
+
>({
|
|
375
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
376
|
+
url: "/stores/{storeId}/products/{productId}",
|
|
377
|
+
...options,
|
|
378
|
+
headers: {
|
|
379
|
+
"Content-Type": "application/json",
|
|
380
|
+
...options.headers,
|
|
381
|
+
},
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* List products from a store.
|
|
386
|
+
*/
|
|
387
|
+
export const listStoreProducts = <ThrowOnError extends boolean = false>(
|
|
388
|
+
options: Options<ListStoreProductsData, ThrowOnError>,
|
|
389
|
+
) =>
|
|
390
|
+
(options.client ?? client).get<
|
|
391
|
+
ListStoreProductsResponses,
|
|
392
|
+
ListStoreProductsErrors,
|
|
393
|
+
ThrowOnError
|
|
394
|
+
>({
|
|
395
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
396
|
+
url: "/stores/{storeId}/products",
|
|
397
|
+
...options,
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Create a store product.
|
|
402
|
+
*/
|
|
403
|
+
export const createStoreProduct = <ThrowOnError extends boolean = false>(
|
|
404
|
+
options: Options<CreateStoreProductData, ThrowOnError>,
|
|
405
|
+
) =>
|
|
406
|
+
(options.client ?? client).post<
|
|
407
|
+
CreateStoreProductResponses,
|
|
408
|
+
CreateStoreProductErrors,
|
|
409
|
+
ThrowOnError
|
|
410
|
+
>({
|
|
411
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
412
|
+
url: "/stores/{storeId}/products",
|
|
413
|
+
...options,
|
|
414
|
+
headers: {
|
|
415
|
+
"Content-Type": "application/json",
|
|
416
|
+
...options.headers,
|
|
417
|
+
},
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Update a product stock item.
|
|
422
|
+
*/
|
|
423
|
+
export const updateStoreProductStockItem = <
|
|
424
|
+
ThrowOnError extends boolean = false,
|
|
425
|
+
>(
|
|
426
|
+
options: Options<UpdateStoreProductStockItemData, ThrowOnError>,
|
|
427
|
+
) =>
|
|
428
|
+
(options.client ?? client).patch<
|
|
429
|
+
UpdateStoreProductStockItemResponses,
|
|
430
|
+
UpdateStoreProductStockItemErrors,
|
|
431
|
+
ThrowOnError
|
|
432
|
+
>({
|
|
433
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
434
|
+
url: "/stores/{storeId}/products/{productId}/stock/{stockId}",
|
|
435
|
+
...options,
|
|
436
|
+
headers: {
|
|
437
|
+
"Content-Type": "application/json",
|
|
438
|
+
...options.headers,
|
|
439
|
+
},
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* List available stock items for a product.
|
|
444
|
+
*/
|
|
445
|
+
export const getStoreProductStock = <ThrowOnError extends boolean = false>(
|
|
446
|
+
options: Options<GetStoreProductStockData, ThrowOnError>,
|
|
447
|
+
) =>
|
|
448
|
+
(options.client ?? client).get<
|
|
449
|
+
GetStoreProductStockResponses,
|
|
450
|
+
GetStoreProductStockErrors,
|
|
451
|
+
ThrowOnError
|
|
452
|
+
>({
|
|
453
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
454
|
+
url: "/stores/{storeId}/products/{productId}/stock",
|
|
455
|
+
...options,
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Add or remove product stock items and update stock lock settings.
|
|
460
|
+
*/
|
|
461
|
+
export const updateStoreProductStock = <ThrowOnError extends boolean = false>(
|
|
462
|
+
options: Options<UpdateStoreProductStockData, ThrowOnError>,
|
|
463
|
+
) =>
|
|
464
|
+
(options.client ?? client).put<
|
|
465
|
+
UpdateStoreProductStockResponses,
|
|
466
|
+
UpdateStoreProductStockErrors,
|
|
467
|
+
ThrowOnError
|
|
468
|
+
>({
|
|
469
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
470
|
+
url: "/stores/{storeId}/products/{productId}/stock",
|
|
471
|
+
...options,
|
|
472
|
+
headers: {
|
|
473
|
+
"Content-Type": "application/json",
|
|
474
|
+
...options.headers,
|
|
475
|
+
},
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Return current OpenAPI specification.
|
|
480
|
+
*/
|
|
481
|
+
export const getApiReference = <ThrowOnError extends boolean = false>(
|
|
482
|
+
options?: Options<GetApiReferenceData, ThrowOnError>,
|
|
483
|
+
) =>
|
|
484
|
+
(options?.client ?? client).get<
|
|
485
|
+
GetApiReferenceResponses,
|
|
486
|
+
unknown,
|
|
487
|
+
ThrowOnError
|
|
488
|
+
>({ url: "/reference", ...options });
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Returns basic service data, focused on website functionality (such as home statistics), but is a public route.
|
|
492
|
+
*/
|
|
493
|
+
export const getServiceData = <ThrowOnError extends boolean = false>(
|
|
494
|
+
options?: Options<GetServiceDataData, ThrowOnError>,
|
|
495
|
+
) =>
|
|
496
|
+
(options?.client ?? client).get<
|
|
497
|
+
GetServiceDataResponses,
|
|
498
|
+
unknown,
|
|
499
|
+
ThrowOnError
|
|
500
|
+
>({ url: "/service", ...options });
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Update store Discord channel bindings.
|
|
504
|
+
*/
|
|
505
|
+
export const updateStoreDiscordChannels = <
|
|
506
|
+
ThrowOnError extends boolean = false,
|
|
507
|
+
>(
|
|
508
|
+
options: Options<UpdateStoreDiscordChannelsData, ThrowOnError>,
|
|
509
|
+
) =>
|
|
510
|
+
(options.client ?? client).patch<
|
|
511
|
+
UpdateStoreDiscordChannelsResponses,
|
|
512
|
+
UpdateStoreDiscordChannelsErrors,
|
|
513
|
+
ThrowOnError
|
|
514
|
+
>({
|
|
515
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
516
|
+
url: "/stores/{storeId}/app/discord/channels",
|
|
517
|
+
...options,
|
|
518
|
+
headers: {
|
|
519
|
+
"Content-Type": "application/json",
|
|
520
|
+
...options.headers,
|
|
521
|
+
},
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Create Discord emojis in a store bot guild.
|
|
526
|
+
*/
|
|
527
|
+
export const createStoreDiscordEmojis = <ThrowOnError extends boolean = false>(
|
|
528
|
+
options: Options<CreateStoreDiscordEmojisData, ThrowOnError>,
|
|
529
|
+
) =>
|
|
530
|
+
(options.client ?? client).post<
|
|
531
|
+
CreateStoreDiscordEmojisResponses,
|
|
532
|
+
CreateStoreDiscordEmojisErrors,
|
|
533
|
+
ThrowOnError
|
|
534
|
+
>({
|
|
535
|
+
...formDataBodySerializer,
|
|
536
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
537
|
+
url: "/stores/{storeId}/app/discord/{serverId}/emojis",
|
|
538
|
+
...options,
|
|
539
|
+
headers: {
|
|
540
|
+
"Content-Type": null,
|
|
541
|
+
...options.headers,
|
|
542
|
+
},
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Get the configured Discord bot status for a store.
|
|
547
|
+
*/
|
|
548
|
+
export const getStoreDiscordBot = <ThrowOnError extends boolean = false>(
|
|
549
|
+
options: Options<GetStoreDiscordBotData, ThrowOnError>,
|
|
550
|
+
) =>
|
|
551
|
+
(options.client ?? client).get<
|
|
552
|
+
GetStoreDiscordBotResponses,
|
|
553
|
+
GetStoreDiscordBotErrors,
|
|
554
|
+
ThrowOnError
|
|
555
|
+
>({
|
|
556
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
557
|
+
url: "/stores/{storeId}/app/discord",
|
|
558
|
+
...options,
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Remove a store Discord bot from a guild.
|
|
563
|
+
*/
|
|
564
|
+
export const deleteStoreDiscordServer = <ThrowOnError extends boolean = false>(
|
|
565
|
+
options: Options<DeleteStoreDiscordServerData, ThrowOnError>,
|
|
566
|
+
) =>
|
|
567
|
+
(options.client ?? client).delete<
|
|
568
|
+
DeleteStoreDiscordServerResponses,
|
|
569
|
+
DeleteStoreDiscordServerErrors,
|
|
570
|
+
ThrowOnError
|
|
571
|
+
>({
|
|
572
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
573
|
+
url: "/stores/{storeId}/app/discord/servers",
|
|
574
|
+
...options,
|
|
575
|
+
headers: {
|
|
576
|
+
"Content-Type": "application/json",
|
|
577
|
+
...options.headers,
|
|
578
|
+
},
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* List Discord guilds cached for a store bot.
|
|
583
|
+
*/
|
|
584
|
+
export const getStoreDiscordServers = <ThrowOnError extends boolean = false>(
|
|
585
|
+
options: Options<GetStoreDiscordServersData, ThrowOnError>,
|
|
586
|
+
) =>
|
|
587
|
+
(options.client ?? client).get<
|
|
588
|
+
GetStoreDiscordServersResponses,
|
|
589
|
+
GetStoreDiscordServersErrors,
|
|
590
|
+
ThrowOnError
|
|
591
|
+
>({
|
|
592
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
593
|
+
url: "/stores/{storeId}/app/discord/servers",
|
|
594
|
+
...options,
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Update a store Discord bot token.
|
|
599
|
+
*/
|
|
600
|
+
export const updateStoreDiscordBotToken = <
|
|
601
|
+
ThrowOnError extends boolean = false,
|
|
602
|
+
>(
|
|
603
|
+
options: Options<UpdateStoreDiscordBotTokenData, ThrowOnError>,
|
|
604
|
+
) =>
|
|
605
|
+
(options.client ?? client).patch<
|
|
606
|
+
UpdateStoreDiscordBotTokenResponses,
|
|
607
|
+
UpdateStoreDiscordBotTokenErrors,
|
|
608
|
+
ThrowOnError
|
|
609
|
+
>({
|
|
610
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
611
|
+
url: "/stores/{storeId}/app/discord/token",
|
|
612
|
+
...options,
|
|
613
|
+
headers: {
|
|
614
|
+
"Content-Type": "application/json",
|
|
615
|
+
...options.headers,
|
|
616
|
+
},
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Delete a store coupon.
|
|
621
|
+
*/
|
|
622
|
+
export const deleteStoreCoupon = <ThrowOnError extends boolean = false>(
|
|
623
|
+
options: Options<DeleteStoreCouponData, ThrowOnError>,
|
|
624
|
+
) =>
|
|
625
|
+
(options.client ?? client).delete<
|
|
626
|
+
DeleteStoreCouponResponses,
|
|
627
|
+
DeleteStoreCouponErrors,
|
|
628
|
+
ThrowOnError
|
|
629
|
+
>({
|
|
630
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
631
|
+
url: "/stores/{storeId}/coupons/{couponId}",
|
|
632
|
+
...options,
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Access a store coupon.
|
|
637
|
+
*/
|
|
638
|
+
export const getStoreCoupon = <ThrowOnError extends boolean = false>(
|
|
639
|
+
options: Options<GetStoreCouponData, ThrowOnError>,
|
|
640
|
+
) =>
|
|
641
|
+
(options.client ?? client).get<
|
|
642
|
+
GetStoreCouponResponses,
|
|
643
|
+
GetStoreCouponErrors,
|
|
644
|
+
ThrowOnError
|
|
645
|
+
>({
|
|
646
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
647
|
+
url: "/stores/{storeId}/coupons/{couponId}",
|
|
648
|
+
...options,
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Update a store coupon.
|
|
653
|
+
*/
|
|
654
|
+
export const updateStoreCoupon = <ThrowOnError extends boolean = false>(
|
|
655
|
+
options: Options<UpdateStoreCouponData, ThrowOnError>,
|
|
656
|
+
) =>
|
|
657
|
+
(options.client ?? client).patch<
|
|
658
|
+
UpdateStoreCouponResponses,
|
|
659
|
+
UpdateStoreCouponErrors,
|
|
660
|
+
ThrowOnError
|
|
661
|
+
>({
|
|
662
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
663
|
+
url: "/stores/{storeId}/coupons/{couponId}",
|
|
664
|
+
...options,
|
|
665
|
+
headers: {
|
|
666
|
+
"Content-Type": "application/json",
|
|
667
|
+
...options.headers,
|
|
668
|
+
},
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* List store coupons.
|
|
673
|
+
*/
|
|
674
|
+
export const getStoreCoupons = <ThrowOnError extends boolean = false>(
|
|
675
|
+
options: Options<GetStoreCouponsData, ThrowOnError>,
|
|
676
|
+
) =>
|
|
677
|
+
(options.client ?? client).get<
|
|
678
|
+
GetStoreCouponsResponses,
|
|
679
|
+
GetStoreCouponsErrors,
|
|
680
|
+
ThrowOnError
|
|
681
|
+
>({
|
|
682
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
683
|
+
url: "/stores/{storeId}/coupons",
|
|
684
|
+
...options,
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Create a store coupon.
|
|
689
|
+
*/
|
|
690
|
+
export const createStoreCoupon = <ThrowOnError extends boolean = false>(
|
|
691
|
+
options: Options<CreateStoreCouponData, ThrowOnError>,
|
|
692
|
+
) =>
|
|
693
|
+
(options.client ?? client).post<
|
|
694
|
+
CreateStoreCouponResponses,
|
|
695
|
+
CreateStoreCouponErrors,
|
|
696
|
+
ThrowOnError
|
|
697
|
+
>({
|
|
698
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
699
|
+
url: "/stores/{storeId}/coupons",
|
|
700
|
+
...options,
|
|
701
|
+
headers: {
|
|
702
|
+
"Content-Type": "application/json",
|
|
703
|
+
...options.headers,
|
|
704
|
+
},
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Create an order to edit store addons or limits.
|
|
709
|
+
*/
|
|
710
|
+
export const createStoreEditOrder = <ThrowOnError extends boolean = false>(
|
|
711
|
+
options: Options<CreateStoreEditOrderData, ThrowOnError>,
|
|
712
|
+
) =>
|
|
713
|
+
(options.client ?? client).post<
|
|
714
|
+
CreateStoreEditOrderResponses,
|
|
715
|
+
CreateStoreEditOrderErrors,
|
|
716
|
+
ThrowOnError
|
|
717
|
+
>({
|
|
718
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
719
|
+
url: "/stores/{storeId}/financial/edit",
|
|
720
|
+
...options,
|
|
721
|
+
headers: {
|
|
722
|
+
"Content-Type": "application/json",
|
|
723
|
+
...options.headers,
|
|
724
|
+
},
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Create an order to renew a store.
|
|
729
|
+
*/
|
|
730
|
+
export const createStoreRenewOrder = <ThrowOnError extends boolean = false>(
|
|
731
|
+
options: Options<CreateStoreRenewOrderData, ThrowOnError>,
|
|
732
|
+
) =>
|
|
733
|
+
(options.client ?? client).post<
|
|
734
|
+
CreateStoreRenewOrderResponses,
|
|
735
|
+
CreateStoreRenewOrderErrors,
|
|
736
|
+
ThrowOnError
|
|
737
|
+
>({
|
|
738
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
739
|
+
url: "/stores/{storeId}/financial/renew",
|
|
740
|
+
...options,
|
|
741
|
+
headers: {
|
|
742
|
+
"Content-Type": "application/json",
|
|
743
|
+
...options.headers,
|
|
744
|
+
},
|
|
745
|
+
});
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Detach media from store entities.
|
|
749
|
+
*/
|
|
750
|
+
export const deleteStoreMedia = <ThrowOnError extends boolean = false>(
|
|
751
|
+
options: Options<DeleteStoreMediaData, ThrowOnError>,
|
|
752
|
+
) =>
|
|
753
|
+
(options.client ?? client).delete<
|
|
754
|
+
DeleteStoreMediaResponses,
|
|
755
|
+
DeleteStoreMediaErrors,
|
|
756
|
+
ThrowOnError
|
|
757
|
+
>({
|
|
758
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
759
|
+
url: "/stores/{storeId}/media",
|
|
760
|
+
...options,
|
|
761
|
+
headers: {
|
|
762
|
+
"Content-Type": "application/json",
|
|
763
|
+
...options.headers,
|
|
764
|
+
},
|
|
765
|
+
});
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Upload a media file and attach it to store entities.
|
|
769
|
+
*/
|
|
770
|
+
export const uploadStoreMedia = <ThrowOnError extends boolean = false>(
|
|
771
|
+
options: Options<UploadStoreMediaData, ThrowOnError>,
|
|
772
|
+
) =>
|
|
773
|
+
(options.client ?? client).post<
|
|
774
|
+
UploadStoreMediaResponses,
|
|
775
|
+
UploadStoreMediaErrors,
|
|
776
|
+
ThrowOnError
|
|
777
|
+
>({
|
|
778
|
+
...formDataBodySerializer,
|
|
779
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
780
|
+
url: "/stores/{storeId}/media",
|
|
781
|
+
...options,
|
|
782
|
+
headers: {
|
|
783
|
+
"Content-Type": null,
|
|
784
|
+
...options.headers,
|
|
785
|
+
},
|
|
786
|
+
});
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Delete a store moderator.
|
|
790
|
+
*/
|
|
791
|
+
export const removeStoreModerator = <ThrowOnError extends boolean = false>(
|
|
792
|
+
options: Options<RemoveStoreModeratorData, ThrowOnError>,
|
|
793
|
+
) =>
|
|
794
|
+
(options.client ?? client).delete<
|
|
795
|
+
RemoveStoreModeratorResponses,
|
|
796
|
+
RemoveStoreModeratorErrors,
|
|
797
|
+
ThrowOnError
|
|
798
|
+
>({
|
|
799
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
800
|
+
url: "/stores/{storeId}/moderators/{modId}",
|
|
801
|
+
...options,
|
|
802
|
+
});
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Update a store moderator.
|
|
806
|
+
*/
|
|
807
|
+
export const editStoreModerator = <ThrowOnError extends boolean = false>(
|
|
808
|
+
options: Options<EditStoreModeratorData, ThrowOnError>,
|
|
809
|
+
) =>
|
|
810
|
+
(options.client ?? client).patch<
|
|
811
|
+
EditStoreModeratorResponses,
|
|
812
|
+
EditStoreModeratorErrors,
|
|
813
|
+
ThrowOnError
|
|
814
|
+
>({
|
|
815
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
816
|
+
url: "/stores/{storeId}/moderators/{modId}",
|
|
817
|
+
...options,
|
|
818
|
+
headers: {
|
|
819
|
+
"Content-Type": "application/json",
|
|
820
|
+
...options.headers,
|
|
821
|
+
},
|
|
822
|
+
});
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Create a store moderator invite.
|
|
826
|
+
*/
|
|
827
|
+
export const addModeratorToStore = <ThrowOnError extends boolean = false>(
|
|
828
|
+
options: Options<AddModeratorToStoreData, ThrowOnError>,
|
|
829
|
+
) =>
|
|
830
|
+
(options.client ?? client).post<
|
|
831
|
+
AddModeratorToStoreResponses,
|
|
832
|
+
AddModeratorToStoreErrors,
|
|
833
|
+
ThrowOnError
|
|
834
|
+
>({
|
|
835
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
836
|
+
url: "/stores/{storeId}/moderators",
|
|
837
|
+
...options,
|
|
838
|
+
headers: {
|
|
839
|
+
"Content-Type": "application/json",
|
|
840
|
+
...options.headers,
|
|
841
|
+
},
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Access store customers ranking, updated in real time.
|
|
846
|
+
*/
|
|
847
|
+
export const getStoreRankingCustomers = <ThrowOnError extends boolean = false>(
|
|
848
|
+
options: Options<GetStoreRankingCustomersData, ThrowOnError>,
|
|
849
|
+
) =>
|
|
850
|
+
(options.client ?? client).get<
|
|
851
|
+
GetStoreRankingCustomersResponses,
|
|
852
|
+
GetStoreRankingCustomersErrors,
|
|
853
|
+
ThrowOnError
|
|
854
|
+
>({
|
|
855
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
856
|
+
url: "/stores/{storeId}/ranking/customers",
|
|
857
|
+
...options,
|
|
858
|
+
});
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Access store product statistics, real-time updated.
|
|
862
|
+
*/
|
|
863
|
+
export const getStoreStatsProducts = <ThrowOnError extends boolean = false>(
|
|
864
|
+
options: Options<GetStoreStatsProductsData, ThrowOnError>,
|
|
865
|
+
) =>
|
|
866
|
+
(options.client ?? client).get<
|
|
867
|
+
GetStoreStatsProductsResponses,
|
|
868
|
+
GetStoreStatsProductsErrors,
|
|
869
|
+
ThrowOnError
|
|
870
|
+
>({
|
|
871
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
872
|
+
url: "/stores/{storeId}/stats/products",
|
|
873
|
+
...options,
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
/**
|
|
877
|
+
* Access store data.
|
|
878
|
+
*/
|
|
879
|
+
export const getStore = <ThrowOnError extends boolean = false>(
|
|
880
|
+
options: Options<GetStoreData, ThrowOnError>,
|
|
881
|
+
) =>
|
|
882
|
+
(options.client ?? client).get<
|
|
883
|
+
GetStoreResponses,
|
|
884
|
+
GetStoreErrors,
|
|
885
|
+
ThrowOnError
|
|
886
|
+
>({
|
|
887
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
888
|
+
url: "/stores/{storeId}",
|
|
889
|
+
...options,
|
|
890
|
+
});
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* Update store settings.
|
|
894
|
+
*/
|
|
895
|
+
export const updateStore = <ThrowOnError extends boolean = false>(
|
|
896
|
+
options: Options<UpdateStoreData, ThrowOnError>,
|
|
897
|
+
) =>
|
|
898
|
+
(options.client ?? client).patch<
|
|
899
|
+
UpdateStoreResponses,
|
|
900
|
+
UpdateStoreErrors,
|
|
901
|
+
ThrowOnError
|
|
902
|
+
>({
|
|
903
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
904
|
+
url: "/stores/{storeId}",
|
|
905
|
+
...options,
|
|
906
|
+
headers: {
|
|
907
|
+
"Content-Type": "application/json",
|
|
908
|
+
...options.headers,
|
|
909
|
+
},
|
|
910
|
+
});
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* List stores owned or moderated by the current user.
|
|
914
|
+
*/
|
|
915
|
+
export const getStores = <ThrowOnError extends boolean = false>(
|
|
916
|
+
options?: Options<GetStoresData, ThrowOnError>,
|
|
917
|
+
) =>
|
|
918
|
+
(options?.client ?? client).get<
|
|
919
|
+
GetStoresResponses,
|
|
920
|
+
GetStoresErrors,
|
|
921
|
+
ThrowOnError
|
|
922
|
+
>({
|
|
923
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
924
|
+
url: "/stores",
|
|
925
|
+
...options,
|
|
926
|
+
});
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Create a checkout order for a new store.
|
|
930
|
+
*/
|
|
931
|
+
export const createStore = <ThrowOnError extends boolean = false>(
|
|
932
|
+
options?: Options<CreateStoreData, ThrowOnError>,
|
|
933
|
+
) =>
|
|
934
|
+
(options?.client ?? client).post<
|
|
935
|
+
CreateStoreResponses,
|
|
936
|
+
CreateStoreErrors,
|
|
937
|
+
ThrowOnError
|
|
938
|
+
>({
|
|
939
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
940
|
+
url: "/stores",
|
|
941
|
+
...options,
|
|
942
|
+
headers: {
|
|
943
|
+
"Content-Type": "application/json",
|
|
944
|
+
...options?.headers,
|
|
945
|
+
},
|
|
946
|
+
});
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* List transactions for the authenticated user.
|
|
950
|
+
*/
|
|
951
|
+
export const listTransactions = <ThrowOnError extends boolean = false>(
|
|
952
|
+
options?: Options<ListTransactionsData, ThrowOnError>,
|
|
953
|
+
) =>
|
|
954
|
+
(options?.client ?? client).get<
|
|
955
|
+
ListTransactionsResponses,
|
|
956
|
+
ListTransactionsErrors,
|
|
957
|
+
ThrowOnError
|
|
958
|
+
>({
|
|
959
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
960
|
+
url: "/transactions",
|
|
961
|
+
...options,
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* Access a transaction by id or Pix E2E id.
|
|
966
|
+
*/
|
|
967
|
+
export const getTransaction = <ThrowOnError extends boolean = false>(
|
|
968
|
+
options: Options<GetTransactionData, ThrowOnError>,
|
|
969
|
+
) =>
|
|
970
|
+
(options.client ?? client).get<
|
|
971
|
+
GetTransactionResponses,
|
|
972
|
+
GetTransactionErrors,
|
|
973
|
+
ThrowOnError
|
|
974
|
+
>({
|
|
975
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
976
|
+
url: "/transactions/{transactionId}",
|
|
977
|
+
...options,
|
|
978
|
+
});
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* Update transaction status or metadata.
|
|
982
|
+
*/
|
|
983
|
+
export const updateTransaction = <ThrowOnError extends boolean = false>(
|
|
984
|
+
options: Options<UpdateTransactionData, ThrowOnError>,
|
|
985
|
+
) =>
|
|
986
|
+
(options.client ?? client).patch<
|
|
987
|
+
UpdateTransactionResponses,
|
|
988
|
+
UpdateTransactionErrors,
|
|
989
|
+
ThrowOnError
|
|
990
|
+
>({
|
|
991
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
992
|
+
url: "/transactions/{transactionId}",
|
|
993
|
+
...options,
|
|
994
|
+
headers: {
|
|
995
|
+
"Content-Type": "application/json",
|
|
996
|
+
...options.headers,
|
|
997
|
+
},
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* Access current user data
|
|
1002
|
+
*/
|
|
1003
|
+
export const getUserById = <ThrowOnError extends boolean = false>(
|
|
1004
|
+
options: Options<GetUserByIdData, ThrowOnError>,
|
|
1005
|
+
) =>
|
|
1006
|
+
(options.client ?? client).get<
|
|
1007
|
+
GetUserByIdResponses,
|
|
1008
|
+
GetUserByIdErrors,
|
|
1009
|
+
ThrowOnError
|
|
1010
|
+
>({
|
|
1011
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1012
|
+
url: "/users/{userId}",
|
|
1013
|
+
...options,
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Update users's avatar
|
|
1018
|
+
*/
|
|
1019
|
+
export const updateUserAvatar = <ThrowOnError extends boolean = false>(
|
|
1020
|
+
options?: Options<UpdateUserAvatarData, ThrowOnError>,
|
|
1021
|
+
) =>
|
|
1022
|
+
(options?.client ?? client).patch<
|
|
1023
|
+
UpdateUserAvatarResponses,
|
|
1024
|
+
UpdateUserAvatarErrors,
|
|
1025
|
+
ThrowOnError
|
|
1026
|
+
>({
|
|
1027
|
+
...formDataBodySerializer,
|
|
1028
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1029
|
+
url: "/users/me/avatar",
|
|
1030
|
+
...options,
|
|
1031
|
+
headers: {
|
|
1032
|
+
"Content-Type": null,
|
|
1033
|
+
...options?.headers,
|
|
1034
|
+
},
|
|
1035
|
+
});
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* Access current user data
|
|
1039
|
+
*/
|
|
1040
|
+
export const getUser = <ThrowOnError extends boolean = false>(
|
|
1041
|
+
options?: Options<GetUserData, ThrowOnError>,
|
|
1042
|
+
) =>
|
|
1043
|
+
(options?.client ?? client).get<
|
|
1044
|
+
GetUserResponses,
|
|
1045
|
+
GetUserErrors,
|
|
1046
|
+
ThrowOnError
|
|
1047
|
+
>({
|
|
1048
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1049
|
+
url: "/users/me",
|
|
1050
|
+
...options,
|
|
1051
|
+
});
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Edit current user data
|
|
1055
|
+
*/
|
|
1056
|
+
export const editUser = <ThrowOnError extends boolean = false>(
|
|
1057
|
+
options?: Options<EditUserData, ThrowOnError>,
|
|
1058
|
+
) =>
|
|
1059
|
+
(options?.client ?? client).patch<
|
|
1060
|
+
EditUserResponses,
|
|
1061
|
+
EditUserErrors,
|
|
1062
|
+
ThrowOnError
|
|
1063
|
+
>({
|
|
1064
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1065
|
+
url: "/users/me",
|
|
1066
|
+
...options,
|
|
1067
|
+
headers: {
|
|
1068
|
+
"Content-Type": "application/json",
|
|
1069
|
+
...options?.headers,
|
|
1070
|
+
},
|
|
1071
|
+
});
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* Update the user's preferred payment method.
|
|
1075
|
+
*/
|
|
1076
|
+
export const updatePaymentMethod = <ThrowOnError extends boolean = false>(
|
|
1077
|
+
options?: Options<UpdatePaymentMethodData, ThrowOnError>,
|
|
1078
|
+
) =>
|
|
1079
|
+
(options?.client ?? client).patch<
|
|
1080
|
+
UpdatePaymentMethodResponses,
|
|
1081
|
+
UpdatePaymentMethodErrors,
|
|
1082
|
+
ThrowOnError
|
|
1083
|
+
>({
|
|
1084
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1085
|
+
url: "/users/me/payment-method",
|
|
1086
|
+
...options,
|
|
1087
|
+
headers: {
|
|
1088
|
+
"Content-Type": "application/json",
|
|
1089
|
+
...options?.headers,
|
|
1090
|
+
},
|
|
1091
|
+
});
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* Configures the user's Efí account with certificate, Pix key, and OAuth credentials.
|
|
1095
|
+
*/
|
|
1096
|
+
export const setupEfi = <ThrowOnError extends boolean = false>(
|
|
1097
|
+
options?: Options<SetupEfiData, ThrowOnError>,
|
|
1098
|
+
) =>
|
|
1099
|
+
(options?.client ?? client).post<
|
|
1100
|
+
SetupEfiResponses,
|
|
1101
|
+
SetupEfiErrors,
|
|
1102
|
+
ThrowOnError
|
|
1103
|
+
>({
|
|
1104
|
+
...formDataBodySerializer,
|
|
1105
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1106
|
+
url: "/users/me/payments/efi/setup",
|
|
1107
|
+
...options,
|
|
1108
|
+
headers: {
|
|
1109
|
+
"Content-Type": null,
|
|
1110
|
+
...options?.headers,
|
|
1111
|
+
},
|
|
1112
|
+
});
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Update the user's semiauto Pix key.
|
|
1116
|
+
*/
|
|
1117
|
+
export const updatePixKey = <ThrowOnError extends boolean = false>(
|
|
1118
|
+
options?: Options<UpdatePixKeyData, ThrowOnError>,
|
|
1119
|
+
) =>
|
|
1120
|
+
(options?.client ?? client).patch<
|
|
1121
|
+
UpdatePixKeyResponses,
|
|
1122
|
+
UpdatePixKeyErrors,
|
|
1123
|
+
ThrowOnError
|
|
1124
|
+
>({
|
|
1125
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1126
|
+
url: "/users/me/pix_key",
|
|
1127
|
+
...options,
|
|
1128
|
+
headers: {
|
|
1129
|
+
"Content-Type": "application/json",
|
|
1130
|
+
...options?.headers,
|
|
1131
|
+
},
|
|
1132
|
+
});
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* Returns the user's Zennify Wallet balance.
|
|
1136
|
+
*/
|
|
1137
|
+
export const walletBalance = <ThrowOnError extends boolean = false>(
|
|
1138
|
+
options?: Options<WalletBalanceData, ThrowOnError>,
|
|
1139
|
+
) =>
|
|
1140
|
+
(options?.client ?? client).get<
|
|
1141
|
+
WalletBalanceResponses,
|
|
1142
|
+
WalletBalanceErrors,
|
|
1143
|
+
ThrowOnError
|
|
1144
|
+
>({
|
|
1145
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1146
|
+
url: "/users/me/wallet/balance",
|
|
1147
|
+
...options,
|
|
1148
|
+
});
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* Requests a withdrawal from the user's Zennify Wallet.
|
|
1152
|
+
*/
|
|
1153
|
+
export const walletWithdraw = <ThrowOnError extends boolean = false>(
|
|
1154
|
+
options?: Options<WalletWithdrawData, ThrowOnError>,
|
|
1155
|
+
) =>
|
|
1156
|
+
(options?.client ?? client).post<
|
|
1157
|
+
WalletWithdrawResponses,
|
|
1158
|
+
WalletWithdrawErrors,
|
|
1159
|
+
ThrowOnError
|
|
1160
|
+
>({
|
|
1161
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1162
|
+
url: "/users/me/wallet/withdraw",
|
|
1163
|
+
...options,
|
|
1164
|
+
headers: {
|
|
1165
|
+
"Content-Type": "application/json",
|
|
1166
|
+
...options?.headers,
|
|
1167
|
+
},
|
|
1168
|
+
});
|
|
1169
|
+
|
|
1170
|
+
/**
|
|
1171
|
+
* Setup an HTTP webhook for the user.
|
|
1172
|
+
*/
|
|
1173
|
+
export const setupWebhook = <ThrowOnError extends boolean = false>(
|
|
1174
|
+
options?: Options<SetupWebhookData, ThrowOnError>,
|
|
1175
|
+
) =>
|
|
1176
|
+
(options?.client ?? client).patch<
|
|
1177
|
+
SetupWebhookResponses,
|
|
1178
|
+
SetupWebhookErrors,
|
|
1179
|
+
ThrowOnError
|
|
1180
|
+
>({
|
|
1181
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1182
|
+
url: "/users/me/webhook",
|
|
1183
|
+
...options,
|
|
1184
|
+
headers: {
|
|
1185
|
+
"Content-Type": "application/json",
|
|
1186
|
+
...options?.headers,
|
|
1187
|
+
},
|
|
1188
|
+
});
|