@smartico/public-api 0.0.226 → 0.0.227
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/Base/ClassId.d.ts +4 -2
- package/dist/Raffle/GetRaffleDrawRunsHistoryRequest.d.ts +5 -0
- package/dist/Raffle/GetRaffleDrawRunsHistoryResponse.d.ts +5 -0
- package/dist/Raffle/RaffleDraw.d.ts +31 -1
- package/dist/Raffle/RafflePrize.d.ts +4 -0
- package/dist/Raffle/RafflePrizeWinner.d.ts +2 -1
- package/dist/Raffle/index.d.ts +2 -0
- package/dist/SmarticoAPI.d.ts +3 -0
- package/dist/WSAPI/WSAPI.d.ts +3 -0
- package/dist/index.js +38 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +18 -2
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +3 -0
- package/docs/classes/WSAPI.md +32 -0
- package/docs/interfaces/GetRaffleDrawRunsHistoryRequest.md +49 -0
- package/docs/interfaces/GetRaffleDrawRunsHistoryResponse.md +63 -0
- package/docs/interfaces/RaffleDrawRun.md +61 -0
- package/docs/interfaces/RafflePrize.md +8 -0
- package/docs/interfaces/RafflePrizeWinner.md +6 -0
- package/package.json +1 -1
- package/src/Base/ClassId.ts +4 -3
- package/src/Raffle/GetRaffleDrawRunsHistoryRequest.ts +6 -0
- package/src/Raffle/GetRaffleDrawRunsHistoryResponse.ts +6 -0
- package/src/Raffle/RaffleDraw.ts +39 -1
- package/src/Raffle/RafflePrize.ts +6 -1
- package/src/Raffle/RafflePrizeWinner.ts +7 -6
- package/src/Raffle/index.ts +3 -1
- package/src/SmarticoAPI.ts +22 -0
- package/src/WSAPI/WSAPI.ts +10 -1
package/dist/Base/ClassId.d.ts
CHANGED
|
@@ -101,8 +101,10 @@ export declare enum ClassId {
|
|
|
101
101
|
JP_WIN_PUSH = 808,
|
|
102
102
|
RAF_GET_RAFFLES_REQUEST = 902,
|
|
103
103
|
RAF_GET_RAFFLES_RESPONSE = 903,
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
RAF_GET_DRAW_RUN_REQUEST = 904,
|
|
105
|
+
RAF_GET_DRAW_RUN_RESPONSE = 905,
|
|
106
|
+
RAF_GET_DRAW_HISTORY_REQUEST = 906,
|
|
107
|
+
RAF_GET_DRAW_HISTORY_RESPONSE = 907,
|
|
106
108
|
REGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,
|
|
107
109
|
REGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,
|
|
108
110
|
CLIENT_DEBUG_REQUEST = 77777,
|
|
@@ -92,4 +92,34 @@ interface RaffleDraw {
|
|
|
92
92
|
my_tickets_count: number;
|
|
93
93
|
my_last_tickets: RaffleTicket[];
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
interface RaffleDrawRun {
|
|
96
|
+
/**
|
|
97
|
+
* Id of the Draw definition, for the repetative draws (e.g. daily), this number will be the same for all draws that are repeating daily
|
|
98
|
+
* (internal name: schedule_id)
|
|
99
|
+
*/
|
|
100
|
+
draw_id: number;
|
|
101
|
+
/**
|
|
102
|
+
* Field indicates the ID of the latest instance/run of draw
|
|
103
|
+
*/
|
|
104
|
+
run_id: number;
|
|
105
|
+
/** Meta information of the Draw for the presentaiton in UI */
|
|
106
|
+
public_meta: RaffleDrawPublicMeta;
|
|
107
|
+
/** Date/time of the draw execution */
|
|
108
|
+
execution_ts: number;
|
|
109
|
+
/**
|
|
110
|
+
* Date/time starting from which the tickets will participate in the upcoming draw
|
|
111
|
+
* This value need to be taken into account with next_execute_ts field value, for example
|
|
112
|
+
* Next draw is at 10:00, ticket_start_date is 9:00, so all tickets that are collected after 9:00 will participate in the draw at 10:00
|
|
113
|
+
* (internally this value is calculated as next_execute_ts - ticket_start_date)
|
|
114
|
+
*/
|
|
115
|
+
ticket_start_date: number;
|
|
116
|
+
/**
|
|
117
|
+
* Shows if user has won a prize in a current run
|
|
118
|
+
*/
|
|
119
|
+
is_winner: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Shows if user has unclaimed prize
|
|
122
|
+
*/
|
|
123
|
+
has_unclaimed_prize: boolean;
|
|
124
|
+
}
|
|
125
|
+
export { RaffleDraw, RaffleDrawRun };
|
|
@@ -92,6 +92,10 @@ interface RafflePrize {
|
|
|
92
92
|
* the stock_items_per_draw will be decreasing by 1 each day (assuming there is enough tickets and it is won every day), and when it reaches 0, the prize is not available anymore.
|
|
93
93
|
*/
|
|
94
94
|
stock_items_per_draw?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Shows if the prize has been claimed
|
|
97
|
+
*/
|
|
98
|
+
is_claimed: boolean;
|
|
95
99
|
winners: RafflePrizeWinner[];
|
|
96
100
|
}
|
|
97
101
|
export { RafflePrize };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { RaffleTicket } from
|
|
1
|
+
import { RaffleTicket } from './RaffleTicket';
|
|
2
2
|
interface RafflePrizeWinner {
|
|
3
3
|
user_id: number;
|
|
4
4
|
public_username?: string;
|
|
5
5
|
avatar_id: string;
|
|
6
6
|
avatar_url?: string;
|
|
7
7
|
ticket: RaffleTicket;
|
|
8
|
+
won_ids: number[];
|
|
8
9
|
}
|
|
9
10
|
export { RafflePrizeWinner };
|
package/dist/Raffle/index.d.ts
CHANGED
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { SAWDoAcknowledgeBatchResponse } from './MiniGames/SAWDoAcknowledgeBatch
|
|
|
21
21
|
import { GetRelatedAchTourResponse } from './Missions/GetRelatedAchTourResponse';
|
|
22
22
|
import { GetRafflesResponse } from './Raffle/GetRafflesResponse';
|
|
23
23
|
import { InboxCategories } from './Inbox/InboxCategories';
|
|
24
|
+
import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse } from './Raffle';
|
|
24
25
|
interface Tracker {
|
|
25
26
|
label_api_key: string;
|
|
26
27
|
userPublicProps: any;
|
|
@@ -131,5 +132,7 @@ declare class SmarticoAPI {
|
|
|
131
132
|
getWSCalls(): WSAPI;
|
|
132
133
|
getRelatedItemsForGame(user_ext_id: string, related_game_id: string): Promise<GetRelatedAchTourResponse>;
|
|
133
134
|
getRaffles(user_ext_id: string): Promise<GetRafflesResponse>;
|
|
135
|
+
getDrawRun(user_ext_id: string, payload: GetDrawRunRequest): Promise<GetDrawRunResponse>;
|
|
136
|
+
getRaffleDrawRunsHistory(user_ext_id: string, payload: GetRaffleDrawRunsHistoryRequest): Promise<GetRaffleDrawRunsHistoryResponse>;
|
|
134
137
|
}
|
|
135
138
|
export { SmarticoAPI, MessageSender };
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from '.
|
|
|
5
5
|
import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';
|
|
6
6
|
import { GetRafflesResponse } from '../Raffle/GetRafflesResponse';
|
|
7
7
|
import { InboxCategories } from '../Inbox/InboxCategories';
|
|
8
|
+
import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse } from 'src/Raffle';
|
|
8
9
|
/** @group General API */
|
|
9
10
|
export declare class WSAPI {
|
|
10
11
|
private api;
|
|
@@ -545,4 +546,6 @@ export declare class WSAPI {
|
|
|
545
546
|
*/
|
|
546
547
|
getRelatedItemsForGame(related_game_id: string): Promise<GetRelatedAchTourResponse>;
|
|
547
548
|
getRaffles(): Promise<GetRafflesResponse>;
|
|
549
|
+
getDrawRun(payload: GetDrawRunRequest): Promise<GetDrawRunResponse>;
|
|
550
|
+
getRaffleDrawRunsHistory(payload: GetRaffleDrawRunsHistoryRequest): Promise<GetRaffleDrawRunsHistoryResponse>;
|
|
548
551
|
}
|
package/dist/index.js
CHANGED
|
@@ -125,8 +125,10 @@ exports.ClassId = void 0;
|
|
|
125
125
|
ClassId[ClassId["JP_WIN_PUSH"] = 808] = "JP_WIN_PUSH";
|
|
126
126
|
ClassId[ClassId["RAF_GET_RAFFLES_REQUEST"] = 902] = "RAF_GET_RAFFLES_REQUEST";
|
|
127
127
|
ClassId[ClassId["RAF_GET_RAFFLES_RESPONSE"] = 903] = "RAF_GET_RAFFLES_RESPONSE";
|
|
128
|
-
ClassId[ClassId["
|
|
129
|
-
ClassId[ClassId["
|
|
128
|
+
ClassId[ClassId["RAF_GET_DRAW_RUN_REQUEST"] = 904] = "RAF_GET_DRAW_RUN_REQUEST";
|
|
129
|
+
ClassId[ClassId["RAF_GET_DRAW_RUN_RESPONSE"] = 905] = "RAF_GET_DRAW_RUN_RESPONSE";
|
|
130
|
+
ClassId[ClassId["RAF_GET_DRAW_HISTORY_REQUEST"] = 906] = "RAF_GET_DRAW_HISTORY_REQUEST";
|
|
131
|
+
ClassId[ClassId["RAF_GET_DRAW_HISTORY_RESPONSE"] = 907] = "RAF_GET_DRAW_HISTORY_RESPONSE";
|
|
130
132
|
/*
|
|
131
133
|
RAF_GET_TICKETS_REQUEST = 902,
|
|
132
134
|
RAF_GET_TICKETS_RESPONSE = 903,
|
|
@@ -2742,6 +2744,22 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2742
2744
|
return Promise.reject(e);
|
|
2743
2745
|
}
|
|
2744
2746
|
};
|
|
2747
|
+
_proto.getDrawRun = function getDrawRun(payload) {
|
|
2748
|
+
try {
|
|
2749
|
+
var _this47 = this;
|
|
2750
|
+
return Promise.resolve(_this47.api.getDrawRun(null, payload));
|
|
2751
|
+
} catch (e) {
|
|
2752
|
+
return Promise.reject(e);
|
|
2753
|
+
}
|
|
2754
|
+
};
|
|
2755
|
+
_proto.getRaffleDrawRunsHistory = function getRaffleDrawRunsHistory(payload) {
|
|
2756
|
+
try {
|
|
2757
|
+
var _this48 = this;
|
|
2758
|
+
return Promise.resolve(_this48.api.getRaffleDrawRunsHistory(null, payload));
|
|
2759
|
+
} catch (e) {
|
|
2760
|
+
return Promise.reject(e);
|
|
2761
|
+
}
|
|
2762
|
+
};
|
|
2745
2763
|
return WSAPI;
|
|
2746
2764
|
}();
|
|
2747
2765
|
|
|
@@ -3951,6 +3969,24 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
3951
3969
|
return Promise.reject(e);
|
|
3952
3970
|
}
|
|
3953
3971
|
};
|
|
3972
|
+
_proto.getDrawRun = function getDrawRun(user_ext_id, payload) {
|
|
3973
|
+
try {
|
|
3974
|
+
var _this64 = this;
|
|
3975
|
+
var message = _this64.buildMessage(user_ext_id, exports.ClassId.RAF_GET_DRAW_RUN_REQUEST, payload);
|
|
3976
|
+
return Promise.resolve(_this64.send(message, exports.ClassId.RAF_GET_DRAW_RUN_RESPONSE));
|
|
3977
|
+
} catch (e) {
|
|
3978
|
+
return Promise.reject(e);
|
|
3979
|
+
}
|
|
3980
|
+
};
|
|
3981
|
+
_proto.getRaffleDrawRunsHistory = function getRaffleDrawRunsHistory(user_ext_id, payload) {
|
|
3982
|
+
try {
|
|
3983
|
+
var _this65 = this;
|
|
3984
|
+
var message = _this65.buildMessage(user_ext_id, exports.ClassId.RAF_GET_DRAW_HISTORY_REQUEST, payload);
|
|
3985
|
+
return Promise.resolve(_this65.send(message, exports.ClassId.RAF_GET_DRAW_HISTORY_RESPONSE));
|
|
3986
|
+
} catch (e) {
|
|
3987
|
+
return Promise.reject(e);
|
|
3988
|
+
}
|
|
3989
|
+
};
|
|
3954
3990
|
return SmarticoAPI;
|
|
3955
3991
|
}();
|
|
3956
3992
|
|