@zennify/sdk-js 1.0.0-beta.17 → 1.0.0-beta.20
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/dist/images.js +16 -0
- package/dist/main.js +1 -0
- package/package.json +1 -1
- package/src/images.ts +14 -0
- package/src/interfaces/Stores.ts +15 -16
- package/src/main.ts +1 -0
- package/translations/pt_BR.json +4 -4
- package/types/images.d.ts +3 -0
- package/types/interfaces/Stores.d.ts +1 -8
- package/types/main.d.ts +1 -0
package/dist/images.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetImageURL = GetImageURL;
|
|
4
|
+
const template = `https://cdn.zennify.app/media/{store_id}/{id}.png`;
|
|
5
|
+
const sources = {
|
|
6
|
+
'product_icon': `https://zennify.app/assets/images/emojis/caixa.png`,
|
|
7
|
+
'general': `https://zennify.app/assets/images/icon.png`
|
|
8
|
+
};
|
|
9
|
+
function GetImageURL(source, store_id, id) {
|
|
10
|
+
if (!store_id || !id)
|
|
11
|
+
return sources[source];
|
|
12
|
+
else
|
|
13
|
+
return template
|
|
14
|
+
.replace("{store_id}", store_id.toString())
|
|
15
|
+
.replace("{id}", id.toString());
|
|
16
|
+
}
|
package/dist/main.js
CHANGED
|
@@ -18,6 +18,7 @@ __exportStar(require("./var"), exports);
|
|
|
18
18
|
__exportStar(require("./errors"), exports);
|
|
19
19
|
__exportStar(require("./utils"), exports);
|
|
20
20
|
__exportStar(require("./RequestError"), exports);
|
|
21
|
+
__exportStar(require("./images"), exports);
|
|
21
22
|
__exportStar(require("./interfaces/Media"), exports);
|
|
22
23
|
__exportStar(require("./interfaces/Panels"), exports);
|
|
23
24
|
__exportStar(require("./interfaces/Products"), exports);
|
package/package.json
CHANGED
package/src/images.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type ImageSources = 'product_icon' | 'general'
|
|
2
|
+
|
|
3
|
+
const template = `https://cdn.zennify.app/media/{store_id}/{id}.png`
|
|
4
|
+
const sources: Record<ImageSources, string> = {
|
|
5
|
+
'product_icon': `https://zennify.app/assets/images/emojis/caixa.png`,
|
|
6
|
+
'general': `https://zennify.app/assets/images/icon.png`
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function GetImageURL(source: ImageSources, store_id?: number | null, id?: number | null) {
|
|
10
|
+
if (!store_id || !id) return sources[source];
|
|
11
|
+
else return template
|
|
12
|
+
.replace("{store_id}", store_id.toString())
|
|
13
|
+
.replace("{id}", id.toString());
|
|
14
|
+
}
|
package/src/interfaces/Stores.ts
CHANGED
|
@@ -2,14 +2,14 @@ import { DiscordGuild } from "./Guild";
|
|
|
2
2
|
|
|
3
3
|
export type Addons = 'custom_bot' | 'divulgation' | 'antiraid' | 'managed_automod';
|
|
4
4
|
export type Banks = 'Banco Inter S.A.'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
| 'Nu Pagamentos S.A.'
|
|
6
|
+
| 'Picpay Serviços S.A.'
|
|
7
|
+
| 'Mercadopago.com Representações Ltda.'
|
|
8
|
+
| 'Caixa Econômica Federal'
|
|
9
|
+
| 'PagSeguro Internet S.A.'
|
|
10
|
+
| 'Banco do Brasil S.A.'
|
|
11
|
+
| 'Banco Bradesco S.A.'
|
|
12
|
+
| 'Banco Santander (Brasil) S.A.';
|
|
13
13
|
|
|
14
14
|
export interface PartialStore {
|
|
15
15
|
id: number,
|
|
@@ -28,14 +28,13 @@ export interface FullStore {
|
|
|
28
28
|
banner_id: number | null,
|
|
29
29
|
addons: Addons[],
|
|
30
30
|
blocked_banks: Banks[],
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
voice
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
31
|
+
discord_channels: Record<
|
|
32
|
+
string /** guild id */,
|
|
33
|
+
Record<
|
|
34
|
+
'sale' | 'voice' | 'feedback' | 'carts',
|
|
35
|
+
string | null | void /** channel id */
|
|
36
|
+
>
|
|
37
|
+
>,
|
|
39
38
|
discord_bot: {
|
|
40
39
|
id: string,
|
|
41
40
|
app_id: string | null,
|
package/src/main.ts
CHANGED
package/translations/pt_BR.json
CHANGED
|
@@ -176,19 +176,19 @@
|
|
|
176
176
|
"message": "Remova o adicional \"{addon}\"."
|
|
177
177
|
},
|
|
178
178
|
"THIS_SELLER_HAS_NOT_YET_CONFIGURED_RECEIPT_VIA_PIX": {
|
|
179
|
-
"name": "
|
|
179
|
+
"name": "O vendedor não configurou o recebimento via Pix",
|
|
180
180
|
"message": "Escolha outro método ou aguarde a configuração do vendedor."
|
|
181
181
|
},
|
|
182
182
|
"THIS_SELLER_HAS_NOT_YET_CONFIGURED_RECEIPT_VIA_BOLETO": {
|
|
183
|
-
"name": "
|
|
183
|
+
"name": "O vendedor não configurou o recebimento via Boleto",
|
|
184
184
|
"message": "Escolha outro método ou aguarde a configuração do vendedor."
|
|
185
185
|
},
|
|
186
186
|
"THIS_SELLER_HAS_NOT_YET_CONFIGURED_RECEIPT_VIA_CRYPTO": {
|
|
187
|
-
"name": "
|
|
187
|
+
"name": "O vendedor não configurou o recebimento via Cripto",
|
|
188
188
|
"message": "Escolha outro método ou aguarde a configuração do vendedor."
|
|
189
189
|
},
|
|
190
190
|
"THIS_SELLER_HAS_NOT_YET_CONFIGURED_RECEIPT_VIA_VISA": {
|
|
191
|
-
"name": "
|
|
191
|
+
"name": "O vendedor não configurou o recebimento via Visa",
|
|
192
192
|
"message": "Escolha outro método ou aguarde a configuração do vendedor."
|
|
193
193
|
},
|
|
194
194
|
"THIS_COUPON_DOES_NOT_EXISTS": {
|
|
@@ -17,14 +17,7 @@ export interface FullStore {
|
|
|
17
17
|
banner_id: number | null;
|
|
18
18
|
addons: Addons[];
|
|
19
19
|
blocked_banks: Banks[];
|
|
20
|
-
|
|
21
|
-
discord: {
|
|
22
|
-
sale: string | null;
|
|
23
|
-
voice: string | null;
|
|
24
|
-
feedback: string | null;
|
|
25
|
-
carts: string | null;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
20
|
+
discord_channels: Record<string /** guild id */, Record<'sale' | 'voice' | 'feedback' | 'carts', string | null | void /** channel id */>>;
|
|
28
21
|
discord_bot: {
|
|
29
22
|
id: string;
|
|
30
23
|
app_id: string | null;
|
package/types/main.d.ts
CHANGED