@zennify/sdk-js 1.23.2 → 1.24.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/.github/workflows/npm-publish-package-ofc.yml +23 -8
- package/dist/images.js +3 -6
- package/dist/main.js +0 -1
- package/package.json +1 -1
- package/src/images.ts +3 -7
- package/src/interfaces/Panels.ts +2 -2
- package/src/interfaces/Products.ts +4 -4
- package/src/interfaces/Stores.ts +5 -4
- package/src/main.ts +0 -1
- package/types/images.d.ts +1 -1
- package/types/interfaces/Panels.d.ts +2 -2
- package/types/interfaces/Products.d.ts +4 -4
- package/types/interfaces/Stores.d.ts +5 -4
- package/types/main.d.ts +0 -1
- package/dist/interfaces/Media.js +0 -2
- package/src/interfaces/Media.ts +0 -6
- package/types/interfaces/Media.d.ts +0 -6
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
name: Publish to npm (Stable)
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- "package.json"
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
6
12
|
|
|
7
13
|
jobs:
|
|
8
|
-
|
|
14
|
+
create-release:
|
|
9
15
|
runs-on: ubuntu-latest
|
|
10
16
|
steps:
|
|
11
17
|
- uses: actions/checkout@v4
|
|
12
|
-
|
|
18
|
+
|
|
19
|
+
- name: Get current version
|
|
20
|
+
run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
|
|
21
|
+
id: version
|
|
22
|
+
|
|
23
|
+
- name: Create GitHub Release
|
|
24
|
+
uses: softprops/action-gh-release@v2
|
|
13
25
|
with:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
tag_name: ${{ steps.version.outputs.version }}
|
|
27
|
+
name: ${{ steps.version.outputs.version }}
|
|
28
|
+
draft: false
|
|
29
|
+
prerelease: false
|
|
30
|
+
env:
|
|
31
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
17
32
|
|
|
18
33
|
publish-npm:
|
|
19
|
-
|
|
34
|
+
if: "${{ startsWith(github.event.head_commit.message, 'chore: new version') }}"
|
|
20
35
|
runs-on: ubuntu-latest
|
|
21
36
|
permissions:
|
|
22
37
|
contents: read
|
package/dist/images.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetImageURL = GetImageURL;
|
|
4
|
-
const template = `https://cdn.zennify.app/media/{store_id}/{id}.png`;
|
|
5
4
|
const sources = {
|
|
6
5
|
'product_icon': `https://zennify.app/assets/images/emojis/caixa.png`,
|
|
7
6
|
'general': `https://zennify.app/assets/images/icon.png`,
|
|
@@ -9,11 +8,9 @@ const sources = {
|
|
|
9
8
|
'null': null,
|
|
10
9
|
'empty': ""
|
|
11
10
|
};
|
|
12
|
-
function GetImageURL(source,
|
|
13
|
-
if (!
|
|
11
|
+
function GetImageURL(source, hash) {
|
|
12
|
+
if (!hash)
|
|
14
13
|
return sources[source];
|
|
15
14
|
else
|
|
16
|
-
return
|
|
17
|
-
.replace("{store_id}", store_id.toString())
|
|
18
|
-
.replace("{id}", id.toString());
|
|
15
|
+
return "https://cdn.zennify.app/media/" + hash;
|
|
19
16
|
}
|
package/dist/main.js
CHANGED
|
@@ -19,7 +19,6 @@ __exportStar(require("./errors"), exports);
|
|
|
19
19
|
__exportStar(require("./utils"), exports);
|
|
20
20
|
__exportStar(require("./RequestError"), exports);
|
|
21
21
|
__exportStar(require("./images"), exports);
|
|
22
|
-
__exportStar(require("./interfaces/Media"), exports);
|
|
23
22
|
__exportStar(require("./interfaces/Panels"), exports);
|
|
24
23
|
__exportStar(require("./interfaces/Products"), exports);
|
|
25
24
|
__exportStar(require("./interfaces/Guild"), exports);
|
package/package.json
CHANGED
package/src/images.ts
CHANGED
|
@@ -6,7 +6,6 @@ interface ImageSources {
|
|
|
6
6
|
general: string
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const template = `https://cdn.zennify.app/media/{store_id}/{id}.png`
|
|
10
9
|
const sources: Record<keyof ImageSources, ImageSources[keyof ImageSources]> = {
|
|
11
10
|
'product_icon': `https://zennify.app/assets/images/emojis/caixa.png`,
|
|
12
11
|
'general': `https://zennify.app/assets/images/icon.png`,
|
|
@@ -17,11 +16,8 @@ const sources: Record<keyof ImageSources, ImageSources[keyof ImageSources]> = {
|
|
|
17
16
|
|
|
18
17
|
export function GetImageURL<Source extends keyof ImageSources>(
|
|
19
18
|
source: Source,
|
|
20
|
-
|
|
21
|
-
id?: number | null
|
|
19
|
+
hash?: string | null
|
|
22
20
|
): ImageSources[Source] | string {
|
|
23
|
-
if (!
|
|
24
|
-
else return
|
|
25
|
-
.replace("{store_id}", store_id.toString())
|
|
26
|
-
.replace("{id}", id.toString());
|
|
21
|
+
if (!hash) return sources[source] as ImageSources[Source];
|
|
22
|
+
else return "https://cdn.zennify.app/media/" + hash
|
|
27
23
|
}
|
package/src/interfaces/Panels.ts
CHANGED
|
@@ -2,8 +2,8 @@ export interface PartialProduct {
|
|
|
2
2
|
id: number,
|
|
3
3
|
name: string,
|
|
4
4
|
value: number,
|
|
5
|
-
icon_id:
|
|
6
|
-
banner_id:
|
|
5
|
+
icon_id: string | null,
|
|
6
|
+
banner_id: string | null,
|
|
7
7
|
stock_locked: boolean | null,
|
|
8
8
|
stock_count: number
|
|
9
9
|
}
|
|
@@ -14,8 +14,8 @@ export interface Product {
|
|
|
14
14
|
created_at: string,
|
|
15
15
|
store_id: number,
|
|
16
16
|
owner_id: number,
|
|
17
|
-
icon_id?: null |
|
|
18
|
-
banner_id?: null |
|
|
17
|
+
icon_id?: null | string,
|
|
18
|
+
banner_id?: null | string,
|
|
19
19
|
value: number,
|
|
20
20
|
description: {
|
|
21
21
|
short: null | string,
|
package/src/interfaces/Stores.ts
CHANGED
|
@@ -6,8 +6,8 @@ export interface PartialStore {
|
|
|
6
6
|
id: number,
|
|
7
7
|
name: string,
|
|
8
8
|
expires_at: string,
|
|
9
|
-
icon_id?:
|
|
10
|
-
banner_id?:
|
|
9
|
+
icon_id?: string | null,
|
|
10
|
+
banner_id?: string | null,
|
|
11
11
|
pending_setup?: boolean | null
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -17,8 +17,9 @@ export interface FullStore {
|
|
|
17
17
|
created_at: string,
|
|
18
18
|
expires_at: string,
|
|
19
19
|
owner_id: number,
|
|
20
|
-
icon_id:
|
|
21
|
-
banner_id:
|
|
20
|
+
icon_id: string | null,
|
|
21
|
+
banner_id: string | null,
|
|
22
|
+
background_ranking_id: string | null,
|
|
22
23
|
addons: Addons[],
|
|
23
24
|
blocked_banks: string[],
|
|
24
25
|
pending_setup?: boolean | null,
|
package/src/main.ts
CHANGED
package/types/images.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ interface ImageSources {
|
|
|
5
5
|
product_icon: string;
|
|
6
6
|
general: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function GetImageURL<Source extends keyof ImageSources>(source: Source,
|
|
8
|
+
export declare function GetImageURL<Source extends keyof ImageSources>(source: Source, hash?: string | null): ImageSources[Source] | string;
|
|
9
9
|
export {};
|
|
@@ -2,8 +2,8 @@ export interface PartialProduct {
|
|
|
2
2
|
id: number;
|
|
3
3
|
name: string;
|
|
4
4
|
value: number;
|
|
5
|
-
icon_id:
|
|
6
|
-
banner_id:
|
|
5
|
+
icon_id: string | null;
|
|
6
|
+
banner_id: string | null;
|
|
7
7
|
stock_locked: boolean | null;
|
|
8
8
|
stock_count: number;
|
|
9
9
|
}
|
|
@@ -13,8 +13,8 @@ export interface Product {
|
|
|
13
13
|
created_at: string;
|
|
14
14
|
store_id: number;
|
|
15
15
|
owner_id: number;
|
|
16
|
-
icon_id?: null |
|
|
17
|
-
banner_id?: null |
|
|
16
|
+
icon_id?: null | string;
|
|
17
|
+
banner_id?: null | string;
|
|
18
18
|
value: number;
|
|
19
19
|
description: {
|
|
20
20
|
short: null | string;
|
|
@@ -4,8 +4,8 @@ export interface PartialStore {
|
|
|
4
4
|
id: number;
|
|
5
5
|
name: string;
|
|
6
6
|
expires_at: string;
|
|
7
|
-
icon_id?:
|
|
8
|
-
banner_id?:
|
|
7
|
+
icon_id?: string | null;
|
|
8
|
+
banner_id?: string | null;
|
|
9
9
|
pending_setup?: boolean | null;
|
|
10
10
|
}
|
|
11
11
|
export interface FullStore {
|
|
@@ -14,8 +14,9 @@ export interface FullStore {
|
|
|
14
14
|
created_at: string;
|
|
15
15
|
expires_at: string;
|
|
16
16
|
owner_id: number;
|
|
17
|
-
icon_id:
|
|
18
|
-
banner_id:
|
|
17
|
+
icon_id: string | null;
|
|
18
|
+
banner_id: string | null;
|
|
19
|
+
background_ranking_id: string | null;
|
|
19
20
|
addons: Addons[];
|
|
20
21
|
blocked_banks: string[];
|
|
21
22
|
pending_setup?: boolean | null;
|
package/types/main.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export * from './errors';
|
|
|
3
3
|
export * from './utils';
|
|
4
4
|
export * from './RequestError';
|
|
5
5
|
export * from './images';
|
|
6
|
-
export * from './interfaces/Media';
|
|
7
6
|
export * from './interfaces/Panels';
|
|
8
7
|
export * from './interfaces/Products';
|
|
9
8
|
export * from './interfaces/Guild';
|
package/dist/interfaces/Media.js
DELETED
package/src/interfaces/Media.ts
DELETED