@smartico/public-api 0.0.307 → 0.0.308
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/Missions/AchievementTaskPublicMeta.d.ts +5 -0
- package/dist/Missions/MissionsUtils.d.ts +2 -0
- package/dist/Missions/UserAchievementTask.d.ts +5 -0
- package/dist/Missions/index.d.ts +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +38 -1
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Missions/AchievementTaskPublicMeta.ts +6 -0
- package/src/Missions/MissionsUtils.ts +47 -0
- package/src/Missions/UserAchievement.ts +15 -11
- package/src/Missions/UserAchievementTask.ts +5 -0
- package/src/Missions/index.ts +1 -0
package/dist/index.modern.mjs
CHANGED
|
@@ -1268,6 +1268,42 @@ MissionUtils.getAvailabilityStatus = mission => {
|
|
|
1268
1268
|
MissionUtils.getMs = ts => {
|
|
1269
1269
|
return new Date(ts).getTime();
|
|
1270
1270
|
};
|
|
1271
|
+
MissionUtils.replaceFavGameNameTag = task => {
|
|
1272
|
+
var _task$user_state_para, _task$task_public_met;
|
|
1273
|
+
if (!task) {
|
|
1274
|
+
return task;
|
|
1275
|
+
}
|
|
1276
|
+
const userStateParams = ((_task$user_state_para = task.user_state_params) == null ? void 0 : _task$user_state_para.map) || {};
|
|
1277
|
+
const userStateOperator = (_task$task_public_met = task.task_public_meta) == null ? void 0 : _task$task_public_met.user_state_operations;
|
|
1278
|
+
const userStateParamsKeys = Object.keys(userStateParams);
|
|
1279
|
+
if (userStateParamsKeys.length === 0 || !userStateOperator) {
|
|
1280
|
+
return task;
|
|
1281
|
+
}
|
|
1282
|
+
const operatorsMulti = ['has', '!has'];
|
|
1283
|
+
const operatorsPos = ['pos1', 'pos2', 'pos3'];
|
|
1284
|
+
let replacementValue = '';
|
|
1285
|
+
userStateParamsKeys.forEach(k => {
|
|
1286
|
+
var _userStateOperator$k;
|
|
1287
|
+
const operator = (_userStateOperator$k = userStateOperator[k]) == null ? void 0 : _userStateOperator$k.op;
|
|
1288
|
+
if (operatorsMulti.includes(operator)) {
|
|
1289
|
+
const value = userStateParams[k];
|
|
1290
|
+
if (value && value.length > 0) {
|
|
1291
|
+
replacementValue = value.join(' ,');
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
if (operatorsPos.includes(operator)) {
|
|
1295
|
+
const value = userStateParams[k];
|
|
1296
|
+
const pos = Number(operator.replace('pos', '')) - 1;
|
|
1297
|
+
if (IntUtils.isNotNull(pos) && value && value[pos]) {
|
|
1298
|
+
replacementValue = value[pos];
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
});
|
|
1302
|
+
if (replacementValue) {
|
|
1303
|
+
task.task_public_meta.name = task.task_public_meta.name.replace('{{suggested_games}}', replacementValue);
|
|
1304
|
+
}
|
|
1305
|
+
return task;
|
|
1306
|
+
};
|
|
1271
1307
|
|
|
1272
1308
|
const UserAchievementTransform = items => {
|
|
1273
1309
|
return items.filter(r => r.ach_id >= 1).map(r => {
|
|
@@ -1302,6 +1338,7 @@ const UserAchievementTransform = items => {
|
|
|
1302
1338
|
ribbon: r.ach_public_meta.label_tag === 'custom' ? r.ach_public_meta.custom_label_tag : r.ach_public_meta.label_tag,
|
|
1303
1339
|
tasks: (r.achievementTasks || []).filter(t => t.task_type_id === AchievementTaskType.CompleteAchievement).map(t => {
|
|
1304
1340
|
var _t$task_public_meta;
|
|
1341
|
+
MissionUtils.replaceFavGameNameTag(t);
|
|
1305
1342
|
return {
|
|
1306
1343
|
id: t.task_id,
|
|
1307
1344
|
name: (_t$task_public_meta = t.task_public_meta) == null ? void 0 : _t$task_public_meta.name,
|
|
@@ -4236,5 +4273,5 @@ var JackpotType;
|
|
|
4236
4273
|
JackpotType[JackpotType["Personal"] = 2] = "Personal";
|
|
4237
4274
|
})(JackpotType || (JackpotType = {}));
|
|
4238
4275
|
|
|
4239
|
-
export { AchCategoryTransform, AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter, AchievementAvailabilityStatus, AchievementStatus, AchievementTaskType, AchievementType, ActivityTypeLimited, BonusItemsTransform, BonusStatus, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, GetJackpotEligibleGamesResponseTransform, GetJackpotWinnersResponseTransform, GetLevelMapResponseTransform, InboxCategories, InboxMessageBodyTransform, InboxMessageType, InboxMessagesTransform, JackPotTemparature, JackpotContributionType, JackpotType, LeaderBoardPeriodType, LiquidEntityData, MiniGamePrizeTypeName, MiniGamePrizeTypeNamed, OCache, OpenLinksType, PrizeModifiers, PrizeModifiersKeysNames, PublicLabelSettings, QuizAnswersValueType, QuizMarketPerSport, QuizSportType, SAWAcknowledgeType, SAWAcknowledgeTypeName, SAWAcknowledgeTypeNamed, SAWAskForUsername, SAWBuyInType, SAWBuyInTypeName, SAWBuyInTypeNamed, SAWGPMarketType, SAWGameDifficultyType, SAWGameDifficultyTypeName, SAWGameLayout, SAWGameType, SAWGameTypeName, SAWGameTypeNamed, SAWHistoryTransform, SAWPrizeType, SAWSpinErrorCode, SAWTemplatesTransform, SAWUtils, SAWWheelLayout, SAWWinSoundFiles, SAWWinSoundType, SawGameDifficultyTypeNamed, ScheduledMissionType, SmarticoAPI, StoreCategoryTransform, StoreItemPurchaseType, StoreItemPurchasedTransform, StoreItemTransform, StoreItemType, StoreItemTypeName, StoreItemTypeNamed, TournamentInstanceStatus, TournamentInstanceStatusName, TournamentItemsTransform, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationStatusName, TournamentRegistrationStatusNamed, TournamentRegistrationType, TournamentRegistrationTypeGetName, TournamentType, TournamentUtils, TranslationArea, UICustomSectionTransform, UserAchievementTransform, getLeaderBoardTransform, marketsInfo, quizAnswerAwayTeamReplacementText, quizAnswerHomeTeamReplacementText, quizAnswersTrKeys, quizDrawReplacementText, quizEvenReplacementText, quizNoGoalsReplacementText, quizNoReplacementText, quizOddReplacementText, quizOrReplacementText, quizSupportedSports, quizYesReplacementText, tournamentInfoItemTransform };
|
|
4276
|
+
export { AchCategoryTransform, AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter, AchievementAvailabilityStatus, AchievementStatus, AchievementTaskType, AchievementType, ActivityTypeLimited, BonusItemsTransform, BonusStatus, BuyStoreItemErrorCode, ClassId, CookieStore, CoreUtils, ECacheContext, GetJackpotEligibleGamesResponseTransform, GetJackpotWinnersResponseTransform, GetLevelMapResponseTransform, InboxCategories, InboxMessageBodyTransform, InboxMessageType, InboxMessagesTransform, JackPotTemparature, JackpotContributionType, JackpotType, LeaderBoardPeriodType, LiquidEntityData, MiniGamePrizeTypeName, MiniGamePrizeTypeNamed, MissionUtils, OCache, OpenLinksType, PrizeModifiers, PrizeModifiersKeysNames, PublicLabelSettings, QuizAnswersValueType, QuizMarketPerSport, QuizSportType, SAWAcknowledgeType, SAWAcknowledgeTypeName, SAWAcknowledgeTypeNamed, SAWAskForUsername, SAWBuyInType, SAWBuyInTypeName, SAWBuyInTypeNamed, SAWGPMarketType, SAWGameDifficultyType, SAWGameDifficultyTypeName, SAWGameLayout, SAWGameType, SAWGameTypeName, SAWGameTypeNamed, SAWHistoryTransform, SAWPrizeType, SAWSpinErrorCode, SAWTemplatesTransform, SAWUtils, SAWWheelLayout, SAWWinSoundFiles, SAWWinSoundType, SawGameDifficultyTypeNamed, ScheduledMissionType, SmarticoAPI, StoreCategoryTransform, StoreItemPurchaseType, StoreItemPurchasedTransform, StoreItemTransform, StoreItemType, StoreItemTypeName, StoreItemTypeNamed, TournamentInstanceStatus, TournamentInstanceStatusName, TournamentItemsTransform, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationStatusName, TournamentRegistrationStatusNamed, TournamentRegistrationType, TournamentRegistrationTypeGetName, TournamentType, TournamentUtils, TranslationArea, UICustomSectionTransform, UserAchievementTransform, getLeaderBoardTransform, marketsInfo, quizAnswerAwayTeamReplacementText, quizAnswerHomeTeamReplacementText, quizAnswersTrKeys, quizDrawReplacementText, quizEvenReplacementText, quizNoGoalsReplacementText, quizNoReplacementText, quizOddReplacementText, quizOrReplacementText, quizSupportedSports, quizYesReplacementText, tournamentInfoItemTransform };
|
|
4240
4277
|
//# sourceMappingURL=index.modern.mjs.map
|