@smartico/public-api 0.0.74 → 0.0.76
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/Core/ActivityTypeLimited.d.ts +12 -1
- package/dist/MiniGames/SAWTemplateUI.d.ts +1 -0
- package/dist/WSAPI/WSAPITypes.d.ts +15 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +35 -0
- package/dist/index.modern.mjs.map +1 -1
- package/docs/interfaces/TTournamentDetailed.md +6 -0
- package/package.json +1 -1
- package/src/Core/ActivityTypeLimited.ts +12 -1
- package/src/MiniGames/SAWTemplateUI.ts +1 -0
- package/src/SmarticoAPI.ts +10 -0
- package/src/Tournaments/GetTournamentInfoResponse.ts +15 -0
- package/src/WSAPI/WSAPITypes.ts +16 -0
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
export declare enum ActivityTypeLimited {
|
|
2
2
|
DoNothing = 8,
|
|
3
3
|
Points = 12,
|
|
4
|
+
GiveMission = 14,
|
|
5
|
+
StartAnotherCampaign = 15,
|
|
6
|
+
MiniGameAttempt = 16,
|
|
7
|
+
DeductPoints = 21,
|
|
8
|
+
ResetPoints = 22,
|
|
4
9
|
Popup = 30,
|
|
5
10
|
Inbox = 31,
|
|
6
|
-
|
|
11
|
+
Slack = 70,
|
|
12
|
+
Email_To_Customer_Support = 80,
|
|
13
|
+
Email_To_Risk_Operator = 90,
|
|
14
|
+
Bonus = 100,
|
|
15
|
+
WebHook = 200,
|
|
16
|
+
TagCustomer = 504,
|
|
17
|
+
UnTagCustomer = 505
|
|
7
18
|
}
|
|
@@ -219,6 +219,21 @@ export interface TTournamentDetailed extends TTournament {
|
|
|
219
219
|
/** The scores of the current user in the tournament */
|
|
220
220
|
scores: number;
|
|
221
221
|
};
|
|
222
|
+
prizes?: {
|
|
223
|
+
/** The name of the prize */
|
|
224
|
+
name: string;
|
|
225
|
+
/** The description of the prize */
|
|
226
|
+
description: string;
|
|
227
|
+
/** The image of the prize */
|
|
228
|
+
image_url: string;
|
|
229
|
+
/** from-to range of the places to which this prize */
|
|
230
|
+
place_from: number;
|
|
231
|
+
place_to: number;
|
|
232
|
+
/** type of the prize: TANGIBLE, POINTS_ADD, POINTS_DEDUCT, POINTS_RESET, MINI_GAME_ATTEMPT, BONUS */
|
|
233
|
+
type: string;
|
|
234
|
+
/** if the prize is points related, indicates amount of points */
|
|
235
|
+
points?: number;
|
|
236
|
+
}[];
|
|
222
237
|
}
|
|
223
238
|
/**
|
|
224
239
|
* TStoreCategory describes the store category item. Each store item can be assigned to 1 or more categories
|
package/dist/index.js
CHANGED
|
@@ -445,9 +445,20 @@ exports.ActivityTypeLimited = void 0;
|
|
|
445
445
|
(function (ActivityTypeLimited) {
|
|
446
446
|
ActivityTypeLimited[ActivityTypeLimited["DoNothing"] = 8] = "DoNothing";
|
|
447
447
|
ActivityTypeLimited[ActivityTypeLimited["Points"] = 12] = "Points";
|
|
448
|
+
ActivityTypeLimited[ActivityTypeLimited["GiveMission"] = 14] = "GiveMission";
|
|
449
|
+
ActivityTypeLimited[ActivityTypeLimited["StartAnotherCampaign"] = 15] = "StartAnotherCampaign";
|
|
450
|
+
ActivityTypeLimited[ActivityTypeLimited["MiniGameAttempt"] = 16] = "MiniGameAttempt";
|
|
451
|
+
ActivityTypeLimited[ActivityTypeLimited["DeductPoints"] = 21] = "DeductPoints";
|
|
452
|
+
ActivityTypeLimited[ActivityTypeLimited["ResetPoints"] = 22] = "ResetPoints";
|
|
448
453
|
ActivityTypeLimited[ActivityTypeLimited["Popup"] = 30] = "Popup";
|
|
449
454
|
ActivityTypeLimited[ActivityTypeLimited["Inbox"] = 31] = "Inbox";
|
|
455
|
+
ActivityTypeLimited[ActivityTypeLimited["Slack"] = 70] = "Slack";
|
|
456
|
+
ActivityTypeLimited[ActivityTypeLimited["Email_To_Customer_Support"] = 80] = "Email_To_Customer_Support";
|
|
457
|
+
ActivityTypeLimited[ActivityTypeLimited["Email_To_Risk_Operator"] = 90] = "Email_To_Risk_Operator";
|
|
450
458
|
ActivityTypeLimited[ActivityTypeLimited["Bonus"] = 100] = "Bonus";
|
|
459
|
+
ActivityTypeLimited[ActivityTypeLimited["WebHook"] = 200] = "WebHook";
|
|
460
|
+
ActivityTypeLimited[ActivityTypeLimited["TagCustomer"] = 504] = "TagCustomer";
|
|
461
|
+
ActivityTypeLimited[ActivityTypeLimited["UnTagCustomer"] = 505] = "UnTagCustomer";
|
|
451
462
|
})(exports.ActivityTypeLimited || (exports.ActivityTypeLimited = {}));
|
|
452
463
|
|
|
453
464
|
var CoreUtils = function CoreUtils() {};
|
|
@@ -702,6 +713,10 @@ var TournamentItemsTransform = function TournamentItemsTransform(items) {
|
|
|
702
713
|
});
|
|
703
714
|
};
|
|
704
715
|
|
|
716
|
+
var tournamentPrizeTypeToPrizeName = function tournamentPrizeTypeToPrizeName(type) {
|
|
717
|
+
var _ActivityTypeLimited$;
|
|
718
|
+
return (_ActivityTypeLimited$ = {}, _ActivityTypeLimited$[exports.ActivityTypeLimited.DoNothing] = 'TANGIBLE', _ActivityTypeLimited$[exports.ActivityTypeLimited.Points] = 'POINTS_ADD', _ActivityTypeLimited$[exports.ActivityTypeLimited.DeductPoints] = 'POINTS_DEDUCT', _ActivityTypeLimited$[exports.ActivityTypeLimited.ResetPoints] = 'POINTS_RESET', _ActivityTypeLimited$[exports.ActivityTypeLimited.MiniGameAttempt] = "MINI_GAME_ATTEMPT", _ActivityTypeLimited$[exports.ActivityTypeLimited.Bonus] = 'BONUS', _ActivityTypeLimited$)[type];
|
|
719
|
+
};
|
|
705
720
|
var tournamentInfoItemTransform = function tournamentInfoItemTransform(t) {
|
|
706
721
|
var response = _extends({}, TournamentItemsTransform([t.tournamentInfo.tournamentLobbyInfo])[0], {
|
|
707
722
|
players: t.tournamentInfo.players.map(function (p) {
|
|
@@ -714,6 +729,13 @@ var tournamentInfoItemTransform = function tournamentInfoItemTransform(t) {
|
|
|
714
729
|
};
|
|
715
730
|
})
|
|
716
731
|
});
|
|
732
|
+
if (t.prizeStructure) {
|
|
733
|
+
response.prizes = t.prizeStructure.prizes.map(function (p) {
|
|
734
|
+
return _extends({}, p, {
|
|
735
|
+
type: tournamentPrizeTypeToPrizeName(p.type)
|
|
736
|
+
});
|
|
737
|
+
});
|
|
738
|
+
}
|
|
717
739
|
if (t.userPosition) {
|
|
718
740
|
response.me = {
|
|
719
741
|
public_username: t.userPosition.userAltName,
|
|
@@ -1418,6 +1440,9 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
1418
1440
|
_proto.sawSpinRequest = function sawSpinRequest(user_ext_id, saw_template_id, round_id) {
|
|
1419
1441
|
try {
|
|
1420
1442
|
var _this10 = this;
|
|
1443
|
+
if (!saw_template_id) {
|
|
1444
|
+
throw new Error('Missing template id');
|
|
1445
|
+
}
|
|
1421
1446
|
var request_id = IntUtils.uuid();
|
|
1422
1447
|
var message = _this10.buildMessage(user_ext_id, exports.ClassId.SAW_DO_SPIN_REQUEST, {
|
|
1423
1448
|
saw_template_id: saw_template_id,
|
|
@@ -1445,6 +1470,9 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
1445
1470
|
_proto.missionOptIn = function missionOptIn(user_ext_id, mission_id) {
|
|
1446
1471
|
try {
|
|
1447
1472
|
var _this11 = this;
|
|
1473
|
+
if (!mission_id) {
|
|
1474
|
+
throw new Error('Missing mission id');
|
|
1475
|
+
}
|
|
1448
1476
|
var message = _this11.buildMessage(user_ext_id, exports.ClassId.MISSION_OPTIN_REQUEST, {
|
|
1449
1477
|
achievementId: mission_id
|
|
1450
1478
|
});
|
|
@@ -1605,6 +1633,9 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
1605
1633
|
_proto.tournamentsGetInfoT = function tournamentsGetInfoT(user_ext_id, tournamentInstanceId) {
|
|
1606
1634
|
try {
|
|
1607
1635
|
var _this24 = this;
|
|
1636
|
+
if (!tournamentInstanceId) {
|
|
1637
|
+
throw new Error('Missing tournament instance id');
|
|
1638
|
+
}
|
|
1608
1639
|
return Promise.resolve(_this24.tournamentsGetInfo(user_ext_id, tournamentInstanceId)).then(tournamentInfoItemTransform);
|
|
1609
1640
|
} catch (e) {
|
|
1610
1641
|
return Promise.reject(e);
|