@smartico/public-api 0.0.252 → 0.0.253
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 +2 -0
- package/dist/Jackpots/GetJackpotWinnersRequest.d.ts +10 -0
- package/dist/Jackpots/GetJackpotWinnersResponse.d.ts +20 -0
- package/dist/Jackpots/index.d.ts +2 -0
- package/dist/Raffle/GetDrawRunResponse.d.ts +2 -0
- package/dist/Raffle/GetRaffleDrawRunsHistoryResponse.d.ts +2 -0
- package/dist/Raffle/GetRafflesResponse.d.ts +10 -0
- package/dist/Raffle/RaffleClaimPrizeResponse.d.ts +4 -0
- package/dist/Raffle/RaffleDraw.d.ts +2 -2
- package/dist/SmarticoAPI.d.ts +17 -5
- package/dist/WSAPI/WSAPI.d.ts +94 -8
- package/dist/WSAPI/WSAPITypes.d.ts +272 -0
- package/dist/index.js +559 -199
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +322 -14
- package/dist/index.modern.mjs.map +1 -1
- package/docs/README.md +140 -0
- package/docs/classes/WSAPI.md +102 -12
- package/docs/enums/RaffleDrawInstanceState.md +25 -0
- package/docs/enums/RaffleDrawTypeExecution.md +27 -0
- package/docs/interfaces/GetJackpotWinnersRequest.md +91 -0
- package/docs/interfaces/GetJackpotWinnersResponse.md +73 -0
- package/docs/interfaces/JackpotWinnerHistory.md +25 -0
- package/docs/interfaces/RaffleClaimPrizeResponse.md +3 -3
- package/docs/interfaces/RaffleDraw.md +2 -2
- package/docs/interfaces/TRaffle.md +101 -0
- package/docs/interfaces/TRaffleDraw.md +181 -0
- package/docs/interfaces/TRaffleDrawRun.md +125 -0
- package/docs/interfaces/TRafflePrize.md +159 -0
- package/docs/interfaces/TRafflePrizeWinner.md +50 -0
- package/docs/interfaces/TRaffleTicket.md +13 -0
- package/docs/interfaces/TransformedRaffleClaimPrizeResponse.md +17 -0
- package/package.json +1 -1
- package/src/Base/ClassId.ts +2 -1
- package/src/Jackpots/GetJackpotWinnersRequest.ts +12 -0
- package/src/Jackpots/GetJackpotWinnersResponse.ts +33 -0
- package/src/Jackpots/index.ts +2 -0
- package/src/Raffle/GetDrawRunResponse.ts +30 -0
- package/src/Raffle/GetRaffleDrawRunsHistoryResponse.ts +23 -0
- package/src/Raffle/GetRafflesResponse.ts +97 -0
- package/src/Raffle/RaffleClaimPrizeResponse.ts +16 -1
- package/src/Raffle/RaffleDraw.ts +2 -2
- package/src/SmarticoAPI.ts +45 -24
- package/src/WSAPI/WSAPI.ts +144 -9
- package/src/WSAPI/WSAPITypes.ts +307 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Interface: TRaffleDraw
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
### id
|
|
6
|
+
|
|
7
|
+
• **id**: `number`
|
|
8
|
+
|
|
9
|
+
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
|
|
10
|
+
(internal name: schedule_id)
|
|
11
|
+
|
|
12
|
+
___
|
|
13
|
+
|
|
14
|
+
### name
|
|
15
|
+
|
|
16
|
+
• **name**: `string`
|
|
17
|
+
|
|
18
|
+
Name of the draw, e.g. 'Daily draw'
|
|
19
|
+
|
|
20
|
+
___
|
|
21
|
+
|
|
22
|
+
### description
|
|
23
|
+
|
|
24
|
+
• **description**: `string`
|
|
25
|
+
|
|
26
|
+
Description of the draw
|
|
27
|
+
|
|
28
|
+
___
|
|
29
|
+
|
|
30
|
+
### image\_url
|
|
31
|
+
|
|
32
|
+
• **image\_url**: `string`
|
|
33
|
+
|
|
34
|
+
URL of the image that represents the draw
|
|
35
|
+
|
|
36
|
+
___
|
|
37
|
+
|
|
38
|
+
### image\_url\_mobile
|
|
39
|
+
|
|
40
|
+
• **image\_url\_mobile**: `string`
|
|
41
|
+
|
|
42
|
+
URL of the moible image that represents the draw
|
|
43
|
+
|
|
44
|
+
___
|
|
45
|
+
|
|
46
|
+
### icon\_url
|
|
47
|
+
|
|
48
|
+
• **icon\_url**: `string`
|
|
49
|
+
|
|
50
|
+
URL of the icon that represents the draw
|
|
51
|
+
|
|
52
|
+
___
|
|
53
|
+
|
|
54
|
+
### background\_image\_url
|
|
55
|
+
|
|
56
|
+
• **background\_image\_url**: `string`
|
|
57
|
+
|
|
58
|
+
URL of the background image that will be used in the draw list item
|
|
59
|
+
|
|
60
|
+
___
|
|
61
|
+
|
|
62
|
+
### background\_image\_url\_mobile
|
|
63
|
+
|
|
64
|
+
• **background\_image\_url\_mobile**: `string`
|
|
65
|
+
|
|
66
|
+
URL of the moible background image that will be used in the draw list item
|
|
67
|
+
|
|
68
|
+
___
|
|
69
|
+
|
|
70
|
+
### is\_grand
|
|
71
|
+
|
|
72
|
+
• **is\_grand**: `boolean`
|
|
73
|
+
|
|
74
|
+
Show if the draw is grand and is marked as special
|
|
75
|
+
|
|
76
|
+
___
|
|
77
|
+
|
|
78
|
+
### prizes
|
|
79
|
+
|
|
80
|
+
• **prizes**: [`TRafflePrize`](TRafflePrize.md)[]
|
|
81
|
+
|
|
82
|
+
Information about prizes in the draw
|
|
83
|
+
|
|
84
|
+
___
|
|
85
|
+
|
|
86
|
+
### current\_state
|
|
87
|
+
|
|
88
|
+
• **current\_state**: [`RaffleDrawInstanceState`](../enums/RaffleDrawInstanceState.md)
|
|
89
|
+
|
|
90
|
+
State of current instance of Draw
|
|
91
|
+
|
|
92
|
+
___
|
|
93
|
+
|
|
94
|
+
### run\_id
|
|
95
|
+
|
|
96
|
+
• **run\_id**: `number`
|
|
97
|
+
|
|
98
|
+
Field indicates the ID of the latest instance/run of draw
|
|
99
|
+
|
|
100
|
+
___
|
|
101
|
+
|
|
102
|
+
### execution\_type
|
|
103
|
+
|
|
104
|
+
• **execution\_type**: [`RaffleDrawTypeExecution`](../enums/RaffleDrawTypeExecution.md)
|
|
105
|
+
|
|
106
|
+
Type of the draw execution, indicating how and when the draw is executed.
|
|
107
|
+
- ExecDate: Draw is executed only once at a specific date and time.
|
|
108
|
+
- Recurring: Draw is executed on a recurring basis (e.g., daily, weekly).
|
|
109
|
+
- Grand: Draw is executed once and is marked as grand, often with larger prizes or more importance.
|
|
110
|
+
|
|
111
|
+
___
|
|
112
|
+
|
|
113
|
+
### execution\_ts
|
|
114
|
+
|
|
115
|
+
• **execution\_ts**: `number`
|
|
116
|
+
|
|
117
|
+
Date/time of the draw execution
|
|
118
|
+
|
|
119
|
+
___
|
|
120
|
+
|
|
121
|
+
### previous\_run\_ts
|
|
122
|
+
|
|
123
|
+
• `Optional` **previous\_run\_ts**: `number`
|
|
124
|
+
|
|
125
|
+
Date of the previously executed draw (if there is such)
|
|
126
|
+
|
|
127
|
+
___
|
|
128
|
+
|
|
129
|
+
### previous\_run\_id
|
|
130
|
+
|
|
131
|
+
• `Optional` **previous\_run\_id**: `number`
|
|
132
|
+
|
|
133
|
+
Unique ID of the previusly executed draw (if there is such)
|
|
134
|
+
|
|
135
|
+
___
|
|
136
|
+
|
|
137
|
+
### ticket\_start\_ts
|
|
138
|
+
|
|
139
|
+
• **ticket\_start\_ts**: `number`
|
|
140
|
+
|
|
141
|
+
Date/time starting from which the tickets will participate in the upcoming draw
|
|
142
|
+
This value need to be taken into account with next_execute_ts field value, for example
|
|
143
|
+
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
|
|
144
|
+
(internally this value is calculated as next_execute_ts - ticket_start_date)
|
|
145
|
+
|
|
146
|
+
___
|
|
147
|
+
|
|
148
|
+
### allow\_multi\_prize\_per\_ticket
|
|
149
|
+
|
|
150
|
+
• **allow\_multi\_prize\_per\_ticket**: `boolean`
|
|
151
|
+
|
|
152
|
+
Field is indicating if same ticket can win multiple prizes in the same draw
|
|
153
|
+
For example there are 3 types of prizes in the draw - iPhone, iPad, MacBook
|
|
154
|
+
If this field is true, then one ticket can win all 3 prizes (depending on the chances of course),
|
|
155
|
+
if false, then one ticket can win only one prize.
|
|
156
|
+
The distribution of the prizes is start from top (assuming on top are the most valuable prizes) to bottom (less valuable prizes)
|
|
157
|
+
If specific prize has multiple values, e.g. we have 3 iPhones,
|
|
158
|
+
then the same ticket can win only one prize of a kind, but can win multiple prizes of different kind (if allow_multi_prize_per_ticket is true)
|
|
159
|
+
|
|
160
|
+
___
|
|
161
|
+
|
|
162
|
+
### total\_tickets\_count
|
|
163
|
+
|
|
164
|
+
• **total\_tickets\_count**: `number`
|
|
165
|
+
|
|
166
|
+
The number of tickets that are already given to all users for this instance of draw.
|
|
167
|
+
In other words tickets that are collected between ticket_start_date and current time (or till current_execution_ts is the instance is executed).
|
|
168
|
+
|
|
169
|
+
___
|
|
170
|
+
|
|
171
|
+
### my\_tickets\_count
|
|
172
|
+
|
|
173
|
+
• **my\_tickets\_count**: `number`
|
|
174
|
+
|
|
175
|
+
The number of tickets collected by current user for this instance of draw.
|
|
176
|
+
|
|
177
|
+
___
|
|
178
|
+
|
|
179
|
+
### my\_last\_tickets
|
|
180
|
+
|
|
181
|
+
• **my\_last\_tickets**: [`TRaffleTicket`](TRaffleTicket.md)[]
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Interface: TRaffleDrawRun
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
### id
|
|
6
|
+
|
|
7
|
+
• **id**: `number`
|
|
8
|
+
|
|
9
|
+
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
|
|
10
|
+
(internal name: schedule_id)
|
|
11
|
+
|
|
12
|
+
___
|
|
13
|
+
|
|
14
|
+
### run\_id
|
|
15
|
+
|
|
16
|
+
• **run\_id**: `number`
|
|
17
|
+
|
|
18
|
+
Field indicates the ID of the latest instance/run of draw
|
|
19
|
+
|
|
20
|
+
___
|
|
21
|
+
|
|
22
|
+
### name
|
|
23
|
+
|
|
24
|
+
• **name**: `string`
|
|
25
|
+
|
|
26
|
+
Name of the draw, e.g. 'Daily draw'
|
|
27
|
+
|
|
28
|
+
___
|
|
29
|
+
|
|
30
|
+
### description
|
|
31
|
+
|
|
32
|
+
• **description**: `string`
|
|
33
|
+
|
|
34
|
+
Description of the draw
|
|
35
|
+
|
|
36
|
+
___
|
|
37
|
+
|
|
38
|
+
### image\_url
|
|
39
|
+
|
|
40
|
+
• **image\_url**: `string`
|
|
41
|
+
|
|
42
|
+
URL of the image that represents the draw
|
|
43
|
+
|
|
44
|
+
___
|
|
45
|
+
|
|
46
|
+
### image\_url\_mobile
|
|
47
|
+
|
|
48
|
+
• **image\_url\_mobile**: `string`
|
|
49
|
+
|
|
50
|
+
URL of the moible image that represents the draw
|
|
51
|
+
|
|
52
|
+
___
|
|
53
|
+
|
|
54
|
+
### icon\_url
|
|
55
|
+
|
|
56
|
+
• **icon\_url**: `string`
|
|
57
|
+
|
|
58
|
+
URL of the icon that represents the draw
|
|
59
|
+
|
|
60
|
+
___
|
|
61
|
+
|
|
62
|
+
### background\_image\_url
|
|
63
|
+
|
|
64
|
+
• **background\_image\_url**: `string`
|
|
65
|
+
|
|
66
|
+
URL of the background image that will be used in the draw list item
|
|
67
|
+
|
|
68
|
+
___
|
|
69
|
+
|
|
70
|
+
### background\_image\_url\_mobile
|
|
71
|
+
|
|
72
|
+
• **background\_image\_url\_mobile**: `string`
|
|
73
|
+
|
|
74
|
+
URL of the moible background image that will be used in the draw list item
|
|
75
|
+
|
|
76
|
+
___
|
|
77
|
+
|
|
78
|
+
### is\_grand
|
|
79
|
+
|
|
80
|
+
• **is\_grand**: `boolean`
|
|
81
|
+
|
|
82
|
+
Show if the draw is grand and is marked as special
|
|
83
|
+
|
|
84
|
+
___
|
|
85
|
+
|
|
86
|
+
### execution\_ts
|
|
87
|
+
|
|
88
|
+
• **execution\_ts**: `number`
|
|
89
|
+
|
|
90
|
+
Date/time of the draw execution
|
|
91
|
+
|
|
92
|
+
___
|
|
93
|
+
|
|
94
|
+
### actual\_execution\_ts
|
|
95
|
+
|
|
96
|
+
• **actual\_execution\_ts**: `number`
|
|
97
|
+
|
|
98
|
+
Actual Date/time of the draw execution
|
|
99
|
+
|
|
100
|
+
___
|
|
101
|
+
|
|
102
|
+
### ticket\_start\_ts
|
|
103
|
+
|
|
104
|
+
• **ticket\_start\_ts**: `number`
|
|
105
|
+
|
|
106
|
+
Date/time starting from which the tickets will participate in the upcoming draw
|
|
107
|
+
This value need to be taken into account with next_execute_ts field value, for example
|
|
108
|
+
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
|
|
109
|
+
(internally this value is calculated as next_execute_ts - ticket_start_date)
|
|
110
|
+
|
|
111
|
+
___
|
|
112
|
+
|
|
113
|
+
### is\_winner
|
|
114
|
+
|
|
115
|
+
• **is\_winner**: `boolean`
|
|
116
|
+
|
|
117
|
+
Shows if user has won a prize in a current run
|
|
118
|
+
|
|
119
|
+
___
|
|
120
|
+
|
|
121
|
+
### has\_unclaimed\_prize
|
|
122
|
+
|
|
123
|
+
• **has\_unclaimed\_prize**: `boolean`
|
|
124
|
+
|
|
125
|
+
Shows if user has unclaimed prize
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Interface: TRafflePrize
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
### id
|
|
6
|
+
|
|
7
|
+
• **id**: `string`
|
|
8
|
+
|
|
9
|
+
The unique identifier for the prize definition
|
|
10
|
+
|
|
11
|
+
___
|
|
12
|
+
|
|
13
|
+
### name
|
|
14
|
+
|
|
15
|
+
• **name**: `string`
|
|
16
|
+
|
|
17
|
+
Name of the prize
|
|
18
|
+
|
|
19
|
+
___
|
|
20
|
+
|
|
21
|
+
### description
|
|
22
|
+
|
|
23
|
+
• **description**: `string`
|
|
24
|
+
|
|
25
|
+
Description of the prize
|
|
26
|
+
|
|
27
|
+
___
|
|
28
|
+
|
|
29
|
+
### image\_url
|
|
30
|
+
|
|
31
|
+
• **image\_url**: `string`
|
|
32
|
+
|
|
33
|
+
URL of the image that represents the prize
|
|
34
|
+
|
|
35
|
+
___
|
|
36
|
+
|
|
37
|
+
### prizes\_per\_run
|
|
38
|
+
|
|
39
|
+
• **prizes\_per\_run**: `number`
|
|
40
|
+
|
|
41
|
+
The number of prizes available per run of the draw.
|
|
42
|
+
E.g. if the draw is run daily, this is the number of prizes available each day, for example 3 iPhones.
|
|
43
|
+
|
|
44
|
+
___
|
|
45
|
+
|
|
46
|
+
### prizes\_per\_run\_actual
|
|
47
|
+
|
|
48
|
+
• **prizes\_per\_run\_actual**: `number`
|
|
49
|
+
|
|
50
|
+
The actual number of prizes for the current instance.
|
|
51
|
+
This value is taking into account follwing values:
|
|
52
|
+
- min_required_total_tickets,
|
|
53
|
+
- add_one_prize_per_each_x_tickets
|
|
54
|
+
- stock_items_per_draw
|
|
55
|
+
- total_tickets_count (from Draw instance)
|
|
56
|
+
- cap_prizes_per_run
|
|
57
|
+
For example:
|
|
58
|
+
- prizes_per_run = 1
|
|
59
|
+
- min_required_total_tickets = 1000
|
|
60
|
+
- add_one_prize_per_each_x_tickets = 1000
|
|
61
|
+
- stock_items_per_draw = 5
|
|
62
|
+
- total_tickets_count = 7000
|
|
63
|
+
- cap_prizes_per_run = 6
|
|
64
|
+
prizes_per_run_actual will be 5, because
|
|
65
|
+
7000 tickets are collected, so 7 iPhones are available, but the cap is 6 and the stock is 5.
|
|
66
|
+
|
|
67
|
+
___
|
|
68
|
+
|
|
69
|
+
### chances\_to\_win\_perc
|
|
70
|
+
|
|
71
|
+
• **chances\_to\_win\_perc**: `number`
|
|
72
|
+
|
|
73
|
+
The chances to win the prize by current player.
|
|
74
|
+
Calculated as the ratio of the number of tickets collected by the current player to the
|
|
75
|
+
total number of tickets collected by all players and multiplied by number of actual prizes of this kind.
|
|
76
|
+
|
|
77
|
+
___
|
|
78
|
+
|
|
79
|
+
### min\_required\_total\_tickets
|
|
80
|
+
|
|
81
|
+
• `Optional` **min\_required\_total\_tickets**: `number`
|
|
82
|
+
|
|
83
|
+
The minimum number of total tickets collected during draw period required to unlock the prize.
|
|
84
|
+
If the number of tickets collected is less than this value, the prize is not available.
|
|
85
|
+
Under total tickets we understand the number of tickets collected by all users.
|
|
86
|
+
The 'draw period' is the time between the ticket_start_date value of the draw and the current time.
|
|
87
|
+
|
|
88
|
+
___
|
|
89
|
+
|
|
90
|
+
### add\_one\_prize\_per\_each\_x\_tickets
|
|
91
|
+
|
|
92
|
+
• `Optional` **add\_one\_prize\_per\_each\_x\_tickets**: `number`
|
|
93
|
+
|
|
94
|
+
One additional prize will be awarded for each X tickets.
|
|
95
|
+
E.g. if the prize is 1 iPhone and the value is set to 1000, then for every 1000 tickets collected, an additional iPhone is awarded.
|
|
96
|
+
If min_required_total_tickets is set to 1000, then next iPhone is awarded when 2000 tickets are collected, and so on.
|
|
97
|
+
If min_required_total_tickets is not set, then the next iPhone will be awarded when 1000 tickets are collected.
|
|
98
|
+
|
|
99
|
+
___
|
|
100
|
+
|
|
101
|
+
### requires\_claim
|
|
102
|
+
|
|
103
|
+
• **requires\_claim**: `boolean`
|
|
104
|
+
|
|
105
|
+
Indicates whether the prize requires a claim action from the user.
|
|
106
|
+
|
|
107
|
+
___
|
|
108
|
+
|
|
109
|
+
### min\_required\_tickets\_for\_user
|
|
110
|
+
|
|
111
|
+
• **min\_required\_tickets\_for\_user**: `number`
|
|
112
|
+
|
|
113
|
+
The minimum number of tickets a user must have to be eligible for the prize.
|
|
114
|
+
For example iPhone prize may require 10 tickets to be collected, only users with 10 or more tickets will be eligible for the prize.
|
|
115
|
+
More tickets are better, as they increase the chances of winning.
|
|
116
|
+
|
|
117
|
+
___
|
|
118
|
+
|
|
119
|
+
### cap\_prizes\_per\_run
|
|
120
|
+
|
|
121
|
+
• `Optional` **cap\_prizes\_per\_run**: `number`
|
|
122
|
+
|
|
123
|
+
The maximum number of prizes that can be given withing one instance/run of draw.
|
|
124
|
+
For example the prize is iPhone and add_one_prize_per_each_x_tickets is set to 1000,
|
|
125
|
+
cap_prizes_per_run is set to 3, and the total number of tickets collected is 7000.
|
|
126
|
+
In this case, the prizes_per_run_actual will be limitted by 3
|
|
127
|
+
|
|
128
|
+
___
|
|
129
|
+
|
|
130
|
+
### priority
|
|
131
|
+
|
|
132
|
+
• **priority**: `number`
|
|
133
|
+
|
|
134
|
+
The priority of the prize. The low number means higher priority (e.g. 1 is higher priority than 2).
|
|
135
|
+
If there are multiple prizes available, the prize with the highest priority (lowest number) will be awarded first.
|
|
136
|
+
|
|
137
|
+
___
|
|
138
|
+
|
|
139
|
+
### stock\_items\_per\_draw
|
|
140
|
+
|
|
141
|
+
• `Optional` **stock\_items\_per\_draw**: `number`
|
|
142
|
+
|
|
143
|
+
Optional field that indicates total remaining number of the prize for all draws of the type.
|
|
144
|
+
For example, the Daily draw has 1 iPhone daily, and the total number of iPhones is 10.
|
|
145
|
+
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.
|
|
146
|
+
|
|
147
|
+
___
|
|
148
|
+
|
|
149
|
+
### should\_claim
|
|
150
|
+
|
|
151
|
+
• **should\_claim**: `boolean`
|
|
152
|
+
|
|
153
|
+
Shows if the prize has been claimed
|
|
154
|
+
|
|
155
|
+
___
|
|
156
|
+
|
|
157
|
+
### winners
|
|
158
|
+
|
|
159
|
+
• **winners**: [`TRafflePrizeWinner`](TRafflePrizeWinner.md)[]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Interface: TRafflePrizeWinner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
### id
|
|
6
|
+
|
|
7
|
+
• **id**: `number`
|
|
8
|
+
|
|
9
|
+
Id of the winner definition, for the repetative winners (e.g. same winner won two prizes), this number will be the same for all winner that are repeating
|
|
10
|
+
(internal name: schedule_id)
|
|
11
|
+
|
|
12
|
+
___
|
|
13
|
+
|
|
14
|
+
### username
|
|
15
|
+
|
|
16
|
+
• `Optional` **username**: `string`
|
|
17
|
+
|
|
18
|
+
Winner user name
|
|
19
|
+
|
|
20
|
+
___
|
|
21
|
+
|
|
22
|
+
### avatar\_url
|
|
23
|
+
|
|
24
|
+
• `Optional` **avatar\_url**: `string`
|
|
25
|
+
|
|
26
|
+
URL of the image of user avatar
|
|
27
|
+
|
|
28
|
+
___
|
|
29
|
+
|
|
30
|
+
### ticket
|
|
31
|
+
|
|
32
|
+
• **ticket**: [`TRaffleTicket`](TRaffleTicket.md)
|
|
33
|
+
|
|
34
|
+
Ticket information (number string and integer)
|
|
35
|
+
|
|
36
|
+
___
|
|
37
|
+
|
|
38
|
+
### raf\_won\_id
|
|
39
|
+
|
|
40
|
+
• **raf\_won\_id**: `number`
|
|
41
|
+
|
|
42
|
+
Unique ID of winning
|
|
43
|
+
|
|
44
|
+
___
|
|
45
|
+
|
|
46
|
+
### claimed\_date
|
|
47
|
+
|
|
48
|
+
• **claimed\_date**: `number`
|
|
49
|
+
|
|
50
|
+
Date when the prize was claimed
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: TransformedRaffleClaimPrizeResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
### errorCode
|
|
6
|
+
|
|
7
|
+
• **errorCode**: `number`
|
|
8
|
+
|
|
9
|
+
Error code, 0 means no error
|
|
10
|
+
|
|
11
|
+
___
|
|
12
|
+
|
|
13
|
+
### errorMessage
|
|
14
|
+
|
|
15
|
+
• `Optional` **errorMessage**: `string`
|
|
16
|
+
|
|
17
|
+
Error message, will be exposed only if ErrorCode is not 0
|
package/package.json
CHANGED
package/src/Base/ClassId.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProtocolRequest } from "src/Base/ProtocolRequest";
|
|
2
|
+
|
|
3
|
+
interface GetJackpotWinnersRequest extends ProtocolRequest {
|
|
4
|
+
/** The ID of the jackpot template */
|
|
5
|
+
jp_template_id: number;
|
|
6
|
+
/** The number of winners to return */
|
|
7
|
+
limit: number;
|
|
8
|
+
/** The offset of the winners to return */
|
|
9
|
+
offset: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { GetJackpotWinnersRequest };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ProtocolResponse } from "../Base/ProtocolResponse";
|
|
2
|
+
import { JackPotWinner } from "./JackPotWinner";
|
|
3
|
+
|
|
4
|
+
export interface GetJackpotWinnersResponse extends ProtocolResponse {
|
|
5
|
+
/** The list of jackpot winners */
|
|
6
|
+
winners: JackpotWinnerHistory[];
|
|
7
|
+
/** Whether there are more winners to fetch */
|
|
8
|
+
has_more: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface JackpotWinnerHistory {
|
|
12
|
+
/** Id of the jackpot pot */
|
|
13
|
+
jp_pot_id: number;
|
|
14
|
+
/** Date of winning in milliseconds */
|
|
15
|
+
win_date_ts: number;
|
|
16
|
+
/** Info about jackpot winner */
|
|
17
|
+
winner: JackPotWinner;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @ignore
|
|
22
|
+
*/
|
|
23
|
+
export const GetJackpotWinnersResponseTransform = (items: JackpotWinnerHistory[]): JackpotWinnerHistory[] => {
|
|
24
|
+
return items.map((item) => {
|
|
25
|
+
const winnerInfo: JackpotWinnerHistory = {
|
|
26
|
+
winner: item.winner,
|
|
27
|
+
win_date_ts: item.win_date_ts,
|
|
28
|
+
jp_pot_id: item.jp_pot_id,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return winnerInfo;
|
|
32
|
+
});
|
|
33
|
+
};
|
package/src/Jackpots/index.ts
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
|
+
import { TRaffleDraw } from 'src/WSAPI/WSAPITypes';
|
|
1
2
|
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
3
|
import { RaffleDraw } from './RaffleDraw';
|
|
4
|
+
import { prizeTransform, ticketsTransform } from './GetRafflesResponse';
|
|
3
5
|
|
|
4
6
|
export interface GetDrawRunResponse extends ProtocolResponse {
|
|
5
7
|
draw: RaffleDraw;
|
|
6
8
|
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export const drawRunTransform = (res: GetDrawRunResponse): TRaffleDraw => {
|
|
12
|
+
return {id: res.draw.draw_id,
|
|
13
|
+
name: res.draw.public_meta.name,
|
|
14
|
+
description: res.draw.public_meta.description,
|
|
15
|
+
image_url:res.draw.public_meta.image_url,
|
|
16
|
+
image_url_mobile:res.draw.public_meta.image_url_mobile,
|
|
17
|
+
icon_url: res.draw.public_meta.icon_url,
|
|
18
|
+
background_image_url: res.draw.public_meta.background_image_url,
|
|
19
|
+
background_image_url_mobile: res.draw.public_meta.background_image_url_mobile,
|
|
20
|
+
is_grand: res.draw.public_meta.is_grand,
|
|
21
|
+
prizes: prizeTransform(res.draw.prizes),
|
|
22
|
+
current_state: res.draw.current_state,
|
|
23
|
+
run_id: res.draw.run_id,
|
|
24
|
+
execution_type: res.draw.execution_type,
|
|
25
|
+
execution_ts: res.draw.execution_ts,
|
|
26
|
+
previous_run_ts: res.draw.previous_run_ts,
|
|
27
|
+
previous_run_id: res.draw.previous_run_id,
|
|
28
|
+
ticket_start_ts: res.draw.ticket_start_ts,
|
|
29
|
+
allow_multi_prize_per_ticket: res.draw.allow_multi_prize_per_ticket,
|
|
30
|
+
total_tickets_count: res.draw.total_tickets_count,
|
|
31
|
+
my_tickets_count: res.draw.my_tickets_count,
|
|
32
|
+
my_last_tickets: ticketsTransform(res.draw.my_last_tickets)}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
};
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
+
import { TRaffleDrawRun } from 'src/WSAPI/WSAPITypes';
|
|
1
2
|
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
3
|
import { RaffleDrawRun } from './RaffleDrawRun';
|
|
3
4
|
|
|
4
5
|
export interface GetRaffleDrawRunsHistoryResponse extends ProtocolResponse {
|
|
5
6
|
draw_runs: RaffleDrawRun[];
|
|
6
7
|
}
|
|
8
|
+
|
|
9
|
+
export const drawRunHistoryTransform = (res: GetRaffleDrawRunsHistoryResponse): TRaffleDrawRun[] => {
|
|
10
|
+
return res.draw_runs.map((item) => {
|
|
11
|
+
return {
|
|
12
|
+
id: item.draw_id,
|
|
13
|
+
run_id: item.run_id,
|
|
14
|
+
name: item.public_meta.name,
|
|
15
|
+
description: item.public_meta.description,
|
|
16
|
+
image_url: item.public_meta.image_url,
|
|
17
|
+
image_url_mobile: item.public_meta.image_url_mobile,
|
|
18
|
+
icon_url: item.public_meta.icon_url,
|
|
19
|
+
background_image_url: item.public_meta.background_image_url,
|
|
20
|
+
background_image_url_mobile: item.public_meta.background_image_url_mobile,
|
|
21
|
+
is_grand: item.public_meta.is_grand,
|
|
22
|
+
execution_ts: item.execution_ts,
|
|
23
|
+
actual_execution_ts:item.actual_execution_ts,
|
|
24
|
+
ticket_start_ts:item.ticket_start_ts,
|
|
25
|
+
is_winner:item.is_winner,
|
|
26
|
+
has_unclaimed_prize:item.has_unclaimed_prize
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
};
|