@smartico/public-api 0.0.347 → 0.0.349

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.
@@ -123,7 +123,7 @@ ___
123
123
 
124
124
  ▸ **getMissions**(`«destructured»?`): `Promise`\<[`TMissionOrBadge`](../interfaces/TMissionOrBadge.md)[]\>
125
125
 
126
- Returns all the missions available the current user.
126
+ Returns all the missions configured for the current user (server-side scoped, not filtered by Widget visibility).
127
127
  The returned missions are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
128
128
  Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
129
129
  The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it.
@@ -418,7 +418,7 @@ ___
418
418
 
419
419
  ▸ **getMiniGames**(`«destructured»?`): `Promise`\<[`TMiniGameTemplate`](../interfaces/TMiniGameTemplate.md)[]\>
420
420
 
421
- Returns the list of mini-games available for user
421
+ Returns the list of mini-games configured for the current user (not filtered by spin availability or Widget visibility).
422
422
  The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
423
423
  The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
424
424
 
@@ -88,3 +88,11 @@ ___
88
88
  Custom data as string or JSON string that can be used in API to build custom UI
89
89
  You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
90
90
  Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
91
+
92
+ ___
93
+
94
+ ### ordinal\_position
95
+
96
+ • **ordinal\_position**: `number`
97
+
98
+ The ordinal position of the level
@@ -130,6 +130,10 @@ ___
130
130
 
131
131
  The ordinal position of the level
132
132
 
133
+ #### Inherited from
134
+
135
+ [TLevel](TLevel.md).[ordinal_position](TLevel.md#ordinal_position)
136
+
133
137
  ___
134
138
 
135
139
  ### progress
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.347",
3
+ "version": "0.0.349",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -173,6 +173,11 @@ export enum ClassId {
173
173
  RAF_CLAIM_PRIZE_REQUEST = 906,
174
174
  */
175
175
 
176
+ BNR_GET_BANNER_PLACEMENTS_REQUEST = 950,
177
+ BNR_GET_BANNER_PLACEMENTS_RESPONSE = 951,
178
+ BNR_GET_BANNER_CONTENT_REQUEST = 952,
179
+ BNR_GET_BANNER_CONTENT_RESPONSE = 953,
180
+
176
181
  /*
177
182
  !Important, if adding new messages that are 'acting' on behalf of the client,
178
183
  you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION
@@ -8,7 +8,9 @@ export interface GetLevelMapResponse extends ProtocolResponse {
8
8
  }
9
9
 
10
10
  export const GetLevelMapResponseTransform = (levels: GetLevelMapResponse): TLevel[] => {
11
- return levels?.levels.map((l) => ({
11
+ if (!levels?.levels) return [];
12
+
13
+ const mapped = levels.levels.map((l) => ({
12
14
  id: l.level_id,
13
15
  name: l.level_public_meta.name,
14
16
  description: l.level_public_meta.description,
@@ -18,5 +20,13 @@ export const GetLevelMapResponseTransform = (levels: GetLevelMapResponse): TLeve
18
20
  required_level_counter_1: l.required_level_counter_1,
19
21
  required_level_counter_2: l.required_level_counter_2,
20
22
  custom_data: IntUtils.JsonOrText(l.level_public_meta?.custom_data),
23
+ ordinal_position: 0,
21
24
  }));
25
+
26
+ const ordinalById = new Map<number, number>();
27
+ [...mapped]
28
+ .sort((a, b) => a.required_points - b.required_points)
29
+ .forEach((l, index) => ordinalById.set(l.id, index + 1));
30
+
31
+ return mapped.map((l) => ({ ...l, ordinal_position: ordinalById.get(l.id) }));
22
32
  };
@@ -1100,7 +1100,6 @@ class SmarticoAPI {
1100
1100
 
1101
1101
  return {
1102
1102
  ...currentLevel,
1103
- ordinal_position: currentLevelIndex + 1,
1104
1103
  progress: Math.min(Math.max(progress, 0), 100),
1105
1104
  };
1106
1105
  }
@@ -50,6 +50,7 @@ declare enum PublicLabelSettings {
50
50
  GAMIFICATION_WIDGET_BG_OPACITY = 'GAMIFICATION_WIDGET_BG_OPACITY',
51
51
  GAMIFICATION_POPUP_BG_OPACITY = 'GAMIFICATION_POPUP_BG_OPACITY',
52
52
  GAMIFICATION_POPUP_BG_BLUR = 'GAMIFICATION_POPUP_BG_BLUR',
53
+ FRONT_DISABLE_POPUP_INBOX_ON_URLS = 'FRONT_DISABLE_POPUP_INBOX_ON_URLS',
53
54
  GAMIFICATION_LEVELS_LOGIC2 = 'GAMIFICATION_LEVELS_LOGIC2',
54
55
  GAMIFICATION_LEVELS_LOGIC3 = 'GAMIFICATION_LEVELS_LOGIC3',
55
56
  AVATAR_CUSTOM_IMAGE_MAX_ID = 'AVATAR_CUSTOM_IMAGE_MAX_ID',
@@ -250,7 +250,7 @@ export class WSAPI {
250
250
  return OCache.use(onUpdateContextKey.CurrentLevel, ECacheContext.WSAPI, () => this.api.getLevelCurrent(null), CACHE_DATA_SEC);
251
251
  }
252
252
 
253
- /** Returns all the missions available the current user.
253
+ /** Returns all the missions configured for the current user (server-side scoped, not filtered by Widget visibility).
254
254
  * The returned missions are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
255
255
  * Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
256
256
  * The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it.
@@ -523,7 +523,7 @@ export class WSAPI {
523
523
  }
524
524
 
525
525
  /**
526
- * Returns the list of mini-games available for user
526
+ * Returns the list of mini-games configured for the current user (not filtered by spin availability or Widget visibility).
527
527
  * The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
528
528
  * The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or wined prize is spin/jackpot and if max count of the available user spin equal one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
529
529
  *
@@ -281,6 +281,8 @@ export interface TLevel {
281
281
  * Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
282
282
  */
283
283
  custom_data: string;
284
+ /** The ordinal position of the level */
285
+ ordinal_position: number;
284
286
  }
285
287
 
286
288
  /**
@@ -288,8 +290,6 @@ export interface TLevel {
288
290
  */
289
291
 
290
292
  export interface TLevelCurrent extends TLevel {
291
- /** The ordinal position of the level */
292
- ordinal_position: number;
293
293
  /** The progress of the user towards next level in the percents to complete */
294
294
  progress: number;
295
295
  }