@smartico/public-api 0.0.324 → 0.0.325
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/dist/SmarticoAPI.d.ts +9 -1
- package/dist/WSAPI/WSAPI.d.ts +49 -0
- package/dist/index.js +83 -9
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +74 -0
- package/dist/index.modern.mjs.map +1 -1
- package/docs/classes/WSAPI.md +66 -0
- package/package.json +1 -1
- package/src/SmarticoAPI.ts +35 -0
- package/src/WSAPI/WSAPI.ts +62 -1
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ClassId } from './Base/ClassId';
|
|
|
2
2
|
import { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';
|
|
3
3
|
import { ILogger } from './ILogger';
|
|
4
4
|
import { SAWDoAknowledgeResponse, SAWDoSpinResponse, SAWPrizesHistory, SAWWinningHistoryResponse } from './MiniGames';
|
|
5
|
-
import { GetTranslationsResponse, PublicLabelSettings, ResponseIdentify, TranslationArea } from './Core';
|
|
5
|
+
import { ActivityTypeLimited, GetTranslationsResponse, PublicLabelSettings, ResponseIdentify, TranslationArea } from './Core';
|
|
6
6
|
import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
|
|
7
7
|
import { GetInboxMessagesResponse, InboxMessageBody, InboxReadStatus, MarkInboxMessageDeletedResponse, MarkInboxMessageReadResponse, MarkInboxMessageStarredResponse } from './Inbox';
|
|
8
8
|
import { BuyStoreItemResponse, GetCategoriesStoreResponse, GetStoreHistoryResponse, GetStoreItemsResponse } from './Store';
|
|
@@ -71,6 +71,14 @@ declare class SmarticoAPI {
|
|
|
71
71
|
public_username_custom: string;
|
|
72
72
|
}>;
|
|
73
73
|
coreCheckSegments(user_ext_id: string, segment_id: number[]): Promise<TSegmentCheckResult[]>;
|
|
74
|
+
/**
|
|
75
|
+
* Reports an engagement impression event (when engagement content is displayed to the user).
|
|
76
|
+
*/
|
|
77
|
+
reportEngagementImpression(user_ext_id: string, engagement_uid: string, activityType: ActivityTypeLimited | number): void;
|
|
78
|
+
/**
|
|
79
|
+
* Reports an engagement action event (when user clicks/interacts with engagement content).
|
|
80
|
+
*/
|
|
81
|
+
reportEngagementAction(user_ext_id: string, engagement_uid: string, activityType: ActivityTypeLimited | number, action?: string): void;
|
|
74
82
|
jackpotGet(user_ext_id: string, filter?: {
|
|
75
83
|
related_game_id?: string;
|
|
76
84
|
jp_template_id?: number;
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ActivityTypeLimited } from '../Core';
|
|
1
2
|
import { SmarticoAPI } from '../SmarticoAPI';
|
|
2
3
|
import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUICustomSection, TUserProfile, UserLevelExtraCountersT, TBonus, TClaimBonusResult, TMiniGamePlayBatchResult, TSawHistory, TRaffle, TRaffleDraw, TRaffleDrawRun, TransformedRaffleClaimPrizeResponse, TLevelCurrent } from './WSAPITypes';
|
|
3
4
|
import { LeaderBoardPeriodType } from '../Leaderboard';
|
|
@@ -496,6 +497,54 @@ export declare class WSAPI {
|
|
|
496
497
|
* Requests translations for the given language. Returns the object including translation key/translation value pairs. All possible translation keys defined in the back office.
|
|
497
498
|
*/
|
|
498
499
|
getTranslations(lang_code: string): Promise<TGetTranslations>;
|
|
500
|
+
/**
|
|
501
|
+
* Reports an impression event for an engagement (when engagement content is displayed to the user).
|
|
502
|
+
* Use this method to track when users view engagement content such as inbox messages, popups.
|
|
503
|
+
* When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType.
|
|
504
|
+
*
|
|
505
|
+
* **Example**:
|
|
506
|
+
* ```
|
|
507
|
+
* _smartico.api.reportImpressionEvent({
|
|
508
|
+
* engagement_uid: 'abc123-def456',
|
|
509
|
+
* activityType: 31 // Inbox
|
|
510
|
+
* });
|
|
511
|
+
* ```
|
|
512
|
+
*
|
|
513
|
+
* **Visitor mode: not supported**
|
|
514
|
+
*
|
|
515
|
+
* @param params.engagement_uid - Unique identifier for the engagement
|
|
516
|
+
* @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
|
|
517
|
+
*/
|
|
518
|
+
reportImpressionEvent({ engagement_uid, activityType, }: {
|
|
519
|
+
engagement_uid: string;
|
|
520
|
+
activityType: ActivityTypeLimited | number;
|
|
521
|
+
}): void;
|
|
522
|
+
/**
|
|
523
|
+
* Reports a click/action event for an engagement (when user interacts with engagement content).
|
|
524
|
+
* Use this method to track when users click on or interact with engagement content such as inbox messages, popups.
|
|
525
|
+
* When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType, and pass the action/deeplink that was triggered by the user interaction as action.
|
|
526
|
+
*
|
|
527
|
+
*
|
|
528
|
+
* **Example**:
|
|
529
|
+
* ```
|
|
530
|
+
* _smartico.api.reportClickEvent({
|
|
531
|
+
* engagement_uid: 'abc123-def456',
|
|
532
|
+
* activityType: 31 // Inbox,
|
|
533
|
+
* action: 'dp:gf_missions'
|
|
534
|
+
* });
|
|
535
|
+
* ```
|
|
536
|
+
*
|
|
537
|
+
* **Visitor mode: not supported**
|
|
538
|
+
*
|
|
539
|
+
* @param params.engagement_uid - Unique identifier for the engagement
|
|
540
|
+
* @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
|
|
541
|
+
* @param params.action - Optional action/deeplink that was triggered by the user interaction
|
|
542
|
+
*/
|
|
543
|
+
reportClickEvent({ engagement_uid, activityType, action, }: {
|
|
544
|
+
engagement_uid: string;
|
|
545
|
+
activityType: ActivityTypeLimited | number;
|
|
546
|
+
action?: string;
|
|
547
|
+
}): void;
|
|
499
548
|
private updateOnSpin;
|
|
500
549
|
private reloadMiniGameTemplate;
|
|
501
550
|
private updateMissions;
|
package/dist/index.js
CHANGED
|
@@ -3102,6 +3102,57 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3102
3102
|
} catch (e) {
|
|
3103
3103
|
return Promise.reject(e);
|
|
3104
3104
|
}
|
|
3105
|
+
}
|
|
3106
|
+
/**
|
|
3107
|
+
* Reports an impression event for an engagement (when engagement content is displayed to the user).
|
|
3108
|
+
* Use this method to track when users view engagement content such as inbox messages, popups.
|
|
3109
|
+
* When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType.
|
|
3110
|
+
*
|
|
3111
|
+
* **Example**:
|
|
3112
|
+
* ```
|
|
3113
|
+
* _smartico.api.reportImpressionEvent({
|
|
3114
|
+
* engagement_uid: 'abc123-def456',
|
|
3115
|
+
* activityType: 31 // Inbox
|
|
3116
|
+
* });
|
|
3117
|
+
* ```
|
|
3118
|
+
*
|
|
3119
|
+
* **Visitor mode: not supported**
|
|
3120
|
+
*
|
|
3121
|
+
* @param params.engagement_uid - Unique identifier for the engagement
|
|
3122
|
+
* @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
|
|
3123
|
+
*/
|
|
3124
|
+
;
|
|
3125
|
+
_proto.reportImpressionEvent = function reportImpressionEvent(_ref12) {
|
|
3126
|
+
var engagement_uid = _ref12.engagement_uid,
|
|
3127
|
+
activityType = _ref12.activityType;
|
|
3128
|
+
this.api.reportEngagementImpression(null, engagement_uid, activityType);
|
|
3129
|
+
}
|
|
3130
|
+
/**
|
|
3131
|
+
* Reports a click/action event for an engagement (when user interacts with engagement content).
|
|
3132
|
+
* Use this method to track when users click on or interact with engagement content such as inbox messages, popups.
|
|
3133
|
+
* When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType, and pass the action/deeplink that was triggered by the user interaction as action.
|
|
3134
|
+
*
|
|
3135
|
+
*
|
|
3136
|
+
* **Example**:
|
|
3137
|
+
* ```
|
|
3138
|
+
* _smartico.api.reportClickEvent({
|
|
3139
|
+
* engagement_uid: 'abc123-def456',
|
|
3140
|
+
* activityType: 31 // Inbox,
|
|
3141
|
+
* action: 'dp:gf_missions'
|
|
3142
|
+
* });
|
|
3143
|
+
* ```
|
|
3144
|
+
*
|
|
3145
|
+
* **Visitor mode: not supported**
|
|
3146
|
+
*
|
|
3147
|
+
* @param params.engagement_uid - Unique identifier for the engagement
|
|
3148
|
+
* @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
|
|
3149
|
+
* @param params.action - Optional action/deeplink that was triggered by the user interaction
|
|
3150
|
+
*/;
|
|
3151
|
+
_proto.reportClickEvent = function reportClickEvent(_ref13) {
|
|
3152
|
+
var engagement_uid = _ref13.engagement_uid,
|
|
3153
|
+
activityType = _ref13.activityType,
|
|
3154
|
+
action = _ref13.action;
|
|
3155
|
+
this.api.reportEngagementAction(null, engagement_uid, activityType, action);
|
|
3105
3156
|
};
|
|
3106
3157
|
_proto.updateOnSpin = function updateOnSpin(data) {
|
|
3107
3158
|
try {
|
|
@@ -3382,10 +3433,10 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3382
3433
|
*
|
|
3383
3434
|
*/
|
|
3384
3435
|
;
|
|
3385
|
-
_proto.getJackpotWinners = function getJackpotWinners(
|
|
3386
|
-
var limit =
|
|
3387
|
-
offset =
|
|
3388
|
-
jp_template_id =
|
|
3436
|
+
_proto.getJackpotWinners = function getJackpotWinners(_ref14) {
|
|
3437
|
+
var limit = _ref14.limit,
|
|
3438
|
+
offset = _ref14.offset,
|
|
3439
|
+
jp_template_id = _ref14.jp_template_id;
|
|
3389
3440
|
try {
|
|
3390
3441
|
var _this51 = this;
|
|
3391
3442
|
return Promise.resolve(OCache.use(onUpdateContextKey.JackpotWinners + jp_template_id, exports.ECacheContext.WSAPI, function () {
|
|
@@ -3409,9 +3460,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3409
3460
|
*
|
|
3410
3461
|
*/
|
|
3411
3462
|
;
|
|
3412
|
-
_proto.getJackpotEligibleGames = function getJackpotEligibleGames(
|
|
3413
|
-
var jp_template_id =
|
|
3414
|
-
onUpdate =
|
|
3463
|
+
_proto.getJackpotEligibleGames = function getJackpotEligibleGames(_ref15) {
|
|
3464
|
+
var jp_template_id = _ref15.jp_template_id,
|
|
3465
|
+
onUpdate = _ref15.onUpdate;
|
|
3415
3466
|
try {
|
|
3416
3467
|
var _this52 = this;
|
|
3417
3468
|
if (onUpdate) {
|
|
@@ -3477,8 +3528,8 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3477
3528
|
*/
|
|
3478
3529
|
;
|
|
3479
3530
|
_proto.getRaffles = function getRaffles(_temp13) {
|
|
3480
|
-
var
|
|
3481
|
-
onUpdate =
|
|
3531
|
+
var _ref16 = _temp13 === void 0 ? {} : _temp13,
|
|
3532
|
+
onUpdate = _ref16.onUpdate;
|
|
3482
3533
|
try {
|
|
3483
3534
|
var _this54 = this;
|
|
3484
3535
|
if (onUpdate) {
|
|
@@ -4069,6 +4120,29 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
4069
4120
|
} catch (e) {
|
|
4070
4121
|
return Promise.reject(e);
|
|
4071
4122
|
}
|
|
4123
|
+
}
|
|
4124
|
+
/**
|
|
4125
|
+
* Reports an engagement impression event (when engagement content is displayed to the user).
|
|
4126
|
+
*/
|
|
4127
|
+
;
|
|
4128
|
+
_proto.reportEngagementImpression = function reportEngagementImpression(user_ext_id, engagement_uid, activityType) {
|
|
4129
|
+
var message = this.buildMessage(user_ext_id, exports.ClassId.CLIENT_ENGAGEMENT_IMPRESSION_REQUEST, {
|
|
4130
|
+
engagement_uid: engagement_uid,
|
|
4131
|
+
activityType: activityType
|
|
4132
|
+
});
|
|
4133
|
+
this.send(message)["catch"](function () {});
|
|
4134
|
+
}
|
|
4135
|
+
/**
|
|
4136
|
+
* Reports an engagement action event (when user clicks/interacts with engagement content).
|
|
4137
|
+
*/;
|
|
4138
|
+
_proto.reportEngagementAction = function reportEngagementAction(user_ext_id, engagement_uid, activityType, action) {
|
|
4139
|
+
var message = this.buildMessage(user_ext_id, exports.ClassId.CLIENT_ENGAGEMENT_ACTION_REQUEST, _extends({
|
|
4140
|
+
engagement_uid: engagement_uid,
|
|
4141
|
+
activityType: activityType
|
|
4142
|
+
}, action && {
|
|
4143
|
+
action: action
|
|
4144
|
+
}));
|
|
4145
|
+
this.send(message)["catch"](function () {});
|
|
4072
4146
|
};
|
|
4073
4147
|
_proto.jackpotGet = function jackpotGet(user_ext_id, filter, force_language) {
|
|
4074
4148
|
try {
|