@zennify/sdk-js 1.23.2 → 1.24.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.
@@ -1,22 +1,37 @@
1
1
  name: Publish to npm (Stable)
2
2
 
3
3
  on:
4
- release:
5
- types: [published]
4
+ push:
5
+ branches:
6
+ - main
7
+ paths:
8
+ - "package.json"
9
+
10
+ permissions:
11
+ contents: write
6
12
 
7
13
  jobs:
8
- build:
14
+ create-release:
9
15
  runs-on: ubuntu-latest
10
16
  steps:
11
17
  - uses: actions/checkout@v4
12
- - uses: actions/setup-node@v3
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
- node-version: 20
15
- - run: npm ci
16
- - run: npm run build
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
- needs: build
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, store_id, id) {
13
- if (!store_id || !id)
11
+ function GetImageURL(source, hash) {
12
+ if (!hash)
14
13
  return sources[source];
15
14
  else
16
- return template
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zennify/sdk-js",
3
- "version": "1.23.2",
3
+ "version": "1.24.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/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
- store_id?: number | null,
21
- id?: number | null
19
+ hash?: string | null
22
20
  ): ImageSources[Source] | string {
23
- if (!store_id || !id) return sources[source] as ImageSources[Source];
24
- else return template
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
  }
@@ -9,7 +9,7 @@ export interface Panel {
9
9
  name: string,
10
10
  placeholder: string,
11
11
  description: string | null,
12
- icon_id: number | null,
13
- banner_id: number | null,
12
+ icon_id: string | null,
13
+ banner_id: string | null,
14
14
  products: PanelProduct[]
15
15
  }
@@ -2,8 +2,8 @@ export interface PartialProduct {
2
2
  id: number,
3
3
  name: string,
4
4
  value: number,
5
- icon_id: number | null,
6
- banner_id: number | null,
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 | number,
18
- banner_id?: null | number,
17
+ icon_id?: null | string,
18
+ banner_id?: null | string,
19
19
  value: number,
20
20
  description: {
21
21
  short: null | string,
@@ -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: number | null,
21
- banner_id: number | null,
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
@@ -4,7 +4,6 @@ export * from './utils';
4
4
  export * from './RequestError';
5
5
  export * from './images'
6
6
 
7
- export * from './interfaces/Media';
8
7
  export * from './interfaces/Panels';
9
8
  export * from './interfaces/Products';
10
9
  export * from './interfaces/Guild';
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, store_id?: number | null, id?: number | null): ImageSources[Source] | string;
8
+ export declare function GetImageURL<Source extends keyof ImageSources>(source: Source, hash?: string | null): ImageSources[Source] | string;
9
9
  export {};
@@ -8,7 +8,7 @@ export interface Panel {
8
8
  name: string;
9
9
  placeholder: string;
10
10
  description: string | null;
11
- icon_id: number | null;
12
- banner_id: number | null;
11
+ icon_id: string | null;
12
+ banner_id: string | null;
13
13
  products: PanelProduct[];
14
14
  }
@@ -2,8 +2,8 @@ export interface PartialProduct {
2
2
  id: number;
3
3
  name: string;
4
4
  value: number;
5
- icon_id: number | null;
6
- banner_id: number | null;
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 | number;
17
- banner_id?: null | number;
16
+ icon_id?: null | string;
17
+ banner_id?: null | string;
18
18
  value: number;
19
19
  description: {
20
20
  short: null | string;
@@ -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: number | null;
18
- banner_id: number | null;
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';
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- export interface Medium {
2
- id: number,
3
- name: string,
4
- size: number,
5
- mime_type: string,
6
- }
@@ -1,6 +0,0 @@
1
- export interface Medium {
2
- id: number;
3
- name: string;
4
- size: number;
5
- mime_type: string;
6
- }