@zennify/sdk-js 2.0.2 → 2.1.1

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.0.2",
3
+ "version": "2.1.1",
4
4
  "description": "A simple package to work with https://api.zennify.app",
5
5
  "main": "dist/main.js",
6
6
  "keywords": [],
package/src/main.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  GetStoreDiscordPanelsResponse,
3
3
  GetStoreProductResponse,
4
+ GetStoreProductStockResponse,
4
5
  GetStoreResponse,
5
6
  GetStoresResponse,
6
7
  GetTransactionResponse,
@@ -15,9 +16,12 @@ export * from "./lib/api/index";
15
16
 
16
17
  export * from "./interfaces/Guild";
17
18
 
19
+ // Utilidades
20
+ type Body<T extends { body?: unknown }> = NonNullable<T["body"]>;
21
+
18
22
  // Usuários, media, tipos gerais
19
23
  export type ZennifyUser = GetUserResponse;
20
- export type MediaUpdatePayload = UploadStoreMediaData;
24
+ export type MediaUpdatePayload = Body<UploadStoreMediaData>;
21
25
 
22
26
  // Stores
23
27
  export type PartialStore = GetStoresResponse[number];
@@ -29,6 +33,7 @@ export type StoreModeratorPermissions = StoreModerator["permissions"][number];
29
33
  // Produtos
30
34
  export type PartialProduct = ListStoreProductsResponse[number];
31
35
  export type Product = GetStoreProductResponse;
36
+ export type ProductStock = GetStoreProductStockResponse[number];
32
37
 
33
38
  // Transações
34
39
  export type TransactionStatus = FullTransaction["status"];
package/types/main.d.ts CHANGED
@@ -1,15 +1,19 @@
1
- import { GetStoreDiscordPanelsResponse, GetStoreProductResponse, GetStoreResponse, GetStoresResponse, GetTransactionResponse, GetUserResponse, ListStoreProductsResponse, ListTransactionsResponse, UploadStoreMediaData } from "./lib/api";
1
+ import { GetStoreDiscordPanelsResponse, 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";
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];
10
13
  export type StoreModeratorPermissions = StoreModerator["permissions"][number];
11
14
  export type PartialProduct = ListStoreProductsResponse[number];
12
15
  export type Product = GetStoreProductResponse;
16
+ export type ProductStock = GetStoreProductStockResponse[number];
13
17
  export type TransactionStatus = FullTransaction["status"];
14
18
  export type PartialTransaction = ListTransactionsResponse[number];
15
19
  export type FullTransaction<T = never> = GetTransactionResponse & {