@zennify/sdk-js 2.1.0 → 2.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zennify/sdk-js",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "A simple package to work with https://api.zennify.app",
5
5
  "main": "dist/main.js",
6
6
  "keywords": [],
@@ -1844,19 +1844,19 @@ export type CreateStoreRenewOrderResponse =
1844
1844
  export type DeleteStoreMediaData = {
1845
1845
  body?: {
1846
1846
  store?: Array<
1847
- "banner" | "icon" | "background_ranking" | "banner_sale_approved"
1847
+ "icon" | "banner" | "background_ranking" | "banner_sale_approved"
1848
1848
  >;
1849
1849
  /**
1850
1850
  * Construct a type with a set of properties K of type T
1851
1851
  */
1852
1852
  products?: {
1853
- [key: string]: Array<"banner" | "icon">;
1853
+ [key: string]: Array<"icon" | "banner">;
1854
1854
  };
1855
1855
  /**
1856
1856
  * Construct a type with a set of properties K of type T
1857
1857
  */
1858
1858
  discord_sale_panels?: {
1859
- [key: string]: Array<"banner" | "icon">;
1859
+ [key: string]: Array<"icon" | "banner">;
1860
1860
  };
1861
1861
  };
1862
1862
  path: {
@@ -1911,19 +1911,19 @@ export type UploadStoreMediaData = {
1911
1911
  file: Blob | File;
1912
1912
  set: {
1913
1913
  store?: Array<
1914
- "banner" | "icon" | "background_ranking" | "banner_sale_approved"
1914
+ "icon" | "banner" | "background_ranking" | "banner_sale_approved"
1915
1915
  >;
1916
1916
  /**
1917
1917
  * Construct a type with a set of properties K of type T
1918
1918
  */
1919
1919
  products?: {
1920
- [key: string]: Array<"banner" | "icon">;
1920
+ [key: string]: Array<"icon" | "banner">;
1921
1921
  };
1922
1922
  /**
1923
1923
  * Construct a type with a set of properties K of type T
1924
1924
  */
1925
1925
  discord_sale_panels?: {
1926
- [key: string]: Array<"banner" | "icon">;
1926
+ [key: string]: Array<"icon" | "banner">;
1927
1927
  };
1928
1928
  };
1929
1929
  };
@@ -2345,8 +2345,8 @@ export type GetStoreResponses = {
2345
2345
  */
2346
2346
  moderators: {
2347
2347
  [key: string]: {
2348
- discord_user_id: string;
2349
2348
  username: string;
2349
+ discord_user_id: string;
2350
2350
  permissions: Array<
2351
2351
  | "MANAGE_DISCORD_PANELS"
2352
2352
  | "MANAGE_PRODUCTS"
@@ -2570,6 +2570,7 @@ export type ListTransactionsResponses = {
2570
2570
  200: Array<{
2571
2571
  id: string;
2572
2572
  base_value: number;
2573
+ type: "sale" | "transfer" | "withdraw" | "deposit";
2573
2574
  value: number;
2574
2575
  created_at: number;
2575
2576
  status:
@@ -2616,23 +2617,24 @@ export type GetTransactionResponses = {
2616
2617
  * Transaction returned successfully.
2617
2618
  */
2618
2619
  200: {
2619
- id: string;
2620
- created_at: number;
2621
2620
  value: number;
2621
+ id: string;
2622
2622
  status:
2623
+ | "approved"
2623
2624
  | "pending"
2625
+ | "cancelled"
2626
+ | "refunded"
2624
2627
  | "inactive"
2625
2628
  | "invalid-pix-key"
2626
- | "approved"
2627
- | "cancelled"
2628
2629
  | "expired"
2629
2630
  | "refused"
2630
- | "refunded"
2631
2631
  | "analysis";
2632
2632
  method: "pix" | "boleto";
2633
+ created_at: number;
2634
+ type: "sale" | "transfer" | "deposit" | "withdraw";
2633
2635
  expires_at: number;
2634
- type: "transfer" | "withdraw" | "sale" | "deposit";
2635
2636
  entity: "mercadopago" | "semiauto" | "efi" | "wallet-efi";
2637
+ metadata?: unknown;
2636
2638
  managed?: null | boolean;
2637
2639
  base_value: number;
2638
2640
  refunded_value: number;
@@ -2655,7 +2657,6 @@ export type GetTransactionResponses = {
2655
2657
  pix_e2eid?: null | string;
2656
2658
  pix_qrcode?: null | string;
2657
2659
  payer_bank?: null | string;
2658
- metadata?: unknown;
2659
2660
  order: {
2660
2661
  id: string;
2661
2662
  platform: "discord" | "website" | "marketplace" | "whatsapp" | "telegram";
@@ -2674,15 +2675,15 @@ export type GetTransactionResponses = {
2674
2675
  */
2675
2676
  payer: {
2676
2677
  id: number;
2677
- discord_user_id: string;
2678
2678
  username: string;
2679
+ discord_user_id: string;
2679
2680
  };
2680
2681
  /**
2681
2682
  * From T, pick a set of properties whose keys are in the union K
2682
2683
  */
2683
2684
  store: {
2684
- id: number;
2685
2685
  name: string;
2686
+ id: number;
2686
2687
  icon_id?: null | string;
2687
2688
  banner_id?: null | string;
2688
2689
  };
@@ -2691,15 +2692,15 @@ export type GetTransactionResponses = {
2691
2692
  */
2692
2693
  seller: {
2693
2694
  id: number;
2694
- discord_user_id: string;
2695
2695
  username: string;
2696
+ discord_user_id: string;
2696
2697
  };
2697
2698
  products: Array<{
2698
- id: number;
2699
+ value: number;
2699
2700
  name: string;
2701
+ id: number;
2700
2702
  icon_id?: null | string;
2701
2703
  banner_id?: null | string;
2702
- value: number;
2703
2704
  short_description?: null | string;
2704
2705
  discord_description?: null | string;
2705
2706
  website_description?: null | string;
@@ -2993,7 +2994,7 @@ export type GetUserResponses = {
2993
2994
  discord?: string;
2994
2995
  };
2995
2996
  legal: {
2996
- status?: "pending" | "approved" | "rejected";
2997
+ status?: "approved" | "pending" | "rejected";
2997
2998
  type?: "cpf" | "cnpj";
2998
2999
  rejectedReason?: string;
2999
3000
  };
package/src/main.ts CHANGED
@@ -16,9 +16,12 @@ export * from "./lib/api/index";
16
16
 
17
17
  export * from "./interfaces/Guild";
18
18
 
19
+ // Utilidades
20
+ type Body<T extends { body?: unknown }> = NonNullable<T["body"]>;
21
+
19
22
  // Usuários, media, tipos gerais
20
23
  export type ZennifyUser = GetUserResponse;
21
- export type MediaUpdatePayload = UploadStoreMediaData;
24
+ export type MediaUpdatePayload = Body<UploadStoreMediaData>;
22
25
 
23
26
  // Stores
24
27
  export type PartialStore = GetStoresResponse[number];
@@ -1640,18 +1640,18 @@ export type CreateStoreRenewOrderResponses = {
1640
1640
  export type CreateStoreRenewOrderResponse = CreateStoreRenewOrderResponses[keyof CreateStoreRenewOrderResponses];
1641
1641
  export type DeleteStoreMediaData = {
1642
1642
  body?: {
1643
- store?: Array<"banner" | "icon" | "background_ranking" | "banner_sale_approved">;
1643
+ store?: Array<"icon" | "banner" | "background_ranking" | "banner_sale_approved">;
1644
1644
  /**
1645
1645
  * Construct a type with a set of properties K of type T
1646
1646
  */
1647
1647
  products?: {
1648
- [key: string]: Array<"banner" | "icon">;
1648
+ [key: string]: Array<"icon" | "banner">;
1649
1649
  };
1650
1650
  /**
1651
1651
  * Construct a type with a set of properties K of type T
1652
1652
  */
1653
1653
  discord_sale_panels?: {
1654
- [key: string]: Array<"banner" | "icon">;
1654
+ [key: string]: Array<"icon" | "banner">;
1655
1655
  };
1656
1656
  };
1657
1657
  path: {
@@ -1698,18 +1698,18 @@ export type UploadStoreMediaData = {
1698
1698
  body?: {
1699
1699
  file: Blob | File;
1700
1700
  set: {
1701
- store?: Array<"banner" | "icon" | "background_ranking" | "banner_sale_approved">;
1701
+ store?: Array<"icon" | "banner" | "background_ranking" | "banner_sale_approved">;
1702
1702
  /**
1703
1703
  * Construct a type with a set of properties K of type T
1704
1704
  */
1705
1705
  products?: {
1706
- [key: string]: Array<"banner" | "icon">;
1706
+ [key: string]: Array<"icon" | "banner">;
1707
1707
  };
1708
1708
  /**
1709
1709
  * Construct a type with a set of properties K of type T
1710
1710
  */
1711
1711
  discord_sale_panels?: {
1712
- [key: string]: Array<"banner" | "icon">;
1712
+ [key: string]: Array<"icon" | "banner">;
1713
1713
  };
1714
1714
  };
1715
1715
  };
@@ -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
  };
@@ -2259,6 +2259,7 @@ export type ListTransactionsResponses = {
2259
2259
  200: Array<{
2260
2260
  id: string;
2261
2261
  base_value: number;
2262
+ type: "sale" | "transfer" | "withdraw" | "deposit";
2262
2263
  value: number;
2263
2264
  created_at: number;
2264
2265
  status: "inactive" | "invalid-pix-key" | "pending" | "approved" | "cancelled" | "expired" | "refused" | "refunded" | "analysis";
@@ -2289,14 +2290,15 @@ export type GetTransactionResponses = {
2289
2290
  * Transaction returned successfully.
2290
2291
  */
2291
2292
  200: {
2292
- id: string;
2293
- created_at: number;
2294
2293
  value: number;
2295
- status: "pending" | "inactive" | "invalid-pix-key" | "approved" | "cancelled" | "expired" | "refused" | "refunded" | "analysis";
2294
+ id: string;
2295
+ status: "approved" | "pending" | "cancelled" | "refunded" | "inactive" | "invalid-pix-key" | "expired" | "refused" | "analysis";
2296
2296
  method: "pix" | "boleto";
2297
+ created_at: number;
2298
+ type: "sale" | "transfer" | "deposit" | "withdraw";
2297
2299
  expires_at: number;
2298
- type: "transfer" | "withdraw" | "sale" | "deposit";
2299
2300
  entity: "mercadopago" | "semiauto" | "efi" | "wallet-efi";
2301
+ metadata?: unknown;
2300
2302
  managed?: null | boolean;
2301
2303
  base_value: number;
2302
2304
  refunded_value: number;
@@ -2306,7 +2308,6 @@ export type GetTransactionResponses = {
2306
2308
  pix_e2eid?: null | string;
2307
2309
  pix_qrcode?: null | string;
2308
2310
  payer_bank?: null | string;
2309
- metadata?: unknown;
2310
2311
  order: {
2311
2312
  id: string;
2312
2313
  platform: "discord" | "website" | "marketplace" | "whatsapp" | "telegram";
@@ -2325,15 +2326,15 @@ export type GetTransactionResponses = {
2325
2326
  */
2326
2327
  payer: {
2327
2328
  id: number;
2328
- discord_user_id: string;
2329
2329
  username: string;
2330
+ discord_user_id: string;
2330
2331
  };
2331
2332
  /**
2332
2333
  * From T, pick a set of properties whose keys are in the union K
2333
2334
  */
2334
2335
  store: {
2335
- id: number;
2336
2336
  name: string;
2337
+ id: number;
2337
2338
  icon_id?: null | string;
2338
2339
  banner_id?: null | string;
2339
2340
  };
@@ -2342,15 +2343,15 @@ export type GetTransactionResponses = {
2342
2343
  */
2343
2344
  seller: {
2344
2345
  id: number;
2345
- discord_user_id: string;
2346
2346
  username: string;
2347
+ discord_user_id: string;
2347
2348
  };
2348
2349
  products: Array<{
2349
- id: number;
2350
+ value: number;
2350
2351
  name: string;
2352
+ id: number;
2351
2353
  icon_id?: null | string;
2352
2354
  banner_id?: null | string;
2353
- value: number;
2354
2355
  short_description?: null | string;
2355
2356
  discord_description?: null | string;
2356
2357
  website_description?: null | string;
@@ -2618,7 +2619,7 @@ export type GetUserResponses = {
2618
2619
  discord?: string;
2619
2620
  };
2620
2621
  legal: {
2621
- status?: "pending" | "approved" | "rejected";
2622
+ status?: "approved" | "pending" | "rejected";
2622
2623
  type?: "cpf" | "cnpj";
2623
2624
  rejectedReason?: string;
2624
2625
  };
package/types/main.d.ts CHANGED
@@ -2,8 +2,11 @@ import { GetStoreDiscordPanelsResponse, GetStoreProductResponse, GetStoreProduct
2
2
  export * from "./images";
3
3
  export * from "./lib/api/index";
4
4
  export * from "./interfaces/Guild";
5
+ type Body<T extends {
6
+ body?: unknown;
7
+ }> = NonNullable<T["body"]>;
5
8
  export type ZennifyUser = GetUserResponse;
6
- export type MediaUpdatePayload = UploadStoreMediaData;
9
+ export type MediaUpdatePayload = Body<UploadStoreMediaData>;
7
10
  export type PartialStore = GetStoresResponse[number];
8
11
  export type FullStore = GetStoreResponse;
9
12
  export type StoreModerator = FullStore["moderators"][number];