@zennify/sdk-js 1.25.0 → 1.25.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/dist/images.js +1 -1
- package/dist/main.js +1 -5
- package/package.json +1 -1
- package/src/images.ts +4 -1
- package/src/main.ts +2 -5
- package/types/images.d.ts +2 -1
- package/types/main.d.ts +2 -1
package/dist/images.js
CHANGED
package/dist/main.js
CHANGED
|
@@ -36,10 +36,6 @@ class ZennifySDK {
|
|
|
36
36
|
// this.language = options?.language ?? "en_US";
|
|
37
37
|
// this.token = options?.token ?? null;
|
|
38
38
|
}
|
|
39
|
-
media = {
|
|
40
|
-
get_url: async (...options) => {
|
|
41
|
-
return (0, images_1.GetImageURL)(...options)?.replace("zennify.app", this.domain);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
39
|
+
media = { get_url: images_1.GetImageURL };
|
|
44
40
|
}
|
|
45
41
|
exports.ZennifySDK = ZennifySDK;
|
package/package.json
CHANGED
package/src/images.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ZennifySDK } from "./main";
|
|
2
|
+
|
|
1
3
|
const fallbacks = {
|
|
2
4
|
'product_icon': `https://zennify.app/assets/images/emojis/caixa.png`,
|
|
3
5
|
'general': `https://zennify.app/assets/images/icon.png`,
|
|
@@ -9,9 +11,10 @@ const fallbacks = {
|
|
|
9
11
|
type Fallbacks = typeof fallbacks;
|
|
10
12
|
|
|
11
13
|
export function GetImageURL<Fallback extends keyof Fallbacks>(
|
|
14
|
+
this: ZennifySDK,
|
|
12
15
|
fallback: Fallback,
|
|
13
16
|
hash?: string | null
|
|
14
17
|
): Fallbacks[Fallback] | string {
|
|
15
18
|
if (!hash) return fallbacks[fallback];
|
|
16
|
-
else return
|
|
19
|
+
else return `https://cdn.${this.domain}/media/${hash}`
|
|
17
20
|
}
|
package/src/main.ts
CHANGED
|
@@ -30,10 +30,7 @@ export class ZennifySDK {
|
|
|
30
30
|
// this.language = options?.language ?? "en_US";
|
|
31
31
|
// this.token = options?.token ?? null;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return GetImageURL(...options)?.replace("zennify.app", this.domain)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
33
|
+
|
|
34
|
+
media = { get_url: GetImageURL }
|
|
38
35
|
|
|
39
36
|
}
|
package/types/images.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ZennifySDK } from "./main";
|
|
1
2
|
declare const fallbacks: {
|
|
2
3
|
readonly product_icon: "https://zennify.app/assets/images/emojis/caixa.png";
|
|
3
4
|
readonly general: "https://zennify.app/assets/images/icon.png";
|
|
@@ -6,5 +7,5 @@ declare const fallbacks: {
|
|
|
6
7
|
readonly empty: "";
|
|
7
8
|
};
|
|
8
9
|
type Fallbacks = typeof fallbacks;
|
|
9
|
-
export declare function GetImageURL<Fallback extends keyof Fallbacks>(fallback: Fallback, hash?: string | null): Fallbacks[Fallback] | string;
|
|
10
|
+
export declare function GetImageURL<Fallback extends keyof Fallbacks>(this: ZennifySDK, fallback: Fallback, hash?: string | null): Fallbacks[Fallback] | string;
|
|
10
11
|
export {};
|
package/types/main.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GetImageURL } from './images';
|
|
1
2
|
export * from './var';
|
|
2
3
|
export * from './errors';
|
|
3
4
|
export * from './utils';
|
|
@@ -16,6 +17,6 @@ export declare class ZennifySDK {
|
|
|
16
17
|
protected readonly token: string | null;
|
|
17
18
|
constructor(options?: SDKOptions);
|
|
18
19
|
media: {
|
|
19
|
-
get_url:
|
|
20
|
+
get_url: typeof GetImageURL;
|
|
20
21
|
};
|
|
21
22
|
}
|