shopeasy-sdk 1.0.5 → 1.1.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/README.md +1080 -1080
- package/dist/client/ShopeeasyClient.cjs +67 -0
- package/dist/client/ShopeeasyClient.mjs +65 -0
- package/dist/core/errors.cjs +13 -0
- package/dist/core/errors.mjs +11 -0
- package/dist/core/request.cjs +107 -0
- package/dist/core/request.mjs +99 -0
- package/dist/functions/utils/cart.cjs +6 -8
- package/dist/functions/utils/cart.mjs +6 -8
- package/dist/index.cjs +33 -26
- package/dist/index.d.cts +1024 -681
- package/dist/index.d.mts +1024 -681
- package/dist/index.d.ts +1024 -681
- package/dist/index.mjs +16 -28
- package/dist/modules/bots/index.cjs +65 -0
- package/dist/modules/bots/index.mjs +63 -0
- package/dist/modules/carts/index.cjs +51 -0
- package/dist/modules/carts/index.mjs +49 -0
- package/dist/modules/catalogs/index.cjs +55 -0
- package/dist/modules/catalogs/index.mjs +53 -0
- package/dist/modules/config/index.cjs +38 -0
- package/dist/modules/config/index.mjs +36 -0
- package/dist/modules/coupons/index.cjs +53 -0
- package/dist/modules/coupons/index.mjs +51 -0
- package/dist/modules/customers/index.cjs +49 -0
- package/dist/modules/customers/index.mjs +47 -0
- package/dist/modules/images/index.cjs +17 -0
- package/dist/modules/images/index.mjs +15 -0
- package/dist/modules/orders/index.cjs +35 -0
- package/dist/modules/orders/index.mjs +33 -0
- package/dist/modules/payments/index.cjs +21 -0
- package/dist/modules/payments/index.mjs +19 -0
- package/dist/modules/plans/index.cjs +73 -0
- package/dist/modules/plans/index.mjs +71 -0
- package/dist/modules/products/index.cjs +92 -0
- package/dist/modules/products/index.mjs +90 -0
- package/dist/modules/sales/index.cjs +29 -0
- package/dist/modules/sales/index.mjs +27 -0
- package/dist/modules/tokens/index.cjs +17 -0
- package/dist/modules/tokens/index.mjs +15 -0
- package/dist/modules/wallet/index.cjs +42 -0
- package/dist/modules/wallet/index.mjs +40 -0
- package/package.json +47 -47
- package/dist/functions/api/config.cjs +0 -81
- package/dist/functions/api/config.mjs +0 -71
- package/dist/functions/api/index.cjs +0 -35
- package/dist/functions/api/index.mjs +0 -33
- package/dist/functions/api/services/carts.service.cjs +0 -64
- package/dist/functions/api/services/carts.service.mjs +0 -62
- package/dist/functions/api/services/catalog.service.cjs +0 -60
- package/dist/functions/api/services/catalog.service.mjs +0 -58
- package/dist/functions/api/services/configs.service.cjs +0 -46
- package/dist/functions/api/services/configs.service.mjs +0 -44
- package/dist/functions/api/services/coupons.service.cjs +0 -54
- package/dist/functions/api/services/coupons.service.mjs +0 -52
- package/dist/functions/api/services/customer.service.cjs +0 -65
- package/dist/functions/api/services/customer.service.mjs +0 -63
- package/dist/functions/api/services/images.service.cjs +0 -17
- package/dist/functions/api/services/images.service.mjs +0 -15
- package/dist/functions/api/services/orders.service.cjs +0 -36
- package/dist/functions/api/services/orders.service.mjs +0 -34
- package/dist/functions/api/services/payment.service.cjs +0 -26
- package/dist/functions/api/services/payment.service.mjs +0 -24
- package/dist/functions/api/services/plans.service.cjs +0 -67
- package/dist/functions/api/services/plans.service.mjs +0 -65
- package/dist/functions/api/services/products.service.cjs +0 -114
- package/dist/functions/api/services/products.service.mjs +0 -112
- package/dist/functions/api/services/sales.service.cjs +0 -29
- package/dist/functions/api/services/sales.service.mjs +0 -27
- package/dist/functions/api/services/token.service.cjs +0 -17
- package/dist/functions/api/services/token.service.mjs +0 -15
- package/dist/functions/api/services/users.service.cjs +0 -13
- package/dist/functions/api/services/users.service.mjs +0 -11
- package/dist/functions/api/services/wallet.service.cjs +0 -37
- package/dist/functions/api/services/wallet.service.mjs +0 -35
package/README.md
CHANGED
|
@@ -1,1081 +1,1081 @@
|
|
|
1
|
-
# ShopEasy SDK
|
|
2
|
-
|
|
3
|
-
SDK oficial para integração com a API ShopEasy.
|
|
4
|
-
|
|
5
|
-
## Instalação
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install shopeasy-sdk
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Configuração
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
15
|
-
|
|
16
|
-
const sdk = new ShopEasySdk({
|
|
17
|
-
secretKey: "sua-chave-secreta",
|
|
18
|
-
baseUrl: "https://api.shopeasy.site", // opcional
|
|
19
|
-
});
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## `sdk.carts`
|
|
25
|
-
|
|
26
|
-
| Método | Parâmetros | Retorno |
|
|
27
|
-
|--------|-----------|--------|
|
|
28
|
-
| `draft.get` | `cardId: string` | `CartDraft | null` |
|
|
29
|
-
| `draft.set` | `cartId: string, update: CartDraft` | `Cart` |
|
|
30
|
-
| `draft.delete` | `cartId: string` | `void` |
|
|
31
|
-
| `create` | `args: CreateCartArgs` | `Cart` |
|
|
32
|
-
| `get` | `args: CartGetArgs` | `Cart | null` |
|
|
33
|
-
| `getById` | `cartId: string` | `Cart | null` |
|
|
34
|
-
| `getAllByGuild` | `guildId: string` | `Cart[]` |
|
|
35
|
-
| `update` | `args: CartUpdateArgs` | `Cart` |
|
|
36
|
-
| `expires` | `botClient: string` | `Cart[]` |
|
|
37
|
-
| `count` | `guildId: string` | `number` |
|
|
38
|
-
| `delete` | `cartId: string` | `void` |
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<details>
|
|
42
|
-
<summary>📦 Tipos utilizados</summary>
|
|
43
|
-
|
|
44
|
-
### `CartDraft`
|
|
45
|
-
|
|
46
|
-
| Campo | Tipo | Obrigatório |
|
|
47
|
-
|-------|------|-------------|
|
|
48
|
-
| `products` | `CartDraftProduct[]` | Sim |
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### `Cart`
|
|
52
|
-
|
|
53
|
-
| Campo | Tipo | Obrigatório |
|
|
54
|
-
|-------|------|-------------|
|
|
55
|
-
| `id` | `string` | Sim |
|
|
56
|
-
| `guildId` | `string` | Sim |
|
|
57
|
-
| `status` | `CartStatus` | Sim |
|
|
58
|
-
| `userId` | `string` | Sim |
|
|
59
|
-
| `message` | `string` | Sim |
|
|
60
|
-
| `products` | `CartProduct[]` | Sim |
|
|
61
|
-
| `createdAt` | `Date` | Sim |
|
|
62
|
-
| `updatedAt` | `Date` | Sim |
|
|
63
|
-
| `expireAt` | `Date` | Não |
|
|
64
|
-
| `orderId` | `string` | Não |
|
|
65
|
-
| `botClient` | `string` | Sim |
|
|
66
|
-
| `guild` | `Guild | null` | Não |
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
### `CreateCartArgs`
|
|
70
|
-
|
|
71
|
-
| Campo | Tipo | Obrigatório |
|
|
72
|
-
|-------|------|-------------|
|
|
73
|
-
| `guildId` | `string` | Sim |
|
|
74
|
-
| `userId` | `string` | Sim |
|
|
75
|
-
| `expireAt` | `Date` | Sim |
|
|
76
|
-
| `botClient` | `string` | Sim |
|
|
77
|
-
| `message` | `string` | Sim |
|
|
78
|
-
| `status` | `CartStatus` | Não |
|
|
79
|
-
| `products` | `CreateCartProduct[]` | Sim |
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
### `CartGetArgs`
|
|
83
|
-
|
|
84
|
-
| Campo | Tipo | Obrigatório |
|
|
85
|
-
|-------|------|-------------|
|
|
86
|
-
| `userId` | `string` | Sim |
|
|
87
|
-
| `guildId` | `string` | Sim |
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
### `CartUpdateArgs`
|
|
91
|
-
|
|
92
|
-
| Campo | Tipo | Obrigatório |
|
|
93
|
-
|-------|------|-------------|
|
|
94
|
-
| `id` | `string` | Sim |
|
|
95
|
-
| `data` | `UpdateCartData` | Sim |
|
|
96
|
-
|
|
97
|
-
</details>
|
|
98
|
-
|
|
99
|
-
**Exemplo de uso:**
|
|
100
|
-
|
|
101
|
-
```typescript
|
|
102
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
103
|
-
|
|
104
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
105
|
-
|
|
106
|
-
const result = await sdk.carts.draft.get(/* args */);
|
|
107
|
-
const result = await sdk.carts.draft.set(/* args */);
|
|
108
|
-
const result = await sdk.carts.draft.delete(/* args */);
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## `sdk.catalogs`
|
|
114
|
-
|
|
115
|
-
| Método | Parâmetros | Retorno |
|
|
116
|
-
|--------|-----------|--------|
|
|
117
|
-
| `setDraft` | `args: CatalogDraftSetArgs` | `Catalog | null` |
|
|
118
|
-
| `getDraft` | `args: CatalogDraftGetArgs` | `Catalog | null` |
|
|
119
|
-
| `getByReference` | `reference: string, guildId: string` | `Catalog | null` |
|
|
120
|
-
| `getById` | `id: string` | `Catalog | null` |
|
|
121
|
-
| `create` | `args: CatalogCreateArgs` | `Catalog` |
|
|
122
|
-
| `getByCaching` | `id: string` | `Catalog | null` |
|
|
123
|
-
| `getAllByGuild` | `guildId: string` | `Array<Catalog>` |
|
|
124
|
-
| `update` | `args: CatalogUpdateArgs` | `Catalog` |
|
|
125
|
-
| `count` | `guildId: string` | `number` |
|
|
126
|
-
| `delete` | `id: string` | `Catalog` |
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<details>
|
|
130
|
-
<summary>📦 Tipos utilizados</summary>
|
|
131
|
-
|
|
132
|
-
### `CatalogDraftSetArgs`
|
|
133
|
-
|
|
134
|
-
| Campo | Tipo | Obrigatório |
|
|
135
|
-
|-------|------|-------------|
|
|
136
|
-
| `id` | `string` | Sim |
|
|
137
|
-
| `userId` | `string` | Sim |
|
|
138
|
-
| `data` | `CatalogUpdateArgs["data"]` | Sim |
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
### `Catalog`
|
|
142
|
-
|
|
143
|
-
| Campo | Tipo | Obrigatório |
|
|
144
|
-
|-------|------|-------------|
|
|
145
|
-
| `id` | `string` | Sim |
|
|
146
|
-
| `guildId` | `string` | Sim |
|
|
147
|
-
| `reference` | `string` | Sim |
|
|
148
|
-
| `createBy` | `string` | Sim |
|
|
149
|
-
| `title` | `string | null` | Sim |
|
|
150
|
-
| `description` | `string | null` | Sim |
|
|
151
|
-
| `banners` | `JsonValue<string[]> | null` | Sim |
|
|
152
|
-
| `color` | `string | null` | Sim |
|
|
153
|
-
| `placeholder` | `string | null` | Sim |
|
|
154
|
-
| `status` | `CatalogStatus` | Não |
|
|
155
|
-
| `messages` | `JsonValue<string[]> | null` | Sim |
|
|
156
|
-
| `products` | `CatalogProduct[]` | Não |
|
|
157
|
-
| `guild` | `Guild | null` | Não |
|
|
158
|
-
| `createdAt` | `Date` | Não |
|
|
159
|
-
| `updatedAt` | `Date` | Não |
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
### `CatalogDraftGetArgs`
|
|
163
|
-
|
|
164
|
-
| Campo | Tipo | Obrigatório |
|
|
165
|
-
|-------|------|-------------|
|
|
166
|
-
| `id` | `string` | Sim |
|
|
167
|
-
| `userId` | `string` | Sim |
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
### `CatalogCreateArgs`
|
|
171
|
-
|
|
172
|
-
| Campo | Tipo | Obrigatório |
|
|
173
|
-
|-------|------|-------------|
|
|
174
|
-
| `guildId` | `string` | Sim |
|
|
175
|
-
| `createBy` | `string` | Sim |
|
|
176
|
-
| `reference` | `string` | Sim |
|
|
177
|
-
| `title` | `string | null` | Não |
|
|
178
|
-
| `description` | `string | null` | Não |
|
|
179
|
-
| `banners` | `JsonValue<Array<string>> | null` | Não |
|
|
180
|
-
| `color` | `string | null` | Não |
|
|
181
|
-
| `placeholder` | `string | null` | Não |
|
|
182
|
-
| `messages` | `JsonValue<string> | null` | Não |
|
|
183
|
-
| `productId` | `string` | Não |
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
### `CatalogUpdateArgs`
|
|
187
|
-
|
|
188
|
-
| Campo | Tipo | Obrigatório |
|
|
189
|
-
|-------|------|-------------|
|
|
190
|
-
| `id` | `string` | Sim |
|
|
191
|
-
| `data` | `Omit<Partial<Catalog>, "id" | "reference" | "guild" | "products">` | Sim |
|
|
192
|
-
|
|
193
|
-
</details>
|
|
194
|
-
|
|
195
|
-
**Exemplo de uso:**
|
|
196
|
-
|
|
197
|
-
```typescript
|
|
198
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
199
|
-
|
|
200
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
201
|
-
|
|
202
|
-
const result = await sdk.catalogs.setDraft(/* args */);
|
|
203
|
-
const result = await sdk.catalogs.getDraft(/* args */);
|
|
204
|
-
const result = await sdk.catalogs.getByReference(/* args */);
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
## `sdk.configss`
|
|
210
|
-
|
|
211
|
-
| Método | Parâmetros | Retorno |
|
|
212
|
-
|--------|-----------|--------|
|
|
213
|
-
| `getByGuild` | `guildId: string` | `Config` |
|
|
214
|
-
| `setDraft` | `args: ConfigDraftSetArgs` | `Config | null` |
|
|
215
|
-
| `delDraft` | `args: ConfigDraftGetArgs` | `Config | null` |
|
|
216
|
-
| `getDraft` | `args: ConfigDraftGetArgs` | `Config | null` |
|
|
217
|
-
| `update` | `args: ConfigUpdateArgs` | `Config` |
|
|
218
|
-
| `getByCaching` | `_guildId: string` | `Config | null` |
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
<details>
|
|
222
|
-
<summary>📦 Tipos utilizados</summary>
|
|
223
|
-
|
|
224
|
-
### `Config`
|
|
225
|
-
|
|
226
|
-
| Campo | Tipo | Obrigatório |
|
|
227
|
-
|-------|------|-------------|
|
|
228
|
-
| `guildId` | `string` | Sim |
|
|
229
|
-
| `antiFake` | `boolean | null` | Sim |
|
|
230
|
-
| `antiFakeDays` | `number | null` | Sim |
|
|
231
|
-
| `notifys` | `string[],` | Sim |
|
|
232
|
-
| `antiFakeRequiredRoleIds` | `string[] | null` | Sim |
|
|
233
|
-
| `antiFakeVerify` | `boolean | null` | Sim |
|
|
234
|
-
| `antiFakeVerifyMessage` | `string | null` | Sim |
|
|
235
|
-
| `colorHex` | `string` | Sim |
|
|
236
|
-
| `channelPublic` | `string | null` | Sim |
|
|
237
|
-
| `channelPrivate` | `string | null` | Sim |
|
|
238
|
-
| `channelCall` | `string | null` | Sim |
|
|
239
|
-
| `channelFeds` | `string | null` | Sim |
|
|
240
|
-
| `categoryCarts` | `string | null` | Sim |
|
|
241
|
-
| `categoryChats` | `string | null` | Sim |
|
|
242
|
-
| `staffRoles` | `RolePermissionsMap | null` | Sim |
|
|
243
|
-
| `staffUsers` | `JsonValue | null` | Sim |
|
|
244
|
-
| `clientRole` | `string | null` | Sim |
|
|
245
|
-
| `clientRolePremium` | `string | null` | Sim |
|
|
246
|
-
| `timeCart` | `number | null` | Sim |
|
|
247
|
-
| `timePayment` | `number | null` | Sim |
|
|
248
|
-
| `usersBanned` | `JsonValue<Array<string | null>> | null` | Sim |
|
|
249
|
-
| `terms` | `string | null` | Sim |
|
|
250
|
-
| `updatedAt` | `Date` | Sim |
|
|
251
|
-
| `guild` | `Guild` | Não |
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
### `ConfigDraftSetArgs`
|
|
255
|
-
|
|
256
|
-
| Campo | Tipo | Obrigatório |
|
|
257
|
-
|-------|------|-------------|
|
|
258
|
-
| `userId` | `string` | Sim |
|
|
259
|
-
| `guildId` | `string` | Sim |
|
|
260
|
-
| `data` | `ConfigUpdateArgs["data"]` | Sim |
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
### `ConfigDraftGetArgs`
|
|
264
|
-
|
|
265
|
-
| Campo | Tipo | Obrigatório |
|
|
266
|
-
|-------|------|-------------|
|
|
267
|
-
| `userId` | `string` | Sim |
|
|
268
|
-
| `guildId` | `string` | Sim |
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
### `ConfigUpdateArgs`
|
|
272
|
-
|
|
273
|
-
| Campo | Tipo | Obrigatório |
|
|
274
|
-
|-------|------|-------------|
|
|
275
|
-
| `guildId` | `string` | Sim |
|
|
276
|
-
| `data` | `Omit<Partial<Config>, "id" | "guildId">` | Sim |
|
|
277
|
-
|
|
278
|
-
</details>
|
|
279
|
-
|
|
280
|
-
**Exemplo de uso:**
|
|
281
|
-
|
|
282
|
-
```typescript
|
|
283
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
284
|
-
|
|
285
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
286
|
-
|
|
287
|
-
const result = await sdk.configss.getByGuild(/* args */);
|
|
288
|
-
const result = await sdk.configss.setDraft(/* args */);
|
|
289
|
-
const result = await sdk.configss.delDraft(/* args */);
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
---
|
|
293
|
-
|
|
294
|
-
## `sdk.coupons`
|
|
295
|
-
|
|
296
|
-
| Método | Parâmetros | Retorno |
|
|
297
|
-
|--------|-----------|--------|
|
|
298
|
-
| `setDraft` | `args: CouponDraftSetArgs` | `Coupon | null` |
|
|
299
|
-
| `getDraft` | `args: CouponDraftGetArgs` | `Coupon | null` |
|
|
300
|
-
| `existsByCode` | `code: string` | `boolean` |
|
|
301
|
-
| `getById` | `id: string` | `Coupon | null` |
|
|
302
|
-
| `create` | `args: CouponCreateArgs` | `Coupon` |
|
|
303
|
-
| `getByCaching` | `id: string` | `Coupon | null` |
|
|
304
|
-
| `getAllByGuild` | `guildId: string` | `Coupon[]` |
|
|
305
|
-
| `update` | `args: CouponUpdateArgs` | `Coupon` |
|
|
306
|
-
| `count` | `guildId: string` | `number` |
|
|
307
|
-
| `delete` | `id: string` | `Coupon` |
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
<details>
|
|
311
|
-
<summary>📦 Tipos utilizados</summary>
|
|
312
|
-
|
|
313
|
-
### `CouponDraftSetArgs`
|
|
314
|
-
|
|
315
|
-
| Campo | Tipo | Obrigatório |
|
|
316
|
-
|-------|------|-------------|
|
|
317
|
-
| `id` | `string` | Sim |
|
|
318
|
-
| `userId` | `string` | Sim |
|
|
319
|
-
| `data` | `CouponUpdateArgs["data"]` | Sim |
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
### `Coupon`
|
|
323
|
-
|
|
324
|
-
| Campo | Tipo | Obrigatório |
|
|
325
|
-
|-------|------|-------------|
|
|
326
|
-
| `id` | `string` | Sim |
|
|
327
|
-
| `reference` | `string` | Sim |
|
|
328
|
-
| `guildId` | `string` | Sim |
|
|
329
|
-
| `createdBy` | `string` | Sim |
|
|
330
|
-
| `discount` | `number | null` | Sim |
|
|
331
|
-
| `valorMin` | `number | null` | Sim |
|
|
332
|
-
| `valorMax` | `number | null` | Sim |
|
|
333
|
-
| `amount` | `number | null` | Sim |
|
|
334
|
-
| `uses` | `number | null` | Sim |
|
|
335
|
-
| `status` | `CouponStatus` | Não |
|
|
336
|
-
| `guild` | `Guild | null` | Não |
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
### `CouponDraftGetArgs`
|
|
340
|
-
|
|
341
|
-
| Campo | Tipo | Obrigatório |
|
|
342
|
-
|-------|------|-------------|
|
|
343
|
-
| `id` | `string` | Sim |
|
|
344
|
-
| `userId` | `string` | Sim |
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
### `CouponCreateArgs`
|
|
348
|
-
|
|
349
|
-
| Campo | Tipo | Obrigatório |
|
|
350
|
-
|-------|------|-------------|
|
|
351
|
-
| `createdBy` | `string` | Sim |
|
|
352
|
-
| `reference` | `string` | Sim |
|
|
353
|
-
| `guildId` | `string` | Sim |
|
|
354
|
-
| `discount` | `number` | Não |
|
|
355
|
-
| `valorMin` | `number` | Não |
|
|
356
|
-
| `valorMax` | `number` | Não |
|
|
357
|
-
| `role` | `string` | Não |
|
|
358
|
-
| `amount` | `number` | Não |
|
|
359
|
-
| `uses` | `number` | Não |
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
### `CouponUpdateArgs`
|
|
363
|
-
|
|
364
|
-
| Campo | Tipo | Obrigatório |
|
|
365
|
-
|-------|------|-------------|
|
|
366
|
-
| `id` | `string` | Sim |
|
|
367
|
-
| `data` | `Omit<Partial<Coupon>, "id" | "reference">` | Sim |
|
|
368
|
-
|
|
369
|
-
</details>
|
|
370
|
-
|
|
371
|
-
**Exemplo de uso:**
|
|
372
|
-
|
|
373
|
-
```typescript
|
|
374
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
375
|
-
|
|
376
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
377
|
-
|
|
378
|
-
const result = await sdk.coupons.setDraft(/* args */);
|
|
379
|
-
const result = await sdk.coupons.getDraft(/* args */);
|
|
380
|
-
const result = await sdk.coupons.existsByCode(/* args */);
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
---
|
|
384
|
-
|
|
385
|
-
## `sdk.customers`
|
|
386
|
-
|
|
387
|
-
| Método | Parâmetros | Retorno |
|
|
388
|
-
|--------|-----------|--------|
|
|
389
|
-
| `setDraft` | `args: CustomerDraftSetArgs` | `Customer | null` |
|
|
390
|
-
| `getDraft` | `args: CustomerDraftGetArgs` | `Customer | null` |
|
|
391
|
-
| `existsByReference` | `_reference: string` | `boolean` |
|
|
392
|
-
| `getById` | `id: string` | `Customer | null` |
|
|
393
|
-
| `getByReference` | `_reference: string` | `Customer | null` |
|
|
394
|
-
| `create` | `args: CustomerCreateArgs` | `Customer` |
|
|
395
|
-
| `getByCaching` | `id: string` | `Customer | null` |
|
|
396
|
-
| `getAllByGuild` | `guildId: string` | `Customer[]` |
|
|
397
|
-
| `update` | `args: CustomerUpdateArgs` | `Customer` |
|
|
398
|
-
| `count` | `guildId: string` | `number` |
|
|
399
|
-
| `delete` | `id: string` | `Customer` |
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
<details>
|
|
403
|
-
<summary>📦 Tipos utilizados</summary>
|
|
404
|
-
|
|
405
|
-
### `CustomerDraftSetArgs`
|
|
406
|
-
|
|
407
|
-
| Campo | Tipo | Obrigatório |
|
|
408
|
-
|-------|------|-------------|
|
|
409
|
-
| `id` | `string` | Sim |
|
|
410
|
-
| `userId` | `string` | Sim |
|
|
411
|
-
| `data` | `CustomerUpdateArgs["data"]` | Sim |
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
### `Customer`
|
|
415
|
-
|
|
416
|
-
| Campo | Tipo | Obrigatório |
|
|
417
|
-
|-------|------|-------------|
|
|
418
|
-
| `id` | `string` | Sim |
|
|
419
|
-
| `userId` | `string` | Sim |
|
|
420
|
-
| `guildId` | `string` | Sim |
|
|
421
|
-
| `balance` | `Decimal` | Sim |
|
|
422
|
-
| `notify` | `boolean` | Sim |
|
|
423
|
-
| `sales` | `Sale[]` | Não |
|
|
424
|
-
| `guild` | `Guild | null` | Não |
|
|
425
|
-
| `createdAt` | `Date` | Não |
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
### `CustomerDraftGetArgs`
|
|
429
|
-
|
|
430
|
-
| Campo | Tipo | Obrigatório |
|
|
431
|
-
|-------|------|-------------|
|
|
432
|
-
| `id` | `string` | Sim |
|
|
433
|
-
| `userId` | `string` | Sim |
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
### `CustomerCreateArgs`
|
|
437
|
-
|
|
438
|
-
| Campo | Tipo | Obrigatório |
|
|
439
|
-
|-------|------|-------------|
|
|
440
|
-
| `userId` | `string` | Sim |
|
|
441
|
-
| `guildId` | `string` | Sim |
|
|
442
|
-
| `balance` | `Decimal` | Não |
|
|
443
|
-
| `notify` | `boolean` | Não |
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
### `CustomerUpdateArgs`
|
|
447
|
-
|
|
448
|
-
| Campo | Tipo | Obrigatório |
|
|
449
|
-
|-------|------|-------------|
|
|
450
|
-
| `id` | `string` | Sim |
|
|
451
|
-
| `data` | `Omit<Partial<Customer>, "id" | "userId" | "guildId">` | Sim |
|
|
452
|
-
|
|
453
|
-
</details>
|
|
454
|
-
|
|
455
|
-
**Exemplo de uso:**
|
|
456
|
-
|
|
457
|
-
```typescript
|
|
458
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
459
|
-
|
|
460
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
461
|
-
|
|
462
|
-
const result = await sdk.customers.setDraft(/* args */);
|
|
463
|
-
const result = await sdk.customers.getDraft(/* args */);
|
|
464
|
-
const result = await sdk.customers.existsByReference(/* args */);
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
---
|
|
468
|
-
|
|
469
|
-
## `sdk.images`
|
|
470
|
-
|
|
471
|
-
| Método | Parâmetros | Retorno |
|
|
472
|
-
|--------|-----------|--------|
|
|
473
|
-
| `getAll` | `guildId: string` | `Image[]` |
|
|
474
|
-
| `create` | `args: imageCreate` | `Image` |
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
<details>
|
|
478
|
-
<summary>📦 Tipos utilizados</summary>
|
|
479
|
-
|
|
480
|
-
### `Image`
|
|
481
|
-
|
|
482
|
-
| Campo | Tipo | Obrigatório |
|
|
483
|
-
|-------|------|-------------|
|
|
484
|
-
| `id` | `string` | Sim |
|
|
485
|
-
| `guildId` | `string` | Sim |
|
|
486
|
-
| `url` | `string` | Sim |
|
|
487
|
-
| `reference` | `string` | Sim |
|
|
488
|
-
| `name` | `string` | Sim |
|
|
489
|
-
| `expiresIn` | `number` | Sim |
|
|
490
|
-
|
|
491
|
-
</details>
|
|
492
|
-
|
|
493
|
-
**Exemplo de uso:**
|
|
494
|
-
|
|
495
|
-
```typescript
|
|
496
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
497
|
-
|
|
498
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
499
|
-
|
|
500
|
-
const result = await sdk.images.getAll(/* args */);
|
|
501
|
-
const result = await sdk.images.create(/* args */);
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
---
|
|
505
|
-
|
|
506
|
-
## `sdk.orders`
|
|
507
|
-
|
|
508
|
-
| Método | Parâmetros | Retorno |
|
|
509
|
-
|--------|-----------|--------|
|
|
510
|
-
| `create` | `args: OrderCreate` | `Order` |
|
|
511
|
-
| `get` | `orderId: string` | `Order | null` |
|
|
512
|
-
| `getPayment` | `orderId: string` | `OrderPayment | null` |
|
|
513
|
-
| `getApprovedUnprocessed` | `botClient: string, guildId?: string` | `Order[]` |
|
|
514
|
-
| `markAsReleased` | `id: string` | `Order` |
|
|
515
|
-
| `aprove` | `id: string` | `Order` |
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
<details>
|
|
519
|
-
<summary>📦 Tipos utilizados</summary>
|
|
520
|
-
|
|
521
|
-
### `OrderCreate`
|
|
522
|
-
|
|
523
|
-
| Campo | Tipo | Obrigatório |
|
|
524
|
-
|-------|------|-------------|
|
|
525
|
-
| `guildId` | `string` | Sim |
|
|
526
|
-
| `amount` | `number` | Sim |
|
|
527
|
-
| `cartId` | `string` | Sim |
|
|
528
|
-
| `botClient` | `string` | Sim |
|
|
529
|
-
| `customer` | `OrderCustomer` | Sim |
|
|
530
|
-
| `products` | `OrderProduct[]` | Sim |
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
### `Order`
|
|
534
|
-
|
|
535
|
-
| Campo | Tipo | Obrigatório |
|
|
536
|
-
|-------|------|-------------|
|
|
537
|
-
| `id` | `string` | Sim |
|
|
538
|
-
| `aproved` | `boolean` | Sim |
|
|
539
|
-
| `released` | `boolean` | Sim |
|
|
540
|
-
| `cartId` | `string` | Não |
|
|
541
|
-
| `planId` | `string` | Não |
|
|
542
|
-
| `paymentId` | `string` | Não |
|
|
543
|
-
| `guildId` | `string` | Sim |
|
|
544
|
-
| `customerId` | `string` | Não |
|
|
545
|
-
| `botClient` | `string` | Não |
|
|
546
|
-
| `paymentProvider` | `PaymentProvider` | Não |
|
|
547
|
-
| `automatic` | `boolean` | Não |
|
|
548
|
-
| `pixKey` | `string` | Sim |
|
|
549
|
-
| `expireAt` | `Date` | Não |
|
|
550
|
-
| `createdAt` | `Date` | Sim |
|
|
551
|
-
| `updatedAt` | `Date` | Sim |
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
### `OrderPayment`
|
|
555
|
-
|
|
556
|
-
| Campo | Tipo | Obrigatório |
|
|
557
|
-
|-------|------|-------------|
|
|
558
|
-
| `id` | `string` | Sim |
|
|
559
|
-
| `aproved` | `boolean` | Sim |
|
|
560
|
-
|
|
561
|
-
</details>
|
|
562
|
-
|
|
563
|
-
**Exemplo de uso:**
|
|
564
|
-
|
|
565
|
-
```typescript
|
|
566
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
567
|
-
|
|
568
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
569
|
-
|
|
570
|
-
const result = await sdk.orders.create(/* args */);
|
|
571
|
-
const result = await sdk.orders.get(/* args */);
|
|
572
|
-
const result = await sdk.orders.getPayment(/* args */);
|
|
573
|
-
```
|
|
574
|
-
|
|
575
|
-
---
|
|
576
|
-
|
|
577
|
-
## `sdk.paymentConfig`
|
|
578
|
-
|
|
579
|
-
| Método | Parâmetros | Retorno |
|
|
580
|
-
|--------|-----------|--------|
|
|
581
|
-
| `getOrCreate` | `guildId: string` | `PaymentConfig` |
|
|
582
|
-
| `update` | `args: UpdatePaymentConfigArgs` | `PaymentConfig` |
|
|
583
|
-
| `getByCaching` | `guildId: string` | `PaymentConfig | null` |
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
<details>
|
|
587
|
-
<summary>📦 Tipos utilizados</summary>
|
|
588
|
-
|
|
589
|
-
### `PaymentConfig`
|
|
590
|
-
|
|
591
|
-
| Campo | Tipo | Obrigatório |
|
|
592
|
-
|-------|------|-------------|
|
|
593
|
-
| `guildId` | `string` | Sim |
|
|
594
|
-
| `provider` | `PaymentProvider | null` | Não |
|
|
595
|
-
| `mercadoPagoToken` | `string | null` | Não |
|
|
596
|
-
| `efiBankToken` | `string | null` | Não |
|
|
597
|
-
| `chavePix` | `string | null` | Não |
|
|
598
|
-
| `chavePixType` | `"CPF" | "EMAIL" | "ALEATORIA" | "NUMERO"` | Não |
|
|
599
|
-
| `chavePixName` | `string` | Não |
|
|
600
|
-
| `chavePixCity` | `string` | Não |
|
|
601
|
-
| `walletApiKey` | `string` | Não |
|
|
602
|
-
| `chavePixchavePixStaticQrCode` | `boolean` | Sim |
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
### `UpdatePaymentConfigArgs`
|
|
606
|
-
|
|
607
|
-
| Campo | Tipo | Obrigatório |
|
|
608
|
-
|-------|------|-------------|
|
|
609
|
-
| `guildId` | `string` | Sim |
|
|
610
|
-
| `data` | `{` | Sim |
|
|
611
|
-
| `provider` | `PaymentProvider | null` | Não |
|
|
612
|
-
| `mercadoPagoToken` | `string | null` | Não |
|
|
613
|
-
| `walletApiKey` | `string | null` | Não |
|
|
614
|
-
| `efiBankToken` | `string | null` | Não |
|
|
615
|
-
| `chavePix` | `string | null` | Não |
|
|
616
|
-
| `chavePixType` | `"CPF" | "EMAIL" | "ALEATORIA" | "NUMERO"` | Não |
|
|
617
|
-
| `chavePixName` | `string` | Não |
|
|
618
|
-
| `chavePixCity` | `string` | Não |
|
|
619
|
-
| `chavePixchavePixStaticQrCode` | `boolean` | Não |
|
|
620
|
-
|
|
621
|
-
</details>
|
|
622
|
-
|
|
623
|
-
**Exemplo de uso:**
|
|
624
|
-
|
|
625
|
-
```typescript
|
|
626
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
627
|
-
|
|
628
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
629
|
-
|
|
630
|
-
const result = await sdk.paymentConfig.getOrCreate(/* args */);
|
|
631
|
-
const result = await sdk.paymentConfig.update(/* args */);
|
|
632
|
-
const result = await sdk.paymentConfig.getByCaching(/* args */);
|
|
633
|
-
```
|
|
634
|
-
|
|
635
|
-
---
|
|
636
|
-
|
|
637
|
-
## `sdk.planss`
|
|
638
|
-
|
|
639
|
-
| Método | Parâmetros | Retorno |
|
|
640
|
-
|--------|-----------|--------|
|
|
641
|
-
| `getByGuild` | `guildId: string` | `Plan | null` |
|
|
642
|
-
| `havePlan` | `guildId: string` | `PlanType | null` |
|
|
643
|
-
| `create` | `args: Plan` | `Plan` |
|
|
644
|
-
| `getExpiring` | `days?: number` | `ExpiringPlan[]` |
|
|
645
|
-
| `getExpired` | `—` | `ExpiredPlansResponse` |
|
|
646
|
-
| `getPlansNeedingAlert` | `days?: number` | `PlansNeedingAlertResponse` |
|
|
647
|
-
| `markAlertSent` | `guildId: string, daysUntilExpire: number` | `MarkAlertResponse` |
|
|
648
|
-
| `checkExpirations` | `—` | `CheckExpirationsResponse` |
|
|
649
|
-
| `getExpirationStatus` | `guildId: string` | `PlanStatus` |
|
|
650
|
-
| `update` | `guildId: string, updates: Partial<Plan>` | `Plan` |
|
|
651
|
-
| `delete` | `guildId: string` | `void` |
|
|
652
|
-
| `createSubscription` | `args: PlanSubscriptionCreateArgs` | `EfiPixCreateResponse` |
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
<details>
|
|
656
|
-
<summary>📦 Tipos utilizados</summary>
|
|
657
|
-
|
|
658
|
-
### `Plan`
|
|
659
|
-
|
|
660
|
-
| Campo | Tipo | Obrigatório |
|
|
661
|
-
|-------|------|-------------|
|
|
662
|
-
| `guildId` | `string` | Sim |
|
|
663
|
-
| `type` | `PlanType` | Sim |
|
|
664
|
-
| `expired` | `boolean` | Sim |
|
|
665
|
-
| `userId` | `string` | Sim |
|
|
666
|
-
| `createdAt` | `Date | null` | Sim |
|
|
667
|
-
| `expireAt` | `Date | null` | Sim |
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
### `ExpiredPlansResponse`
|
|
671
|
-
|
|
672
|
-
| Campo | Tipo | Obrigatório |
|
|
673
|
-
|-------|------|-------------|
|
|
674
|
-
| `count` | `number` | Sim |
|
|
675
|
-
| `plans` | `Array<{` | Sim |
|
|
676
|
-
| `guildId` | `string` | Sim |
|
|
677
|
-
| `userId` | `string` | Sim |
|
|
678
|
-
| `type` | `PlanType` | Sim |
|
|
679
|
-
| `expiredAt` | `Date | null` | Sim |
|
|
680
|
-
| `createdAt` | `Date | null` | Sim |
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
### `PlansNeedingAlertResponse`
|
|
684
|
-
|
|
685
|
-
| Campo | Tipo | Obrigatório |
|
|
686
|
-
|-------|------|-------------|
|
|
687
|
-
| `count` | `number` | Sim |
|
|
688
|
-
| `plans` | `PlanNeedingAlert[]` | Sim |
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
### `MarkAlertResponse`
|
|
692
|
-
|
|
693
|
-
| Campo | Tipo | Obrigatório |
|
|
694
|
-
|-------|------|-------------|
|
|
695
|
-
| `success` | `boolean` | Sim |
|
|
696
|
-
| `message` | `string` | Sim |
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
### `CheckExpirationsResponse`
|
|
700
|
-
|
|
701
|
-
| Campo | Tipo | Obrigatório |
|
|
702
|
-
|-------|------|-------------|
|
|
703
|
-
| `expired` | `{` | Sim |
|
|
704
|
-
| `count` | `number` | Sim |
|
|
705
|
-
| `plans` | `Array<{` | Sim |
|
|
706
|
-
| `guildId` | `string` | Sim |
|
|
707
|
-
| `userId` | `string` | Sim |
|
|
708
|
-
| `type` | `PlanType` | Sim |
|
|
709
|
-
| `expiredAt` | `Date | null` | Sim |
|
|
710
|
-
| `createdAt` | `Date | null` | Sim |
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
### `PlanStatus`
|
|
714
|
-
|
|
715
|
-
| Campo | Tipo | Obrigatório |
|
|
716
|
-
|-------|------|-------------|
|
|
717
|
-
| `active` | `boolean` | Sim |
|
|
718
|
-
| `expired` | `boolean` | Sim |
|
|
719
|
-
| `expireAt` | `Date` | Não |
|
|
720
|
-
| `daysUntilExpire` | `number` | Não |
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
### `PlanSubscriptionCreateArgs`
|
|
724
|
-
|
|
725
|
-
| Campo | Tipo | Obrigatório |
|
|
726
|
-
|-------|------|-------------|
|
|
727
|
-
| `guildId` | `string` | Sim |
|
|
728
|
-
| `userId` | `string` | Sim |
|
|
729
|
-
| `months` | `number` | Sim |
|
|
730
|
-
| `plan` | `"essential" | "complete"` | Sim |
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
### `EfiPixCreateResponse`
|
|
734
|
-
|
|
735
|
-
| Campo | Tipo | Obrigatório |
|
|
736
|
-
|-------|------|-------------|
|
|
737
|
-
| `calendario` | `{` | Sim |
|
|
738
|
-
| `criacao` | `string` | Sim |
|
|
739
|
-
| `expiracao` | `number` | Sim |
|
|
740
|
-
|
|
741
|
-
</details>
|
|
742
|
-
|
|
743
|
-
**Exemplo de uso:**
|
|
744
|
-
|
|
745
|
-
```typescript
|
|
746
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
747
|
-
|
|
748
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
749
|
-
|
|
750
|
-
const result = await sdk.planss.getByGuild(/* args */);
|
|
751
|
-
const result = await sdk.planss.havePlan(/* args */);
|
|
752
|
-
const result = await sdk.planss.create(/* args */);
|
|
753
|
-
```
|
|
754
|
-
|
|
755
|
-
---
|
|
756
|
-
|
|
757
|
-
## `sdk.products`
|
|
758
|
-
|
|
759
|
-
| Método | Parâmetros | Retorno |
|
|
760
|
-
|--------|-----------|--------|
|
|
761
|
-
| `setDraft` | `args: ProduductDraftSetArgs` | `Product | null` |
|
|
1
|
+
# ShopEasy SDK
|
|
2
|
+
|
|
3
|
+
SDK oficial para integração com a API ShopEasy.
|
|
4
|
+
|
|
5
|
+
## Instalação
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install shopeasy-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Configuração
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
15
|
+
|
|
16
|
+
const sdk = new ShopEasySdk({
|
|
17
|
+
secretKey: "sua-chave-secreta",
|
|
18
|
+
baseUrl: "https://api.shopeasy.site", // opcional
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## `sdk.carts`
|
|
25
|
+
|
|
26
|
+
| Método | Parâmetros | Retorno |
|
|
27
|
+
|--------|-----------|--------|
|
|
28
|
+
| `draft.get` | `cardId: string` | `CartDraft | null` |
|
|
29
|
+
| `draft.set` | `cartId: string, update: CartDraft` | `Cart` |
|
|
30
|
+
| `draft.delete` | `cartId: string` | `void` |
|
|
31
|
+
| `create` | `args: CreateCartArgs` | `Cart` |
|
|
32
|
+
| `get` | `args: CartGetArgs` | `Cart | null` |
|
|
33
|
+
| `getById` | `cartId: string` | `Cart | null` |
|
|
34
|
+
| `getAllByGuild` | `guildId: string` | `Cart[]` |
|
|
35
|
+
| `update` | `args: CartUpdateArgs` | `Cart` |
|
|
36
|
+
| `expires` | `botClient: string` | `Cart[]` |
|
|
37
|
+
| `count` | `guildId: string` | `number` |
|
|
38
|
+
| `delete` | `cartId: string` | `void` |
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<details>
|
|
42
|
+
<summary>📦 Tipos utilizados</summary>
|
|
43
|
+
|
|
44
|
+
### `CartDraft`
|
|
45
|
+
|
|
46
|
+
| Campo | Tipo | Obrigatório |
|
|
47
|
+
|-------|------|-------------|
|
|
48
|
+
| `products` | `CartDraftProduct[]` | Sim |
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### `Cart`
|
|
52
|
+
|
|
53
|
+
| Campo | Tipo | Obrigatório |
|
|
54
|
+
|-------|------|-------------|
|
|
55
|
+
| `id` | `string` | Sim |
|
|
56
|
+
| `guildId` | `string` | Sim |
|
|
57
|
+
| `status` | `CartStatus` | Sim |
|
|
58
|
+
| `userId` | `string` | Sim |
|
|
59
|
+
| `message` | `string` | Sim |
|
|
60
|
+
| `products` | `CartProduct[]` | Sim |
|
|
61
|
+
| `createdAt` | `Date` | Sim |
|
|
62
|
+
| `updatedAt` | `Date` | Sim |
|
|
63
|
+
| `expireAt` | `Date` | Não |
|
|
64
|
+
| `orderId` | `string` | Não |
|
|
65
|
+
| `botClient` | `string` | Sim |
|
|
66
|
+
| `guild` | `Guild | null` | Não |
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### `CreateCartArgs`
|
|
70
|
+
|
|
71
|
+
| Campo | Tipo | Obrigatório |
|
|
72
|
+
|-------|------|-------------|
|
|
73
|
+
| `guildId` | `string` | Sim |
|
|
74
|
+
| `userId` | `string` | Sim |
|
|
75
|
+
| `expireAt` | `Date` | Sim |
|
|
76
|
+
| `botClient` | `string` | Sim |
|
|
77
|
+
| `message` | `string` | Sim |
|
|
78
|
+
| `status` | `CartStatus` | Não |
|
|
79
|
+
| `products` | `CreateCartProduct[]` | Sim |
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### `CartGetArgs`
|
|
83
|
+
|
|
84
|
+
| Campo | Tipo | Obrigatório |
|
|
85
|
+
|-------|------|-------------|
|
|
86
|
+
| `userId` | `string` | Sim |
|
|
87
|
+
| `guildId` | `string` | Sim |
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### `CartUpdateArgs`
|
|
91
|
+
|
|
92
|
+
| Campo | Tipo | Obrigatório |
|
|
93
|
+
|-------|------|-------------|
|
|
94
|
+
| `id` | `string` | Sim |
|
|
95
|
+
| `data` | `UpdateCartData` | Sim |
|
|
96
|
+
|
|
97
|
+
</details>
|
|
98
|
+
|
|
99
|
+
**Exemplo de uso:**
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
103
|
+
|
|
104
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
105
|
+
|
|
106
|
+
const result = await sdk.carts.draft.get(/* args */);
|
|
107
|
+
const result = await sdk.carts.draft.set(/* args */);
|
|
108
|
+
const result = await sdk.carts.draft.delete(/* args */);
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## `sdk.catalogs`
|
|
114
|
+
|
|
115
|
+
| Método | Parâmetros | Retorno |
|
|
116
|
+
|--------|-----------|--------|
|
|
117
|
+
| `setDraft` | `args: CatalogDraftSetArgs` | `Catalog | null` |
|
|
118
|
+
| `getDraft` | `args: CatalogDraftGetArgs` | `Catalog | null` |
|
|
119
|
+
| `getByReference` | `reference: string, guildId: string` | `Catalog | null` |
|
|
120
|
+
| `getById` | `id: string` | `Catalog | null` |
|
|
121
|
+
| `create` | `args: CatalogCreateArgs` | `Catalog` |
|
|
122
|
+
| `getByCaching` | `id: string` | `Catalog | null` |
|
|
123
|
+
| `getAllByGuild` | `guildId: string` | `Array<Catalog>` |
|
|
124
|
+
| `update` | `args: CatalogUpdateArgs` | `Catalog` |
|
|
125
|
+
| `count` | `guildId: string` | `number` |
|
|
126
|
+
| `delete` | `id: string` | `Catalog` |
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
<details>
|
|
130
|
+
<summary>📦 Tipos utilizados</summary>
|
|
131
|
+
|
|
132
|
+
### `CatalogDraftSetArgs`
|
|
133
|
+
|
|
134
|
+
| Campo | Tipo | Obrigatório |
|
|
135
|
+
|-------|------|-------------|
|
|
136
|
+
| `id` | `string` | Sim |
|
|
137
|
+
| `userId` | `string` | Sim |
|
|
138
|
+
| `data` | `CatalogUpdateArgs["data"]` | Sim |
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
### `Catalog`
|
|
142
|
+
|
|
143
|
+
| Campo | Tipo | Obrigatório |
|
|
144
|
+
|-------|------|-------------|
|
|
145
|
+
| `id` | `string` | Sim |
|
|
146
|
+
| `guildId` | `string` | Sim |
|
|
147
|
+
| `reference` | `string` | Sim |
|
|
148
|
+
| `createBy` | `string` | Sim |
|
|
149
|
+
| `title` | `string | null` | Sim |
|
|
150
|
+
| `description` | `string | null` | Sim |
|
|
151
|
+
| `banners` | `JsonValue<string[]> | null` | Sim |
|
|
152
|
+
| `color` | `string | null` | Sim |
|
|
153
|
+
| `placeholder` | `string | null` | Sim |
|
|
154
|
+
| `status` | `CatalogStatus` | Não |
|
|
155
|
+
| `messages` | `JsonValue<string[]> | null` | Sim |
|
|
156
|
+
| `products` | `CatalogProduct[]` | Não |
|
|
157
|
+
| `guild` | `Guild | null` | Não |
|
|
158
|
+
| `createdAt` | `Date` | Não |
|
|
159
|
+
| `updatedAt` | `Date` | Não |
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
### `CatalogDraftGetArgs`
|
|
163
|
+
|
|
164
|
+
| Campo | Tipo | Obrigatório |
|
|
165
|
+
|-------|------|-------------|
|
|
166
|
+
| `id` | `string` | Sim |
|
|
167
|
+
| `userId` | `string` | Sim |
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### `CatalogCreateArgs`
|
|
171
|
+
|
|
172
|
+
| Campo | Tipo | Obrigatório |
|
|
173
|
+
|-------|------|-------------|
|
|
174
|
+
| `guildId` | `string` | Sim |
|
|
175
|
+
| `createBy` | `string` | Sim |
|
|
176
|
+
| `reference` | `string` | Sim |
|
|
177
|
+
| `title` | `string | null` | Não |
|
|
178
|
+
| `description` | `string | null` | Não |
|
|
179
|
+
| `banners` | `JsonValue<Array<string>> | null` | Não |
|
|
180
|
+
| `color` | `string | null` | Não |
|
|
181
|
+
| `placeholder` | `string | null` | Não |
|
|
182
|
+
| `messages` | `JsonValue<string> | null` | Não |
|
|
183
|
+
| `productId` | `string` | Não |
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
### `CatalogUpdateArgs`
|
|
187
|
+
|
|
188
|
+
| Campo | Tipo | Obrigatório |
|
|
189
|
+
|-------|------|-------------|
|
|
190
|
+
| `id` | `string` | Sim |
|
|
191
|
+
| `data` | `Omit<Partial<Catalog>, "id" | "reference" | "guild" | "products">` | Sim |
|
|
192
|
+
|
|
193
|
+
</details>
|
|
194
|
+
|
|
195
|
+
**Exemplo de uso:**
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
199
|
+
|
|
200
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
201
|
+
|
|
202
|
+
const result = await sdk.catalogs.setDraft(/* args */);
|
|
203
|
+
const result = await sdk.catalogs.getDraft(/* args */);
|
|
204
|
+
const result = await sdk.catalogs.getByReference(/* args */);
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## `sdk.configss`
|
|
210
|
+
|
|
211
|
+
| Método | Parâmetros | Retorno |
|
|
212
|
+
|--------|-----------|--------|
|
|
213
|
+
| `getByGuild` | `guildId: string` | `Config` |
|
|
214
|
+
| `setDraft` | `args: ConfigDraftSetArgs` | `Config | null` |
|
|
215
|
+
| `delDraft` | `args: ConfigDraftGetArgs` | `Config | null` |
|
|
216
|
+
| `getDraft` | `args: ConfigDraftGetArgs` | `Config | null` |
|
|
217
|
+
| `update` | `args: ConfigUpdateArgs` | `Config` |
|
|
218
|
+
| `getByCaching` | `_guildId: string` | `Config | null` |
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
<details>
|
|
222
|
+
<summary>📦 Tipos utilizados</summary>
|
|
223
|
+
|
|
224
|
+
### `Config`
|
|
225
|
+
|
|
226
|
+
| Campo | Tipo | Obrigatório |
|
|
227
|
+
|-------|------|-------------|
|
|
228
|
+
| `guildId` | `string` | Sim |
|
|
229
|
+
| `antiFake` | `boolean | null` | Sim |
|
|
230
|
+
| `antiFakeDays` | `number | null` | Sim |
|
|
231
|
+
| `notifys` | `string[],` | Sim |
|
|
232
|
+
| `antiFakeRequiredRoleIds` | `string[] | null` | Sim |
|
|
233
|
+
| `antiFakeVerify` | `boolean | null` | Sim |
|
|
234
|
+
| `antiFakeVerifyMessage` | `string | null` | Sim |
|
|
235
|
+
| `colorHex` | `string` | Sim |
|
|
236
|
+
| `channelPublic` | `string | null` | Sim |
|
|
237
|
+
| `channelPrivate` | `string | null` | Sim |
|
|
238
|
+
| `channelCall` | `string | null` | Sim |
|
|
239
|
+
| `channelFeds` | `string | null` | Sim |
|
|
240
|
+
| `categoryCarts` | `string | null` | Sim |
|
|
241
|
+
| `categoryChats` | `string | null` | Sim |
|
|
242
|
+
| `staffRoles` | `RolePermissionsMap | null` | Sim |
|
|
243
|
+
| `staffUsers` | `JsonValue | null` | Sim |
|
|
244
|
+
| `clientRole` | `string | null` | Sim |
|
|
245
|
+
| `clientRolePremium` | `string | null` | Sim |
|
|
246
|
+
| `timeCart` | `number | null` | Sim |
|
|
247
|
+
| `timePayment` | `number | null` | Sim |
|
|
248
|
+
| `usersBanned` | `JsonValue<Array<string | null>> | null` | Sim |
|
|
249
|
+
| `terms` | `string | null` | Sim |
|
|
250
|
+
| `updatedAt` | `Date` | Sim |
|
|
251
|
+
| `guild` | `Guild` | Não |
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
### `ConfigDraftSetArgs`
|
|
255
|
+
|
|
256
|
+
| Campo | Tipo | Obrigatório |
|
|
257
|
+
|-------|------|-------------|
|
|
258
|
+
| `userId` | `string` | Sim |
|
|
259
|
+
| `guildId` | `string` | Sim |
|
|
260
|
+
| `data` | `ConfigUpdateArgs["data"]` | Sim |
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
### `ConfigDraftGetArgs`
|
|
264
|
+
|
|
265
|
+
| Campo | Tipo | Obrigatório |
|
|
266
|
+
|-------|------|-------------|
|
|
267
|
+
| `userId` | `string` | Sim |
|
|
268
|
+
| `guildId` | `string` | Sim |
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
### `ConfigUpdateArgs`
|
|
272
|
+
|
|
273
|
+
| Campo | Tipo | Obrigatório |
|
|
274
|
+
|-------|------|-------------|
|
|
275
|
+
| `guildId` | `string` | Sim |
|
|
276
|
+
| `data` | `Omit<Partial<Config>, "id" | "guildId">` | Sim |
|
|
277
|
+
|
|
278
|
+
</details>
|
|
279
|
+
|
|
280
|
+
**Exemplo de uso:**
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
284
|
+
|
|
285
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
286
|
+
|
|
287
|
+
const result = await sdk.configss.getByGuild(/* args */);
|
|
288
|
+
const result = await sdk.configss.setDraft(/* args */);
|
|
289
|
+
const result = await sdk.configss.delDraft(/* args */);
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## `sdk.coupons`
|
|
295
|
+
|
|
296
|
+
| Método | Parâmetros | Retorno |
|
|
297
|
+
|--------|-----------|--------|
|
|
298
|
+
| `setDraft` | `args: CouponDraftSetArgs` | `Coupon | null` |
|
|
299
|
+
| `getDraft` | `args: CouponDraftGetArgs` | `Coupon | null` |
|
|
300
|
+
| `existsByCode` | `code: string` | `boolean` |
|
|
301
|
+
| `getById` | `id: string` | `Coupon | null` |
|
|
302
|
+
| `create` | `args: CouponCreateArgs` | `Coupon` |
|
|
303
|
+
| `getByCaching` | `id: string` | `Coupon | null` |
|
|
304
|
+
| `getAllByGuild` | `guildId: string` | `Coupon[]` |
|
|
305
|
+
| `update` | `args: CouponUpdateArgs` | `Coupon` |
|
|
306
|
+
| `count` | `guildId: string` | `number` |
|
|
307
|
+
| `delete` | `id: string` | `Coupon` |
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
<details>
|
|
311
|
+
<summary>📦 Tipos utilizados</summary>
|
|
312
|
+
|
|
313
|
+
### `CouponDraftSetArgs`
|
|
314
|
+
|
|
315
|
+
| Campo | Tipo | Obrigatório |
|
|
316
|
+
|-------|------|-------------|
|
|
317
|
+
| `id` | `string` | Sim |
|
|
318
|
+
| `userId` | `string` | Sim |
|
|
319
|
+
| `data` | `CouponUpdateArgs["data"]` | Sim |
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
### `Coupon`
|
|
323
|
+
|
|
324
|
+
| Campo | Tipo | Obrigatório |
|
|
325
|
+
|-------|------|-------------|
|
|
326
|
+
| `id` | `string` | Sim |
|
|
327
|
+
| `reference` | `string` | Sim |
|
|
328
|
+
| `guildId` | `string` | Sim |
|
|
329
|
+
| `createdBy` | `string` | Sim |
|
|
330
|
+
| `discount` | `number | null` | Sim |
|
|
331
|
+
| `valorMin` | `number | null` | Sim |
|
|
332
|
+
| `valorMax` | `number | null` | Sim |
|
|
333
|
+
| `amount` | `number | null` | Sim |
|
|
334
|
+
| `uses` | `number | null` | Sim |
|
|
335
|
+
| `status` | `CouponStatus` | Não |
|
|
336
|
+
| `guild` | `Guild | null` | Não |
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
### `CouponDraftGetArgs`
|
|
340
|
+
|
|
341
|
+
| Campo | Tipo | Obrigatório |
|
|
342
|
+
|-------|------|-------------|
|
|
343
|
+
| `id` | `string` | Sim |
|
|
344
|
+
| `userId` | `string` | Sim |
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
### `CouponCreateArgs`
|
|
348
|
+
|
|
349
|
+
| Campo | Tipo | Obrigatório |
|
|
350
|
+
|-------|------|-------------|
|
|
351
|
+
| `createdBy` | `string` | Sim |
|
|
352
|
+
| `reference` | `string` | Sim |
|
|
353
|
+
| `guildId` | `string` | Sim |
|
|
354
|
+
| `discount` | `number` | Não |
|
|
355
|
+
| `valorMin` | `number` | Não |
|
|
356
|
+
| `valorMax` | `number` | Não |
|
|
357
|
+
| `role` | `string` | Não |
|
|
358
|
+
| `amount` | `number` | Não |
|
|
359
|
+
| `uses` | `number` | Não |
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
### `CouponUpdateArgs`
|
|
363
|
+
|
|
364
|
+
| Campo | Tipo | Obrigatório |
|
|
365
|
+
|-------|------|-------------|
|
|
366
|
+
| `id` | `string` | Sim |
|
|
367
|
+
| `data` | `Omit<Partial<Coupon>, "id" | "reference">` | Sim |
|
|
368
|
+
|
|
369
|
+
</details>
|
|
370
|
+
|
|
371
|
+
**Exemplo de uso:**
|
|
372
|
+
|
|
373
|
+
```typescript
|
|
374
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
375
|
+
|
|
376
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
377
|
+
|
|
378
|
+
const result = await sdk.coupons.setDraft(/* args */);
|
|
379
|
+
const result = await sdk.coupons.getDraft(/* args */);
|
|
380
|
+
const result = await sdk.coupons.existsByCode(/* args */);
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## `sdk.customers`
|
|
386
|
+
|
|
387
|
+
| Método | Parâmetros | Retorno |
|
|
388
|
+
|--------|-----------|--------|
|
|
389
|
+
| `setDraft` | `args: CustomerDraftSetArgs` | `Customer | null` |
|
|
390
|
+
| `getDraft` | `args: CustomerDraftGetArgs` | `Customer | null` |
|
|
391
|
+
| `existsByReference` | `_reference: string` | `boolean` |
|
|
392
|
+
| `getById` | `id: string` | `Customer | null` |
|
|
393
|
+
| `getByReference` | `_reference: string` | `Customer | null` |
|
|
394
|
+
| `create` | `args: CustomerCreateArgs` | `Customer` |
|
|
395
|
+
| `getByCaching` | `id: string` | `Customer | null` |
|
|
396
|
+
| `getAllByGuild` | `guildId: string` | `Customer[]` |
|
|
397
|
+
| `update` | `args: CustomerUpdateArgs` | `Customer` |
|
|
398
|
+
| `count` | `guildId: string` | `number` |
|
|
399
|
+
| `delete` | `id: string` | `Customer` |
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
<details>
|
|
403
|
+
<summary>📦 Tipos utilizados</summary>
|
|
404
|
+
|
|
405
|
+
### `CustomerDraftSetArgs`
|
|
406
|
+
|
|
407
|
+
| Campo | Tipo | Obrigatório |
|
|
408
|
+
|-------|------|-------------|
|
|
409
|
+
| `id` | `string` | Sim |
|
|
410
|
+
| `userId` | `string` | Sim |
|
|
411
|
+
| `data` | `CustomerUpdateArgs["data"]` | Sim |
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
### `Customer`
|
|
415
|
+
|
|
416
|
+
| Campo | Tipo | Obrigatório |
|
|
417
|
+
|-------|------|-------------|
|
|
418
|
+
| `id` | `string` | Sim |
|
|
419
|
+
| `userId` | `string` | Sim |
|
|
420
|
+
| `guildId` | `string` | Sim |
|
|
421
|
+
| `balance` | `Decimal` | Sim |
|
|
422
|
+
| `notify` | `boolean` | Sim |
|
|
423
|
+
| `sales` | `Sale[]` | Não |
|
|
424
|
+
| `guild` | `Guild | null` | Não |
|
|
425
|
+
| `createdAt` | `Date` | Não |
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
### `CustomerDraftGetArgs`
|
|
429
|
+
|
|
430
|
+
| Campo | Tipo | Obrigatório |
|
|
431
|
+
|-------|------|-------------|
|
|
432
|
+
| `id` | `string` | Sim |
|
|
433
|
+
| `userId` | `string` | Sim |
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
### `CustomerCreateArgs`
|
|
437
|
+
|
|
438
|
+
| Campo | Tipo | Obrigatório |
|
|
439
|
+
|-------|------|-------------|
|
|
440
|
+
| `userId` | `string` | Sim |
|
|
441
|
+
| `guildId` | `string` | Sim |
|
|
442
|
+
| `balance` | `Decimal` | Não |
|
|
443
|
+
| `notify` | `boolean` | Não |
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
### `CustomerUpdateArgs`
|
|
447
|
+
|
|
448
|
+
| Campo | Tipo | Obrigatório |
|
|
449
|
+
|-------|------|-------------|
|
|
450
|
+
| `id` | `string` | Sim |
|
|
451
|
+
| `data` | `Omit<Partial<Customer>, "id" | "userId" | "guildId">` | Sim |
|
|
452
|
+
|
|
453
|
+
</details>
|
|
454
|
+
|
|
455
|
+
**Exemplo de uso:**
|
|
456
|
+
|
|
457
|
+
```typescript
|
|
458
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
459
|
+
|
|
460
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
461
|
+
|
|
462
|
+
const result = await sdk.customers.setDraft(/* args */);
|
|
463
|
+
const result = await sdk.customers.getDraft(/* args */);
|
|
464
|
+
const result = await sdk.customers.existsByReference(/* args */);
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
## `sdk.images`
|
|
470
|
+
|
|
471
|
+
| Método | Parâmetros | Retorno |
|
|
472
|
+
|--------|-----------|--------|
|
|
473
|
+
| `getAll` | `guildId: string` | `Image[]` |
|
|
474
|
+
| `create` | `args: imageCreate` | `Image` |
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
<details>
|
|
478
|
+
<summary>📦 Tipos utilizados</summary>
|
|
479
|
+
|
|
480
|
+
### `Image`
|
|
481
|
+
|
|
482
|
+
| Campo | Tipo | Obrigatório |
|
|
483
|
+
|-------|------|-------------|
|
|
484
|
+
| `id` | `string` | Sim |
|
|
485
|
+
| `guildId` | `string` | Sim |
|
|
486
|
+
| `url` | `string` | Sim |
|
|
487
|
+
| `reference` | `string` | Sim |
|
|
488
|
+
| `name` | `string` | Sim |
|
|
489
|
+
| `expiresIn` | `number` | Sim |
|
|
490
|
+
|
|
491
|
+
</details>
|
|
492
|
+
|
|
493
|
+
**Exemplo de uso:**
|
|
494
|
+
|
|
495
|
+
```typescript
|
|
496
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
497
|
+
|
|
498
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
499
|
+
|
|
500
|
+
const result = await sdk.images.getAll(/* args */);
|
|
501
|
+
const result = await sdk.images.create(/* args */);
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
## `sdk.orders`
|
|
507
|
+
|
|
508
|
+
| Método | Parâmetros | Retorno |
|
|
509
|
+
|--------|-----------|--------|
|
|
510
|
+
| `create` | `args: OrderCreate` | `Order` |
|
|
511
|
+
| `get` | `orderId: string` | `Order | null` |
|
|
512
|
+
| `getPayment` | `orderId: string` | `OrderPayment | null` |
|
|
513
|
+
| `getApprovedUnprocessed` | `botClient: string, guildId?: string` | `Order[]` |
|
|
514
|
+
| `markAsReleased` | `id: string` | `Order` |
|
|
515
|
+
| `aprove` | `id: string` | `Order` |
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
<details>
|
|
519
|
+
<summary>📦 Tipos utilizados</summary>
|
|
520
|
+
|
|
521
|
+
### `OrderCreate`
|
|
522
|
+
|
|
523
|
+
| Campo | Tipo | Obrigatório |
|
|
524
|
+
|-------|------|-------------|
|
|
525
|
+
| `guildId` | `string` | Sim |
|
|
526
|
+
| `amount` | `number` | Sim |
|
|
527
|
+
| `cartId` | `string` | Sim |
|
|
528
|
+
| `botClient` | `string` | Sim |
|
|
529
|
+
| `customer` | `OrderCustomer` | Sim |
|
|
530
|
+
| `products` | `OrderProduct[]` | Sim |
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
### `Order`
|
|
534
|
+
|
|
535
|
+
| Campo | Tipo | Obrigatório |
|
|
536
|
+
|-------|------|-------------|
|
|
537
|
+
| `id` | `string` | Sim |
|
|
538
|
+
| `aproved` | `boolean` | Sim |
|
|
539
|
+
| `released` | `boolean` | Sim |
|
|
540
|
+
| `cartId` | `string` | Não |
|
|
541
|
+
| `planId` | `string` | Não |
|
|
542
|
+
| `paymentId` | `string` | Não |
|
|
543
|
+
| `guildId` | `string` | Sim |
|
|
544
|
+
| `customerId` | `string` | Não |
|
|
545
|
+
| `botClient` | `string` | Não |
|
|
546
|
+
| `paymentProvider` | `PaymentProvider` | Não |
|
|
547
|
+
| `automatic` | `boolean` | Não |
|
|
548
|
+
| `pixKey` | `string` | Sim |
|
|
549
|
+
| `expireAt` | `Date` | Não |
|
|
550
|
+
| `createdAt` | `Date` | Sim |
|
|
551
|
+
| `updatedAt` | `Date` | Sim |
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
### `OrderPayment`
|
|
555
|
+
|
|
556
|
+
| Campo | Tipo | Obrigatório |
|
|
557
|
+
|-------|------|-------------|
|
|
558
|
+
| `id` | `string` | Sim |
|
|
559
|
+
| `aproved` | `boolean` | Sim |
|
|
560
|
+
|
|
561
|
+
</details>
|
|
562
|
+
|
|
563
|
+
**Exemplo de uso:**
|
|
564
|
+
|
|
565
|
+
```typescript
|
|
566
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
567
|
+
|
|
568
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
569
|
+
|
|
570
|
+
const result = await sdk.orders.create(/* args */);
|
|
571
|
+
const result = await sdk.orders.get(/* args */);
|
|
572
|
+
const result = await sdk.orders.getPayment(/* args */);
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
---
|
|
576
|
+
|
|
577
|
+
## `sdk.paymentConfig`
|
|
578
|
+
|
|
579
|
+
| Método | Parâmetros | Retorno |
|
|
580
|
+
|--------|-----------|--------|
|
|
581
|
+
| `getOrCreate` | `guildId: string` | `PaymentConfig` |
|
|
582
|
+
| `update` | `args: UpdatePaymentConfigArgs` | `PaymentConfig` |
|
|
583
|
+
| `getByCaching` | `guildId: string` | `PaymentConfig | null` |
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
<details>
|
|
587
|
+
<summary>📦 Tipos utilizados</summary>
|
|
588
|
+
|
|
589
|
+
### `PaymentConfig`
|
|
590
|
+
|
|
591
|
+
| Campo | Tipo | Obrigatório |
|
|
592
|
+
|-------|------|-------------|
|
|
593
|
+
| `guildId` | `string` | Sim |
|
|
594
|
+
| `provider` | `PaymentProvider | null` | Não |
|
|
595
|
+
| `mercadoPagoToken` | `string | null` | Não |
|
|
596
|
+
| `efiBankToken` | `string | null` | Não |
|
|
597
|
+
| `chavePix` | `string | null` | Não |
|
|
598
|
+
| `chavePixType` | `"CPF" | "EMAIL" | "ALEATORIA" | "NUMERO"` | Não |
|
|
599
|
+
| `chavePixName` | `string` | Não |
|
|
600
|
+
| `chavePixCity` | `string` | Não |
|
|
601
|
+
| `walletApiKey` | `string` | Não |
|
|
602
|
+
| `chavePixchavePixStaticQrCode` | `boolean` | Sim |
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
### `UpdatePaymentConfigArgs`
|
|
606
|
+
|
|
607
|
+
| Campo | Tipo | Obrigatório |
|
|
608
|
+
|-------|------|-------------|
|
|
609
|
+
| `guildId` | `string` | Sim |
|
|
610
|
+
| `data` | `{` | Sim |
|
|
611
|
+
| `provider` | `PaymentProvider | null` | Não |
|
|
612
|
+
| `mercadoPagoToken` | `string | null` | Não |
|
|
613
|
+
| `walletApiKey` | `string | null` | Não |
|
|
614
|
+
| `efiBankToken` | `string | null` | Não |
|
|
615
|
+
| `chavePix` | `string | null` | Não |
|
|
616
|
+
| `chavePixType` | `"CPF" | "EMAIL" | "ALEATORIA" | "NUMERO"` | Não |
|
|
617
|
+
| `chavePixName` | `string` | Não |
|
|
618
|
+
| `chavePixCity` | `string` | Não |
|
|
619
|
+
| `chavePixchavePixStaticQrCode` | `boolean` | Não |
|
|
620
|
+
|
|
621
|
+
</details>
|
|
622
|
+
|
|
623
|
+
**Exemplo de uso:**
|
|
624
|
+
|
|
625
|
+
```typescript
|
|
626
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
627
|
+
|
|
628
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
629
|
+
|
|
630
|
+
const result = await sdk.paymentConfig.getOrCreate(/* args */);
|
|
631
|
+
const result = await sdk.paymentConfig.update(/* args */);
|
|
632
|
+
const result = await sdk.paymentConfig.getByCaching(/* args */);
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
---
|
|
636
|
+
|
|
637
|
+
## `sdk.planss`
|
|
638
|
+
|
|
639
|
+
| Método | Parâmetros | Retorno |
|
|
640
|
+
|--------|-----------|--------|
|
|
641
|
+
| `getByGuild` | `guildId: string` | `Plan | null` |
|
|
642
|
+
| `havePlan` | `guildId: string` | `PlanType | null` |
|
|
643
|
+
| `create` | `args: Plan` | `Plan` |
|
|
644
|
+
| `getExpiring` | `days?: number` | `ExpiringPlan[]` |
|
|
645
|
+
| `getExpired` | `—` | `ExpiredPlansResponse` |
|
|
646
|
+
| `getPlansNeedingAlert` | `days?: number` | `PlansNeedingAlertResponse` |
|
|
647
|
+
| `markAlertSent` | `guildId: string, daysUntilExpire: number` | `MarkAlertResponse` |
|
|
648
|
+
| `checkExpirations` | `—` | `CheckExpirationsResponse` |
|
|
649
|
+
| `getExpirationStatus` | `guildId: string` | `PlanStatus` |
|
|
650
|
+
| `update` | `guildId: string, updates: Partial<Plan>` | `Plan` |
|
|
651
|
+
| `delete` | `guildId: string` | `void` |
|
|
652
|
+
| `createSubscription` | `args: PlanSubscriptionCreateArgs` | `EfiPixCreateResponse` |
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
<details>
|
|
656
|
+
<summary>📦 Tipos utilizados</summary>
|
|
657
|
+
|
|
658
|
+
### `Plan`
|
|
659
|
+
|
|
660
|
+
| Campo | Tipo | Obrigatório |
|
|
661
|
+
|-------|------|-------------|
|
|
662
|
+
| `guildId` | `string` | Sim |
|
|
663
|
+
| `type` | `PlanType` | Sim |
|
|
664
|
+
| `expired` | `boolean` | Sim |
|
|
665
|
+
| `userId` | `string` | Sim |
|
|
666
|
+
| `createdAt` | `Date | null` | Sim |
|
|
667
|
+
| `expireAt` | `Date | null` | Sim |
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
### `ExpiredPlansResponse`
|
|
671
|
+
|
|
672
|
+
| Campo | Tipo | Obrigatório |
|
|
673
|
+
|-------|------|-------------|
|
|
674
|
+
| `count` | `number` | Sim |
|
|
675
|
+
| `plans` | `Array<{` | Sim |
|
|
676
|
+
| `guildId` | `string` | Sim |
|
|
677
|
+
| `userId` | `string` | Sim |
|
|
678
|
+
| `type` | `PlanType` | Sim |
|
|
679
|
+
| `expiredAt` | `Date | null` | Sim |
|
|
680
|
+
| `createdAt` | `Date | null` | Sim |
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
### `PlansNeedingAlertResponse`
|
|
684
|
+
|
|
685
|
+
| Campo | Tipo | Obrigatório |
|
|
686
|
+
|-------|------|-------------|
|
|
687
|
+
| `count` | `number` | Sim |
|
|
688
|
+
| `plans` | `PlanNeedingAlert[]` | Sim |
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
### `MarkAlertResponse`
|
|
692
|
+
|
|
693
|
+
| Campo | Tipo | Obrigatório |
|
|
694
|
+
|-------|------|-------------|
|
|
695
|
+
| `success` | `boolean` | Sim |
|
|
696
|
+
| `message` | `string` | Sim |
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
### `CheckExpirationsResponse`
|
|
700
|
+
|
|
701
|
+
| Campo | Tipo | Obrigatório |
|
|
702
|
+
|-------|------|-------------|
|
|
703
|
+
| `expired` | `{` | Sim |
|
|
704
|
+
| `count` | `number` | Sim |
|
|
705
|
+
| `plans` | `Array<{` | Sim |
|
|
706
|
+
| `guildId` | `string` | Sim |
|
|
707
|
+
| `userId` | `string` | Sim |
|
|
708
|
+
| `type` | `PlanType` | Sim |
|
|
709
|
+
| `expiredAt` | `Date | null` | Sim |
|
|
710
|
+
| `createdAt` | `Date | null` | Sim |
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
### `PlanStatus`
|
|
714
|
+
|
|
715
|
+
| Campo | Tipo | Obrigatório |
|
|
716
|
+
|-------|------|-------------|
|
|
717
|
+
| `active` | `boolean` | Sim |
|
|
718
|
+
| `expired` | `boolean` | Sim |
|
|
719
|
+
| `expireAt` | `Date` | Não |
|
|
720
|
+
| `daysUntilExpire` | `number` | Não |
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
### `PlanSubscriptionCreateArgs`
|
|
724
|
+
|
|
725
|
+
| Campo | Tipo | Obrigatório |
|
|
726
|
+
|-------|------|-------------|
|
|
727
|
+
| `guildId` | `string` | Sim |
|
|
728
|
+
| `userId` | `string` | Sim |
|
|
729
|
+
| `months` | `number` | Sim |
|
|
730
|
+
| `plan` | `"essential" | "complete"` | Sim |
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
### `EfiPixCreateResponse`
|
|
734
|
+
|
|
735
|
+
| Campo | Tipo | Obrigatório |
|
|
736
|
+
|-------|------|-------------|
|
|
737
|
+
| `calendario` | `{` | Sim |
|
|
738
|
+
| `criacao` | `string` | Sim |
|
|
739
|
+
| `expiracao` | `number` | Sim |
|
|
740
|
+
|
|
741
|
+
</details>
|
|
742
|
+
|
|
743
|
+
**Exemplo de uso:**
|
|
744
|
+
|
|
745
|
+
```typescript
|
|
746
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
747
|
+
|
|
748
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
749
|
+
|
|
750
|
+
const result = await sdk.planss.getByGuild(/* args */);
|
|
751
|
+
const result = await sdk.planss.havePlan(/* args */);
|
|
752
|
+
const result = await sdk.planss.create(/* args */);
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
---
|
|
756
|
+
|
|
757
|
+
## `sdk.products`
|
|
758
|
+
|
|
759
|
+
| Método | Parâmetros | Retorno |
|
|
760
|
+
|--------|-----------|--------|
|
|
761
|
+
| `setDraft` | `args: ProduductDraftSetArgs` | `Product | null` |
|
|
762
762
|
| `pushStock` | `{
|
|
763
|
-
product, amount, }: ProductStockPushArgs` | `string[]` |
|
|
764
|
-
| `getDraft` | `args: ProduductDraftGetArgs` | `Product | null` |
|
|
765
|
-
| `existsByReference` | `args: ProductGetByReference` | `Product | null` |
|
|
766
|
-
| `getById` | `id: string` | `Product | null` |
|
|
767
|
-
| `getByReference` | `reference: string, guildId: string` | `Product | null` |
|
|
768
|
-
| `create` | `args: ProductCreateArgs` | `Product` |
|
|
769
|
-
| `getByCaching` | `id: string` | `Product | null` |
|
|
770
|
-
| `getAllByGuild` | `guildId: string` | `Array<Product>` |
|
|
771
|
-
| `update` | `args: ProductUpdateArgs` | `Product` |
|
|
772
|
-
| `count` | `guildId: string` | `number` |
|
|
773
|
-
| `delete` | `id: string` | `void` |
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
<details>
|
|
777
|
-
<summary>📦 Tipos utilizados</summary>
|
|
778
|
-
|
|
779
|
-
### `ProduductDraftSetArgs`
|
|
780
|
-
|
|
781
|
-
| Campo | Tipo | Obrigatório |
|
|
782
|
-
|-------|------|-------------|
|
|
783
|
-
| `id` | `string` | Sim |
|
|
784
|
-
| `userId` | `string` | Sim |
|
|
785
|
-
| `data` | `ProductUpdateArgs["data"] & {` | Sim |
|
|
786
|
-
| `catalogs` | `string[]` | Não |
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
### `Product`
|
|
790
|
-
|
|
791
|
-
| Campo | Tipo | Obrigatório |
|
|
792
|
-
|-------|------|-------------|
|
|
793
|
-
| `id` | `string` | Sim |
|
|
794
|
-
| `reference` | `string` | Sim |
|
|
795
|
-
| `guildId` | `string` | Sim |
|
|
796
|
-
| `createdBy` | `string` | Sim |
|
|
797
|
-
| `status` | `ProductStatus` | Sim |
|
|
798
|
-
| `title` | `string | null` | Não |
|
|
799
|
-
| `banned` | `boolean | null` | Sim |
|
|
800
|
-
| `usersNotifyStock` | `JsonValue<Array<string>> | null` | Sim |
|
|
801
|
-
| `description` | `string | null` | Sim |
|
|
802
|
-
| `price` | `Decimal` | Sim |
|
|
803
|
-
| `discount` | `Decimal | null` | Sim |
|
|
804
|
-
| `banners` | `JsonValue<Array<string>> | null` | Sim |
|
|
805
|
-
| `messages` | `JsonValue<Array<string>> | null` | Sim |
|
|
806
|
-
| `stockMode` | `StockMode` | Sim |
|
|
807
|
-
| `stockItems` | `JsonValue<Array<string>> | null` | Sim |
|
|
808
|
-
| `stockText` | `string | null` | Sim |
|
|
809
|
-
| `stockProductMode` | `ProductMode | null` | Sim |
|
|
810
|
-
| `stockRepeat` | `number | null` | Sim |
|
|
811
|
-
| `stockCount` | `number | null` | Sim |
|
|
812
|
-
| `instructions` | `string | null` | Sim |
|
|
813
|
-
| `stockMin` | `number` | Sim |
|
|
814
|
-
| `stockMax` | `number` | Sim |
|
|
815
|
-
| `chat` | `boolean | null` | Não |
|
|
816
|
-
| `private` | `boolean | null` | Não |
|
|
817
|
-
| `deshighlight` | `boolean | null` | Não |
|
|
818
|
-
| `sell` | `boolean | null` | Não |
|
|
819
|
-
| `coupon` | `boolean` | Não |
|
|
820
|
-
| `colorHex` | `string | null` | Não |
|
|
821
|
-
| `guild` | `Guild | null` | Não |
|
|
822
|
-
| `sales` | `SaleProduct[]` | Não |
|
|
823
|
-
| `catalogs` | `string[]` | Não |
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
### `ProductStockPushArgs`
|
|
827
|
-
|
|
828
|
-
| Campo | Tipo | Obrigatório |
|
|
829
|
-
|-------|------|-------------|
|
|
830
|
-
| `product` | `Product` | Sim |
|
|
831
|
-
| `amount` | `number` | Sim |
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
### `ProduductDraftGetArgs`
|
|
835
|
-
|
|
836
|
-
| Campo | Tipo | Obrigatório |
|
|
837
|
-
|-------|------|-------------|
|
|
838
|
-
| `id` | `string` | Sim |
|
|
839
|
-
| `userId` | `string` | Sim |
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
### `ProductGetByReference`
|
|
843
|
-
|
|
844
|
-
| Campo | Tipo | Obrigatório |
|
|
845
|
-
|-------|------|-------------|
|
|
846
|
-
| `reference` | `string` | Sim |
|
|
847
|
-
| `guildId` | `string` | Sim |
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
### `ProductCreateArgs`
|
|
851
|
-
|
|
852
|
-
| Campo | Tipo | Obrigatório |
|
|
853
|
-
|-------|------|-------------|
|
|
854
|
-
| `createdBy` | `string` | Sim |
|
|
855
|
-
| `reference` | `string` | Sim |
|
|
856
|
-
| `guildId` | `string` | Sim |
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
### `ProductUpdateArgs`
|
|
860
|
-
|
|
861
|
-
| Campo | Tipo | Obrigatório |
|
|
862
|
-
|-------|------|-------------|
|
|
863
|
-
| `id` | `string` | Sim |
|
|
864
|
-
| `data` | `Omit<Partial<Product>, "id" | "reference">` | Sim |
|
|
865
|
-
|
|
866
|
-
</details>
|
|
867
|
-
|
|
868
|
-
**Exemplo de uso:**
|
|
869
|
-
|
|
870
|
-
```typescript
|
|
871
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
872
|
-
|
|
873
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
874
|
-
|
|
875
|
-
const result = await sdk.products.setDraft(/* args */);
|
|
876
|
-
const result = await sdk.products.pushStock(/* args */);
|
|
877
|
-
const result = await sdk.products.getDraft(/* args */);
|
|
878
|
-
```
|
|
879
|
-
|
|
880
|
-
---
|
|
881
|
-
|
|
882
|
-
## `sdk.sales`
|
|
883
|
-
|
|
884
|
-
| Método | Parâmetros | Retorno |
|
|
885
|
-
|--------|-----------|--------|
|
|
886
|
-
| `create` | `args: SaleCreateArgs` | `Sale` |
|
|
887
|
-
| `getById` | `id: string` | `Sale | null` |
|
|
888
|
-
| `getAllByGuild` | `guildId: string` | `Sale[]` |
|
|
889
|
-
| `saleProductGet` | `id: string` | `SaleProduct | null` |
|
|
890
|
-
| `delete` | `id: string` | `void` |
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
<details>
|
|
894
|
-
<summary>📦 Tipos utilizados</summary>
|
|
895
|
-
|
|
896
|
-
### `SaleCreateArgs`
|
|
897
|
-
|
|
898
|
-
| Campo | Tipo | Obrigatório |
|
|
899
|
-
|-------|------|-------------|
|
|
900
|
-
| `userId` | `string` | Sim |
|
|
901
|
-
| `guildId` | `string` | Sim |
|
|
902
|
-
| `totalValue` | `Decimal` | Sim |
|
|
903
|
-
| `products` | `SaleProductCreateArgs[]` | Sim |
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
### `Sale`
|
|
907
|
-
|
|
908
|
-
| Campo | Tipo | Obrigatório |
|
|
909
|
-
|-------|------|-------------|
|
|
910
|
-
| `id` | `string` | Sim |
|
|
911
|
-
| `userId` | `string` | Sim |
|
|
912
|
-
| `guildId` | `string` | Sim |
|
|
913
|
-
| `totalValue` | `Decimal` | Sim |
|
|
914
|
-
| `createdAt` | `Date | null` | Sim |
|
|
915
|
-
| `guild` | `Guild` | Não |
|
|
916
|
-
| `customer` | `Customer` | Não |
|
|
917
|
-
| `saleProducts` | `SaleProduct[]` | Não |
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
### `SaleProduct`
|
|
921
|
-
|
|
922
|
-
| Campo | Tipo | Obrigatório |
|
|
923
|
-
|-------|------|-------------|
|
|
924
|
-
| `id` | `string` | Sim |
|
|
925
|
-
| `saleId` | `string` | Sim |
|
|
926
|
-
| `productId` | `string` | Sim |
|
|
927
|
-
| `valueTotal` | `Decimal` | Sim |
|
|
928
|
-
| `quantity` | `number` | Sim |
|
|
929
|
-
| `product` | `Product` | Não |
|
|
930
|
-
| `sale` | `Sale` | Não |
|
|
931
|
-
| `deliveryStock` | `JsonValue<Array<string>> | null` | Não |
|
|
932
|
-
| `deliveryPedding` | `boolean | null` | Não |
|
|
933
|
-
| `deliveryPeddingAmount` | `number | null` | Não |
|
|
934
|
-
|
|
935
|
-
</details>
|
|
936
|
-
|
|
937
|
-
**Exemplo de uso:**
|
|
938
|
-
|
|
939
|
-
```typescript
|
|
940
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
941
|
-
|
|
942
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
943
|
-
|
|
944
|
-
const result = await sdk.sales.create(/* args */);
|
|
945
|
-
const result = await sdk.sales.getById(/* args */);
|
|
946
|
-
const result = await sdk.sales.getAllByGuild(/* args */);
|
|
947
|
-
```
|
|
948
|
-
|
|
949
|
-
---
|
|
950
|
-
|
|
951
|
-
## `sdk.tokens`
|
|
952
|
-
|
|
953
|
-
| Método | Parâmetros | Retorno |
|
|
954
|
-
|--------|-----------|--------|
|
|
955
|
-
| `listUnused` | `—` | `Token[] | null` |
|
|
956
|
-
| `update` | `args: TokenUpdateArgs` | `Token` |
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
<details>
|
|
960
|
-
<summary>📦 Tipos utilizados</summary>
|
|
961
|
-
|
|
962
|
-
### `Token`
|
|
963
|
-
|
|
964
|
-
| Campo | Tipo | Obrigatório |
|
|
965
|
-
|-------|------|-------------|
|
|
966
|
-
| `id` | `string` | Sim |
|
|
967
|
-
| `botId` | `string` | Sim |
|
|
968
|
-
| `used` | `boolean` | Sim |
|
|
969
|
-
| `token` | `string` | Sim |
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
### `TokenUpdateArgs`
|
|
973
|
-
|
|
974
|
-
| Campo | Tipo | Obrigatório |
|
|
975
|
-
|-------|------|-------------|
|
|
976
|
-
| `id` | `string` | Sim |
|
|
977
|
-
| `data` | `Partial<Omit<Token, "id" | "botId">>` | Sim |
|
|
978
|
-
|
|
979
|
-
</details>
|
|
980
|
-
|
|
981
|
-
**Exemplo de uso:**
|
|
982
|
-
|
|
983
|
-
```typescript
|
|
984
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
985
|
-
|
|
986
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
987
|
-
|
|
988
|
-
const result = await sdk.tokens.listUnused();
|
|
989
|
-
const result = await sdk.tokens.update(/* args */);
|
|
990
|
-
```
|
|
991
|
-
|
|
992
|
-
---
|
|
993
|
-
|
|
994
|
-
## `sdk.users`
|
|
995
|
-
|
|
996
|
-
| Método | Parâmetros | Retorno |
|
|
997
|
-
|--------|-----------|--------|
|
|
998
|
-
| `get` | `userId: string` | `User | null` |
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
<details>
|
|
1002
|
-
<summary>📦 Tipos utilizados</summary>
|
|
1003
|
-
|
|
1004
|
-
### `User`
|
|
1005
|
-
|
|
1006
|
-
| Campo | Tipo | Obrigatório |
|
|
1007
|
-
|-------|------|-------------|
|
|
1008
|
-
| `id` | `string` | Sim |
|
|
1009
|
-
| `develop` | `boolean` | Não |
|
|
1010
|
-
|
|
1011
|
-
</details>
|
|
1012
|
-
|
|
1013
|
-
**Exemplo de uso:**
|
|
1014
|
-
|
|
1015
|
-
```typescript
|
|
1016
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
1017
|
-
|
|
1018
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
1019
|
-
|
|
1020
|
-
const result = await sdk.users.get(/* args */);
|
|
1021
|
-
```
|
|
1022
|
-
|
|
1023
|
-
---
|
|
1024
|
-
|
|
1025
|
-
## `sdk.wallet`
|
|
1026
|
-
|
|
1027
|
-
| Método | Parâmetros | Retorno |
|
|
1028
|
-
|--------|-----------|--------|
|
|
1029
|
-
| `getOrCreate` | `userId: string` | `Wallet` |
|
|
1030
|
-
| `getByUserId` | `userId: string` | `Wallet` |
|
|
1031
|
-
| `getByApiKey` | `apiKey: string` | `Wallet` |
|
|
1032
|
-
| `update` | `args: UpdateWalletArgs` | `Wallet` |
|
|
1033
|
-
| `getByCaching` | `userId: string` | `Wallet | null` |
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
<details>
|
|
1037
|
-
<summary>📦 Tipos utilizados</summary>
|
|
1038
|
-
|
|
1039
|
-
### `Wallet`
|
|
1040
|
-
|
|
1041
|
-
| Campo | Tipo | Obrigatório |
|
|
1042
|
-
|-------|------|-------------|
|
|
1043
|
-
| `id` | `string` | Sim |
|
|
1044
|
-
| `userId` | `string` | Sim |
|
|
1045
|
-
| `apiKey` | `string | null` | Não |
|
|
1046
|
-
| `balance` | `WalletBalance` | Não |
|
|
1047
|
-
| `gatewayProvider` | `GatewayProvider | null` | Não |
|
|
1048
|
-
| `gatewayConfig` | `Record<string, unknown> | null` | Não |
|
|
1049
|
-
| `isActive` | `boolean | null` | Não |
|
|
1050
|
-
| `createdAt` | `Date` | Sim |
|
|
1051
|
-
| `updatedAt` | `Date` | Sim |
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
### `UpdateWalletArgs`
|
|
1055
|
-
|
|
1056
|
-
| Campo | Tipo | Obrigatório |
|
|
1057
|
-
|-------|------|-------------|
|
|
1058
|
-
| `userId` | `string` | Sim |
|
|
1059
|
-
| `data` | `{` | Sim |
|
|
1060
|
-
| `apiKey` | `string | null` | Não |
|
|
1061
|
-
| `gatewayProvider` | `GatewayProvider | null` | Não |
|
|
1062
|
-
| `gatewayConfig` | `Record<string, unknown> | null` | Não |
|
|
1063
|
-
| `isActive` | `boolean | null` | Não |
|
|
1064
|
-
|
|
1065
|
-
</details>
|
|
1066
|
-
|
|
1067
|
-
**Exemplo de uso:**
|
|
1068
|
-
|
|
1069
|
-
```typescript
|
|
1070
|
-
import { ShopEasySdk } from "shopeasy-sdk";
|
|
1071
|
-
|
|
1072
|
-
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
1073
|
-
|
|
1074
|
-
const result = await sdk.wallet.getOrCreate(/* args */);
|
|
1075
|
-
const result = await sdk.wallet.getByUserId(/* args */);
|
|
1076
|
-
const result = await sdk.wallet.getByApiKey(/* args */);
|
|
1077
|
-
```
|
|
1078
|
-
|
|
1079
|
-
---
|
|
1080
|
-
|
|
1081
|
-
> Documentação gerada automaticamente em 11/03/2026.
|
|
763
|
+
product, amount, }: ProductStockPushArgs` | `string[]` |
|
|
764
|
+
| `getDraft` | `args: ProduductDraftGetArgs` | `Product | null` |
|
|
765
|
+
| `existsByReference` | `args: ProductGetByReference` | `Product | null` |
|
|
766
|
+
| `getById` | `id: string` | `Product | null` |
|
|
767
|
+
| `getByReference` | `reference: string, guildId: string` | `Product | null` |
|
|
768
|
+
| `create` | `args: ProductCreateArgs` | `Product` |
|
|
769
|
+
| `getByCaching` | `id: string` | `Product | null` |
|
|
770
|
+
| `getAllByGuild` | `guildId: string` | `Array<Product>` |
|
|
771
|
+
| `update` | `args: ProductUpdateArgs` | `Product` |
|
|
772
|
+
| `count` | `guildId: string` | `number` |
|
|
773
|
+
| `delete` | `id: string` | `void` |
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
<details>
|
|
777
|
+
<summary>📦 Tipos utilizados</summary>
|
|
778
|
+
|
|
779
|
+
### `ProduductDraftSetArgs`
|
|
780
|
+
|
|
781
|
+
| Campo | Tipo | Obrigatório |
|
|
782
|
+
|-------|------|-------------|
|
|
783
|
+
| `id` | `string` | Sim |
|
|
784
|
+
| `userId` | `string` | Sim |
|
|
785
|
+
| `data` | `ProductUpdateArgs["data"] & {` | Sim |
|
|
786
|
+
| `catalogs` | `string[]` | Não |
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
### `Product`
|
|
790
|
+
|
|
791
|
+
| Campo | Tipo | Obrigatório |
|
|
792
|
+
|-------|------|-------------|
|
|
793
|
+
| `id` | `string` | Sim |
|
|
794
|
+
| `reference` | `string` | Sim |
|
|
795
|
+
| `guildId` | `string` | Sim |
|
|
796
|
+
| `createdBy` | `string` | Sim |
|
|
797
|
+
| `status` | `ProductStatus` | Sim |
|
|
798
|
+
| `title` | `string | null` | Não |
|
|
799
|
+
| `banned` | `boolean | null` | Sim |
|
|
800
|
+
| `usersNotifyStock` | `JsonValue<Array<string>> | null` | Sim |
|
|
801
|
+
| `description` | `string | null` | Sim |
|
|
802
|
+
| `price` | `Decimal` | Sim |
|
|
803
|
+
| `discount` | `Decimal | null` | Sim |
|
|
804
|
+
| `banners` | `JsonValue<Array<string>> | null` | Sim |
|
|
805
|
+
| `messages` | `JsonValue<Array<string>> | null` | Sim |
|
|
806
|
+
| `stockMode` | `StockMode` | Sim |
|
|
807
|
+
| `stockItems` | `JsonValue<Array<string>> | null` | Sim |
|
|
808
|
+
| `stockText` | `string | null` | Sim |
|
|
809
|
+
| `stockProductMode` | `ProductMode | null` | Sim |
|
|
810
|
+
| `stockRepeat` | `number | null` | Sim |
|
|
811
|
+
| `stockCount` | `number | null` | Sim |
|
|
812
|
+
| `instructions` | `string | null` | Sim |
|
|
813
|
+
| `stockMin` | `number` | Sim |
|
|
814
|
+
| `stockMax` | `number` | Sim |
|
|
815
|
+
| `chat` | `boolean | null` | Não |
|
|
816
|
+
| `private` | `boolean | null` | Não |
|
|
817
|
+
| `deshighlight` | `boolean | null` | Não |
|
|
818
|
+
| `sell` | `boolean | null` | Não |
|
|
819
|
+
| `coupon` | `boolean` | Não |
|
|
820
|
+
| `colorHex` | `string | null` | Não |
|
|
821
|
+
| `guild` | `Guild | null` | Não |
|
|
822
|
+
| `sales` | `SaleProduct[]` | Não |
|
|
823
|
+
| `catalogs` | `string[]` | Não |
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
### `ProductStockPushArgs`
|
|
827
|
+
|
|
828
|
+
| Campo | Tipo | Obrigatório |
|
|
829
|
+
|-------|------|-------------|
|
|
830
|
+
| `product` | `Product` | Sim |
|
|
831
|
+
| `amount` | `number` | Sim |
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
### `ProduductDraftGetArgs`
|
|
835
|
+
|
|
836
|
+
| Campo | Tipo | Obrigatório |
|
|
837
|
+
|-------|------|-------------|
|
|
838
|
+
| `id` | `string` | Sim |
|
|
839
|
+
| `userId` | `string` | Sim |
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
### `ProductGetByReference`
|
|
843
|
+
|
|
844
|
+
| Campo | Tipo | Obrigatório |
|
|
845
|
+
|-------|------|-------------|
|
|
846
|
+
| `reference` | `string` | Sim |
|
|
847
|
+
| `guildId` | `string` | Sim |
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
### `ProductCreateArgs`
|
|
851
|
+
|
|
852
|
+
| Campo | Tipo | Obrigatório |
|
|
853
|
+
|-------|------|-------------|
|
|
854
|
+
| `createdBy` | `string` | Sim |
|
|
855
|
+
| `reference` | `string` | Sim |
|
|
856
|
+
| `guildId` | `string` | Sim |
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
### `ProductUpdateArgs`
|
|
860
|
+
|
|
861
|
+
| Campo | Tipo | Obrigatório |
|
|
862
|
+
|-------|------|-------------|
|
|
863
|
+
| `id` | `string` | Sim |
|
|
864
|
+
| `data` | `Omit<Partial<Product>, "id" | "reference">` | Sim |
|
|
865
|
+
|
|
866
|
+
</details>
|
|
867
|
+
|
|
868
|
+
**Exemplo de uso:**
|
|
869
|
+
|
|
870
|
+
```typescript
|
|
871
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
872
|
+
|
|
873
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
874
|
+
|
|
875
|
+
const result = await sdk.products.setDraft(/* args */);
|
|
876
|
+
const result = await sdk.products.pushStock(/* args */);
|
|
877
|
+
const result = await sdk.products.getDraft(/* args */);
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
---
|
|
881
|
+
|
|
882
|
+
## `sdk.sales`
|
|
883
|
+
|
|
884
|
+
| Método | Parâmetros | Retorno |
|
|
885
|
+
|--------|-----------|--------|
|
|
886
|
+
| `create` | `args: SaleCreateArgs` | `Sale` |
|
|
887
|
+
| `getById` | `id: string` | `Sale | null` |
|
|
888
|
+
| `getAllByGuild` | `guildId: string` | `Sale[]` |
|
|
889
|
+
| `saleProductGet` | `id: string` | `SaleProduct | null` |
|
|
890
|
+
| `delete` | `id: string` | `void` |
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
<details>
|
|
894
|
+
<summary>📦 Tipos utilizados</summary>
|
|
895
|
+
|
|
896
|
+
### `SaleCreateArgs`
|
|
897
|
+
|
|
898
|
+
| Campo | Tipo | Obrigatório |
|
|
899
|
+
|-------|------|-------------|
|
|
900
|
+
| `userId` | `string` | Sim |
|
|
901
|
+
| `guildId` | `string` | Sim |
|
|
902
|
+
| `totalValue` | `Decimal` | Sim |
|
|
903
|
+
| `products` | `SaleProductCreateArgs[]` | Sim |
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
### `Sale`
|
|
907
|
+
|
|
908
|
+
| Campo | Tipo | Obrigatório |
|
|
909
|
+
|-------|------|-------------|
|
|
910
|
+
| `id` | `string` | Sim |
|
|
911
|
+
| `userId` | `string` | Sim |
|
|
912
|
+
| `guildId` | `string` | Sim |
|
|
913
|
+
| `totalValue` | `Decimal` | Sim |
|
|
914
|
+
| `createdAt` | `Date | null` | Sim |
|
|
915
|
+
| `guild` | `Guild` | Não |
|
|
916
|
+
| `customer` | `Customer` | Não |
|
|
917
|
+
| `saleProducts` | `SaleProduct[]` | Não |
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
### `SaleProduct`
|
|
921
|
+
|
|
922
|
+
| Campo | Tipo | Obrigatório |
|
|
923
|
+
|-------|------|-------------|
|
|
924
|
+
| `id` | `string` | Sim |
|
|
925
|
+
| `saleId` | `string` | Sim |
|
|
926
|
+
| `productId` | `string` | Sim |
|
|
927
|
+
| `valueTotal` | `Decimal` | Sim |
|
|
928
|
+
| `quantity` | `number` | Sim |
|
|
929
|
+
| `product` | `Product` | Não |
|
|
930
|
+
| `sale` | `Sale` | Não |
|
|
931
|
+
| `deliveryStock` | `JsonValue<Array<string>> | null` | Não |
|
|
932
|
+
| `deliveryPedding` | `boolean | null` | Não |
|
|
933
|
+
| `deliveryPeddingAmount` | `number | null` | Não |
|
|
934
|
+
|
|
935
|
+
</details>
|
|
936
|
+
|
|
937
|
+
**Exemplo de uso:**
|
|
938
|
+
|
|
939
|
+
```typescript
|
|
940
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
941
|
+
|
|
942
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
943
|
+
|
|
944
|
+
const result = await sdk.sales.create(/* args */);
|
|
945
|
+
const result = await sdk.sales.getById(/* args */);
|
|
946
|
+
const result = await sdk.sales.getAllByGuild(/* args */);
|
|
947
|
+
```
|
|
948
|
+
|
|
949
|
+
---
|
|
950
|
+
|
|
951
|
+
## `sdk.tokens`
|
|
952
|
+
|
|
953
|
+
| Método | Parâmetros | Retorno |
|
|
954
|
+
|--------|-----------|--------|
|
|
955
|
+
| `listUnused` | `—` | `Token[] | null` |
|
|
956
|
+
| `update` | `args: TokenUpdateArgs` | `Token` |
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
<details>
|
|
960
|
+
<summary>📦 Tipos utilizados</summary>
|
|
961
|
+
|
|
962
|
+
### `Token`
|
|
963
|
+
|
|
964
|
+
| Campo | Tipo | Obrigatório |
|
|
965
|
+
|-------|------|-------------|
|
|
966
|
+
| `id` | `string` | Sim |
|
|
967
|
+
| `botId` | `string` | Sim |
|
|
968
|
+
| `used` | `boolean` | Sim |
|
|
969
|
+
| `token` | `string` | Sim |
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
### `TokenUpdateArgs`
|
|
973
|
+
|
|
974
|
+
| Campo | Tipo | Obrigatório |
|
|
975
|
+
|-------|------|-------------|
|
|
976
|
+
| `id` | `string` | Sim |
|
|
977
|
+
| `data` | `Partial<Omit<Token, "id" | "botId">>` | Sim |
|
|
978
|
+
|
|
979
|
+
</details>
|
|
980
|
+
|
|
981
|
+
**Exemplo de uso:**
|
|
982
|
+
|
|
983
|
+
```typescript
|
|
984
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
985
|
+
|
|
986
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
987
|
+
|
|
988
|
+
const result = await sdk.tokens.listUnused();
|
|
989
|
+
const result = await sdk.tokens.update(/* args */);
|
|
990
|
+
```
|
|
991
|
+
|
|
992
|
+
---
|
|
993
|
+
|
|
994
|
+
## `sdk.users`
|
|
995
|
+
|
|
996
|
+
| Método | Parâmetros | Retorno |
|
|
997
|
+
|--------|-----------|--------|
|
|
998
|
+
| `get` | `userId: string` | `User | null` |
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
<details>
|
|
1002
|
+
<summary>📦 Tipos utilizados</summary>
|
|
1003
|
+
|
|
1004
|
+
### `User`
|
|
1005
|
+
|
|
1006
|
+
| Campo | Tipo | Obrigatório |
|
|
1007
|
+
|-------|------|-------------|
|
|
1008
|
+
| `id` | `string` | Sim |
|
|
1009
|
+
| `develop` | `boolean` | Não |
|
|
1010
|
+
|
|
1011
|
+
</details>
|
|
1012
|
+
|
|
1013
|
+
**Exemplo de uso:**
|
|
1014
|
+
|
|
1015
|
+
```typescript
|
|
1016
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
1017
|
+
|
|
1018
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
1019
|
+
|
|
1020
|
+
const result = await sdk.users.get(/* args */);
|
|
1021
|
+
```
|
|
1022
|
+
|
|
1023
|
+
---
|
|
1024
|
+
|
|
1025
|
+
## `sdk.wallet`
|
|
1026
|
+
|
|
1027
|
+
| Método | Parâmetros | Retorno |
|
|
1028
|
+
|--------|-----------|--------|
|
|
1029
|
+
| `getOrCreate` | `userId: string` | `Wallet` |
|
|
1030
|
+
| `getByUserId` | `userId: string` | `Wallet` |
|
|
1031
|
+
| `getByApiKey` | `apiKey: string` | `Wallet` |
|
|
1032
|
+
| `update` | `args: UpdateWalletArgs` | `Wallet` |
|
|
1033
|
+
| `getByCaching` | `userId: string` | `Wallet | null` |
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
<details>
|
|
1037
|
+
<summary>📦 Tipos utilizados</summary>
|
|
1038
|
+
|
|
1039
|
+
### `Wallet`
|
|
1040
|
+
|
|
1041
|
+
| Campo | Tipo | Obrigatório |
|
|
1042
|
+
|-------|------|-------------|
|
|
1043
|
+
| `id` | `string` | Sim |
|
|
1044
|
+
| `userId` | `string` | Sim |
|
|
1045
|
+
| `apiKey` | `string | null` | Não |
|
|
1046
|
+
| `balance` | `WalletBalance` | Não |
|
|
1047
|
+
| `gatewayProvider` | `GatewayProvider | null` | Não |
|
|
1048
|
+
| `gatewayConfig` | `Record<string, unknown> | null` | Não |
|
|
1049
|
+
| `isActive` | `boolean | null` | Não |
|
|
1050
|
+
| `createdAt` | `Date` | Sim |
|
|
1051
|
+
| `updatedAt` | `Date` | Sim |
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
### `UpdateWalletArgs`
|
|
1055
|
+
|
|
1056
|
+
| Campo | Tipo | Obrigatório |
|
|
1057
|
+
|-------|------|-------------|
|
|
1058
|
+
| `userId` | `string` | Sim |
|
|
1059
|
+
| `data` | `{` | Sim |
|
|
1060
|
+
| `apiKey` | `string | null` | Não |
|
|
1061
|
+
| `gatewayProvider` | `GatewayProvider | null` | Não |
|
|
1062
|
+
| `gatewayConfig` | `Record<string, unknown> | null` | Não |
|
|
1063
|
+
| `isActive` | `boolean | null` | Não |
|
|
1064
|
+
|
|
1065
|
+
</details>
|
|
1066
|
+
|
|
1067
|
+
**Exemplo de uso:**
|
|
1068
|
+
|
|
1069
|
+
```typescript
|
|
1070
|
+
import { ShopEasySdk } from "shopeasy-sdk";
|
|
1071
|
+
|
|
1072
|
+
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
|
|
1073
|
+
|
|
1074
|
+
const result = await sdk.wallet.getOrCreate(/* args */);
|
|
1075
|
+
const result = await sdk.wallet.getByUserId(/* args */);
|
|
1076
|
+
const result = await sdk.wallet.getByApiKey(/* args */);
|
|
1077
|
+
```
|
|
1078
|
+
|
|
1079
|
+
---
|
|
1080
|
+
|
|
1081
|
+
> Documentação gerada automaticamente em 11/03/2026.
|