@zennify/sdk-js 2.1.1 → 2.2.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.
@@ -35,270 +35,6 @@ export type GetServiceApiSchemaResponses = {
35
35
  */
36
36
  200: unknown;
37
37
  };
38
- export type DeleteStoreDiscordPanelData = {
39
- body?: never;
40
- path: {
41
- storeId: string;
42
- panelId: string;
43
- };
44
- query?: never;
45
- url: "/stores/{storeId}/discord_panels/{panelId}";
46
- };
47
- export type DeleteStoreDiscordPanelErrors = {
48
- /**
49
- * User not authenticated.
50
- */
51
- 401: DefaultError;
52
- /**
53
- * This store has expired.
54
- */
55
- 402: DefaultError;
56
- /**
57
- * Permission denied.
58
- */
59
- 403: DefaultError;
60
- /**
61
- * Not Found
62
- */
63
- 404: DefaultError;
64
- };
65
- export type DeleteStoreDiscordPanelError = DeleteStoreDiscordPanelErrors[keyof DeleteStoreDiscordPanelErrors];
66
- export type DeleteStoreDiscordPanelResponses = {
67
- /**
68
- * Discord panel deleted successfully.
69
- */
70
- 204: void;
71
- };
72
- export type DeleteStoreDiscordPanelResponse = DeleteStoreDiscordPanelResponses[keyof DeleteStoreDiscordPanelResponses];
73
- export type UpdateStoreDiscordPanelData = {
74
- body?: {
75
- /**
76
- * Public name. Must be 3 to 50 valid characters.
77
- */
78
- name?: string;
79
- placeholder?: null | string;
80
- /**
81
- * Discord panel description.
82
- */
83
- description?: string;
84
- /**
85
- * Products displayed in the panel.
86
- */
87
- products?: Array<{
88
- /**
89
- * Product id to show in the panel.
90
- */
91
- id: number;
92
- emoji?: null | string;
93
- label?: null | string;
94
- }>;
95
- };
96
- path: {
97
- storeId: string;
98
- panelId: string;
99
- };
100
- query?: never;
101
- url: "/stores/{storeId}/discord_panels/{panelId}";
102
- };
103
- export type UpdateStoreDiscordPanelErrors = {
104
- /**
105
- * Invalid JSON payload.
106
- */
107
- 400: DefaultError;
108
- /**
109
- * User not authenticated.
110
- */
111
- 401: DefaultError;
112
- /**
113
- * This store has expired.
114
- */
115
- 402: DefaultError;
116
- /**
117
- * Permission denied.
118
- */
119
- 403: DefaultError;
120
- /**
121
- * Not Found
122
- */
123
- 404: DefaultError;
124
- /**
125
- * Payload too large.
126
- */
127
- 413: DefaultError;
128
- /**
129
- * Unprocessable Entity
130
- */
131
- 422: DefaultError;
132
- };
133
- export type UpdateStoreDiscordPanelError = UpdateStoreDiscordPanelErrors[keyof UpdateStoreDiscordPanelErrors];
134
- export type UpdateStoreDiscordPanelResponses = {
135
- /**
136
- * Discord panel updated successfully.
137
- */
138
- 204: void;
139
- };
140
- export type UpdateStoreDiscordPanelResponse = UpdateStoreDiscordPanelResponses[keyof UpdateStoreDiscordPanelResponses];
141
- export type GetStoreDiscordPanelsData = {
142
- body?: never;
143
- path: {
144
- storeId: string;
145
- };
146
- query?: never;
147
- url: "/stores/{storeId}/discord_panels";
148
- };
149
- export type GetStoreDiscordPanelsErrors = {
150
- /**
151
- * User not authenticated.
152
- */
153
- 401: DefaultError;
154
- /**
155
- * This store has expired.
156
- */
157
- 402: DefaultError;
158
- /**
159
- * Permission denied.
160
- */
161
- 403: DefaultError;
162
- /**
163
- * Unknown store.
164
- */
165
- 404: DefaultError;
166
- };
167
- export type GetStoreDiscordPanelsError = GetStoreDiscordPanelsErrors[keyof GetStoreDiscordPanelsErrors];
168
- export type GetStoreDiscordPanelsResponses = {
169
- /**
170
- * Discord panels listed successfully.
171
- */
172
- 200: Array<{
173
- id: number;
174
- name: string;
175
- placeholder: null | string;
176
- description: null | string;
177
- created_at: number;
178
- owner_id: number;
179
- store_id: number;
180
- icon_id?: null | string;
181
- banner_id?: null | string;
182
- products: Array<{
183
- id: number;
184
- emoji: null | string;
185
- label: null | string;
186
- }>;
187
- }>;
188
- };
189
- export type GetStoreDiscordPanelsResponse = GetStoreDiscordPanelsResponses[keyof GetStoreDiscordPanelsResponses];
190
- export type CreateStoreDiscordPanelData = {
191
- body?: {
192
- /**
193
- * Public name. Must be 3 to 50 valid characters.
194
- */
195
- name: string;
196
- /**
197
- * Discord panel description.
198
- */
199
- description?: string;
200
- placeholder?: null | string;
201
- };
202
- path: {
203
- storeId: string;
204
- };
205
- query?: never;
206
- url: "/stores/{storeId}/discord_panels";
207
- };
208
- export type CreateStoreDiscordPanelErrors = {
209
- /**
210
- * Invalid JSON payload.
211
- */
212
- 400: DefaultError;
213
- /**
214
- * User not authenticated.
215
- */
216
- 401: DefaultError;
217
- /**
218
- * This store has expired.
219
- */
220
- 402: DefaultError;
221
- /**
222
- * Permission denied.
223
- */
224
- 403: DefaultError;
225
- /**
226
- * Unknown store.
227
- */
228
- 404: DefaultError;
229
- /**
230
- * Payload too large.
231
- */
232
- 413: DefaultError;
233
- /**
234
- * Unprocessable Entity
235
- */
236
- 422: DefaultError;
237
- };
238
- export type CreateStoreDiscordPanelError = CreateStoreDiscordPanelErrors[keyof CreateStoreDiscordPanelErrors];
239
- export type CreateStoreDiscordPanelResponses = {
240
- /**
241
- * Discord panel created successfully.
242
- */
243
- 200: {
244
- /**
245
- * Discord panel ID.
246
- */
247
- id: number;
248
- };
249
- };
250
- export type CreateStoreDiscordPanelResponse = CreateStoreDiscordPanelResponses[keyof CreateStoreDiscordPanelResponses];
251
- export type PostStoreDiscordPanelMessageData = {
252
- body?: {
253
- /**
254
- * Discord channel id where the panel message should be posted.
255
- */
256
- channel_id: string;
257
- };
258
- path: {
259
- storeId: string;
260
- panelId: string;
261
- };
262
- query?: never;
263
- url: "/stores/{storeId}/discord_panels/{panelId}/discord_messages";
264
- };
265
- export type PostStoreDiscordPanelMessageErrors = {
266
- /**
267
- * Invalid JSON payload.
268
- */
269
- 400: DefaultError;
270
- /**
271
- * User not authenticated.
272
- */
273
- 401: DefaultError;
274
- /**
275
- * This store has expired.
276
- */
277
- 402: DefaultError;
278
- /**
279
- * Permission denied.
280
- */
281
- 403: DefaultError;
282
- /**
283
- * Not Found
284
- */
285
- 404: DefaultError;
286
- /**
287
- * Payload too large.
288
- */
289
- 413: DefaultError;
290
- /**
291
- * Unknown channel.
292
- */
293
- 422: DefaultError;
294
- };
295
- export type PostStoreDiscordPanelMessageError = PostStoreDiscordPanelMessageErrors[keyof PostStoreDiscordPanelMessageErrors];
296
- export type PostStoreDiscordPanelMessageResponses = {
297
- /**
298
- * Discord panel message queued successfully.
299
- */
300
- 202: unknown;
301
- };
302
38
  export type PostStoreProductDiscordMessageData = {
303
39
  body?: {
304
40
  /**
@@ -1246,6 +982,270 @@ export type UpdateStoreDiscordBotTokenResponses = {
1246
982
  204: void;
1247
983
  };
1248
984
  export type UpdateStoreDiscordBotTokenResponse = UpdateStoreDiscordBotTokenResponses[keyof UpdateStoreDiscordBotTokenResponses];
985
+ export type DeleteStoreCatalogData = {
986
+ body?: never;
987
+ path: {
988
+ storeId: string;
989
+ catalogId: string;
990
+ };
991
+ query?: never;
992
+ url: "/stores/{storeId}/catalogs/{catalogId}";
993
+ };
994
+ export type DeleteStoreCatalogErrors = {
995
+ /**
996
+ * User not authenticated.
997
+ */
998
+ 401: DefaultError;
999
+ /**
1000
+ * This store has expired.
1001
+ */
1002
+ 402: DefaultError;
1003
+ /**
1004
+ * Permission denied.
1005
+ */
1006
+ 403: DefaultError;
1007
+ /**
1008
+ * Not Found
1009
+ */
1010
+ 404: DefaultError;
1011
+ };
1012
+ export type DeleteStoreCatalogError = DeleteStoreCatalogErrors[keyof DeleteStoreCatalogErrors];
1013
+ export type DeleteStoreCatalogResponses = {
1014
+ /**
1015
+ * Catalog deleted successfully.
1016
+ */
1017
+ 204: void;
1018
+ };
1019
+ export type DeleteStoreCatalogResponse = DeleteStoreCatalogResponses[keyof DeleteStoreCatalogResponses];
1020
+ export type UpdateStoreCatalogData = {
1021
+ body?: {
1022
+ /**
1023
+ * Public name. Must be 3 to 50 valid characters.
1024
+ */
1025
+ name?: string;
1026
+ placeholder?: null | string;
1027
+ /**
1028
+ * Catalog description.
1029
+ */
1030
+ description?: string;
1031
+ /**
1032
+ * Products displayed in the catalog.
1033
+ */
1034
+ products?: Array<{
1035
+ /**
1036
+ * Product id to show in the catalog.
1037
+ */
1038
+ id: number;
1039
+ emoji?: null | string;
1040
+ label?: null | string;
1041
+ }>;
1042
+ };
1043
+ path: {
1044
+ storeId: string;
1045
+ catalogId: string;
1046
+ };
1047
+ query?: never;
1048
+ url: "/stores/{storeId}/catalogs/{catalogId}";
1049
+ };
1050
+ export type UpdateStoreCatalogErrors = {
1051
+ /**
1052
+ * Invalid JSON payload.
1053
+ */
1054
+ 400: DefaultError;
1055
+ /**
1056
+ * User not authenticated.
1057
+ */
1058
+ 401: DefaultError;
1059
+ /**
1060
+ * This store has expired.
1061
+ */
1062
+ 402: DefaultError;
1063
+ /**
1064
+ * Permission denied.
1065
+ */
1066
+ 403: DefaultError;
1067
+ /**
1068
+ * Not Found
1069
+ */
1070
+ 404: DefaultError;
1071
+ /**
1072
+ * Payload too large.
1073
+ */
1074
+ 413: DefaultError;
1075
+ /**
1076
+ * Unprocessable Entity
1077
+ */
1078
+ 422: DefaultError;
1079
+ };
1080
+ export type UpdateStoreCatalogError = UpdateStoreCatalogErrors[keyof UpdateStoreCatalogErrors];
1081
+ export type UpdateStoreCatalogResponses = {
1082
+ /**
1083
+ * Catalog updated successfully.
1084
+ */
1085
+ 204: void;
1086
+ };
1087
+ export type UpdateStoreCatalogResponse = UpdateStoreCatalogResponses[keyof UpdateStoreCatalogResponses];
1088
+ export type GetStoreCatalogsData = {
1089
+ body?: never;
1090
+ path: {
1091
+ storeId: string;
1092
+ };
1093
+ query?: never;
1094
+ url: "/stores/{storeId}/catalogs";
1095
+ };
1096
+ export type GetStoreCatalogsErrors = {
1097
+ /**
1098
+ * User not authenticated.
1099
+ */
1100
+ 401: DefaultError;
1101
+ /**
1102
+ * This store has expired.
1103
+ */
1104
+ 402: DefaultError;
1105
+ /**
1106
+ * Permission denied.
1107
+ */
1108
+ 403: DefaultError;
1109
+ /**
1110
+ * Unknown store.
1111
+ */
1112
+ 404: DefaultError;
1113
+ };
1114
+ export type GetStoreCatalogsError = GetStoreCatalogsErrors[keyof GetStoreCatalogsErrors];
1115
+ export type GetStoreCatalogsResponses = {
1116
+ /**
1117
+ * Catalogs listed successfully.
1118
+ */
1119
+ 200: Array<{
1120
+ id: number;
1121
+ name: string;
1122
+ placeholder: null | string;
1123
+ description: null | string;
1124
+ created_at: number;
1125
+ owner_id: number;
1126
+ store_id: number;
1127
+ icon_id?: null | string;
1128
+ banner_id?: null | string;
1129
+ products: Array<{
1130
+ id: number;
1131
+ emoji: null | string;
1132
+ label: null | string;
1133
+ }>;
1134
+ }>;
1135
+ };
1136
+ export type GetStoreCatalogsResponse = GetStoreCatalogsResponses[keyof GetStoreCatalogsResponses];
1137
+ export type CreateStoreCatalogData = {
1138
+ body?: {
1139
+ /**
1140
+ * Public name. Must be 3 to 50 valid characters.
1141
+ */
1142
+ name: string;
1143
+ /**
1144
+ * Catalog description.
1145
+ */
1146
+ description?: string;
1147
+ placeholder?: null | string;
1148
+ };
1149
+ path: {
1150
+ storeId: string;
1151
+ };
1152
+ query?: never;
1153
+ url: "/stores/{storeId}/catalogs";
1154
+ };
1155
+ export type CreateStoreCatalogErrors = {
1156
+ /**
1157
+ * Invalid JSON payload.
1158
+ */
1159
+ 400: DefaultError;
1160
+ /**
1161
+ * User not authenticated.
1162
+ */
1163
+ 401: DefaultError;
1164
+ /**
1165
+ * This store has expired.
1166
+ */
1167
+ 402: DefaultError;
1168
+ /**
1169
+ * Permission denied.
1170
+ */
1171
+ 403: DefaultError;
1172
+ /**
1173
+ * Unknown store.
1174
+ */
1175
+ 404: DefaultError;
1176
+ /**
1177
+ * Payload too large.
1178
+ */
1179
+ 413: DefaultError;
1180
+ /**
1181
+ * Unprocessable Entity
1182
+ */
1183
+ 422: DefaultError;
1184
+ };
1185
+ export type CreateStoreCatalogError = CreateStoreCatalogErrors[keyof CreateStoreCatalogErrors];
1186
+ export type CreateStoreCatalogResponses = {
1187
+ /**
1188
+ * Catalog created successfully.
1189
+ */
1190
+ 200: {
1191
+ /**
1192
+ * Catalog ID.
1193
+ */
1194
+ id: number;
1195
+ };
1196
+ };
1197
+ export type CreateStoreCatalogResponse = CreateStoreCatalogResponses[keyof CreateStoreCatalogResponses];
1198
+ export type PostStoreCatalogMessageData = {
1199
+ body?: {
1200
+ /**
1201
+ * Discord channel id where the catalog message should be posted.
1202
+ */
1203
+ channel_id: string;
1204
+ };
1205
+ path: {
1206
+ storeId: string;
1207
+ catalogId: string;
1208
+ };
1209
+ query?: never;
1210
+ url: "/stores/{storeId}/catalogs/{catalogId}/discord_messages";
1211
+ };
1212
+ export type PostStoreCatalogMessageErrors = {
1213
+ /**
1214
+ * Invalid JSON payload.
1215
+ */
1216
+ 400: DefaultError;
1217
+ /**
1218
+ * User not authenticated.
1219
+ */
1220
+ 401: DefaultError;
1221
+ /**
1222
+ * This store has expired.
1223
+ */
1224
+ 402: DefaultError;
1225
+ /**
1226
+ * Permission denied.
1227
+ */
1228
+ 403: DefaultError;
1229
+ /**
1230
+ * Not Found
1231
+ */
1232
+ 404: DefaultError;
1233
+ /**
1234
+ * Payload too large.
1235
+ */
1236
+ 413: DefaultError;
1237
+ /**
1238
+ * Unknown channel.
1239
+ */
1240
+ 422: DefaultError;
1241
+ };
1242
+ export type PostStoreCatalogMessageError = PostStoreCatalogMessageErrors[keyof PostStoreCatalogMessageErrors];
1243
+ export type PostStoreCatalogMessageResponses = {
1244
+ /**
1245
+ * Catalog message queued successfully.
1246
+ */
1247
+ 202: unknown;
1248
+ };
1249
1249
  export type DeleteStoreCouponData = {
1250
1250
  body?: never;
1251
1251
  path: {
@@ -1650,7 +1650,7 @@ export type DeleteStoreMediaData = {
1650
1650
  /**
1651
1651
  * Construct a type with a set of properties K of type T
1652
1652
  */
1653
- discord_sale_panels?: {
1653
+ catalogs?: {
1654
1654
  [key: string]: Array<"banner" | "icon">;
1655
1655
  };
1656
1656
  };
@@ -1708,7 +1708,7 @@ export type UploadStoreMediaData = {
1708
1708
  /**
1709
1709
  * Construct a type with a set of properties K of type T
1710
1710
  */
1711
- discord_sale_panels?: {
1711
+ catalogs?: {
1712
1712
  [key: string]: Array<"banner" | "icon">;
1713
1713
  };
1714
1714
  };
@@ -2066,8 +2066,8 @@ export type GetStoreResponses = {
2066
2066
  */
2067
2067
  moderators: {
2068
2068
  [key: string]: {
2069
- discord_user_id: string;
2070
2069
  username: string;
2070
+ discord_user_id: string;
2071
2071
  permissions: Array<"MANAGE_DISCORD_PANELS" | "MANAGE_PRODUCTS" | "MANAGE_COUPONS" | "MANAGE_STORE" | "MANAGE_SALES" | "VIEW_STATISTICS" | "VIEW_DISCKETS" | "MANAGE_DISCKETS">;
2072
2072
  created_at: number;
2073
2073
  };
@@ -2258,10 +2258,12 @@ export type ListTransactionsResponses = {
2258
2258
  */
2259
2259
  200: Array<{
2260
2260
  id: string;
2261
- base_value: number;
2261
+ status: "pending" | "inactive" | "invalid-pix-key" | "approved" | "cancelled" | "expired" | "refused" | "refunded" | "analysis";
2262
2262
  value: number;
2263
+ type: "transfer" | "withdraw" | "sale" | "deposit";
2263
2264
  created_at: number;
2264
- status: "inactive" | "invalid-pix-key" | "pending" | "approved" | "cancelled" | "expired" | "refused" | "refunded" | "analysis";
2265
+ user2?: null | number;
2266
+ base_value: number;
2265
2267
  }>;
2266
2268
  };
2267
2269
  export type ListTransactionsResponse = ListTransactionsResponses[keyof ListTransactionsResponses];
@@ -2290,12 +2292,12 @@ export type GetTransactionResponses = {
2290
2292
  */
2291
2293
  200: {
2292
2294
  id: string;
2293
- created_at: number;
2294
- value: number;
2295
2295
  status: "pending" | "inactive" | "invalid-pix-key" | "approved" | "cancelled" | "expired" | "refused" | "refunded" | "analysis";
2296
- method: "pix" | "boleto";
2297
- expires_at: number;
2296
+ value: number;
2298
2297
  type: "transfer" | "withdraw" | "sale" | "deposit";
2298
+ created_at: number;
2299
+ expires_at: number;
2300
+ method: "pix" | "boleto";
2299
2301
  entity: "mercadopago" | "semiauto" | "efi" | "wallet-efi";
2300
2302
  managed?: null | boolean;
2301
2303
  base_value: number;
@@ -2325,8 +2327,8 @@ export type GetTransactionResponses = {
2325
2327
  */
2326
2328
  payer: {
2327
2329
  id: number;
2328
- discord_user_id: string;
2329
2330
  username: string;
2331
+ discord_user_id: string;
2330
2332
  };
2331
2333
  /**
2332
2334
  * From T, pick a set of properties whose keys are in the union K
@@ -2342,15 +2344,15 @@ export type GetTransactionResponses = {
2342
2344
  */
2343
2345
  seller: {
2344
2346
  id: number;
2345
- discord_user_id: string;
2346
2347
  username: string;
2348
+ discord_user_id: string;
2347
2349
  };
2348
2350
  products: Array<{
2349
2351
  id: number;
2350
2352
  name: string;
2353
+ value: number;
2351
2354
  icon_id?: null | string;
2352
2355
  banner_id?: null | string;
2353
- value: number;
2354
2356
  short_description?: null | string;
2355
2357
  discord_description?: null | string;
2356
2358
  website_description?: null | string;
@@ -2755,7 +2757,7 @@ export type UpdatePixKeyData = {
2755
2757
  };
2756
2758
  path?: never;
2757
2759
  query?: never;
2758
- url: "/users/me/pix_key";
2760
+ url: "/users/me/payments/semiauto";
2759
2761
  };
2760
2762
  export type UpdatePixKeyErrors = {
2761
2763
  /**
@@ -2778,7 +2780,7 @@ export type UpdatePixKeyErrors = {
2778
2780
  export type UpdatePixKeyError = UpdatePixKeyErrors[keyof UpdatePixKeyErrors];
2779
2781
  export type UpdatePixKeyResponses = {
2780
2782
  /**
2781
- * Pix key updated or unchanged.
2783
+ * Semiauto configured succesfully.
2782
2784
  */
2783
2785
  204: void;
2784
2786
  };
package/types/main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { GetStoreDiscordPanelsResponse, GetStoreProductResponse, GetStoreProductStockResponse, GetStoreResponse, GetStoresResponse, GetTransactionResponse, GetUserResponse, ListStoreProductsResponse, ListTransactionsResponse, UploadStoreMediaData } from "./lib/api";
1
+ import { GetStoreCatalogsResponse, GetStoreProductResponse, GetStoreProductStockResponse, GetStoreResponse, GetStoresResponse, GetTransactionResponse, GetUserResponse, ListStoreProductsResponse, ListTransactionsResponse, UploadStoreMediaData } from "./lib/api";
2
2
  export * from "./images";
3
3
  export * from "./lib/api/index";
4
4
  export * from "./interfaces/Guild";
@@ -19,5 +19,5 @@ export type PartialTransaction = ListTransactionsResponse[number];
19
19
  export type FullTransaction<T = never> = GetTransactionResponse & {
20
20
  metadata: T;
21
21
  };
22
- export type Panel = GetStoreDiscordPanelsResponse[number];
23
- export type PanelProduct = Panel["products"][number];
22
+ export type Catalog = GetStoreCatalogsResponse[number];
23
+ export type CatalogProduct = Catalog["products"][number];