@smartico/public-api 0.0.438 → 0.0.440
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/GamePick/GamePickTypes.d.ts +2 -2
- package/dist/MiniGames/SAWGameType.d.ts +3 -1
- package/dist/MiniGames/SAWPrize.d.ts +3 -3
- package/dist/MiniGames/SAWTemplate.d.ts +1 -1
- package/dist/MiniGames/SAWTemplateUI.d.ts +2 -2
- package/dist/Missions/AchievementAvailabilityStatus.d.ts +2 -2
- package/dist/Missions/UserAchievement.d.ts +1 -0
- package/dist/WSAPI/WSAPIGamePick.d.ts +12 -12
- package/dist/WSAPI/WSAPIMiniGames.d.ts +4 -4
- package/dist/WSAPI/WSAPIMissions.d.ts +10 -3
- package/dist/WSAPI/WSAPITypes.d.ts +3 -1
- package/dist/index.js +36 -22
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +37 -22
- package/dist/index.modern.mjs.map +1 -1
- package/docs/ui/missions/UIGuide_getMissions.md +7 -1
- package/package.json +1 -1
- package/src/GamePick/GamePickTypes.ts +2 -2
- package/src/MiniGames/SAWGameType.ts +3 -0
- package/src/MiniGames/SAWPrize.ts +3 -3
- package/src/MiniGames/SAWTemplate.ts +1 -1
- package/src/MiniGames/SAWTemplateUI.ts +2 -2
- package/src/Missions/AchievementAvailabilityStatus.ts +2 -2
- package/src/Missions/MissionsUtils.ts +5 -0
- package/src/Missions/UserAchievement.ts +2 -0
- package/src/WSAPI/WSAPIGamePick.ts +12 -12
- package/src/WSAPI/WSAPIMiniGames.ts +4 -4
- package/src/WSAPI/WSAPIMissions.ts +10 -3
- package/src/WSAPI/WSAPITypes.ts +4 -1
package/dist/index.modern.mjs
CHANGED
|
@@ -364,6 +364,7 @@ var SAWGameType;
|
|
|
364
364
|
SAWGameType[SAWGameType["Plinko"] = 11] = "Plinko";
|
|
365
365
|
SAWGameType[SAWGameType["CoinFlip"] = 12] = "CoinFlip";
|
|
366
366
|
SAWGameType[SAWGameType["CustomMinigame"] = 13] = "CustomMinigame";
|
|
367
|
+
SAWGameType[SAWGameType["Bingo"] = 14] = "Bingo";
|
|
367
368
|
})(SAWGameType || (SAWGameType = {}));
|
|
368
369
|
var SAWGameTypeName;
|
|
369
370
|
(function (SAWGameTypeName) {
|
|
@@ -380,6 +381,7 @@ var SAWGameTypeName;
|
|
|
380
381
|
SAWGameTypeName["Plinko"] = "plinko";
|
|
381
382
|
SAWGameTypeName["CoinFlip"] = "coin_flip";
|
|
382
383
|
SAWGameTypeName["CustomMinigame"] = "custom_minigame";
|
|
384
|
+
SAWGameTypeName["Bingo"] = "bingo";
|
|
383
385
|
SAWGameTypeName["Unknown"] = "unknown";
|
|
384
386
|
})(SAWGameTypeName || (SAWGameTypeName = {}));
|
|
385
387
|
/** @hidden */
|
|
@@ -397,7 +399,8 @@ const SAWGameTypeNamed = type => {
|
|
|
397
399
|
[SAWGameType.Voyager]: SAWGameTypeName.Voyager,
|
|
398
400
|
[SAWGameType.Plinko]: SAWGameTypeName.Plinko,
|
|
399
401
|
[SAWGameType.CoinFlip]: SAWGameTypeName.CoinFlip,
|
|
400
|
-
[SAWGameType.CustomMinigame]: SAWGameTypeName.CustomMinigame
|
|
402
|
+
[SAWGameType.CustomMinigame]: SAWGameTypeName.CustomMinigame,
|
|
403
|
+
[SAWGameType.Bingo]: SAWGameTypeName.Bingo
|
|
401
404
|
}[type] || SAWGameTypeName.Unknown;
|
|
402
405
|
};
|
|
403
406
|
|
|
@@ -1255,8 +1258,8 @@ var AchievementAvailabilityStatus;
|
|
|
1255
1258
|
AchievementAvailabilityStatus[AchievementAvailabilityStatus["AvailableInactive"] = 1] = "AvailableInactive";
|
|
1256
1259
|
/** Mission without date/time restrictions or with passed active from date, opt-in is required, user is opted-in or mission is unlocked*/
|
|
1257
1260
|
AchievementAvailabilityStatus[AchievementAvailabilityStatus["AvailableActive"] = 2] = "AvailableActive";
|
|
1258
|
-
/** Mission with active from date defined, date is in future.
|
|
1259
|
-
* Field: active_from_ts
|
|
1261
|
+
/** Mission with active from date defined, date is in future, or a mission available only on some weekdays / days of the month that is outside its active days.
|
|
1262
|
+
* Field: activity_period_next_start_ts when set (the time the mission opens next), otherwise active_from_ts
|
|
1260
1263
|
*/
|
|
1261
1264
|
AchievementAvailabilityStatus[AchievementAvailabilityStatus["UnavailableWithActiveFrom"] = 3] = "UnavailableWithActiveFrom";
|
|
1262
1265
|
/** Mission with active till date defined, date is in future, and no opt-in required and mission is unlocked.
|
|
@@ -1354,6 +1357,10 @@ MissionUtils.getAvailabilityStatus = mission => {
|
|
|
1354
1357
|
if (!mission) {
|
|
1355
1358
|
return null;
|
|
1356
1359
|
}
|
|
1360
|
+
// a mission available only on some weekdays / days of the month, currently outside them
|
|
1361
|
+
if (mission.activity_period_next_start_ts && _MissionUtils.getMs(mission.activity_period_next_start_ts) > Date.now()) {
|
|
1362
|
+
return AchievementAvailabilityStatus.UnavailableWithActiveFrom;
|
|
1363
|
+
}
|
|
1357
1364
|
const activeFrom = mission.active_from_ts ? _MissionUtils.getMs(mission.active_from_ts) : null;
|
|
1358
1365
|
const activeTill = mission.active_till_ts ? _MissionUtils.getMs(mission.active_till_ts) : null;
|
|
1359
1366
|
const startDate = mission.start_date_ts ? _MissionUtils.getMs(mission.start_date_ts) : null;
|
|
@@ -1648,6 +1655,7 @@ const UserAchievementTransform = items => {
|
|
|
1648
1655
|
time_limit_ms: r.time_limit_ms,
|
|
1649
1656
|
active_from_ts: r.active_from_ts,
|
|
1650
1657
|
active_till_ts: r.active_till_ts,
|
|
1658
|
+
activity_period_next_start_ts: r.activity_period_next_start_ts,
|
|
1651
1659
|
dt_start: r.start_date_ts,
|
|
1652
1660
|
reward: r.ach_public_meta.reward,
|
|
1653
1661
|
progress: r.progress,
|
|
@@ -3323,6 +3331,10 @@ class WSAPIMissions extends WSAPIGeneral {
|
|
|
3323
3331
|
* - `RECURRING` missions between cycles, until the next cycle starts.
|
|
3324
3332
|
* - `RECURRING_QUANTITY` missions outside their `active_from_ts` /
|
|
3325
3333
|
* `active_till_ts` window.
|
|
3334
|
+
* - Missions available only on some weekdays or days of the month, while
|
|
3335
|
+
* outside those days — unless the mission is configured to be shown
|
|
3336
|
+
* before it opens (then it arrives with `activity_period_next_start_ts`),
|
|
3337
|
+
* and always once it will not open again. Completed missions stay.
|
|
3326
3338
|
*
|
|
3327
3339
|
* Client-side filtering you may still want: missions with
|
|
3328
3340
|
* `only_in_custom_section: true` are intended for their custom-section
|
|
@@ -3341,7 +3353,9 @@ class WSAPIMissions extends WSAPIGeneral {
|
|
|
3341
3353
|
* missions) at least one cycle done / the cap reached — see the recurring
|
|
3342
3354
|
* caveats below. Sort by `complete_date_ts` DESC.
|
|
3343
3355
|
* 3. **Locked** — `is_locked === true`, OR not yet started
|
|
3344
|
-
* (`active_from_ts > Date.now()`)
|
|
3356
|
+
* (`active_from_ts > Date.now()`), OR outside its active days
|
|
3357
|
+
* (`activity_period_next_start_ts > Date.now()` — show an "opens in"
|
|
3358
|
+
* countdown to it, and refetch when it elapses). Sort by `position` ASC.
|
|
3345
3359
|
* 4. **In-progress** — `is_opted_in === true`, OR (no opt-in required and
|
|
3346
3360
|
* `progress > 0`). Sort by `position` ASC.
|
|
3347
3361
|
* 5. **Available** — everything else (opt-in required but not yet joined, or
|
|
@@ -3666,8 +3680,9 @@ class WSAPIMissions extends WSAPIGeneral {
|
|
|
3666
3680
|
* means local mission state was stale (e.g. user opted in from another
|
|
3667
3681
|
* session/tab).
|
|
3668
3682
|
* - `40013` — mission not opt-in-able: missing `requires_optin`, in
|
|
3669
|
-
* DRAFT/ARCHIVED state,
|
|
3670
|
-
* `active_till_ts` window
|
|
3683
|
+
* DRAFT/ARCHIVED state, outside its `active_from_ts` /
|
|
3684
|
+
* `active_till_ts` window, or outside its active weekdays / days of the
|
|
3685
|
+
* month (`activity_period_next_start_ts` is set).
|
|
3671
3686
|
* - `40014` — mission is locked; user has unlock-tasks remaining.
|
|
3672
3687
|
* Surface the mission's `unlock_mission_description` to guide them.
|
|
3673
3688
|
* - other non-zero — generic server error. Surface `err_message` if any.
|
|
@@ -6943,14 +6958,14 @@ class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
6943
6958
|
* substitution at fetch time.
|
|
6944
6959
|
*
|
|
6945
6960
|
* **Game-type variants**
|
|
6946
|
-
* All
|
|
6961
|
+
* All `SAWGameType` values (`SpinAWheel`, `ScratchCard`,
|
|
6947
6962
|
* `MatchX`, `GiftBox`, `PrizeDrop`, `Quiz`, `LootboxWeekdays`,
|
|
6948
6963
|
* `LootboxCalendarDays`, `TreasureHunt`, `Voyager`, `Plinko`,
|
|
6949
|
-
* `CoinFlip`) surface through the same template shape. Most are
|
|
6964
|
+
* `CoinFlip`, `CustomMinigame`, `Bingo`) surface through the same template shape. Most are
|
|
6950
6965
|
* played via {@link playMiniGame}; the exceptions are:
|
|
6951
6966
|
* - `PrizeDrop` — server-push only; the consumer does NOT call
|
|
6952
6967
|
* `playMiniGame`. Prizes arrive via the prize-drop push channel.
|
|
6953
|
-
* - `MatchX` / `Quiz` — predictions are submitted via a separate
|
|
6968
|
+
* - `MatchX` / `Quiz` / `Bingo` — predictions are submitted via a separate
|
|
6954
6969
|
* games server (not this SDK); the SAW spin is fired
|
|
6955
6970
|
* server-internally to deduct the buy-in.
|
|
6956
6971
|
*
|
|
@@ -7116,7 +7131,7 @@ class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
7116
7131
|
* Works for all `SAWGameType` values EXCEPT:
|
|
7117
7132
|
* - `PrizeDrop` — prizes arrive server-pushed; do NOT call
|
|
7118
7133
|
* `playMiniGame` for this type.
|
|
7119
|
-
* - `MatchX` / `Quiz` — prediction submission goes through a
|
|
7134
|
+
* - `MatchX` / `Quiz` / `Bingo` — prediction submission goes through a
|
|
7120
7135
|
* separate games server; `playMiniGame` is not the entry point.
|
|
7121
7136
|
*
|
|
7122
7137
|
* @remarks
|
|
@@ -8011,7 +8026,7 @@ class WSAPIAvatars extends WSAPIMiniGames {
|
|
|
8011
8026
|
/** @group GamePick */
|
|
8012
8027
|
class WSAPIGamePick extends WSAPIAvatars {
|
|
8013
8028
|
/**
|
|
8014
|
-
* Returns every open round for a MatchX or
|
|
8029
|
+
* Returns every open round for a MatchX, Quiz or Bingo game template, with the full
|
|
8015
8030
|
* event list (matches / questions) and the current user's selections per event.
|
|
8016
8031
|
*
|
|
8017
8032
|
* Use to power the rounds-lobby screen — typically a list of round cards a user
|
|
@@ -8021,7 +8036,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8021
8036
|
* @remarks
|
|
8022
8037
|
* **Preconditions**
|
|
8023
8038
|
* - User must be authenticated.
|
|
8024
|
-
* - `saw_template_id` must reference a MatchX or
|
|
8039
|
+
* - `saw_template_id` must reference a MatchX, Quiz or Bingo game template. The SDK
|
|
8025
8040
|
* throws synchronously if it's missing.
|
|
8026
8041
|
*
|
|
8027
8042
|
* **Transport**
|
|
@@ -8054,7 +8069,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8054
8069
|
*
|
|
8055
8070
|
* **UI guidance**: see [UI Guide — `gamePickGetActiveRounds`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md).
|
|
8056
8071
|
*
|
|
8057
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
8072
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
8058
8073
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array.
|
|
8059
8074
|
*
|
|
8060
8075
|
* @example
|
|
@@ -8079,7 +8094,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8079
8094
|
}
|
|
8080
8095
|
/**
|
|
8081
8096
|
* Returns a single round (events, user selections, scoring rules) for a
|
|
8082
|
-
* MatchX or
|
|
8097
|
+
* MatchX, Quiz or Bingo game. Use to power the round-detail / prediction-input
|
|
8083
8098
|
* screen the user lands on after picking a round from the lobby.
|
|
8084
8099
|
*
|
|
8085
8100
|
* Same shape as one entry of {@link gamePickGetActiveRounds}; cheaper when the
|
|
@@ -8111,7 +8126,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8111
8126
|
*
|
|
8112
8127
|
* **UI guidance**: see [UI Guide — `gamePickGetActiveRound`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md).
|
|
8113
8128
|
*
|
|
8114
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
8129
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
8115
8130
|
* @param props.round_id ID of the round to fetch.
|
|
8116
8131
|
* @returns Wrapped {@link GamesApiResponse} of a single {@link GamePickRound}.
|
|
8117
8132
|
*
|
|
@@ -8139,7 +8154,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8139
8154
|
return this.api.gpGetActiveRound(props.saw_template_id, props.round_id);
|
|
8140
8155
|
}
|
|
8141
8156
|
/**
|
|
8142
|
-
* Returns the full round history (active + resolved) for a MatchX or
|
|
8157
|
+
* Returns the full round history (active + resolved) for a MatchX, Quiz or Bingo game
|
|
8143
8158
|
* template, newest-first. Each round carries the user's predictions plus the
|
|
8144
8159
|
* server-resolved outcome on each event.
|
|
8145
8160
|
*
|
|
@@ -8173,7 +8188,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8173
8188
|
*
|
|
8174
8189
|
* **UI guidance**: see [UI Guide — `gamePickGetHistory`](../../docs/ui/gamepick/UIGuide_gamePickGetHistory.md).
|
|
8175
8190
|
*
|
|
8176
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
8191
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
8177
8192
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array,
|
|
8178
8193
|
* newest-first.
|
|
8179
8194
|
*
|
|
@@ -8193,7 +8208,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8193
8208
|
return this.api.gpGetGamesHistory(props.saw_template_id);
|
|
8194
8209
|
}
|
|
8195
8210
|
/**
|
|
8196
|
-
* Returns the leaderboard for a MatchX or
|
|
8211
|
+
* Returns the leaderboard for a MatchX, Quiz or Bingo game round — ranked list of
|
|
8197
8212
|
* players plus the current user's entry (`my_user`). Pass `round_id: -1` for
|
|
8198
8213
|
* the season / overall leaderboard across every round in the template.
|
|
8199
8214
|
*
|
|
@@ -8233,7 +8248,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8233
8248
|
*
|
|
8234
8249
|
* **UI guidance**: see [UI Guide — `gamePickGetBoard`](../../docs/ui/gamepick/UIGuide_gamePickGetBoard.md).
|
|
8235
8250
|
*
|
|
8236
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
8251
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
8237
8252
|
* @param props.round_id Round ID, or `-1` for the season leaderboard.
|
|
8238
8253
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickRoundBoard}.
|
|
8239
8254
|
*
|
|
@@ -8500,7 +8515,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8500
8515
|
*
|
|
8501
8516
|
* **UI guidance**: see [UI Guide — `gamePickGetUserInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md).
|
|
8502
8517
|
*
|
|
8503
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
8518
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
8504
8519
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickUserInfo}.
|
|
8505
8520
|
*
|
|
8506
8521
|
* @example
|
|
@@ -8557,7 +8572,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8557
8572
|
*
|
|
8558
8573
|
* **UI guidance**: see [UI Guide — `gamePickGetGameInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md).
|
|
8559
8574
|
*
|
|
8560
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
8575
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
8561
8576
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickGameInfo}.
|
|
8562
8577
|
*
|
|
8563
8578
|
* @example
|
|
@@ -8617,7 +8632,7 @@ class WSAPIGamePick extends WSAPIAvatars {
|
|
|
8617
8632
|
*
|
|
8618
8633
|
* **UI guidance**: see [UI Guide — `gamePickGetRoundInfoForUser`](../../docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md).
|
|
8619
8634
|
*
|
|
8620
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
8635
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
8621
8636
|
* @param props.round_id ID of the round to inspect.
|
|
8622
8637
|
* @param props.int_user_id Internal user ID from
|
|
8623
8638
|
* `gamePickGetBoard.users[].int_user_id`.
|