@smartico/public-api 0.0.186 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.186",
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
 
@@ -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 */
@@ -494,6 +496,7 @@ export interface TMissionOrBadge {
494
496
  custom_section_id: number;
495
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 */
496
498
  only_in_custom_section: boolean;
499
+
497
500
  /** The custom data of the mission or badge defined by operator. Can be a JSON object, string or number */
498
501
  custom_data: any;
499
502