@smartico/public-api 0.0.311 → 0.0.313

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.
@@ -17,6 +17,7 @@ export interface InboxMessageBody {
17
17
  show_duration_sec?: number;
18
18
  enable_zoom_mode?: boolean;
19
19
  open_links?: OpenLinksType;
20
+ custom_data?: string;
20
21
  }
21
22
  export interface InboxMessage {
22
23
  createDate: string;
@@ -26,5 +27,6 @@ export interface InboxMessage {
26
27
  is_starred: boolean;
27
28
  is_deleted?: boolean;
28
29
  category_id?: InboxCategories;
30
+ expire_on_dt?: number;
29
31
  }
30
32
  export declare const InboxMessageBodyTransform: (item: InboxMessageBody) => TInboxMessageBody;
@@ -1,5 +1,6 @@
1
1
  import { AchievementTaskPublicMeta } from './AchievementTaskPublicMeta';
2
2
  import { AchievementTaskType } from './AchievementTaskType';
3
+ import { AffectsProgress } from './UserAchievementTaskAffectsProgress';
3
4
  export interface UserAchievementTask {
4
5
  task_id?: number;
5
6
  task_public_meta?: AchievementTaskPublicMeta;
@@ -13,8 +14,7 @@ export interface UserAchievementTask {
13
14
  unlocked_by_mission_id?: number;
14
15
  unlocked_by_level_id?: number;
15
16
  user_state_params?: {
16
- map: {
17
- [key: string]: any;
18
- };
17
+ [key: string]: any;
19
18
  };
19
+ affects_progress?: AffectsProgress | null;
20
20
  }
@@ -0,0 +1,6 @@
1
+ export interface AffectsProgress {
2
+ affects_level: boolean;
3
+ affects_leaderboard: boolean;
4
+ affects_current_balance: boolean;
5
+ rewardPoints: number;
6
+ }
@@ -21,3 +21,4 @@ export * from './AchievementAvailabilityStatus';
21
21
  export * from './GetRelatedAchTourResponse';
22
22
  export * from './MissionsUtils';
23
23
  export * from './MissionCategory';
24
+ export * from './UserAchievementTaskAffectsProgress';
@@ -709,6 +709,8 @@ export interface TInboxMessage {
709
709
  favorite: boolean;
710
710
  /** Category id per inbox message, can be part of System inboxes, Personal inboxes or General inbox messages */
711
711
  category_id?: InboxCategories;
712
+ /** The epoch timestamp, with milliseconds, when the message is going to be expired */
713
+ expire_on_dt?: number;
712
714
  }
713
715
  export interface TInboxMessageBody {
714
716
  /** Message title */
@@ -732,6 +734,8 @@ export interface TInboxMessageBody {
732
734
  /** Button text */
733
735
  text: string;
734
736
  }[];
737
+ /** The custom data of the inbox message defined by operator. Can be a JSON object, string or number */
738
+ custom_data?: string;
735
739
  }
736
740
  export interface InboxMarkMessageAction {
737
741
  /** An error code representing the result of marking a message as deleted, favorite or read. Successful marking action if err_code is 0 */
package/dist/index.js CHANGED
@@ -832,7 +832,8 @@ var InboxMessagesTransform = function InboxMessagesTransform(items) {
832
832
  message_guid: item.engagement_uid,
833
833
  read: item.is_read,
834
834
  favorite: item.is_starred,
835
- category_id: item.category_id
835
+ category_id: item.category_id,
836
+ expire_on_dt: item.expire_on_dt
836
837
  };
837
838
  return x;
838
839
  });
@@ -855,6 +856,7 @@ var InboxMessageBodyTransform = function InboxMessageBodyTransform(item) {
855
856
  });
856
857
  }
857
858
  x.html_body = (item == null ? void 0 : item.html_body) || null;
859
+ x.custom_data = IntUtils.JsonOrText(item == null ? void 0 : item.custom_data);
858
860
  }
859
861
  return x;
860
862
  };
@@ -1278,11 +1280,11 @@ MissionUtils.getMs = function (ts) {
1278
1280
  return new Date(ts).getTime();
1279
1281
  };
1280
1282
  MissionUtils.replaceFavGameNameTag = function (task) {
1281
- var _task$user_state_para, _task$task_public_met;
1283
+ var _task$task_public_met;
1282
1284
  if (!task) {
1283
1285
  return task;
1284
1286
  }
1285
- var userStateParams = ((_task$user_state_para = task.user_state_params) == null ? void 0 : _task$user_state_para.map) || {};
1287
+ var userStateParams = task.user_state_params || {};
1286
1288
  var userStateOperator = (_task$task_public_met = task.task_public_meta) == null ? void 0 : _task$task_public_met.user_state_operations;
1287
1289
  var userStateParamsKeys = Object.keys(userStateParams);
1288
1290
  if (userStateParamsKeys.length === 0 || !userStateOperator) {
@@ -1297,7 +1299,10 @@ MissionUtils.replaceFavGameNameTag = function (task) {
1297
1299
  if (operatorsMulti.includes(operator)) {
1298
1300
  var value = userStateParams[k];
1299
1301
  if (value && value.length > 0) {
1300
- replacementValue = value.join(' ,');
1302
+ replacementValue = value.map(function (v) {
1303
+ var cleaned = v.replace(/_/g, ' ').toLowerCase();
1304
+ return cleaned.charAt(0).toUpperCase() + cleaned.slice(1);
1305
+ }).join(' ,');
1301
1306
  }
1302
1307
  }
1303
1308
  if (operatorsPos.includes(operator)) {
@@ -1305,6 +1310,10 @@ MissionUtils.replaceFavGameNameTag = function (task) {
1305
1310
  var pos = Number(operator.replace('pos', '')) - 1;
1306
1311
  if (IntUtils.isNotNull(pos) && _value && _value[pos]) {
1307
1312
  replacementValue = _value[pos];
1313
+ if (replacementValue) {
1314
+ replacementValue = replacementValue.replace('_', ' ').toLowerCase();
1315
+ replacementValue = replacementValue.charAt(0).toUpperCase() + replacementValue.slice(1);
1316
+ }
1308
1317
  }
1309
1318
  }
1310
1319
  });