@smartico/public-api 0.0.247 → 0.0.249
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/Raffle/Raffle.d.ts +2 -0
- package/dist/Raffle/RaffleDrawPublicMeta.d.ts +2 -0
- package/dist/Raffle/RafflePrizeWinner.d.ts +1 -0
- package/dist/index.js +3 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +3 -11
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Raffle/Raffle.ts +3 -0
- package/src/Raffle/RaffleDrawPublicMeta.ts +2 -0
- package/src/Raffle/RafflePrizeWinner.ts +1 -0
- package/src/SmarticoAPI.ts +2 -11
package/package.json
CHANGED
package/src/Raffle/Raffle.ts
CHANGED
|
@@ -10,6 +10,9 @@ interface RafflePublicMeta {
|
|
|
10
10
|
custom_section_id: number;
|
|
11
11
|
/** URL of the image that represents the raffle */
|
|
12
12
|
image_url: string;
|
|
13
|
+
/** URL of the mobile image that represents the raffle */
|
|
14
|
+
image_url_mobile: string;
|
|
15
|
+
|
|
13
16
|
/**
|
|
14
17
|
* Custom data as string or JSON string that can be used in API to build custom UI
|
|
15
18
|
* You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
|
|
@@ -9,6 +9,8 @@ export interface RaffleDrawPublicMeta {
|
|
|
9
9
|
icon_url: string;
|
|
10
10
|
/** URL of the background image that will be used in the draw list item */
|
|
11
11
|
background_image_url: string;
|
|
12
|
+
/** URL of the moible background image that will be used in the draw list item */
|
|
13
|
+
background_image_url_mobile: string;
|
|
12
14
|
/** Show if the draw is grand and is marked as special */
|
|
13
15
|
is_grand: boolean;
|
|
14
16
|
}
|
package/src/SmarticoAPI.ts
CHANGED
|
@@ -245,12 +245,7 @@ class SmarticoAPI {
|
|
|
245
245
|
public static getAvatarUrl(label_api_key: string): string {
|
|
246
246
|
const envId = SmarticoAPI.getEnvDnsSuffix(label_api_key);
|
|
247
247
|
const avatarUrl = AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
248
|
-
|
|
249
|
-
if (envs.includes(envId)) {
|
|
250
|
-
return SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);
|
|
251
|
-
} else {
|
|
252
|
-
return avatarUrl;
|
|
253
|
-
}
|
|
248
|
+
return SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);
|
|
254
249
|
}
|
|
255
250
|
|
|
256
251
|
private async send<T>(message: any, expectCID?: ClassId, force_language?: string): Promise<T> {
|
|
@@ -267,12 +262,8 @@ class SmarticoAPI {
|
|
|
267
262
|
try {
|
|
268
263
|
const timeStart = new Date().getTime();
|
|
269
264
|
result = await this.messageSender(message, this.publicUrl, expectCID);
|
|
265
|
+
result = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);
|
|
270
266
|
const timeEnd = new Date().getTime();
|
|
271
|
-
const envs = ['4', '5', '6', '7'];
|
|
272
|
-
|
|
273
|
-
if (envs.includes(SmarticoAPI.getEnvDnsSuffix(this.label_api_key)) && result) {
|
|
274
|
-
result = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);
|
|
275
|
-
}
|
|
276
267
|
|
|
277
268
|
if (this.logHTTPTiming) {
|
|
278
269
|
this.logger.always('HTTP time, ms:' + (timeEnd - timeStart));
|