@zennify/sdk-js 1.37.6 → 1.38.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/package.json +5 -5
- package/src/interfaces/Products.ts +1 -1
- package/src/interfaces/Statistics.ts +2 -2
- package/src/interfaces/Stores.ts +12 -9
- package/src/interfaces/Transactions.ts +3 -3
- package/types/interfaces/Products.d.ts +1 -1
- package/types/interfaces/Statistics.d.ts +2 -2
- package/types/interfaces/Stores.d.ts +6 -6
- package/types/interfaces/Transactions.d.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zennify/sdk-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "A simple package to work with https://api.zennify.app",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"keywords": [],
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
},
|
|
15
15
|
"types": "./types/main.d.ts",
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@types/node": "^20.
|
|
18
|
-
"discord.js": "^14.
|
|
19
|
-
"typescript": "^5.
|
|
17
|
+
"@types/node": "^20.19.7",
|
|
18
|
+
"discord.js": "^14.21.0",
|
|
19
|
+
"typescript": "^5.8.3"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "tsc"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"undici-types": "^5.
|
|
25
|
+
"undici-types": "^5.28.4"
|
|
26
26
|
},
|
|
27
27
|
"bugs": {
|
|
28
28
|
"url": "https://github.com/zennify-ofc/sdk-js/issues"
|
|
@@ -15,7 +15,7 @@ export type ProductStatistics = {
|
|
|
15
15
|
|
|
16
16
|
export type Statistics = Record<string, Record<number, ProductStatistics>>
|
|
17
17
|
export type StatisticsResponse = {
|
|
18
|
-
last_update:
|
|
19
|
-
created_at:
|
|
18
|
+
last_update: number,
|
|
19
|
+
created_at: number
|
|
20
20
|
statistics: Statistics
|
|
21
21
|
};
|
package/src/interfaces/Stores.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type Addons = 'custom_bot' | 'divulgation' | 'antiraid' | 'managed_automo
|
|
|
5
5
|
export interface PartialStore {
|
|
6
6
|
id: number,
|
|
7
7
|
name: string,
|
|
8
|
-
expires_at:
|
|
8
|
+
expires_at: number,
|
|
9
9
|
icon_id?: string | null,
|
|
10
10
|
banner_id?: string | null,
|
|
11
11
|
pending_setup?: boolean | null,
|
|
@@ -13,23 +13,26 @@ export interface PartialStore {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export type StoreModeratorPermissions =
|
|
16
|
-
| '
|
|
17
|
-
| '
|
|
18
|
-
| '
|
|
19
|
-
| '
|
|
16
|
+
| 'MANAGE_DISCORD_PANELS' // Gerenciar painéis do Discord
|
|
17
|
+
| 'MANAGE_PRODUCTS' // Gerenciar produtos
|
|
18
|
+
| 'MANAGE_COUPONS' // Gerenciar cupons
|
|
19
|
+
| 'MANAGE_STORE' // Gerenciar a loja (Editar bot, nome, imagem, bancos bloqueados) e comandos /customize, /mod, /autorole, /temprole
|
|
20
|
+
| 'MANAGE_SALES' // Gerenciar vendas (Aprovar, cancelar e reembolsar)
|
|
21
|
+
| 'VIEW_STATISTICS' // Ver estatísticas (Acessar a home da dashboard, usar o comando /ranking e ver estatisticas de produtos)
|
|
22
|
+
|
|
20
23
|
|
|
21
24
|
export type StoreModerator = {
|
|
22
25
|
username: string,
|
|
23
26
|
discord_user_id: string | null,
|
|
24
|
-
created_at:
|
|
27
|
+
created_at: number,
|
|
25
28
|
permissions: StoreModeratorPermissions[]
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
export interface FullStore {
|
|
29
32
|
id: number,
|
|
30
33
|
name: string,
|
|
31
|
-
created_at:
|
|
32
|
-
expires_at:
|
|
34
|
+
created_at: number,
|
|
35
|
+
expires_at: number,
|
|
33
36
|
owner_id: number,
|
|
34
37
|
icon_id: string | null,
|
|
35
38
|
banner_id: string | null,
|
|
@@ -63,7 +66,7 @@ export type StoreInvite = {
|
|
|
63
66
|
},
|
|
64
67
|
store: {
|
|
65
68
|
name: string,
|
|
66
|
-
created_at:
|
|
69
|
+
created_at: number
|
|
67
70
|
icon_id?: string | null,
|
|
68
71
|
banner_id?: string | null,
|
|
69
72
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type BaseTransaction<TransactionMetadata = any> = {
|
|
2
2
|
id: string,
|
|
3
|
-
created_at:
|
|
3
|
+
created_at: number,
|
|
4
4
|
entity: 'semiauto' | 'mercadopago',
|
|
5
5
|
method: 'pix',
|
|
6
6
|
managed?: boolean | null,
|
|
@@ -30,7 +30,7 @@ type SaleTransaction = {
|
|
|
30
30
|
type: 'sale',
|
|
31
31
|
order: DiscordOrder & {
|
|
32
32
|
id: string,
|
|
33
|
-
created_at:
|
|
33
|
+
created_at: number,
|
|
34
34
|
discount: number,
|
|
35
35
|
subtotal: number,
|
|
36
36
|
total_value: number,
|
|
@@ -70,6 +70,6 @@ export type FullTransaction<TransactionMetadata = any> = BaseTransaction<Transac
|
|
|
70
70
|
export type PartialTransaction = {
|
|
71
71
|
id: string,
|
|
72
72
|
base_value: number,
|
|
73
|
-
created_at:
|
|
73
|
+
created_at: number,
|
|
74
74
|
status: 'approved' | 'cancelled' | 'expired' | 'pending' | 'refused' | 'rejected' | 'analysis' | 'refunded' | 'refunded_partial'
|
|
75
75
|
}
|
|
@@ -13,7 +13,7 @@ export type ProductStatistics = {
|
|
|
13
13
|
};
|
|
14
14
|
export type Statistics = Record<string, Record<number, ProductStatistics>>;
|
|
15
15
|
export type StatisticsResponse = {
|
|
16
|
-
last_update:
|
|
17
|
-
created_at:
|
|
16
|
+
last_update: number;
|
|
17
|
+
created_at: number;
|
|
18
18
|
statistics: Statistics;
|
|
19
19
|
};
|
|
@@ -3,24 +3,24 @@ export type Addons = 'custom_bot' | 'divulgation' | 'antiraid' | 'managed_automo
|
|
|
3
3
|
export interface PartialStore {
|
|
4
4
|
id: number;
|
|
5
5
|
name: string;
|
|
6
|
-
expires_at:
|
|
6
|
+
expires_at: number;
|
|
7
7
|
icon_id?: string | null;
|
|
8
8
|
banner_id?: string | null;
|
|
9
9
|
pending_setup?: boolean | null;
|
|
10
10
|
is_owner: boolean;
|
|
11
11
|
}
|
|
12
|
-
export type StoreModeratorPermissions = '
|
|
12
|
+
export type StoreModeratorPermissions = 'MANAGE_DISCORD_PANELS' | 'MANAGE_PRODUCTS' | 'MANAGE_COUPONS' | 'MANAGE_STORE' | 'MANAGE_SALES' | 'VIEW_STATISTICS';
|
|
13
13
|
export type StoreModerator = {
|
|
14
14
|
username: string;
|
|
15
15
|
discord_user_id: string | null;
|
|
16
|
-
created_at:
|
|
16
|
+
created_at: number;
|
|
17
17
|
permissions: StoreModeratorPermissions[];
|
|
18
18
|
};
|
|
19
19
|
export interface FullStore {
|
|
20
20
|
id: number;
|
|
21
21
|
name: string;
|
|
22
|
-
created_at:
|
|
23
|
-
expires_at:
|
|
22
|
+
created_at: number;
|
|
23
|
+
expires_at: number;
|
|
24
24
|
owner_id: number;
|
|
25
25
|
icon_id: string | null;
|
|
26
26
|
banner_id: string | null;
|
|
@@ -47,7 +47,7 @@ export type StoreInvite = {
|
|
|
47
47
|
};
|
|
48
48
|
store: {
|
|
49
49
|
name: string;
|
|
50
|
-
created_at:
|
|
50
|
+
created_at: number;
|
|
51
51
|
icon_id?: string | null;
|
|
52
52
|
banner_id?: string | null;
|
|
53
53
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type BaseTransaction<TransactionMetadata = any> = {
|
|
2
2
|
id: string;
|
|
3
|
-
created_at:
|
|
3
|
+
created_at: number;
|
|
4
4
|
entity: 'semiauto' | 'mercadopago';
|
|
5
5
|
method: 'pix';
|
|
6
6
|
managed?: boolean | null;
|
|
@@ -28,7 +28,7 @@ type SaleTransaction = {
|
|
|
28
28
|
type: 'sale';
|
|
29
29
|
order: DiscordOrder & {
|
|
30
30
|
id: string;
|
|
31
|
-
created_at:
|
|
31
|
+
created_at: number;
|
|
32
32
|
discount: number;
|
|
33
33
|
subtotal: number;
|
|
34
34
|
total_value: number;
|
|
@@ -67,7 +67,7 @@ export type FullTransaction<TransactionMetadata = any> = BaseTransaction<Transac
|
|
|
67
67
|
export type PartialTransaction = {
|
|
68
68
|
id: string;
|
|
69
69
|
base_value: number;
|
|
70
|
-
created_at:
|
|
70
|
+
created_at: number;
|
|
71
71
|
status: 'approved' | 'cancelled' | 'expired' | 'pending' | 'refused' | 'rejected' | 'analysis' | 'refunded' | 'refunded_partial';
|
|
72
72
|
};
|
|
73
73
|
export {};
|