@zennify/sdk-js 1.30.0 → 1.32.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/dist/images.js +2 -2
- package/package.json +1 -1
- package/src/images.ts +3 -2
- package/src/interfaces/Media.ts +1 -1
- package/types/images.d.ts +1 -1
- package/types/interfaces/Media.d.ts +1 -1
package/dist/images.js
CHANGED
|
@@ -8,9 +8,9 @@ const sources = {
|
|
|
8
8
|
'null': null,
|
|
9
9
|
'empty': ""
|
|
10
10
|
};
|
|
11
|
-
function GetImageURL(source, hash, domain = "zennify.app") {
|
|
11
|
+
function GetImageURL(source, hash, domain = "zennify.app", extension = ".webp") {
|
|
12
12
|
if (!hash)
|
|
13
13
|
return sources[source];
|
|
14
14
|
else
|
|
15
|
-
return `https://cdn.${domain}/media/${hash}`;
|
|
15
|
+
return `https://cdn.${domain}/media/${hash}${extension}`;
|
|
16
16
|
}
|
package/package.json
CHANGED
package/src/images.ts
CHANGED
|
@@ -17,8 +17,9 @@ const sources: Record<keyof ImageSources, ImageSources[keyof ImageSources]> = {
|
|
|
17
17
|
export function GetImageURL<Source extends keyof ImageSources>(
|
|
18
18
|
source: Source,
|
|
19
19
|
hash?: string | null,
|
|
20
|
-
domain: string = "zennify.app"
|
|
20
|
+
domain: string = "zennify.app",
|
|
21
|
+
extension = ".webp"
|
|
21
22
|
): ImageSources[Source] | string {
|
|
22
23
|
if (!hash) return sources[source] as ImageSources[Source];
|
|
23
|
-
else return `https://cdn.${domain}/media/${hash}`;
|
|
24
|
+
else return `https://cdn.${domain}/media/${hash}${extension}`;
|
|
24
25
|
}
|
package/src/interfaces/Media.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type MediaUpdatePayload = {
|
|
2
|
-
store?: ("icon" | "banner" | "
|
|
2
|
+
store?: ("icon" | "banner" | "banner_sale_approved" | "background_ranking")[],
|
|
3
3
|
products?: Record<string | number, ("icon" | "banner")[]>,
|
|
4
4
|
discord_sale_panels?: Record<string | number, ("icon" | "banner")[]>
|
|
5
5
|
}
|
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, hash?: string | null, domain?: string): ImageSources[Source] | string;
|
|
8
|
+
export declare function GetImageURL<Source extends keyof ImageSources>(source: Source, hash?: string | null, domain?: string, extension?: string): ImageSources[Source] | string;
|
|
9
9
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type MediaUpdatePayload = {
|
|
2
|
-
store?: ("icon" | "banner" | "
|
|
2
|
+
store?: ("icon" | "banner" | "banner_sale_approved" | "background_ranking")[];
|
|
3
3
|
products?: Record<string | number, ("icon" | "banner")[]>;
|
|
4
4
|
discord_sale_panels?: Record<string | number, ("icon" | "banner")[]>;
|
|
5
5
|
};
|