@smartico/public-api 0.0.356 → 0.0.357
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 +33 -8
- package/dist/WSAPI/WSAPI.d.ts +26 -26
- package/dist/index.js +26 -26
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +26 -26
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/classes/WSAPI.md +19 -19
- package/package.json +1 -1
- package/src/WSAPI/WSAPI.ts +26 -26
package/README.md
CHANGED
|
@@ -122,19 +122,44 @@ npm install --save @smartico/public-api
|
|
|
122
122
|
|
|
123
123
|
### Usage
|
|
124
124
|
|
|
125
|
+
`WSAPI` provides a high-level interface on top of `SmarticoAPI`. Create a `SmarticoAPI` instance with a custom `messageSender`, then create `WSAPI` instances bound to specific users:
|
|
126
|
+
|
|
125
127
|
```typescript
|
|
126
|
-
import { SmarticoAPI } from '@smartico/public-api';
|
|
128
|
+
import { SmarticoAPI, WSAPI } from '@smartico/public-api';
|
|
129
|
+
|
|
130
|
+
// publicApiUrl is resolved automatically by SmarticoAPI from your label key
|
|
131
|
+
const messageSender = async (message: any, publicApiUrl?: string): Promise<any> => {
|
|
132
|
+
const res = await fetch(publicApiUrl, {
|
|
133
|
+
method: 'POST',
|
|
134
|
+
headers: { 'Content-Type': 'application/json' },
|
|
135
|
+
body: JSON.stringify(message),
|
|
136
|
+
});
|
|
137
|
+
return res.ok ? res.json() : '';
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const smarticoApi = new SmarticoAPI('your-label-api-key', 'your-brand-key', messageSender);
|
|
141
|
+
|
|
142
|
+
const userExtId = 'John1984';
|
|
143
|
+
const api = new WSAPI(smarticoApi, userExtId);
|
|
144
|
+
|
|
145
|
+
const missions = await api.getMissions();
|
|
146
|
+
missions.forEach(m => {
|
|
147
|
+
console.log(m.name, m.is_completed);
|
|
148
|
+
});
|
|
127
149
|
|
|
128
|
-
const
|
|
150
|
+
const optInResult = await api.requestMissionOptIn(missions[0].id);
|
|
151
|
+
console.log('Opt-in:', optInResult.err_code);
|
|
152
|
+
```
|
|
129
153
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const response = await SAPI.miniGamesGetTemplates(userExtId);
|
|
154
|
+
For the full list of available methods, see the [WSAPI documentation](docs/api/classes/WSAPI.md).
|
|
133
155
|
|
|
134
|
-
|
|
135
|
-
console.log(t.saw_template_ui_definition.name)
|
|
136
|
-
}
|
|
156
|
+
You can also use `SmarticoAPI` directly for low-level protocol access:
|
|
137
157
|
|
|
158
|
+
```typescript
|
|
159
|
+
const response = await smarticoApi.miniGamesGetTemplates(userExtId);
|
|
160
|
+
response.templates.forEach(t => {
|
|
161
|
+
console.log(t.saw_template_ui_definition.name);
|
|
162
|
+
});
|
|
138
163
|
```
|
|
139
164
|
|
|
140
165
|
## Backend usage (http-protocol)
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -604,7 +604,7 @@ export declare class WSAPI {
|
|
|
604
604
|
*
|
|
605
605
|
* **Example**:
|
|
606
606
|
* ```
|
|
607
|
-
* _smartico.api.
|
|
607
|
+
* _smartico.api.gamePickGetActiveRounds({
|
|
608
608
|
* saw_template_id: 1083,
|
|
609
609
|
* }).then((result) => {
|
|
610
610
|
* console.log(result.data); // GamePickRound[]
|
|
@@ -616,7 +616,7 @@ export declare class WSAPI {
|
|
|
616
616
|
*
|
|
617
617
|
* **Visitor mode: not supported**
|
|
618
618
|
*/
|
|
619
|
-
|
|
619
|
+
gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
|
|
620
620
|
/**
|
|
621
621
|
* Returns a single active round for the specified MatchX or Quiz game.
|
|
622
622
|
* The round includes full event details with the current user's selections.
|
|
@@ -626,12 +626,12 @@ export declare class WSAPI {
|
|
|
626
626
|
*
|
|
627
627
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
628
628
|
* - `errCode` - 0 on success
|
|
629
|
-
* - `data` - Single round object with the same structure as in `
|
|
629
|
+
* - `data` - Single round object with the same structure as in `gamePickGetActiveRounds`,
|
|
630
630
|
* including `events[]` with full event details, user selections, and resolution info
|
|
631
631
|
*
|
|
632
632
|
* **Example**:
|
|
633
633
|
* ```
|
|
634
|
-
* _smartico.api.
|
|
634
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
635
635
|
* saw_template_id: 1083,
|
|
636
636
|
* round_id: 31652,
|
|
637
637
|
* }).then((result) => {
|
|
@@ -642,7 +642,7 @@ export declare class WSAPI {
|
|
|
642
642
|
*
|
|
643
643
|
* **Visitor mode: not supported**
|
|
644
644
|
*/
|
|
645
|
-
|
|
645
|
+
gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>>;
|
|
646
646
|
/**
|
|
647
647
|
* Returns the history of all rounds (including resolved ones) for the specified MatchX or Quiz game.
|
|
648
648
|
* Each round contains full event details with results and the current user's predictions.
|
|
@@ -652,12 +652,12 @@ export declare class WSAPI {
|
|
|
652
652
|
* **Response** `GamesApiResponse<GamePickRound[]>`:
|
|
653
653
|
* - `errCode` - 0 on success
|
|
654
654
|
* - `data` - Array of rounds ordered by `round_row_id` descending (newest first).
|
|
655
|
-
* Each round has the same structure as in `
|
|
655
|
+
* Each round has the same structure as in `gamePickGetActiveRounds`, including resolved events
|
|
656
656
|
* with `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) and `resolution_score`
|
|
657
657
|
*
|
|
658
658
|
* **Example**:
|
|
659
659
|
* ```
|
|
660
|
-
* _smartico.api.
|
|
660
|
+
* _smartico.api.gamePickGetHistory({
|
|
661
661
|
* saw_template_id: 1083,
|
|
662
662
|
* }).then((result) => {
|
|
663
663
|
* result.data.forEach(round => {
|
|
@@ -668,7 +668,7 @@ export declare class WSAPI {
|
|
|
668
668
|
*
|
|
669
669
|
* **Visitor mode: not supported**
|
|
670
670
|
*/
|
|
671
|
-
|
|
671
|
+
gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
|
|
672
672
|
/**
|
|
673
673
|
* Returns the leaderboard for a specific round within a MatchX or Quiz game.
|
|
674
674
|
* Use `round_id = -1` (AllRoundsGameBoardID) to get the season/overall leaderboard across all rounds.
|
|
@@ -690,7 +690,7 @@ export declare class WSAPI {
|
|
|
690
690
|
*
|
|
691
691
|
* **Example**:
|
|
692
692
|
* ```
|
|
693
|
-
* _smartico.api.
|
|
693
|
+
* _smartico.api.gamePickGetBoard({
|
|
694
694
|
* saw_template_id: 1083,
|
|
695
695
|
* round_id: 31652,
|
|
696
696
|
* }).then((result) => {
|
|
@@ -701,7 +701,7 @@ export declare class WSAPI {
|
|
|
701
701
|
*
|
|
702
702
|
* **Visitor mode: not supported**
|
|
703
703
|
*/
|
|
704
|
-
|
|
704
|
+
gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>>;
|
|
705
705
|
/**
|
|
706
706
|
* Submits score predictions for a round in a MatchX game.
|
|
707
707
|
* Sends the round object with user selections for all events at once.
|
|
@@ -710,7 +710,7 @@ export declare class WSAPI {
|
|
|
710
710
|
* Predictions can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
|
|
711
711
|
*
|
|
712
712
|
* @param props.saw_template_id - The ID of the MatchX game template
|
|
713
|
-
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `
|
|
713
|
+
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
|
|
714
714
|
* and modified with user predictions. Each event needs: `gp_event_id`, `team1_user_selection`, `team2_user_selection`
|
|
715
715
|
*
|
|
716
716
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
@@ -720,7 +720,7 @@ export declare class WSAPI {
|
|
|
720
720
|
*
|
|
721
721
|
* **Example**:
|
|
722
722
|
* ```
|
|
723
|
-
* _smartico.api.
|
|
723
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
724
724
|
* saw_template_id: 1190,
|
|
725
725
|
* round_id: 38665,
|
|
726
726
|
* }).then((roundData) => {
|
|
@@ -730,7 +730,7 @@ export declare class WSAPI {
|
|
|
730
730
|
* team1_user_selection: 1,
|
|
731
731
|
* team2_user_selection: 0,
|
|
732
732
|
* }));
|
|
733
|
-
* _smartico.api.
|
|
733
|
+
* _smartico.api.gamePickSubmitSelection({
|
|
734
734
|
* saw_template_id: 1190,
|
|
735
735
|
* round: round,
|
|
736
736
|
* }).then((result) => {
|
|
@@ -741,7 +741,7 @@ export declare class WSAPI {
|
|
|
741
741
|
*
|
|
742
742
|
* **Visitor mode: not supported**
|
|
743
743
|
*/
|
|
744
|
-
|
|
744
|
+
gamePickSubmitSelection(props: GamePickRequestParams & {
|
|
745
745
|
round: Partial<GamePickRound>;
|
|
746
746
|
}): Promise<GamesApiResponse<GamePickRound>>;
|
|
747
747
|
/**
|
|
@@ -752,7 +752,7 @@ export declare class WSAPI {
|
|
|
752
752
|
* Answers can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
|
|
753
753
|
*
|
|
754
754
|
* @param props.saw_template_id - The ID of the Quiz game template
|
|
755
|
-
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `
|
|
755
|
+
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
|
|
756
756
|
* and modified with user answers. Each event needs: `gp_event_id`, `user_selection`
|
|
757
757
|
*
|
|
758
758
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
@@ -762,7 +762,7 @@ export declare class WSAPI {
|
|
|
762
762
|
*
|
|
763
763
|
* **Example**:
|
|
764
764
|
* ```
|
|
765
|
-
* _smartico.api.
|
|
765
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
766
766
|
* saw_template_id: 1183,
|
|
767
767
|
* round_id: 37974,
|
|
768
768
|
* }).then((roundData) => {
|
|
@@ -771,7 +771,7 @@ export declare class WSAPI {
|
|
|
771
771
|
* gp_event_id: e.gp_event_id,
|
|
772
772
|
* user_selection: 'x',
|
|
773
773
|
* }));
|
|
774
|
-
* _smartico.api.
|
|
774
|
+
* _smartico.api.gamePickSubmitSelectionQuiz({
|
|
775
775
|
* saw_template_id: 1183,
|
|
776
776
|
* round: round,
|
|
777
777
|
* }).then((result) => {
|
|
@@ -782,7 +782,7 @@ export declare class WSAPI {
|
|
|
782
782
|
*
|
|
783
783
|
* **Visitor mode: not supported**
|
|
784
784
|
*/
|
|
785
|
-
|
|
785
|
+
gamePickSubmitSelectionQuiz(props: GamePickRequestParams & {
|
|
786
786
|
round: Partial<GamePickRound>;
|
|
787
787
|
}): Promise<GamesApiResponse<GamePickRound>>;
|
|
788
788
|
/**
|
|
@@ -807,7 +807,7 @@ export declare class WSAPI {
|
|
|
807
807
|
*
|
|
808
808
|
* **Example**:
|
|
809
809
|
* ```
|
|
810
|
-
* _smartico.api.
|
|
810
|
+
* _smartico.api.gamePickGetUserInfo({
|
|
811
811
|
* saw_template_id: 1083,
|
|
812
812
|
* }).then((result) => {
|
|
813
813
|
* console.log(result.data.public_username, result.data.ach_points_balance);
|
|
@@ -816,7 +816,7 @@ export declare class WSAPI {
|
|
|
816
816
|
*
|
|
817
817
|
* **Visitor mode: not supported**
|
|
818
818
|
*/
|
|
819
|
-
|
|
819
|
+
gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>>;
|
|
820
820
|
/**
|
|
821
821
|
* Returns the game configuration and the list of all rounds for the specified MatchX or Quiz game.
|
|
822
822
|
* Includes the SAW template definition, label settings, and round metadata (without events).
|
|
@@ -840,7 +840,7 @@ export declare class WSAPI {
|
|
|
840
840
|
*
|
|
841
841
|
* **Example**:
|
|
842
842
|
* ```
|
|
843
|
-
* _smartico.api.
|
|
843
|
+
* _smartico.api.gamePickGetGameInfo({
|
|
844
844
|
* saw_template_id: 1189,
|
|
845
845
|
* }).then((result) => {
|
|
846
846
|
* console.log(result.data.sawTemplate.saw_template_ui_definition.name);
|
|
@@ -851,11 +851,11 @@ export declare class WSAPI {
|
|
|
851
851
|
*
|
|
852
852
|
* **Visitor mode: not supported**
|
|
853
853
|
*/
|
|
854
|
-
|
|
854
|
+
gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>>;
|
|
855
855
|
/**
|
|
856
856
|
* Returns round data with events and picks for a specific user (identified by their internal user ID).
|
|
857
857
|
* Useful for viewing another user's predictions from the leaderboard.
|
|
858
|
-
* The `int_user_id` can be obtained from the `
|
|
858
|
+
* The `int_user_id` can be obtained from the `gamePickGetBoard` response (`users[].int_user_id`).
|
|
859
859
|
*
|
|
860
860
|
* @param props.saw_template_id - The ID of the MatchX or Quiz game template
|
|
861
861
|
* @param props.round_id - The round to get info for
|
|
@@ -864,13 +864,13 @@ export declare class WSAPI {
|
|
|
864
864
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
865
865
|
* - `errCode` - 0 on success
|
|
866
866
|
* - `data` - Round object with the target user's selections.
|
|
867
|
-
* Same structure as `
|
|
867
|
+
* Same structure as `gamePickGetActiveRound`, but `user_selection`/`team1_user_selection`/`team2_user_selection`
|
|
868
868
|
* fields on events reflect the specified user's picks instead of the current user's.
|
|
869
869
|
* Events also include `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) showing how each prediction was scored
|
|
870
870
|
*
|
|
871
871
|
* **Example**:
|
|
872
872
|
* ```
|
|
873
|
-
* _smartico.api.
|
|
873
|
+
* _smartico.api.gamePickGetRoundInfoForUser({
|
|
874
874
|
* saw_template_id: 1083,
|
|
875
875
|
* round_id: 31652,
|
|
876
876
|
* int_user_id: 65653810,
|
|
@@ -883,7 +883,7 @@ export declare class WSAPI {
|
|
|
883
883
|
*
|
|
884
884
|
* **Visitor mode: not supported**
|
|
885
885
|
*/
|
|
886
|
-
|
|
886
|
+
gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & {
|
|
887
887
|
int_user_id: number;
|
|
888
888
|
}): Promise<GamesApiResponse<GamePickRound>>;
|
|
889
889
|
private updateOnSpin;
|
package/dist/index.js
CHANGED
|
@@ -3329,7 +3329,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3329
3329
|
*
|
|
3330
3330
|
* **Example**:
|
|
3331
3331
|
* ```
|
|
3332
|
-
* _smartico.api.
|
|
3332
|
+
* _smartico.api.gamePickGetActiveRounds({
|
|
3333
3333
|
* saw_template_id: 1083,
|
|
3334
3334
|
* }).then((result) => {
|
|
3335
3335
|
* console.log(result.data); // GamePickRound[]
|
|
@@ -3342,7 +3342,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3342
3342
|
* **Visitor mode: not supported**
|
|
3343
3343
|
*/
|
|
3344
3344
|
;
|
|
3345
|
-
_proto.
|
|
3345
|
+
_proto.gamePickGetActiveRounds = function gamePickGetActiveRounds(props) {
|
|
3346
3346
|
try {
|
|
3347
3347
|
var _this36 = this;
|
|
3348
3348
|
if (!props.saw_template_id) {
|
|
@@ -3362,12 +3362,12 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3362
3362
|
*
|
|
3363
3363
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
3364
3364
|
* - `errCode` - 0 on success
|
|
3365
|
-
* - `data` - Single round object with the same structure as in `
|
|
3365
|
+
* - `data` - Single round object with the same structure as in `gamePickGetActiveRounds`,
|
|
3366
3366
|
* including `events[]` with full event details, user selections, and resolution info
|
|
3367
3367
|
*
|
|
3368
3368
|
* **Example**:
|
|
3369
3369
|
* ```
|
|
3370
|
-
* _smartico.api.
|
|
3370
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
3371
3371
|
* saw_template_id: 1083,
|
|
3372
3372
|
* round_id: 31652,
|
|
3373
3373
|
* }).then((result) => {
|
|
@@ -3379,7 +3379,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3379
3379
|
* **Visitor mode: not supported**
|
|
3380
3380
|
*/
|
|
3381
3381
|
;
|
|
3382
|
-
_proto.
|
|
3382
|
+
_proto.gamePickGetActiveRound = function gamePickGetActiveRound(props) {
|
|
3383
3383
|
try {
|
|
3384
3384
|
var _this37 = this;
|
|
3385
3385
|
if (!props.saw_template_id) {
|
|
@@ -3402,12 +3402,12 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3402
3402
|
* **Response** `GamesApiResponse<GamePickRound[]>`:
|
|
3403
3403
|
* - `errCode` - 0 on success
|
|
3404
3404
|
* - `data` - Array of rounds ordered by `round_row_id` descending (newest first).
|
|
3405
|
-
* Each round has the same structure as in `
|
|
3405
|
+
* Each round has the same structure as in `gamePickGetActiveRounds`, including resolved events
|
|
3406
3406
|
* with `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) and `resolution_score`
|
|
3407
3407
|
*
|
|
3408
3408
|
* **Example**:
|
|
3409
3409
|
* ```
|
|
3410
|
-
* _smartico.api.
|
|
3410
|
+
* _smartico.api.gamePickGetHistory({
|
|
3411
3411
|
* saw_template_id: 1083,
|
|
3412
3412
|
* }).then((result) => {
|
|
3413
3413
|
* result.data.forEach(round => {
|
|
@@ -3419,7 +3419,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3419
3419
|
* **Visitor mode: not supported**
|
|
3420
3420
|
*/
|
|
3421
3421
|
;
|
|
3422
|
-
_proto.
|
|
3422
|
+
_proto.gamePickGetHistory = function gamePickGetHistory(props) {
|
|
3423
3423
|
try {
|
|
3424
3424
|
var _this38 = this;
|
|
3425
3425
|
if (!props.saw_template_id) {
|
|
@@ -3451,7 +3451,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3451
3451
|
*
|
|
3452
3452
|
* **Example**:
|
|
3453
3453
|
* ```
|
|
3454
|
-
* _smartico.api.
|
|
3454
|
+
* _smartico.api.gamePickGetBoard({
|
|
3455
3455
|
* saw_template_id: 1083,
|
|
3456
3456
|
* round_id: 31652,
|
|
3457
3457
|
* }).then((result) => {
|
|
@@ -3463,7 +3463,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3463
3463
|
* **Visitor mode: not supported**
|
|
3464
3464
|
*/
|
|
3465
3465
|
;
|
|
3466
|
-
_proto.
|
|
3466
|
+
_proto.gamePickGetBoard = function gamePickGetBoard(props) {
|
|
3467
3467
|
try {
|
|
3468
3468
|
var _this39 = this;
|
|
3469
3469
|
if (!props.saw_template_id) {
|
|
@@ -3485,7 +3485,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3485
3485
|
* Predictions can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
|
|
3486
3486
|
*
|
|
3487
3487
|
* @param props.saw_template_id - The ID of the MatchX game template
|
|
3488
|
-
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `
|
|
3488
|
+
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
|
|
3489
3489
|
* and modified with user predictions. Each event needs: `gp_event_id`, `team1_user_selection`, `team2_user_selection`
|
|
3490
3490
|
*
|
|
3491
3491
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
@@ -3495,7 +3495,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3495
3495
|
*
|
|
3496
3496
|
* **Example**:
|
|
3497
3497
|
* ```
|
|
3498
|
-
* _smartico.api.
|
|
3498
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
3499
3499
|
* saw_template_id: 1190,
|
|
3500
3500
|
* round_id: 38665,
|
|
3501
3501
|
* }).then((roundData) => {
|
|
@@ -3505,7 +3505,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3505
3505
|
* team1_user_selection: 1,
|
|
3506
3506
|
* team2_user_selection: 0,
|
|
3507
3507
|
* }));
|
|
3508
|
-
* _smartico.api.
|
|
3508
|
+
* _smartico.api.gamePickSubmitSelection({
|
|
3509
3509
|
* saw_template_id: 1190,
|
|
3510
3510
|
* round: round,
|
|
3511
3511
|
* }).then((result) => {
|
|
@@ -3517,7 +3517,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3517
3517
|
* **Visitor mode: not supported**
|
|
3518
3518
|
*/
|
|
3519
3519
|
;
|
|
3520
|
-
_proto.
|
|
3520
|
+
_proto.gamePickSubmitSelection = function gamePickSubmitSelection(props) {
|
|
3521
3521
|
try {
|
|
3522
3522
|
var _props$round;
|
|
3523
3523
|
var _this40 = this;
|
|
@@ -3540,7 +3540,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3540
3540
|
* Answers can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
|
|
3541
3541
|
*
|
|
3542
3542
|
* @param props.saw_template_id - The ID of the Quiz game template
|
|
3543
|
-
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `
|
|
3543
|
+
* @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
|
|
3544
3544
|
* and modified with user answers. Each event needs: `gp_event_id`, `user_selection`
|
|
3545
3545
|
*
|
|
3546
3546
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
@@ -3550,7 +3550,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3550
3550
|
*
|
|
3551
3551
|
* **Example**:
|
|
3552
3552
|
* ```
|
|
3553
|
-
* _smartico.api.
|
|
3553
|
+
* _smartico.api.gamePickGetActiveRound({
|
|
3554
3554
|
* saw_template_id: 1183,
|
|
3555
3555
|
* round_id: 37974,
|
|
3556
3556
|
* }).then((roundData) => {
|
|
@@ -3559,7 +3559,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3559
3559
|
* gp_event_id: e.gp_event_id,
|
|
3560
3560
|
* user_selection: 'x',
|
|
3561
3561
|
* }));
|
|
3562
|
-
* _smartico.api.
|
|
3562
|
+
* _smartico.api.gamePickSubmitSelectionQuiz({
|
|
3563
3563
|
* saw_template_id: 1183,
|
|
3564
3564
|
* round: round,
|
|
3565
3565
|
* }).then((result) => {
|
|
@@ -3571,7 +3571,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3571
3571
|
* **Visitor mode: not supported**
|
|
3572
3572
|
*/
|
|
3573
3573
|
;
|
|
3574
|
-
_proto.
|
|
3574
|
+
_proto.gamePickSubmitSelectionQuiz = function gamePickSubmitSelectionQuiz(props) {
|
|
3575
3575
|
try {
|
|
3576
3576
|
var _props$round2;
|
|
3577
3577
|
var _this41 = this;
|
|
@@ -3608,7 +3608,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3608
3608
|
*
|
|
3609
3609
|
* **Example**:
|
|
3610
3610
|
* ```
|
|
3611
|
-
* _smartico.api.
|
|
3611
|
+
* _smartico.api.gamePickGetUserInfo({
|
|
3612
3612
|
* saw_template_id: 1083,
|
|
3613
3613
|
* }).then((result) => {
|
|
3614
3614
|
* console.log(result.data.public_username, result.data.ach_points_balance);
|
|
@@ -3618,7 +3618,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3618
3618
|
* **Visitor mode: not supported**
|
|
3619
3619
|
*/
|
|
3620
3620
|
;
|
|
3621
|
-
_proto.
|
|
3621
|
+
_proto.gamePickGetUserInfo = function gamePickGetUserInfo(props) {
|
|
3622
3622
|
try {
|
|
3623
3623
|
var _this42 = this;
|
|
3624
3624
|
if (!props.saw_template_id) {
|
|
@@ -3652,7 +3652,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3652
3652
|
*
|
|
3653
3653
|
* **Example**:
|
|
3654
3654
|
* ```
|
|
3655
|
-
* _smartico.api.
|
|
3655
|
+
* _smartico.api.gamePickGetGameInfo({
|
|
3656
3656
|
* saw_template_id: 1189,
|
|
3657
3657
|
* }).then((result) => {
|
|
3658
3658
|
* console.log(result.data.sawTemplate.saw_template_ui_definition.name);
|
|
@@ -3664,7 +3664,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3664
3664
|
* **Visitor mode: not supported**
|
|
3665
3665
|
*/
|
|
3666
3666
|
;
|
|
3667
|
-
_proto.
|
|
3667
|
+
_proto.gamePickGetGameInfo = function gamePickGetGameInfo(props) {
|
|
3668
3668
|
try {
|
|
3669
3669
|
var _this43 = this;
|
|
3670
3670
|
if (!props.saw_template_id) {
|
|
@@ -3678,7 +3678,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3678
3678
|
/**
|
|
3679
3679
|
* Returns round data with events and picks for a specific user (identified by their internal user ID).
|
|
3680
3680
|
* Useful for viewing another user's predictions from the leaderboard.
|
|
3681
|
-
* The `int_user_id` can be obtained from the `
|
|
3681
|
+
* The `int_user_id` can be obtained from the `gamePickGetBoard` response (`users[].int_user_id`).
|
|
3682
3682
|
*
|
|
3683
3683
|
* @param props.saw_template_id - The ID of the MatchX or Quiz game template
|
|
3684
3684
|
* @param props.round_id - The round to get info for
|
|
@@ -3687,13 +3687,13 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3687
3687
|
* **Response** `GamesApiResponse<GamePickRound>`:
|
|
3688
3688
|
* - `errCode` - 0 on success
|
|
3689
3689
|
* - `data` - Round object with the target user's selections.
|
|
3690
|
-
* Same structure as `
|
|
3690
|
+
* Same structure as `gamePickGetActiveRound`, but `user_selection`/`team1_user_selection`/`team2_user_selection`
|
|
3691
3691
|
* fields on events reflect the specified user's picks instead of the current user's.
|
|
3692
3692
|
* Events also include `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) showing how each prediction was scored
|
|
3693
3693
|
*
|
|
3694
3694
|
* **Example**:
|
|
3695
3695
|
* ```
|
|
3696
|
-
* _smartico.api.
|
|
3696
|
+
* _smartico.api.gamePickGetRoundInfoForUser({
|
|
3697
3697
|
* saw_template_id: 1083,
|
|
3698
3698
|
* round_id: 31652,
|
|
3699
3699
|
* int_user_id: 65653810,
|
|
@@ -3707,7 +3707,7 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
3707
3707
|
* **Visitor mode: not supported**
|
|
3708
3708
|
*/
|
|
3709
3709
|
;
|
|
3710
|
-
_proto.
|
|
3710
|
+
_proto.gamePickGetRoundInfoForUser = function gamePickGetRoundInfoForUser(props) {
|
|
3711
3711
|
try {
|
|
3712
3712
|
var _this44 = this;
|
|
3713
3713
|
if (!props.saw_template_id) {
|