@smartico/public-api 0.0.119 → 0.0.120

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.
@@ -79,4 +79,4 @@ ___
79
79
 
80
80
  • **custom\_data**: `string`
81
81
 
82
- The custom data of the mini-game defined by operator. Can be a JSON object, string or number
82
+ The custom data of the Level defined by operator in the BackOffice. Can be a JSON object, string or number
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.119",
3
+ "version": "0.0.120",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -75,6 +75,9 @@ export enum ClassId {
75
75
  GET_ACH_CATEGORIES_REQUEST = 537,
76
76
  GET_ACH_CATEGORIES_RESPONSE = 538,
77
77
 
78
+ ACHIEVEMENT_CLAIM_PRIZE_REQUEST = 539,
79
+ ACHIEVEMENT_CLAIM_PRIZE_RESPONSE = 540,
80
+
78
81
  GET_BONUSES_REQUEST = 600,
79
82
  GET_BONUSES_RESPONSE = 601,
80
83
  CLAIM_BONUS_REQUEST = 602,
@@ -18,7 +18,7 @@ export interface InboxMessage {
18
18
  engagement_uid: string;
19
19
  is_read: boolean;
20
20
  is_starred: boolean;
21
- is_deleted: boolean;
21
+ is_deleted?: boolean;
22
22
  }
23
23
 
24
24
  export const InboxMessageBodyTransform = (item: InboxMessageBody): TInboxMessageBody => {
@@ -0,0 +1,7 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+
3
+ export interface AchClaimPrizeRequest extends ProtocolMessage {
4
+
5
+ ach_id: number;
6
+ ach_completed_id: number; // ID of the completion fact from ach_completed or ach_completed_recurring tables
7
+ }
@@ -0,0 +1,6 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+
3
+ export interface AchClaimPrizeRequest extends ProtocolMessage {
4
+
5
+ // no details here, just check for errCode and reload list of missions
6
+ }
@@ -33,6 +33,10 @@ export interface UserAchievement {
33
33
  related_games?: AchRelatedGame[];
34
34
  active_from_ts?: number; // indicates when 'scheduled' mission is active from,
35
35
  ach_categories?: number[];
36
+
37
+ ach_completed_id?: number; // ID of the completion fact from ach_completed or ach_completed_recurring tables
38
+ requires_prize_claim?: boolean; // flag from achievement if the mission prize will be given only after user claims it
39
+ prize_claimed_date_ts?: number; // the date/timestamp indicating when the prize was claimed by the user
36
40
  }
37
41
 
38
42
  export const UserAchievementTransform = (items: UserAchievement[]): TMissionOrBadge[] => {
@@ -128,8 +128,8 @@ class SmarticoAPI {
128
128
  }
129
129
 
130
130
  } catch (e) {
131
- this.logger.error(`Failed to make request to smartico channel. ${e.message}`, { url: this.publicUrl, request: message, error: e.message });
132
- throw(new Error(`Failed to make request to smartico channel. ${e.message}`));
131
+ this.logger.error(`Failed to make request to smartico channel, L2. ${e.message}`, { url: this.publicUrl, request: message, error: e.message });
132
+ throw(new Error(`Failed to make request to smartico channel, L1. ${e.message}`));
133
133
  }
134
134
 
135
135
  if (this.logCIDs.includes(message.cid)) {
@@ -91,7 +91,7 @@ export interface TMiniGameTemplate {
91
91
  promo_image: string;
92
92
  /** The promo text */
93
93
  promo_text: string;
94
- /** The custom data of the mini-game defined by operator. Can be a JSON object, string or number */
94
+ /** The custom data of the mini-game defined by operator in the BackOffice. Can be a JSON object, string or number */
95
95
  custom_data: any;
96
96
 
97
97
 
@@ -170,7 +170,7 @@ export interface TLevel {
170
170
  */
171
171
  required_level_counter_2: number,
172
172
 
173
- /** The custom data of the mini-game defined by operator. Can be a JSON object, string or number */
173
+ /** The custom data of the Level defined by operator in the BackOffice. Can be a JSON object, string or number */
174
174
  custom_data: string;
175
175
  }
176
176