@smartico/public-api 0.0.410 → 0.0.412
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/README.md +1 -1
- package/dist/Jackpots/JackpotPublicMeta.d.ts +1 -1
- package/dist/Level/LevelPublicMeta.d.ts +1 -1
- package/dist/MiniGames/SAWPrize.d.ts +9 -0
- package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
- package/dist/MiniGames/SAWTemplate.d.ts +25 -0
- package/dist/Raffle/Raffle.d.ts +1 -1
- package/dist/SmarticoLib/index.d.ts +3 -3
- package/dist/WSAPI/WSAPIMiniGames.d.ts +7 -1
- package/dist/WSAPI/WSAPIMissions.d.ts +40 -12
- package/dist/WSAPI/WSAPITypes.d.ts +40 -37
- package/dist/index.js +49 -13
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +49 -13
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/classes/WSAPIMiniGames.md +7 -1
- package/docs/api/classes/WSAPIMissions.md +40 -12
- package/docs/api/interfaces/JackpotPublicMeta.md +1 -1
- package/docs/api/interfaces/LevelPublicMeta.md +1 -1
- package/docs/api/interfaces/RafflePublicMeta.md +1 -1
- package/docs/api/interfaces/SAWPrize.md +18 -0
- package/docs/api/interfaces/SAWPrizeUI.md +2 -0
- package/docs/api/interfaces/SAWTemplate.md +46 -0
- package/docs/api/interfaces/TMiniGamePrize.md +28 -20
- package/docs/api/interfaces/TMiniGameTemplate.md +12 -13
- package/docs/api/interfaces/TMissionOrBadge.md +6 -4
- package/docs/api/interfaces/TRaffle.md +1 -1
- package/docs/capabilities/getBadges.md +4 -4
- package/docs/capabilities/getMiniGames.md +30 -29
- package/docs/capabilities/getMissions.md +44 -16
- package/docs/capabilities/getRaffles.md +1 -1
- package/docs/capabilities/jackpotGet.md +1 -1
- package/docs/capabilities/miniGameWinAcknowledgeRequest.md +7 -1
- package/docs/native/PROTOCOL.md +4 -0
- package/docs/ui/minigames/UIGuide_getMiniGames.md +22 -0
- package/docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md +90 -0
- package/docs/ui/minigames/UIGuide_playMiniGame.md +12 -3
- package/docs/ui/missions/UIGuide_getMissions.md +44 -24
- package/package.json +1 -1
- package/src/Jackpots/JackpotPublicMeta.ts +1 -1
- package/src/Level/LevelPublicMeta.ts +1 -1
- package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -0
- package/src/MiniGames/SAWPrize.ts +9 -0
- package/src/MiniGames/SAWPrizeUI.ts +2 -1
- package/src/MiniGames/SAWTemplate.ts +28 -4
- package/src/Raffle/Raffle.ts +1 -1
- package/src/SmarticoAPI.ts +5 -0
- package/src/SmarticoLib/index.ts +3 -3
- package/src/WSAPI/WSAPIMiniGames.ts +7 -1
- package/src/WSAPI/WSAPIMissions.ts +40 -12
- package/src/WSAPI/WSAPITypes.ts +42 -39
package/dist/index.modern.mjs
CHANGED
|
@@ -535,6 +535,7 @@ const SAWTemplatesTransform = items => {
|
|
|
535
535
|
sectors: p.saw_prize_ui_definition.sectors,
|
|
536
536
|
acknowledge_type: SAWAcknowledgeTypeNamed(p.saw_prize_ui_definition.acknowledge_type),
|
|
537
537
|
aknowledge_message: p.saw_prize_ui_definition.aknowledge_message,
|
|
538
|
+
aknowledge_message_lose: p.saw_prize_ui_definition.aknowledge_message_lose,
|
|
538
539
|
acknowledge_dp: p.saw_prize_ui_definition.acknowledge_dp,
|
|
539
540
|
acknowledge_action_title: p.saw_prize_ui_definition.acknowledge_action_title,
|
|
540
541
|
acknowledge_dp_additional: p.saw_prize_ui_definition.acknowledge_dp_additional,
|
|
@@ -3278,18 +3279,46 @@ class WSAPIMissions extends WSAPIGeneral {
|
|
|
3278
3279
|
* `only_in_custom_section: true` are intended for their custom-section
|
|
3279
3280
|
* view only and should be hidden from the main mission list.
|
|
3280
3281
|
*
|
|
3281
|
-
* **
|
|
3282
|
-
*
|
|
3283
|
-
*
|
|
3284
|
-
*
|
|
3285
|
-
*
|
|
3286
|
-
*
|
|
3287
|
-
*
|
|
3288
|
-
*
|
|
3289
|
-
*
|
|
3290
|
-
*
|
|
3291
|
-
*
|
|
3292
|
-
*
|
|
3282
|
+
* **Status bucketing (which tab / section a mission belongs to)**
|
|
3283
|
+
* There is no pre-computed bucket field — assign each mission to exactly
|
|
3284
|
+
* ONE section reading the raw state fields directly (NOT `availability_status`;
|
|
3285
|
+
* see "Timers" below). Priority order, FIRST match wins:
|
|
3286
|
+
* 1. **Missed / Expired** — not completed and the window has closed:
|
|
3287
|
+
* `!is_completed && ((time_limit_ms && dt_start && dt_start + time_limit_ms < Date.now())`
|
|
3288
|
+
* `|| (active_till_ts && active_till_ts < Date.now()))`. Do NOT gate this on
|
|
3289
|
+
* opt-in — an opt-in mission whose window closed before the user ever
|
|
3290
|
+
* opted in is still Missed. Sort by `position` ASC.
|
|
3291
|
+
* 2. **Completed** — `is_completed === true`, OR (recurring-upon-completion
|
|
3292
|
+
* missions) at least one cycle done / the cap reached — see the recurring
|
|
3293
|
+
* caveats below. Sort by `complete_date_ts` DESC.
|
|
3294
|
+
* 3. **Locked** — `is_locked === true`, OR not yet started
|
|
3295
|
+
* (`active_from_ts > Date.now()`). Sort by `position` ASC.
|
|
3296
|
+
* 4. **In-progress** — `is_opted_in === true`, OR (no opt-in required and
|
|
3297
|
+
* `progress > 0`). Sort by `position` ASC.
|
|
3298
|
+
* 5. **Available** — everything else (opt-in required but not yet joined, or
|
|
3299
|
+
* an unrestricted mission not yet started). Sort by `position` ASC.
|
|
3300
|
+
*
|
|
3301
|
+
* **Recurring-upon-completion caveats** (the common mis-bucketing trap):
|
|
3302
|
+
* - `is_completed` NEVER flips true for a recurring-upon-completion mission
|
|
3303
|
+
* (only for one-shot missions) — detect a completed cycle from
|
|
3304
|
+
* `completion_count > 0`, not `is_completed`.
|
|
3305
|
+
* - A non-null `completion_count` is what identifies a recurring-upon-completion
|
|
3306
|
+
* mission. `max_completion_count === null` means an INFINITE cap (still
|
|
3307
|
+
* recurring — never read null as "not recurring"), so only test
|
|
3308
|
+
* `completion_count >= max_completion_count` when `max_completion_count` is set.
|
|
3309
|
+
*
|
|
3310
|
+
* **Timers & timestamps** (display only — NOT bucketing)
|
|
3311
|
+
* `availability_status` (enum {@link AchievementAvailabilityStatus}) is the
|
|
3312
|
+
* timer/window signal: use it to pick WHICH countdown to show and whether the
|
|
3313
|
+
* window has elapsed — NOT to choose the section. It does not read
|
|
3314
|
+
* `completion_count`, and between cycles the server may keep reporting the
|
|
3315
|
+
* just-elapsed cycle's `Missed*` value even after `dt_start` / `active_till_ts`
|
|
3316
|
+
* are cleared for the next attempt, so bucketing by it sends recurring missions
|
|
3317
|
+
* to the wrong tab. For time-limited / opt-in missions `dt_start` is the opt-in
|
|
3318
|
+
* timestamp (or unlock timestamp for previously-locked missions), and a
|
|
3319
|
+
* time-limited mission expires at `dt_start + time_limit_ms`.
|
|
3320
|
+
* `next_recurrence_date_ts` is populated for `RECURRING` / `RECURRING_QUANTITY`
|
|
3321
|
+
* missions but is no longer meaningful once `active_till_ts` has passed.
|
|
3293
3322
|
*
|
|
3294
3323
|
* **Refresh after a mutation**
|
|
3295
3324
|
* After `requestMissionOptIn(...)` or `requestMissionClaimReward(...)`
|
|
@@ -7199,7 +7228,11 @@ class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
7199
7228
|
* true` with no prize attached. Use this for game mechanics where the
|
|
7200
7229
|
* player can decline or forfeit the drawn prize — e.g. a
|
|
7201
7230
|
* gamble/discard step, or a client-driven game where the user's final
|
|
7202
|
-
* action decides whether the pre-drawn prize is actually won
|
|
7231
|
+
* action decides whether the pre-drawn prize is actually won (the
|
|
7232
|
+
* default Smartico UI does this for the Voyager game: failing the
|
|
7233
|
+
* star-collection run finalises the spin as lost). When configured,
|
|
7234
|
+
* the prize's `aknowledge_message_lose` is the operator's result copy
|
|
7235
|
+
* for this case — show it instead of `aknowledge_message`. It only
|
|
7203
7236
|
* works on a spin that is not yet finalised, so it requires playing
|
|
7204
7237
|
* with `acknowledge: false` and calling promptly — once the automatic
|
|
7205
7238
|
* acknowledge or the server-side fallback (below) has finalised the
|
|
@@ -7229,6 +7262,8 @@ class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
7229
7262
|
* - Either way the spin's `is_claimed` flips to `true` on the next
|
|
7230
7263
|
* {@link getMiniGamesHistory} fetch.
|
|
7231
7264
|
*
|
|
7265
|
+
* **UI guidance**: see [UI Guide — `miniGameWinAcknowledgeRequest`](../../docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md).
|
|
7266
|
+
*
|
|
7232
7267
|
* **Visitor mode**: not supported.
|
|
7233
7268
|
*
|
|
7234
7269
|
* @param request_id Correlation id of the spin to finalise: the
|
|
@@ -9997,6 +10032,7 @@ class SmarticoAPI {
|
|
|
9997
10032
|
t.prizes.forEach(p => {
|
|
9998
10033
|
p.saw_prize_ui_definition.name = IntUtils.replaceAll(p.saw_prize_ui_definition.name, '{{jackpot}}', jackpotValue);
|
|
9999
10034
|
p.saw_prize_ui_definition.aknowledge_message = IntUtils.replaceAll(p.saw_prize_ui_definition.aknowledge_message, '{{jackpot}}', jackpotValue);
|
|
10035
|
+
p.saw_prize_ui_definition.aknowledge_message_lose = IntUtils.replaceAll(p.saw_prize_ui_definition.aknowledge_message_lose, '{{jackpot}}', jackpotValue);
|
|
10000
10036
|
});
|
|
10001
10037
|
}
|
|
10002
10038
|
});
|