@smartico/public-api 0.0.242 → 0.0.243

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.242",
3
+ "version": "0.0.243",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/IntUtils.ts CHANGED
@@ -40,7 +40,7 @@ class IntUtils {
40
40
  return str;
41
41
  }
42
42
  }
43
- return str;
43
+ return str || {};
44
44
  };
45
45
 
46
46
  // public static wsTimeToEpoch = (time: string): number => {
@@ -14,7 +14,11 @@ interface JackpotPublicMeta {
14
14
  placeholder1: string;
15
15
  /** custom value of placeholder2 defined by operator and can be used in the HTML templates */
16
16
  placeholder2: string;
17
- /** custom data as string or JSON string that can be used in UIWidget */
17
+ /**
18
+ * Custom data as string or JSON string that can be used in API to build custom UI
19
+ * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
20
+ * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
21
+ */
18
22
  custom_data: string;
19
23
  }
20
24
 
@@ -14,6 +14,10 @@ export interface LevelPublicMeta {
14
14
  dx: number;
15
15
  dy: number;
16
16
  };
17
- /**custom data as string or JSON string that can be used in UIWidget */
17
+ /**
18
+ * Custom data as string or JSON string that can be used in API to build custom UI
19
+ * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
20
+ * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
21
+ */
18
22
  custom_data: string;
19
23
  }
@@ -10,7 +10,11 @@ interface RafflePublicMeta {
10
10
  custom_section_id: number;
11
11
  /** URL of the image that represents the raffle */
12
12
  image_url: string;
13
- /** Custom data as string or JSON string that can be used in UIWidget */
13
+ /**
14
+ * Custom data as string or JSON string that can be used in API to build custom UI
15
+ * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
16
+ * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
17
+ */
14
18
  custom_data: string;
15
19
  }
16
20
 
@@ -851,7 +851,11 @@ export interface TLevel {
851
851
  *
852
852
  */
853
853
  required_level_counter_2: number;
854
- /** The custom data of the Level defined by operator in the BackOffice. Can be a JSON object, string or number */
854
+ /**
855
+ * Custom data as string or JSON string that can be used in API to build custom UI
856
+ * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
857
+ * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
858
+ */
855
859
  custom_data: string;
856
860
  }
857
861
  /**
@@ -54,6 +54,7 @@ import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse
54
54
  import { GetRafflesResponse } from '../Raffle/GetRafflesResponse';
55
55
  import { InboxCategories } from '../Inbox/InboxCategories';
56
56
  import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse } from '../Raffle';
57
+ import { IntUtils } from '../IntUtils';
57
58
 
58
59
  /** @hidden */
59
60
  const CACHE_DATA_SEC = 30;
@@ -951,6 +952,10 @@ export class WSAPI {
951
952
  const _jackpots = await this.api.jackpotGet(null, filter);
952
953
  const _pots = _jackpots.items.map((jp) => jp.pot);
953
954
 
955
+ _jackpots.items.forEach((jp) => {
956
+ jp.jp_public_meta.custom_data = IntUtils.JsonOrText(jp.jp_public_meta.custom_data);
957
+ });
958
+
954
959
  OCache.set(onUpdateContextKey.Pots, _pots, ECacheContext.WSAPI, JACKPOT_POT_CACHE_SEC);
955
960
  return _jackpots.items;
956
961
  },
@@ -241,7 +241,11 @@ export interface TLevel {
241
241
  */
242
242
  required_level_counter_2: number;
243
243
 
244
- /** The custom data of the Level defined by operator in the BackOffice. Can be a JSON object, string or number */
244
+ /**
245
+ * Custom data as string or JSON string that can be used in API to build custom UI
246
+ * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
247
+ * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
248
+ */
245
249
  custom_data: string;
246
250
  }
247
251