@smartico/public-api 0.0.237 → 0.0.239

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.
@@ -129,6 +129,8 @@ var ClassId;
129
129
  ClassId[ClassId["RAF_GET_DRAW_RUN_RESPONSE"] = 905] = "RAF_GET_DRAW_RUN_RESPONSE";
130
130
  ClassId[ClassId["RAF_GET_DRAW_HISTORY_REQUEST"] = 906] = "RAF_GET_DRAW_HISTORY_REQUEST";
131
131
  ClassId[ClassId["RAF_GET_DRAW_HISTORY_RESPONSE"] = 907] = "RAF_GET_DRAW_HISTORY_RESPONSE";
132
+ ClassId[ClassId["RAF_CLAIM_PRIZE_REQUEST"] = 908] = "RAF_CLAIM_PRIZE_REQUEST";
133
+ ClassId[ClassId["RAF_CLAIM_PRIZE_RESPONSE"] = 909] = "RAF_CLAIM_PRIZE_RESPONSE";
132
134
  /*
133
135
  RAF_GET_TICKETS_REQUEST = 902,
134
136
  RAF_GET_TICKETS_RESPONSE = 903,
@@ -2447,22 +2449,29 @@ var AchOverviewMissionsFilter;
2447
2449
  AchOverviewMissionsFilter[AchOverviewMissionsFilter["ALL_EXCEPT_COMPLETED_AND_LOCKED"] = 5] = "ALL_EXCEPT_COMPLETED_AND_LOCKED";
2448
2450
  })(AchOverviewMissionsFilter || (AchOverviewMissionsFilter = {}));
2449
2451
 
2450
- const UICustomSectionTransform = items => {
2451
- return items.filter(r => r.section_type_id !== undefined && r.section_type_id >= 1).map(r => {
2452
- const x = {
2453
- body: r.body,
2454
- menu_img: r.menu_img,
2455
- menu_name: r.menu_name,
2456
- section_type_id: r.section_type_id,
2457
- custom_skin_images: r.custom_skin_images,
2458
- generic_custom_css: r.generic_custom_css,
2459
- mission_tabs_options: r.mission_tabs_options,
2460
- overview_missions_count: r.overview_missions_count,
2461
- overview_missions_filter: r.overview_missions_filter,
2462
- theme: r.theme
2463
- };
2464
- return x;
2452
+ const UICustomSectionTransform = response => {
2453
+ const items = [];
2454
+ Object.keys(response.customSections).forEach(key => {
2455
+ const r = response.customSections[key];
2456
+ const id = parseInt(key);
2457
+ if (r.section_type_id !== undefined && r.section_type_id >= 1) {
2458
+ const x = {
2459
+ id: id,
2460
+ body: r.body,
2461
+ menu_img: r.menu_img,
2462
+ menu_name: r.menu_name,
2463
+ section_type_id: r.section_type_id,
2464
+ custom_skin_images: r.custom_skin_images,
2465
+ generic_custom_css: r.generic_custom_css,
2466
+ mission_tabs_options: r.mission_tabs_options,
2467
+ overview_missions_count: r.overview_missions_count,
2468
+ overview_missions_filter: r.overview_missions_filter,
2469
+ theme: r.theme
2470
+ };
2471
+ items.push(x);
2472
+ }
2465
2473
  });
2474
+ return items;
2466
2475
  };
2467
2476
 
2468
2477
  const BonusItemsTransform = items => {
@@ -2574,7 +2583,8 @@ class SmarticoAPI {
2574
2583
  static getAvatarUrl(label_api_key) {
2575
2584
  const envId = SmarticoAPI.getEnvDnsSuffix(label_api_key);
2576
2585
  const avatarUrl = AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
2577
- if (envId === '4') {
2586
+ const envs = ['4', '5', '6', '7'];
2587
+ if (envs.includes(envId)) {
2578
2588
  return SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);
2579
2589
  } else {
2580
2590
  return avatarUrl;
@@ -2592,7 +2602,8 @@ class SmarticoAPI {
2592
2602
  const timeStart = new Date().getTime();
2593
2603
  result = await this.messageSender(message, this.publicUrl, expectCID);
2594
2604
  const timeEnd = new Date().getTime();
2595
- if (SmarticoAPI.getEnvDnsSuffix(this.label_api_key) === '4' && result) {
2605
+ const envs = ['4', '5', '6', '7'];
2606
+ if (envs.includes(SmarticoAPI.getEnvDnsSuffix(this.label_api_key)) && result) {
2596
2607
  result = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);
2597
2608
  }
2598
2609
  if (this.logHTTPTiming) {
@@ -3047,7 +3058,7 @@ class SmarticoAPI {
3047
3058
  return await this.send(message, ClassId.GET_CUSTOM_SECTIONS_RESPONSE);
3048
3059
  }
3049
3060
  async getCustomSectionsT(user_ext_id) {
3050
- return UICustomSectionTransform(Object.values((await this.getCustomSections(user_ext_id)).customSections));
3061
+ return UICustomSectionTransform(await this.getCustomSections(user_ext_id));
3051
3062
  }
3052
3063
  async getTranslationsT(user_ext_id, lang_code, areas, cacheSec = 60) {
3053
3064
  return await this.coreGetTranslations(user_ext_id, lang_code, areas, 30);