@smartico/public-api 0.0.185 → 0.0.187

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.
@@ -109,6 +109,14 @@ Holds time from which mission will become available, for the missions that are t
109
109
 
110
110
  ___
111
111
 
112
+ ### active\_till\_ts
113
+
114
+ • **active\_till\_ts**: `number`
115
+
116
+ Holds time till mission will become unavailable, for the missions that are targeted to be available from specific date/time
117
+
118
+ ___
119
+
112
120
  ### dt\_start
113
121
 
114
122
  • **dt\_start**: `number`
@@ -47,3 +47,19 @@ ___
47
47
  • **is\_claimed**: `boolean`
48
48
 
49
49
  Flag indicating to show whether prize in the mini-game claimed or not
50
+
51
+ ___
52
+
53
+ ### create\_date\_ts
54
+
55
+ • **create\_date\_ts**: `number`
56
+
57
+ Win prize date in milliseconds
58
+
59
+ ___
60
+
61
+ ### acknowledge\_date\_ts
62
+
63
+ • **acknowledge\_date\_ts**: `number`
64
+
65
+ Claim prize date in milliseconds
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.185",
3
+ "version": "0.0.187",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2,21 +2,39 @@ import { TInboxMessageBody } from '../WSAPI/WSAPITypes';
2
2
  import { InboxMessageType } from './InboxMessageType';
3
3
 
4
4
  export interface InboxMessageBody {
5
+ // URL or deep-link that neeed to be executed when user clicks on the message
5
6
  action: string;
7
+ // the body of the message in case it's 'simple' inbox message
6
8
  body: string;
9
+ // type of message, deprecated
7
10
  type: InboxMessageType;
11
+ // image of the icon
8
12
  image: string;
13
+ // title of the message
9
14
  title: string;
15
+ // HTML body of the message in case it's 'rich' inbox message
10
16
  html_body: string;
17
+ // set of the buttons with text on the button and action that could be URL or deep-link
11
18
  additional_buttons?: { inbox_cta_text: string; action: string }[];
19
+ // indicator if the message need to be shown when sent and overlay or it should be shown only in the inbox, when user open 'inbox' interface explicitly
20
+ // default is 'true'
21
+ show_preview?: boolean;
22
+ // duration in seconds for how long to show preview, default is 7 seconds
23
+ show_duration_sec?: number;
12
24
  }
13
25
 
14
26
  export interface InboxMessage {
27
+ // date when the message was created
15
28
  createDate: string;
29
+ // body of the message according to the interface
16
30
  body: InboxMessageBody;
31
+ // unique identifier of the message that connects it to the campaign from which it was sent
17
32
  engagement_uid: string;
33
+ // flag that indicates if the message was read by the user
18
34
  is_read: boolean;
35
+ // flag that indicates if the message was marked as favorite by the user
19
36
  is_starred: boolean;
37
+ // flag that indicates if the message was deleted by the user. Such messages are not returned in the response and property is used only internaly in Smartico
20
38
  is_deleted?: boolean;
21
39
  }
22
40
 
@@ -13,6 +13,8 @@ export interface SAWPrizesHistory {
13
13
  prize_amount: number,
14
14
  client_request_id: string,
15
15
  is_claimed: boolean,
16
+ create_date_ts: number;
17
+ acknowledge_date_ts: number;
16
18
  }
17
19
 
18
20
  export const SAWHistoryTransform = (items: SAWPrizesHistory[]): TSawHistory[] => {
@@ -23,7 +25,9 @@ export const SAWHistoryTransform = (items: SAWPrizesHistory[]): TSawHistory[] =>
23
25
  saw_prize_id: r.saw_prize_id,
24
26
  prize_amount: r.prize_amount,
25
27
  client_request_id: r.client_request_id,
26
- is_claimed: r.is_claimed
28
+ is_claimed: r.is_claimed,
29
+ create_date_ts: r.create_date_ts,
30
+ acknowledge_date_ts: r.acknowledge_date_ts,
27
31
  }
28
32
  return x;
29
33
  })
@@ -30,6 +30,7 @@ export interface UserAchievement {
30
30
  scheduledMissionType?: ScheduledMissionType;
31
31
  related_games?: AchRelatedGame[];
32
32
  active_from_ts?: number; // indicates when 'scheduled' mission is active from,
33
+ active_till_ts?: number; // indicates when 'scheduled' mission is active till,
33
34
  ach_categories?: number[];
34
35
 
35
36
  ach_completed_id?: number; // ID of the completion fact from ach_completed or ach_completed_recurring tables
@@ -63,6 +64,7 @@ export const UserAchievementTransform = (items: UserAchievement[]): TMissionOrBa
63
64
  is_opted_in: r.isOptedIn,
64
65
  time_limit_ms: r.time_limit_ms,
65
66
  active_from_ts: r.active_from_ts,
67
+ active_till_ts: r.active_from_ts,
66
68
  dt_start: r.start_date_ts,
67
69
  reward: r.ach_public_meta.reward,
68
70
  progress: r.progress,
@@ -1,3 +1,4 @@
1
+ import { IntUtils } from '../IntUtils';
1
2
  import { TStoreItem } from '../WSAPI/WSAPITypes';
2
3
  import { StoreItemPublicMeta } from './StoreItemPublicMeta';
3
4
  import { StoreItemType, StoreItemTypeNamed } from './StoreItemType';
@@ -30,6 +31,7 @@ export const StoreItemTransform = (items: StoreItem[]): TStoreItem[] => {
30
31
  can_buy: r.canBuy,
31
32
  category_ids: r.categoryIds ?? [],
32
33
  pool: r.shopPool,
34
+ custom_data: IntUtils.JsonOrText(r.itemPublicMeta.custom_data),
33
35
  };
34
36
  return x;
35
37
  });
@@ -9,4 +9,5 @@ export interface StoreItemPublicMeta {
9
9
  priority: number;
10
10
  related_items: number[];
11
11
  hint_text: string;
12
+ custom_data: string;
12
13
  }
@@ -510,7 +510,7 @@ export class WSAPI {
510
510
  *
511
511
  * **Visitor mode: not supported**
512
512
  */
513
- public async playMiniGame(template_id: number, { onUpdate }: { onUpdate?: (data: TMissionOrBadge[]) => void } = {}): Promise<TMiniGamePlayResult> {
513
+ public async playMiniGame(template_id: number, { onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {}): Promise<TMiniGamePlayResult> {
514
514
 
515
515
  if (onUpdate) {
516
516
  this.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);
@@ -412,6 +412,8 @@ export interface TStoreItem {
412
412
  category_ids: number[];
413
413
  /** Number of items in the pool avaliable for the purchase.*/
414
414
  pool?: number;
415
+ /** The custom data of the store item defined by operator. Can be a JSON object, string or number */
416
+ custom_data: any;
415
417
  /** The T&C text for the store item */
416
418
  hint_text?: string;
417
419
  /** Purchase time to show in purchase history screen */
@@ -471,6 +473,9 @@ export interface TMissionOrBadge {
471
473
 
472
474
  /** Holds time from which mission will become available, for the missions that are targeted to be available from specific date/time */
473
475
  active_from_ts: number;
476
+
477
+ /** Holds time till mission will become unavailable, for the missions that are targeted to be available from specific date/time */
478
+ active_till_ts: number;
474
479
 
475
480
  /** The date when the mission was started, relevant for the time limited missions */
476
481
  dt_start: number;
@@ -491,6 +496,7 @@ export interface TMissionOrBadge {
491
496
  custom_section_id: number;
492
497
  /** The indicator if the mission or badge is visible only in the custom section and should be hidden from the main overview of missions/badges */
493
498
  only_in_custom_section: boolean;
499
+
494
500
  /** The custom data of the mission or badge defined by operator. Can be a JSON object, string or number */
495
501
  custom_data: any;
496
502
 
@@ -775,4 +781,8 @@ export interface TSawHistory {
775
781
  client_request_id: string,
776
782
  /** Flag indicating to show whether prize in the mini-game claimed or not */
777
783
  is_claimed: boolean,
784
+ /** Win prize date in milliseconds */
785
+ create_date_ts: number;
786
+ /** Claimed prize date in milliseconds */
787
+ acknowledge_date_ts: number;
778
788
  }