@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
|
@@ -154,7 +154,7 @@ export interface QuizEventMeta {
|
|
|
154
154
|
custom_question: string;
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
157
|
-
* GamePickEventMeta describes metadata for a MatchX or
|
|
157
|
+
* GamePickEventMeta describes metadata for a MatchX, Quiz or Bingo event, including team info and sport context
|
|
158
158
|
*/
|
|
159
159
|
export interface GamePickEventMeta extends QuizEventMeta {
|
|
160
160
|
/** Display name of the event/match */
|
|
@@ -448,7 +448,7 @@ export interface GamesApiResponse<T> {
|
|
|
448
448
|
* GamePickRequestParams describes the base parameters required for GamePick API calls
|
|
449
449
|
*/
|
|
450
450
|
export interface GamePickRequestParams {
|
|
451
|
-
/** ID of the MatchX or
|
|
451
|
+
/** ID of the MatchX, Quiz or Bingo game template. The only field the consumer supplies. */
|
|
452
452
|
saw_template_id: number;
|
|
453
453
|
/** External user ID. Injected by the SDK from the active session; consumers omit it. */
|
|
454
454
|
ext_user_id?: string;
|
|
@@ -11,7 +11,8 @@ export declare enum SAWGameType {
|
|
|
11
11
|
Voyager = 10,
|
|
12
12
|
Plinko = 11,
|
|
13
13
|
CoinFlip = 12,
|
|
14
|
-
CustomMinigame = 13
|
|
14
|
+
CustomMinigame = 13,
|
|
15
|
+
Bingo = 14
|
|
15
16
|
}
|
|
16
17
|
export declare enum SAWGameTypeName {
|
|
17
18
|
SpinAWheel = "wheel",
|
|
@@ -27,6 +28,7 @@ export declare enum SAWGameTypeName {
|
|
|
27
28
|
Plinko = "plinko",
|
|
28
29
|
CoinFlip = "coin_flip",
|
|
29
30
|
CustomMinigame = "custom_minigame",
|
|
31
|
+
Bingo = "bingo",
|
|
30
32
|
Unknown = "unknown"
|
|
31
33
|
}
|
|
32
34
|
/** @hidden */
|
|
@@ -10,13 +10,13 @@ export interface SAWPrize {
|
|
|
10
10
|
prize_value?: number;
|
|
11
11
|
/** The type of the prize — see {@link SAWPrizeType} */
|
|
12
12
|
prize_type_id: SAWPrizeType;
|
|
13
|
-
/** Competition games (MatchX / Quiz): first finishing place this prize applies to */
|
|
13
|
+
/** Competition games (MatchX / Quiz / Bingo): first finishing place this prize applies to */
|
|
14
14
|
place_from?: number;
|
|
15
|
-
/** Competition games (MatchX / Quiz): last finishing place this prize applies to; equals `place_from` for a single-place prize */
|
|
15
|
+
/** Competition games (MatchX / Quiz / Bingo): last finishing place this prize applies to; equals `place_from` for a single-place prize */
|
|
16
16
|
place_to?: number;
|
|
17
17
|
/** Client-side only — unique id of a win instance generated by the default Smartico UI to dedupe render effects; never sent by the server */
|
|
18
18
|
sawUniqueWinId?: string;
|
|
19
|
-
/** Remaining stock. Present only when the template's `expose_game_stat_on_api` is enabled; always present for MatchX / Quiz games */
|
|
19
|
+
/** Remaining stock. Present only when the template's `expose_game_stat_on_api` is enabled; always present for MatchX / Quiz / Bingo games */
|
|
20
20
|
pool?: number;
|
|
21
21
|
/** Initial (configured) stock. Present regardless of `expose_game_stat_on_api` */
|
|
22
22
|
pool_initial?: number;
|
|
@@ -52,7 +52,7 @@ export interface SAWTemplate {
|
|
|
52
52
|
use_new_popups?: boolean;
|
|
53
53
|
lottie_animation_speed?: number;
|
|
54
54
|
};
|
|
55
|
-
/** Operator template setting. When enabled, the per-prize stock statistics (`pool`, `wins_count`, `weekdays`, `active_from_ts` / `active_till_ts`) are populated on `prizes`; when disabled (default) the server strips them from the response (`pool` is kept for MatchX / Quiz games). */
|
|
55
|
+
/** Operator template setting. When enabled, the per-prize stock statistics (`pool`, `wins_count`, `weekdays`, `active_from_ts` / `active_till_ts`) are populated on `prizes`; when disabled (default) the server strips them from the response (`pool` is kept for MatchX / Quiz / Bingo games). */
|
|
56
56
|
expose_game_stat_on_api?: boolean;
|
|
57
57
|
/** Prize Drop only: when true, the pushed prize requires an explicit claim by the user before it is credited */
|
|
58
58
|
requires_prize_claim?: boolean;
|
|
@@ -383,8 +383,8 @@ export interface SAWTemplateUI {
|
|
|
383
383
|
* widget loads `custom_game_url` in an iframe instead of rendering the
|
|
384
384
|
* built-in game. `saw_game_type_id` still reports the original type, so
|
|
385
385
|
* treat this flag — not the type — as the answer to "is this played as a
|
|
386
|
-
* custom game", together with `SAWGameType.CustomMinigame
|
|
387
|
-
* played that way.
|
|
386
|
+
* custom game", together with `SAWGameType.CustomMinigame` and
|
|
387
|
+
* `SAWGameType.Bingo`, which are always played that way.
|
|
388
388
|
*
|
|
389
389
|
* When `false` or omitted, the template is played as its own game type.
|
|
390
390
|
* Back-Office label: _"Use Custom Game"_.
|
|
@@ -10,8 +10,8 @@ export declare enum AchievementAvailabilityStatus {
|
|
|
10
10
|
AvailableInactive = 1,
|
|
11
11
|
/** Mission without date/time restrictions or with passed active from date, opt-in is required, user is opted-in or mission is unlocked*/
|
|
12
12
|
AvailableActive = 2,
|
|
13
|
-
/** Mission with active from date defined, date is in future.
|
|
14
|
-
* Field: active_from_ts
|
|
13
|
+
/** 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.
|
|
14
|
+
* Field: activity_period_next_start_ts when set (the time the mission opens next), otherwise active_from_ts
|
|
15
15
|
*/
|
|
16
16
|
UnavailableWithActiveFrom = 3,
|
|
17
17
|
/** Mission with active till date defined, date is in future, and no opt-in required and mission is unlocked.
|
|
@@ -3,7 +3,7 @@ import { WSAPIAvatars } from './WSAPIAvatars';
|
|
|
3
3
|
/** @group GamePick */
|
|
4
4
|
export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
5
5
|
/**
|
|
6
|
-
* Returns every open round for a MatchX or
|
|
6
|
+
* Returns every open round for a MatchX, Quiz or Bingo game template, with the full
|
|
7
7
|
* event list (matches / questions) and the current user's selections per event.
|
|
8
8
|
*
|
|
9
9
|
* Use to power the rounds-lobby screen — typically a list of round cards a user
|
|
@@ -13,7 +13,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
13
13
|
* @remarks
|
|
14
14
|
* **Preconditions**
|
|
15
15
|
* - User must be authenticated.
|
|
16
|
-
* - `saw_template_id` must reference a MatchX or
|
|
16
|
+
* - `saw_template_id` must reference a MatchX, Quiz or Bingo game template. The SDK
|
|
17
17
|
* throws synchronously if it's missing.
|
|
18
18
|
*
|
|
19
19
|
* **Transport**
|
|
@@ -46,7 +46,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
46
46
|
*
|
|
47
47
|
* **UI guidance**: see [UI Guide — `gamePickGetActiveRounds`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md).
|
|
48
48
|
*
|
|
49
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
49
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
50
50
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array.
|
|
51
51
|
*
|
|
52
52
|
* @example
|
|
@@ -66,7 +66,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
66
66
|
gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
|
|
67
67
|
/**
|
|
68
68
|
* Returns a single round (events, user selections, scoring rules) for a
|
|
69
|
-
* MatchX or
|
|
69
|
+
* MatchX, Quiz or Bingo game. Use to power the round-detail / prediction-input
|
|
70
70
|
* screen the user lands on after picking a round from the lobby.
|
|
71
71
|
*
|
|
72
72
|
* Same shape as one entry of {@link gamePickGetActiveRounds}; cheaper when the
|
|
@@ -98,7 +98,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
98
98
|
*
|
|
99
99
|
* **UI guidance**: see [UI Guide — `gamePickGetActiveRound`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md).
|
|
100
100
|
*
|
|
101
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
101
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
102
102
|
* @param props.round_id ID of the round to fetch.
|
|
103
103
|
* @returns Wrapped {@link GamesApiResponse} of a single {@link GamePickRound}.
|
|
104
104
|
*
|
|
@@ -118,7 +118,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
118
118
|
*/
|
|
119
119
|
gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>>;
|
|
120
120
|
/**
|
|
121
|
-
* Returns the full round history (active + resolved) for a MatchX or
|
|
121
|
+
* Returns the full round history (active + resolved) for a MatchX, Quiz or Bingo game
|
|
122
122
|
* template, newest-first. Each round carries the user's predictions plus the
|
|
123
123
|
* server-resolved outcome on each event.
|
|
124
124
|
*
|
|
@@ -152,7 +152,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
152
152
|
*
|
|
153
153
|
* **UI guidance**: see [UI Guide — `gamePickGetHistory`](../../docs/ui/gamepick/UIGuide_gamePickGetHistory.md).
|
|
154
154
|
*
|
|
155
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
155
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
156
156
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array,
|
|
157
157
|
* newest-first.
|
|
158
158
|
*
|
|
@@ -167,7 +167,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
167
167
|
*/
|
|
168
168
|
gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
|
|
169
169
|
/**
|
|
170
|
-
* Returns the leaderboard for a MatchX or
|
|
170
|
+
* Returns the leaderboard for a MatchX, Quiz or Bingo game round — ranked list of
|
|
171
171
|
* players plus the current user's entry (`my_user`). Pass `round_id: -1` for
|
|
172
172
|
* the season / overall leaderboard across every round in the template.
|
|
173
173
|
*
|
|
@@ -207,7 +207,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
207
207
|
*
|
|
208
208
|
* **UI guidance**: see [UI Guide — `gamePickGetBoard`](../../docs/ui/gamepick/UIGuide_gamePickGetBoard.md).
|
|
209
209
|
*
|
|
210
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
210
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
211
211
|
* @param props.round_id Round ID, or `-1` for the season leaderboard.
|
|
212
212
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickRoundBoard}.
|
|
213
213
|
*
|
|
@@ -452,7 +452,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
452
452
|
*
|
|
453
453
|
* **UI guidance**: see [UI Guide — `gamePickGetUserInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md).
|
|
454
454
|
*
|
|
455
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
455
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
456
456
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickUserInfo}.
|
|
457
457
|
*
|
|
458
458
|
* @example
|
|
@@ -504,7 +504,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
504
504
|
*
|
|
505
505
|
* **UI guidance**: see [UI Guide — `gamePickGetGameInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md).
|
|
506
506
|
*
|
|
507
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
507
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
508
508
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickGameInfo}.
|
|
509
509
|
*
|
|
510
510
|
* @example
|
|
@@ -559,7 +559,7 @@ export declare class WSAPIGamePick extends WSAPIAvatars {
|
|
|
559
559
|
*
|
|
560
560
|
* **UI guidance**: see [UI Guide — `gamePickGetRoundInfoForUser`](../../docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md).
|
|
561
561
|
*
|
|
562
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
562
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
563
563
|
* @param props.round_id ID of the round to inspect.
|
|
564
564
|
* @param props.int_user_id Internal user ID from
|
|
565
565
|
* `gamePickGetBoard.users[].int_user_id`.
|
|
@@ -42,14 +42,14 @@ export declare class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
42
42
|
* substitution at fetch time.
|
|
43
43
|
*
|
|
44
44
|
* **Game-type variants**
|
|
45
|
-
* All
|
|
45
|
+
* All `SAWGameType` values (`SpinAWheel`, `ScratchCard`,
|
|
46
46
|
* `MatchX`, `GiftBox`, `PrizeDrop`, `Quiz`, `LootboxWeekdays`,
|
|
47
47
|
* `LootboxCalendarDays`, `TreasureHunt`, `Voyager`, `Plinko`,
|
|
48
|
-
* `CoinFlip`) surface through the same template shape. Most are
|
|
48
|
+
* `CoinFlip`, `CustomMinigame`, `Bingo`) surface through the same template shape. Most are
|
|
49
49
|
* played via {@link playMiniGame}; the exceptions are:
|
|
50
50
|
* - `PrizeDrop` — server-push only; the consumer does NOT call
|
|
51
51
|
* `playMiniGame`. Prizes arrive via the prize-drop push channel.
|
|
52
|
-
* - `MatchX` / `Quiz` — predictions are submitted via a separate
|
|
52
|
+
* - `MatchX` / `Quiz` / `Bingo` — predictions are submitted via a separate
|
|
53
53
|
* games server (not this SDK); the SAW spin is fired
|
|
54
54
|
* server-internally to deduct the buy-in.
|
|
55
55
|
*
|
|
@@ -208,7 +208,7 @@ export declare class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
208
208
|
* Works for all `SAWGameType` values EXCEPT:
|
|
209
209
|
* - `PrizeDrop` — prizes arrive server-pushed; do NOT call
|
|
210
210
|
* `playMiniGame` for this type.
|
|
211
|
-
* - `MatchX` / `Quiz` — prediction submission goes through a
|
|
211
|
+
* - `MatchX` / `Quiz` / `Bingo` — prediction submission goes through a
|
|
212
212
|
* separate games server; `playMiniGame` is not the entry point.
|
|
213
213
|
*
|
|
214
214
|
* @remarks
|
|
@@ -50,6 +50,10 @@ export declare class WSAPIMissions extends WSAPIGeneral {
|
|
|
50
50
|
* - `RECURRING` missions between cycles, until the next cycle starts.
|
|
51
51
|
* - `RECURRING_QUANTITY` missions outside their `active_from_ts` /
|
|
52
52
|
* `active_till_ts` window.
|
|
53
|
+
* - Missions available only on some weekdays or days of the month, while
|
|
54
|
+
* outside those days — unless the mission is configured to be shown
|
|
55
|
+
* before it opens (then it arrives with `activity_period_next_start_ts`),
|
|
56
|
+
* and always once it will not open again. Completed missions stay.
|
|
53
57
|
*
|
|
54
58
|
* Client-side filtering you may still want: missions with
|
|
55
59
|
* `only_in_custom_section: true` are intended for their custom-section
|
|
@@ -68,7 +72,9 @@ export declare class WSAPIMissions extends WSAPIGeneral {
|
|
|
68
72
|
* missions) at least one cycle done / the cap reached — see the recurring
|
|
69
73
|
* caveats below. Sort by `complete_date_ts` DESC.
|
|
70
74
|
* 3. **Locked** — `is_locked === true`, OR not yet started
|
|
71
|
-
* (`active_from_ts > Date.now()`)
|
|
75
|
+
* (`active_from_ts > Date.now()`), OR outside its active days
|
|
76
|
+
* (`activity_period_next_start_ts > Date.now()` — show an "opens in"
|
|
77
|
+
* countdown to it, and refetch when it elapses). Sort by `position` ASC.
|
|
72
78
|
* 4. **In-progress** — `is_opted_in === true`, OR (no opt-in required and
|
|
73
79
|
* `progress > 0`). Sort by `position` ASC.
|
|
74
80
|
* 5. **Available** — everything else (opt-in required but not yet joined, or
|
|
@@ -378,8 +384,9 @@ export declare class WSAPIMissions extends WSAPIGeneral {
|
|
|
378
384
|
* means local mission state was stale (e.g. user opted in from another
|
|
379
385
|
* session/tab).
|
|
380
386
|
* - `40013` — mission not opt-in-able: missing `requires_optin`, in
|
|
381
|
-
* DRAFT/ARCHIVED state,
|
|
382
|
-
* `active_till_ts` window
|
|
387
|
+
* DRAFT/ARCHIVED state, outside its `active_from_ts` /
|
|
388
|
+
* `active_till_ts` window, or outside its active weekdays / days of the
|
|
389
|
+
* month (`activity_period_next_start_ts` is set).
|
|
383
390
|
* - `40014` — mission is locked; user has unlock-tasks remaining.
|
|
384
391
|
* Surface the mission's `unlock_mission_description` to guide them.
|
|
385
392
|
* - other non-zero — generic server error. Surface `err_message` if any.
|
|
@@ -62,7 +62,7 @@ export interface TMiniGamePrize {
|
|
|
62
62
|
second_btn_action_title?: string;
|
|
63
63
|
/** Message when the prize pool is empty for that specific prize */
|
|
64
64
|
out_of_stock_message?: string;
|
|
65
|
-
/** Remaining stock of the prize — decrements on each win, refunded if the spin is finalised as lost. Populated only when the template's `expose_game_stat_on_api` is enabled; always populated for MatchX / Quiz games */
|
|
65
|
+
/** Remaining stock of the prize — decrements on each win, refunded if the spin is finalised as lost. Populated only when the template's `expose_game_stat_on_api` is enabled; always populated for MatchX / Quiz / Bingo games */
|
|
66
66
|
pool?: number;
|
|
67
67
|
/** Initial (configured) stock of the prize. Populated regardless of `expose_game_stat_on_api` */
|
|
68
68
|
pool_initial?: number;
|
|
@@ -857,6 +857,8 @@ export interface TMissionOrBadge {
|
|
|
857
857
|
active_from_ts: number;
|
|
858
858
|
/** Holds time till mission will become unavailable, for the missions that are targeted to be available from specific date/time */
|
|
859
859
|
active_till_ts: number;
|
|
860
|
+
/** Time (epoch ms) when a mission that is available only on some weekdays or days of the month opens next. Set only while the mission is outside its active days and is shown before it opens; absent when it is open now or has no such limit */
|
|
861
|
+
activity_period_next_start_ts?: number;
|
|
860
862
|
/** The date when the mission was started, relevant for the time limited missions, also indicating opt-it date for mission that requires opt-in and unlock date for Locked mission. */
|
|
861
863
|
dt_start: number;
|
|
862
864
|
/** The progress of the mission in percents calculated as the aggregated relative percentage of all tasks */
|
package/dist/index.js
CHANGED
|
@@ -394,6 +394,7 @@ exports.SAWGameType = void 0;
|
|
|
394
394
|
SAWGameType[SAWGameType["Plinko"] = 11] = "Plinko";
|
|
395
395
|
SAWGameType[SAWGameType["CoinFlip"] = 12] = "CoinFlip";
|
|
396
396
|
SAWGameType[SAWGameType["CustomMinigame"] = 13] = "CustomMinigame";
|
|
397
|
+
SAWGameType[SAWGameType["Bingo"] = 14] = "Bingo";
|
|
397
398
|
})(exports.SAWGameType || (exports.SAWGameType = {}));
|
|
398
399
|
exports.SAWGameTypeName = void 0;
|
|
399
400
|
(function (SAWGameTypeName) {
|
|
@@ -410,12 +411,13 @@ exports.SAWGameTypeName = void 0;
|
|
|
410
411
|
SAWGameTypeName["Plinko"] = "plinko";
|
|
411
412
|
SAWGameTypeName["CoinFlip"] = "coin_flip";
|
|
412
413
|
SAWGameTypeName["CustomMinigame"] = "custom_minigame";
|
|
414
|
+
SAWGameTypeName["Bingo"] = "bingo";
|
|
413
415
|
SAWGameTypeName["Unknown"] = "unknown";
|
|
414
416
|
})(exports.SAWGameTypeName || (exports.SAWGameTypeName = {}));
|
|
415
417
|
/** @hidden */
|
|
416
418
|
var SAWGameTypeNamed = function SAWGameTypeNamed(type) {
|
|
417
419
|
var _SAWGameType$SpinAWhe;
|
|
418
|
-
return (_SAWGameType$SpinAWhe = {}, _SAWGameType$SpinAWhe[exports.SAWGameType.SpinAWheel] = exports.SAWGameTypeName.SpinAWheel, _SAWGameType$SpinAWhe[exports.SAWGameType.ScratchCard] = exports.SAWGameTypeName.ScratchCard, _SAWGameType$SpinAWhe[exports.SAWGameType.MatchX] = exports.SAWGameTypeName.MatchX, _SAWGameType$SpinAWhe[exports.SAWGameType.GiftBox] = exports.SAWGameTypeName.GiftBox, _SAWGameType$SpinAWhe[exports.SAWGameType.PrizeDrop] = exports.SAWGameTypeName.PrizeDrop, _SAWGameType$SpinAWhe[exports.SAWGameType.Quiz] = exports.SAWGameTypeName.Quiz, _SAWGameType$SpinAWhe[exports.SAWGameType.LootboxWeekdays] = exports.SAWGameTypeName.LootboxWeekdays, _SAWGameType$SpinAWhe[exports.SAWGameType.LootboxCalendarDays] = exports.SAWGameTypeName.LootboxCalendarDays, _SAWGameType$SpinAWhe[exports.SAWGameType.TreasureHunt] = exports.SAWGameTypeName.TreasureHunt, _SAWGameType$SpinAWhe[exports.SAWGameType.Voyager] = exports.SAWGameTypeName.Voyager, _SAWGameType$SpinAWhe[exports.SAWGameType.Plinko] = exports.SAWGameTypeName.Plinko, _SAWGameType$SpinAWhe[exports.SAWGameType.CoinFlip] = exports.SAWGameTypeName.CoinFlip, _SAWGameType$SpinAWhe[exports.SAWGameType.CustomMinigame] = exports.SAWGameTypeName.CustomMinigame, _SAWGameType$SpinAWhe)[type] || exports.SAWGameTypeName.Unknown;
|
|
420
|
+
return (_SAWGameType$SpinAWhe = {}, _SAWGameType$SpinAWhe[exports.SAWGameType.SpinAWheel] = exports.SAWGameTypeName.SpinAWheel, _SAWGameType$SpinAWhe[exports.SAWGameType.ScratchCard] = exports.SAWGameTypeName.ScratchCard, _SAWGameType$SpinAWhe[exports.SAWGameType.MatchX] = exports.SAWGameTypeName.MatchX, _SAWGameType$SpinAWhe[exports.SAWGameType.GiftBox] = exports.SAWGameTypeName.GiftBox, _SAWGameType$SpinAWhe[exports.SAWGameType.PrizeDrop] = exports.SAWGameTypeName.PrizeDrop, _SAWGameType$SpinAWhe[exports.SAWGameType.Quiz] = exports.SAWGameTypeName.Quiz, _SAWGameType$SpinAWhe[exports.SAWGameType.LootboxWeekdays] = exports.SAWGameTypeName.LootboxWeekdays, _SAWGameType$SpinAWhe[exports.SAWGameType.LootboxCalendarDays] = exports.SAWGameTypeName.LootboxCalendarDays, _SAWGameType$SpinAWhe[exports.SAWGameType.TreasureHunt] = exports.SAWGameTypeName.TreasureHunt, _SAWGameType$SpinAWhe[exports.SAWGameType.Voyager] = exports.SAWGameTypeName.Voyager, _SAWGameType$SpinAWhe[exports.SAWGameType.Plinko] = exports.SAWGameTypeName.Plinko, _SAWGameType$SpinAWhe[exports.SAWGameType.CoinFlip] = exports.SAWGameTypeName.CoinFlip, _SAWGameType$SpinAWhe[exports.SAWGameType.CustomMinigame] = exports.SAWGameTypeName.CustomMinigame, _SAWGameType$SpinAWhe[exports.SAWGameType.Bingo] = exports.SAWGameTypeName.Bingo, _SAWGameType$SpinAWhe)[type] || exports.SAWGameTypeName.Unknown;
|
|
419
421
|
};
|
|
420
422
|
|
|
421
423
|
exports.SAWExposeUserSpinId = void 0;
|
|
@@ -1281,8 +1283,8 @@ exports.AchievementAvailabilityStatus = void 0;
|
|
|
1281
1283
|
AchievementAvailabilityStatus[AchievementAvailabilityStatus["AvailableInactive"] = 1] = "AvailableInactive";
|
|
1282
1284
|
/** Mission without date/time restrictions or with passed active from date, opt-in is required, user is opted-in or mission is unlocked*/
|
|
1283
1285
|
AchievementAvailabilityStatus[AchievementAvailabilityStatus["AvailableActive"] = 2] = "AvailableActive";
|
|
1284
|
-
/** Mission with active from date defined, date is in future.
|
|
1285
|
-
* Field: active_from_ts
|
|
1286
|
+
/** 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.
|
|
1287
|
+
* Field: activity_period_next_start_ts when set (the time the mission opens next), otherwise active_from_ts
|
|
1286
1288
|
*/
|
|
1287
1289
|
AchievementAvailabilityStatus[AchievementAvailabilityStatus["UnavailableWithActiveFrom"] = 3] = "UnavailableWithActiveFrom";
|
|
1288
1290
|
/** Mission with active till date defined, date is in future, and no opt-in required and mission is unlocked.
|
|
@@ -1382,6 +1384,10 @@ MissionUtils.getAvailabilityStatus = function (mission) {
|
|
|
1382
1384
|
if (!mission) {
|
|
1383
1385
|
return null;
|
|
1384
1386
|
}
|
|
1387
|
+
// a mission available only on some weekdays / days of the month, currently outside them
|
|
1388
|
+
if (mission.activity_period_next_start_ts && _MissionUtils.getMs(mission.activity_period_next_start_ts) > Date.now()) {
|
|
1389
|
+
return exports.AchievementAvailabilityStatus.UnavailableWithActiveFrom;
|
|
1390
|
+
}
|
|
1385
1391
|
var activeFrom = mission.active_from_ts ? _MissionUtils.getMs(mission.active_from_ts) : null;
|
|
1386
1392
|
var activeTill = mission.active_till_ts ? _MissionUtils.getMs(mission.active_till_ts) : null;
|
|
1387
1393
|
var startDate = mission.start_date_ts ? _MissionUtils.getMs(mission.start_date_ts) : null;
|
|
@@ -1680,6 +1686,7 @@ var UserAchievementTransform = function UserAchievementTransform(items) {
|
|
|
1680
1686
|
time_limit_ms: r.time_limit_ms,
|
|
1681
1687
|
active_from_ts: r.active_from_ts,
|
|
1682
1688
|
active_till_ts: r.active_till_ts,
|
|
1689
|
+
activity_period_next_start_ts: r.activity_period_next_start_ts,
|
|
1683
1690
|
dt_start: r.start_date_ts,
|
|
1684
1691
|
reward: r.ach_public_meta.reward,
|
|
1685
1692
|
progress: r.progress,
|
|
@@ -3457,6 +3464,10 @@ var WSAPIMissions = /*#__PURE__*/function (_WSAPIGeneral) {
|
|
|
3457
3464
|
* - `RECURRING` missions between cycles, until the next cycle starts.
|
|
3458
3465
|
* - `RECURRING_QUANTITY` missions outside their `active_from_ts` /
|
|
3459
3466
|
* `active_till_ts` window.
|
|
3467
|
+
* - Missions available only on some weekdays or days of the month, while
|
|
3468
|
+
* outside those days — unless the mission is configured to be shown
|
|
3469
|
+
* before it opens (then it arrives with `activity_period_next_start_ts`),
|
|
3470
|
+
* and always once it will not open again. Completed missions stay.
|
|
3460
3471
|
*
|
|
3461
3472
|
* Client-side filtering you may still want: missions with
|
|
3462
3473
|
* `only_in_custom_section: true` are intended for their custom-section
|
|
@@ -3475,7 +3486,9 @@ var WSAPIMissions = /*#__PURE__*/function (_WSAPIGeneral) {
|
|
|
3475
3486
|
* missions) at least one cycle done / the cap reached — see the recurring
|
|
3476
3487
|
* caveats below. Sort by `complete_date_ts` DESC.
|
|
3477
3488
|
* 3. **Locked** — `is_locked === true`, OR not yet started
|
|
3478
|
-
* (`active_from_ts > Date.now()`)
|
|
3489
|
+
* (`active_from_ts > Date.now()`), OR outside its active days
|
|
3490
|
+
* (`activity_period_next_start_ts > Date.now()` — show an "opens in"
|
|
3491
|
+
* countdown to it, and refetch when it elapses). Sort by `position` ASC.
|
|
3479
3492
|
* 4. **In-progress** — `is_opted_in === true`, OR (no opt-in required and
|
|
3480
3493
|
* `progress > 0`). Sort by `position` ASC.
|
|
3481
3494
|
* 5. **Available** — everything else (opt-in required but not yet joined, or
|
|
@@ -3823,8 +3836,9 @@ var WSAPIMissions = /*#__PURE__*/function (_WSAPIGeneral) {
|
|
|
3823
3836
|
* means local mission state was stale (e.g. user opted in from another
|
|
3824
3837
|
* session/tab).
|
|
3825
3838
|
* - `40013` — mission not opt-in-able: missing `requires_optin`, in
|
|
3826
|
-
* DRAFT/ARCHIVED state,
|
|
3827
|
-
* `active_till_ts` window
|
|
3839
|
+
* DRAFT/ARCHIVED state, outside its `active_from_ts` /
|
|
3840
|
+
* `active_till_ts` window, or outside its active weekdays / days of the
|
|
3841
|
+
* month (`activity_period_next_start_ts` is set).
|
|
3828
3842
|
* - `40014` — mission is locked; user has unlock-tasks remaining.
|
|
3829
3843
|
* Surface the mission's `unlock_mission_description` to guide them.
|
|
3830
3844
|
* - other non-zero — generic server error. Surface `err_message` if any.
|
|
@@ -7397,14 +7411,14 @@ var WSAPIMiniGames = /*#__PURE__*/function (_WSAPIRaffles) {
|
|
|
7397
7411
|
* substitution at fetch time.
|
|
7398
7412
|
*
|
|
7399
7413
|
* **Game-type variants**
|
|
7400
|
-
* All
|
|
7414
|
+
* All `SAWGameType` values (`SpinAWheel`, `ScratchCard`,
|
|
7401
7415
|
* `MatchX`, `GiftBox`, `PrizeDrop`, `Quiz`, `LootboxWeekdays`,
|
|
7402
7416
|
* `LootboxCalendarDays`, `TreasureHunt`, `Voyager`, `Plinko`,
|
|
7403
|
-
* `CoinFlip`) surface through the same template shape. Most are
|
|
7417
|
+
* `CoinFlip`, `CustomMinigame`, `Bingo`) surface through the same template shape. Most are
|
|
7404
7418
|
* played via {@link playMiniGame}; the exceptions are:
|
|
7405
7419
|
* - `PrizeDrop` — server-push only; the consumer does NOT call
|
|
7406
7420
|
* `playMiniGame`. Prizes arrive via the prize-drop push channel.
|
|
7407
|
-
* - `MatchX` / `Quiz` — predictions are submitted via a separate
|
|
7421
|
+
* - `MatchX` / `Quiz` / `Bingo` — predictions are submitted via a separate
|
|
7408
7422
|
* games server (not this SDK); the SAW spin is fired
|
|
7409
7423
|
* server-internally to deduct the buy-in.
|
|
7410
7424
|
*
|
|
@@ -7584,7 +7598,7 @@ var WSAPIMiniGames = /*#__PURE__*/function (_WSAPIRaffles) {
|
|
|
7584
7598
|
* Works for all `SAWGameType` values EXCEPT:
|
|
7585
7599
|
* - `PrizeDrop` — prizes arrive server-pushed; do NOT call
|
|
7586
7600
|
* `playMiniGame` for this type.
|
|
7587
|
-
* - `MatchX` / `Quiz` — prediction submission goes through a
|
|
7601
|
+
* - `MatchX` / `Quiz` / `Bingo` — prediction submission goes through a
|
|
7588
7602
|
* separate games server; `playMiniGame` is not the entry point.
|
|
7589
7603
|
*
|
|
7590
7604
|
* @remarks
|
|
@@ -8575,7 +8589,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
8575
8589
|
_inheritsLoose(WSAPIGamePick, _WSAPIAvatars);
|
|
8576
8590
|
var _proto = WSAPIGamePick.prototype;
|
|
8577
8591
|
/**
|
|
8578
|
-
* Returns every open round for a MatchX or
|
|
8592
|
+
* Returns every open round for a MatchX, Quiz or Bingo game template, with the full
|
|
8579
8593
|
* event list (matches / questions) and the current user's selections per event.
|
|
8580
8594
|
*
|
|
8581
8595
|
* Use to power the rounds-lobby screen — typically a list of round cards a user
|
|
@@ -8585,7 +8599,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
8585
8599
|
* @remarks
|
|
8586
8600
|
* **Preconditions**
|
|
8587
8601
|
* - User must be authenticated.
|
|
8588
|
-
* - `saw_template_id` must reference a MatchX or
|
|
8602
|
+
* - `saw_template_id` must reference a MatchX, Quiz or Bingo game template. The SDK
|
|
8589
8603
|
* throws synchronously if it's missing.
|
|
8590
8604
|
*
|
|
8591
8605
|
* **Transport**
|
|
@@ -8618,7 +8632,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
8618
8632
|
*
|
|
8619
8633
|
* **UI guidance**: see [UI Guide — `gamePickGetActiveRounds`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md).
|
|
8620
8634
|
*
|
|
8621
|
-
* @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.
|
|
8622
8636
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array.
|
|
8623
8637
|
*
|
|
8624
8638
|
* @example
|
|
@@ -8648,7 +8662,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
8648
8662
|
}
|
|
8649
8663
|
/**
|
|
8650
8664
|
* Returns a single round (events, user selections, scoring rules) for a
|
|
8651
|
-
* MatchX or
|
|
8665
|
+
* MatchX, Quiz or Bingo game. Use to power the round-detail / prediction-input
|
|
8652
8666
|
* screen the user lands on after picking a round from the lobby.
|
|
8653
8667
|
*
|
|
8654
8668
|
* Same shape as one entry of {@link gamePickGetActiveRounds}; cheaper when the
|
|
@@ -8680,7 +8694,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
8680
8694
|
*
|
|
8681
8695
|
* **UI guidance**: see [UI Guide — `gamePickGetActiveRound`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md).
|
|
8682
8696
|
*
|
|
8683
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
8697
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
8684
8698
|
* @param props.round_id ID of the round to fetch.
|
|
8685
8699
|
* @returns Wrapped {@link GamesApiResponse} of a single {@link GamePickRound}.
|
|
8686
8700
|
*
|
|
@@ -8714,7 +8728,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
8714
8728
|
}
|
|
8715
8729
|
}
|
|
8716
8730
|
/**
|
|
8717
|
-
* Returns the full round history (active + resolved) for a MatchX or
|
|
8731
|
+
* Returns the full round history (active + resolved) for a MatchX, Quiz or Bingo game
|
|
8718
8732
|
* template, newest-first. Each round carries the user's predictions plus the
|
|
8719
8733
|
* server-resolved outcome on each event.
|
|
8720
8734
|
*
|
|
@@ -8748,7 +8762,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
8748
8762
|
*
|
|
8749
8763
|
* **UI guidance**: see [UI Guide — `gamePickGetHistory`](../../docs/ui/gamepick/UIGuide_gamePickGetHistory.md).
|
|
8750
8764
|
*
|
|
8751
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
8765
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
8752
8766
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array,
|
|
8753
8767
|
* newest-first.
|
|
8754
8768
|
*
|
|
@@ -8774,7 +8788,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
8774
8788
|
}
|
|
8775
8789
|
}
|
|
8776
8790
|
/**
|
|
8777
|
-
* Returns the leaderboard for a MatchX or
|
|
8791
|
+
* Returns the leaderboard for a MatchX, Quiz or Bingo game round — ranked list of
|
|
8778
8792
|
* players plus the current user's entry (`my_user`). Pass `round_id: -1` for
|
|
8779
8793
|
* the season / overall leaderboard across every round in the template.
|
|
8780
8794
|
*
|
|
@@ -8814,7 +8828,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
8814
8828
|
*
|
|
8815
8829
|
* **UI guidance**: see [UI Guide — `gamePickGetBoard`](../../docs/ui/gamepick/UIGuide_gamePickGetBoard.md).
|
|
8816
8830
|
*
|
|
8817
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
8831
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
8818
8832
|
* @param props.round_id Round ID, or `-1` for the season leaderboard.
|
|
8819
8833
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickRoundBoard}.
|
|
8820
8834
|
*
|
|
@@ -9099,7 +9113,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
9099
9113
|
*
|
|
9100
9114
|
* **UI guidance**: see [UI Guide — `gamePickGetUserInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md).
|
|
9101
9115
|
*
|
|
9102
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
9116
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
9103
9117
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickUserInfo}.
|
|
9104
9118
|
*
|
|
9105
9119
|
* @example
|
|
@@ -9162,7 +9176,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
9162
9176
|
*
|
|
9163
9177
|
* **UI guidance**: see [UI Guide — `gamePickGetGameInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md).
|
|
9164
9178
|
*
|
|
9165
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
9179
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
9166
9180
|
* @returns Wrapped {@link GamesApiResponse} of {@link GamePickGameInfo}.
|
|
9167
9181
|
*
|
|
9168
9182
|
* @example
|
|
@@ -9228,7 +9242,7 @@ var WSAPIGamePick = /*#__PURE__*/function (_WSAPIAvatars) {
|
|
|
9228
9242
|
*
|
|
9229
9243
|
* **UI guidance**: see [UI Guide — `gamePickGetRoundInfoForUser`](../../docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md).
|
|
9230
9244
|
*
|
|
9231
|
-
* @param props.saw_template_id ID of the MatchX or
|
|
9245
|
+
* @param props.saw_template_id ID of the MatchX, Quiz or Bingo game template.
|
|
9232
9246
|
* @param props.round_id ID of the round to inspect.
|
|
9233
9247
|
* @param props.int_user_id Internal user ID from
|
|
9234
9248
|
* `gamePickGetBoard.users[].int_user_id`.
|