@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.247",
3
+ "version": "0.0.249",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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
  }
@@ -7,6 +7,7 @@ interface RafflePrizeWinner {
7
7
  avatar_url?: string;
8
8
  ticket: RaffleTicket;
9
9
  raf_won_id: number;
10
+ claimed_date: number
10
11
  }
11
12
 
12
13
  export { RafflePrizeWinner }
@@ -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
- const envs = ['4', '5', '6', '7'];
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));