@getenginex/sdk-igaming 0.8.0 → 0.8.1
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +260 -259
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +259 -259
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var sdk = require('@getenginex/sdk');
|
|
4
4
|
var extension = require('@getenginex/sdk/extension');
|
|
5
|
-
var
|
|
5
|
+
var z2 = require('zod/mini');
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -23,12 +23,13 @@ function _interopNamespace(e) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var extension__namespace = /*#__PURE__*/_interopNamespace(extension);
|
|
26
|
+
var z2__namespace = /*#__PURE__*/_interopNamespace(z2);
|
|
26
27
|
|
|
27
28
|
// src/client.ts
|
|
28
29
|
function protoEnum(prefix) {
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
return z2__namespace.pipe(
|
|
31
|
+
z2__namespace.optional(z2__namespace.union([z2__namespace.string(), z2__namespace.number()])),
|
|
32
|
+
z2__namespace.transform((value) => {
|
|
32
33
|
if (value === void 0 || value === 0) return "unspecified";
|
|
33
34
|
if (typeof value === "number") return String(value);
|
|
34
35
|
return (value.startsWith(prefix) ? value.slice(prefix.length) : value).toLowerCase();
|
|
@@ -43,174 +44,174 @@ function currencyOrEmpty() {
|
|
|
43
44
|
}
|
|
44
45
|
var INTEGER_TEXT = "Expected an integer within the safe range of number";
|
|
45
46
|
function integerText() {
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
return z2__namespace.pipe(
|
|
48
|
+
z2__namespace.union([
|
|
49
|
+
z2__namespace.string().check(
|
|
50
|
+
z2__namespace.refine((value) => /^-?\d+$/.test(value) && Number.isSafeInteger(Number(value)), { message: INTEGER_TEXT })
|
|
50
51
|
),
|
|
51
|
-
|
|
52
|
+
z2__namespace.number().check(z2__namespace.refine((value) => Number.isSafeInteger(value), { message: INTEGER_TEXT }))
|
|
52
53
|
]),
|
|
53
|
-
|
|
54
|
+
z2__namespace.transform(Number)
|
|
54
55
|
);
|
|
55
56
|
}
|
|
56
57
|
function text() {
|
|
57
|
-
return
|
|
58
|
+
return z2__namespace._default(z2__namespace.string(), "");
|
|
58
59
|
}
|
|
59
60
|
function count() {
|
|
60
|
-
return
|
|
61
|
+
return z2__namespace._default(z2__namespace.number(), 0);
|
|
61
62
|
}
|
|
62
63
|
function list(item) {
|
|
63
|
-
return
|
|
64
|
+
return z2__namespace._default(z2__namespace.array(item), []);
|
|
64
65
|
}
|
|
65
66
|
function durationSeconds() {
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
return z2__namespace.pipe(
|
|
68
|
+
z2__namespace.string().check(z2__namespace.regex(/^-?\d+(\.\d+)?s$/, { message: 'Expected a protobuf duration, e.g. "86400s"' })),
|
|
69
|
+
z2__namespace.transform((value) => Number(value.slice(0, -1)))
|
|
69
70
|
);
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
// src/modules/bonus.ts
|
|
73
|
-
var campaignCurrency = () =>
|
|
74
|
-
var money = () => extension.wire({ amount:
|
|
75
|
-
var timeWindow = () => extension.wire({ starts_at:
|
|
76
|
-
var ratio = () => extension.wire({ decimal:
|
|
74
|
+
var campaignCurrency = () => z2__namespace._default(currencyOrEmpty(), "");
|
|
75
|
+
var money = () => extension.wire({ amount: z2__namespace._default(minorUnits(), 0), currency: campaignCurrency() });
|
|
76
|
+
var timeWindow = () => extension.wire({ starts_at: z2__namespace.optional(z2__namespace.string()), ends_at: z2__namespace.optional(z2__namespace.string()) });
|
|
77
|
+
var ratio = () => extension.wire({ decimal: z2__namespace.optional(z2__namespace.string()), basis_points: z2__namespace.optional(z2__namespace.number()), maximum_scale: count() });
|
|
77
78
|
var empty = () => extension.wire({});
|
|
78
79
|
var policy = (prefix) => extension.wire({ code: protoEnum(prefix), version: count() });
|
|
79
80
|
var casinoSelector = () => extension.wire({
|
|
80
81
|
provider_instance_id: text(),
|
|
81
|
-
software_ids: list(
|
|
82
|
-
game_ids: list(
|
|
83
|
-
category_codes: list(
|
|
82
|
+
software_ids: list(z2__namespace.string()),
|
|
83
|
+
game_ids: list(z2__namespace.string()),
|
|
84
|
+
category_codes: list(z2__namespace.string())
|
|
84
85
|
});
|
|
85
86
|
var sportsSelector = () => extension.wire({
|
|
86
|
-
sport_codes: list(
|
|
87
|
-
competition_ids: list(
|
|
88
|
-
event_ids: list(
|
|
89
|
-
market_codes: list(
|
|
90
|
-
live:
|
|
87
|
+
sport_codes: list(z2__namespace.string()),
|
|
88
|
+
competition_ids: list(z2__namespace.string()),
|
|
89
|
+
event_ids: list(z2__namespace.string()),
|
|
90
|
+
market_codes: list(z2__namespace.string()),
|
|
91
|
+
live: z2__namespace.optional(z2__namespace.boolean()),
|
|
91
92
|
bet_types: list(protoEnum("SPORTS_BET_TYPE_"))
|
|
92
93
|
});
|
|
93
94
|
var qualification = () => extension.wire({
|
|
94
95
|
version: count(),
|
|
95
|
-
immediate:
|
|
96
|
-
user_event:
|
|
96
|
+
immediate: z2__namespace.optional(empty()),
|
|
97
|
+
user_event: z2__namespace.optional(
|
|
97
98
|
extension.wire({
|
|
98
99
|
event_code: text(),
|
|
99
100
|
event_version: count(),
|
|
100
101
|
source_authority: text(),
|
|
101
|
-
identity_fields: list(
|
|
102
|
+
identity_fields: list(z2__namespace.string())
|
|
102
103
|
})
|
|
103
104
|
),
|
|
104
|
-
deposit_settled:
|
|
105
|
+
deposit_settled: z2__namespace.optional(
|
|
105
106
|
extension.wire({
|
|
106
107
|
currency: campaignCurrency(),
|
|
107
|
-
eligible_method_codes: list(
|
|
108
|
+
eligible_method_codes: list(z2__namespace.string()),
|
|
108
109
|
first_deposit_policy: protoEnum("FIRST_DEPOSIT_POLICY_"),
|
|
109
|
-
minimum_settled_net_amount:
|
|
110
|
-
maximum_settled_net_amount:
|
|
110
|
+
minimum_settled_net_amount: z2__namespace.optional(money()),
|
|
111
|
+
maximum_settled_net_amount: z2__namespace.optional(money()),
|
|
111
112
|
amount_basis: protoEnum("DEPOSIT_AMOUNT_BASIS_")
|
|
112
113
|
})
|
|
113
114
|
),
|
|
114
|
-
activity_aggregate:
|
|
115
|
+
activity_aggregate: z2__namespace.optional(
|
|
115
116
|
extension.wire({
|
|
116
117
|
basis: protoEnum("BASIS_"),
|
|
117
118
|
product_scope: protoEnum("PRODUCT_SCOPE_"),
|
|
118
119
|
currency: campaignCurrency(),
|
|
119
|
-
window:
|
|
120
|
+
window: z2__namespace.optional(durationSeconds()),
|
|
120
121
|
timezone: text(),
|
|
121
|
-
late_event_grace:
|
|
122
|
-
casino:
|
|
123
|
-
sportsbook:
|
|
122
|
+
late_event_grace: z2__namespace.optional(durationSeconds()),
|
|
123
|
+
casino: z2__namespace.optional(casinoSelector()),
|
|
124
|
+
sportsbook: z2__namespace.optional(sportsSelector())
|
|
124
125
|
})
|
|
125
126
|
)
|
|
126
127
|
});
|
|
127
128
|
var validity = () => extension.wire({
|
|
128
|
-
no_expiry:
|
|
129
|
-
absolute_expiry:
|
|
130
|
-
duration_from_grant:
|
|
129
|
+
no_expiry: z2__namespace.optional(empty()),
|
|
130
|
+
absolute_expiry: z2__namespace.optional(extension.wire({ expires_at: z2__namespace.optional(z2__namespace.string()) })),
|
|
131
|
+
duration_from_grant: z2__namespace.optional(extension.wire({ duration: z2__namespace.optional(durationSeconds()) }))
|
|
131
132
|
});
|
|
132
133
|
var rounding = () => protoEnum("ROUNDING_MODE_");
|
|
133
134
|
var proceedsClass = () => protoEnum("PROCEEDS_CLASS_");
|
|
134
135
|
var percent = () => extension.wire({
|
|
135
|
-
percentage:
|
|
136
|
+
percentage: z2__namespace.optional(ratio()),
|
|
136
137
|
rounding: rounding(),
|
|
137
|
-
minimum_reward:
|
|
138
|
-
maximum_reward:
|
|
138
|
+
minimum_reward: z2__namespace.optional(money()),
|
|
139
|
+
maximum_reward: z2__namespace.optional(money())
|
|
139
140
|
});
|
|
140
141
|
var balanceCredit = () => extension.wire({
|
|
141
|
-
fixed_amount:
|
|
142
|
-
percent_of_source_amount:
|
|
143
|
-
aggregate_rebate:
|
|
142
|
+
fixed_amount: z2__namespace.optional(extension.wire({ amount: z2__namespace.optional(money()) })),
|
|
143
|
+
percent_of_source_amount: z2__namespace.optional(percent()),
|
|
144
|
+
aggregate_rebate: z2__namespace.optional(
|
|
144
145
|
extension.wire({
|
|
145
|
-
percentage:
|
|
146
|
+
percentage: z2__namespace.optional(ratio()),
|
|
146
147
|
rounding: rounding(),
|
|
147
|
-
minimum_basis:
|
|
148
|
-
maximum_reward:
|
|
148
|
+
minimum_basis: z2__namespace.optional(money()),
|
|
149
|
+
maximum_reward: z2__namespace.optional(money())
|
|
149
150
|
})
|
|
150
151
|
),
|
|
151
152
|
balance_class: protoEnum("BALANCE_CLASS_"),
|
|
152
153
|
proceeds_class: proceedsClass(),
|
|
153
|
-
validity:
|
|
154
|
+
validity: z2__namespace.optional(validity())
|
|
154
155
|
});
|
|
155
|
-
var maximumBet = () => extension.wire({ mode: protoEnum("MAXIMUM_BET_MODE_"), campaign_maximum:
|
|
156
|
+
var maximumBet = () => extension.wire({ mode: protoEnum("MAXIMUM_BET_MODE_"), campaign_maximum: z2__namespace.optional(money()) });
|
|
156
157
|
var oddsPolicy = () => extension.wire({
|
|
157
158
|
mode: protoEnum("MODE_"),
|
|
158
|
-
minimum_total_odds_decimal:
|
|
159
|
-
minimum_odds_per_leg_decimal:
|
|
160
|
-
minimum_legs:
|
|
161
|
-
maximum_legs:
|
|
159
|
+
minimum_total_odds_decimal: z2__namespace.optional(z2__namespace.string()),
|
|
160
|
+
minimum_odds_per_leg_decimal: z2__namespace.optional(z2__namespace.string()),
|
|
161
|
+
minimum_legs: z2__namespace.optional(z2__namespace.number()),
|
|
162
|
+
maximum_legs: z2__namespace.optional(z2__namespace.number())
|
|
162
163
|
});
|
|
163
164
|
var cashoutMode = () => protoEnum("RESTRICTED_CASHOUT_MODE_");
|
|
164
165
|
var usePolicy = () => extension.wire({
|
|
165
166
|
version: count(),
|
|
166
|
-
funds_consumption:
|
|
167
|
-
casino:
|
|
168
|
-
sportsbook:
|
|
167
|
+
funds_consumption: z2__namespace.optional(policy("FUNDS_CONSUMPTION_POLICY_CODE_")),
|
|
168
|
+
casino: z2__namespace.optional(extension.wire({ allowed_scopes: list(casinoSelector()), maximum_bet: z2__namespace.optional(maximumBet()) })),
|
|
169
|
+
sportsbook: z2__namespace.optional(
|
|
169
170
|
extension.wire({
|
|
170
171
|
allowed_scopes: list(sportsSelector()),
|
|
171
172
|
excluded_scopes: list(sportsSelector()),
|
|
172
|
-
maximum_bet:
|
|
173
|
-
funding_odds:
|
|
173
|
+
maximum_bet: z2__namespace.optional(maximumBet()),
|
|
174
|
+
funding_odds: z2__namespace.optional(oddsPolicy()),
|
|
174
175
|
cashout_mode: cashoutMode()
|
|
175
176
|
})
|
|
176
177
|
),
|
|
177
|
-
casino_and_sportsbook:
|
|
178
|
+
casino_and_sportsbook: z2__namespace.optional(
|
|
178
179
|
extension.wire({
|
|
179
180
|
allowed_casino_scopes: list(casinoSelector()),
|
|
180
181
|
allowed_sportsbook_scopes: list(sportsSelector()),
|
|
181
182
|
excluded_sportsbook_scopes: list(sportsSelector()),
|
|
182
|
-
maximum_casino_bet:
|
|
183
|
-
maximum_sportsbook_bet:
|
|
184
|
-
sportsbook_funding_odds:
|
|
183
|
+
maximum_casino_bet: z2__namespace.optional(maximumBet()),
|
|
184
|
+
maximum_sportsbook_bet: z2__namespace.optional(maximumBet()),
|
|
185
|
+
sportsbook_funding_odds: z2__namespace.optional(oddsPolicy()),
|
|
185
186
|
sportsbook_cashout_mode: cashoutMode()
|
|
186
187
|
})
|
|
187
188
|
),
|
|
188
|
-
payout_allocation:
|
|
189
|
+
payout_allocation: z2__namespace.optional(policy("PAYOUT_ALLOCATION_POLICY_CODE_"))
|
|
189
190
|
});
|
|
190
191
|
var wageringPolicy = () => extension.wire({
|
|
191
192
|
version: count(),
|
|
192
|
-
none:
|
|
193
|
-
multiplier:
|
|
193
|
+
none: z2__namespace.optional(empty()),
|
|
194
|
+
multiplier: z2__namespace.optional(
|
|
194
195
|
extension.wire({
|
|
195
196
|
requirement_basis: protoEnum("REQUIREMENT_BASIS_"),
|
|
196
|
-
multiplier:
|
|
197
|
+
multiplier: z2__namespace.optional(ratio()),
|
|
197
198
|
contribution_rates: list(
|
|
198
199
|
extension.wire({
|
|
199
|
-
casino:
|
|
200
|
-
sportsbook:
|
|
201
|
-
rate:
|
|
200
|
+
casino: z2__namespace.optional(casinoSelector()),
|
|
201
|
+
sportsbook: z2__namespace.optional(sportsSelector()),
|
|
202
|
+
rate: z2__namespace.optional(ratio())
|
|
202
203
|
})
|
|
203
204
|
),
|
|
204
|
-
deadline:
|
|
205
|
+
deadline: z2__namespace.optional(validity()),
|
|
205
206
|
rounding: rounding(),
|
|
206
|
-
sportsbook_contribution_odds:
|
|
207
|
+
sportsbook_contribution_odds: z2__namespace.optional(oddsPolicy())
|
|
207
208
|
})
|
|
208
209
|
)
|
|
209
210
|
});
|
|
210
211
|
var stackingPolicy = () => extension.wire({
|
|
211
212
|
version: count(),
|
|
212
|
-
exclusive_in_group:
|
|
213
|
-
multiple_in_group:
|
|
213
|
+
exclusive_in_group: z2__namespace.optional(extension.wire({ stacking_group_key: text() })),
|
|
214
|
+
multiple_in_group: z2__namespace.optional(extension.wire({ stacking_group_key: text(), maximum_active_per_player: count() }))
|
|
214
215
|
});
|
|
215
216
|
var reward = () => extension.wire({
|
|
216
217
|
reward_key: text(),
|
|
@@ -218,49 +219,49 @@ var reward = () => extension.wire({
|
|
|
218
219
|
reward_kind_version: count(),
|
|
219
220
|
execution_profile_code: protoEnum("EXECUTION_PROFILE_CODE_"),
|
|
220
221
|
execution_profile_version: count(),
|
|
221
|
-
balance_credit:
|
|
222
|
-
provider_managed_balance:
|
|
223
|
-
casino_free_spins:
|
|
222
|
+
balance_credit: z2__namespace.optional(balanceCredit()),
|
|
223
|
+
provider_managed_balance: z2__namespace.optional(extension.wire({ provider_code: text() })),
|
|
224
|
+
casino_free_spins: z2__namespace.optional(
|
|
224
225
|
extension.wire({
|
|
225
226
|
provider_code: text(),
|
|
226
|
-
casino_scope:
|
|
227
|
+
casino_scope: z2__namespace.optional(casinoSelector()),
|
|
227
228
|
quantity: count(),
|
|
228
|
-
denomination:
|
|
229
|
+
denomination: z2__namespace.optional(money()),
|
|
229
230
|
currency: campaignCurrency(),
|
|
230
|
-
grant_window:
|
|
231
|
+
grant_window: z2__namespace.optional(timeWindow()),
|
|
231
232
|
proceeds_class: proceedsClass(),
|
|
232
|
-
maximum_winnings:
|
|
233
|
+
maximum_winnings: z2__namespace.optional(money())
|
|
233
234
|
})
|
|
234
235
|
),
|
|
235
|
-
sports_bonus_bet:
|
|
236
|
+
sports_bonus_bet: z2__namespace.optional(
|
|
236
237
|
extension.wire({
|
|
237
238
|
provider_code: text(),
|
|
238
|
-
sportsbook_scope:
|
|
239
|
-
amount:
|
|
239
|
+
sportsbook_scope: z2__namespace.optional(sportsSelector()),
|
|
240
|
+
amount: z2__namespace.optional(money()),
|
|
240
241
|
quantity: count(),
|
|
241
|
-
validity:
|
|
242
|
+
validity: z2__namespace.optional(validity())
|
|
242
243
|
})
|
|
243
244
|
),
|
|
244
|
-
sports_bet_coverage:
|
|
245
|
+
sports_bet_coverage: z2__namespace.optional(
|
|
245
246
|
extension.wire({
|
|
246
247
|
provider_code: text(),
|
|
247
|
-
qualifying_bet_scope:
|
|
248
|
-
coverage_cap:
|
|
249
|
-
validity:
|
|
248
|
+
qualifying_bet_scope: z2__namespace.optional(sportsSelector()),
|
|
249
|
+
coverage_cap: z2__namespace.optional(money()),
|
|
250
|
+
validity: z2__namespace.optional(validity())
|
|
250
251
|
})
|
|
251
252
|
),
|
|
252
|
-
use_policy:
|
|
253
|
-
wagering_policy:
|
|
254
|
-
stacking_policy:
|
|
255
|
-
restricted_position_selection_policy:
|
|
253
|
+
use_policy: z2__namespace.optional(usePolicy()),
|
|
254
|
+
wagering_policy: z2__namespace.optional(wageringPolicy()),
|
|
255
|
+
stacking_policy: z2__namespace.optional(stackingPolicy()),
|
|
256
|
+
restricted_position_selection_policy: z2__namespace.optional(
|
|
256
257
|
extension.wire({
|
|
257
258
|
version: count(),
|
|
258
|
-
priority_then_earliest_expiry:
|
|
259
|
+
priority_then_earliest_expiry: z2__namespace.optional(extension.wire({ selection_priority: z2__namespace.optional(z2__namespace.number()) }))
|
|
259
260
|
})
|
|
260
261
|
)
|
|
261
262
|
});
|
|
262
263
|
var localizedContent = () => extension.wire({ locale: text(), display_name: text(), description: text(), terms: text(), terms_revision: text() });
|
|
263
|
-
var content = () => extension.wire({ default_locale: text(), supported_locales: list(
|
|
264
|
+
var content = () => extension.wire({ default_locale: text(), supported_locales: list(z2__namespace.string()), localized_content: list(localizedContent()) });
|
|
264
265
|
var offerSchema = /* @__PURE__ */ extension.lazy(
|
|
265
266
|
() => extension.wire({
|
|
266
267
|
campaign_id: text(),
|
|
@@ -268,33 +269,33 @@ var offerSchema = /* @__PURE__ */ extension.lazy(
|
|
|
268
269
|
publication_id: text(),
|
|
269
270
|
product_scope: protoEnum("PRODUCT_SCOPE_"),
|
|
270
271
|
timezone: text(),
|
|
271
|
-
enrollment_window:
|
|
272
|
-
qualification_window:
|
|
273
|
-
claim_window:
|
|
274
|
-
entry_policy:
|
|
275
|
-
reward_claim_policy:
|
|
276
|
-
qualification:
|
|
277
|
-
reward:
|
|
278
|
-
publication_starts_at:
|
|
279
|
-
publication_ends_at:
|
|
280
|
-
content:
|
|
272
|
+
enrollment_window: z2__namespace.optional(timeWindow()),
|
|
273
|
+
qualification_window: z2__namespace.optional(timeWindow()),
|
|
274
|
+
claim_window: z2__namespace.optional(timeWindow()),
|
|
275
|
+
entry_policy: z2__namespace.optional(policy("ENTRY_POLICY_CODE_")),
|
|
276
|
+
reward_claim_policy: z2__namespace.optional(policy("REWARD_CLAIM_POLICY_CODE_")),
|
|
277
|
+
qualification: z2__namespace.optional(qualification()),
|
|
278
|
+
reward: z2__namespace.optional(reward()),
|
|
279
|
+
publication_starts_at: z2__namespace.optional(z2__namespace.string()),
|
|
280
|
+
publication_ends_at: z2__namespace.optional(z2__namespace.string()),
|
|
281
|
+
content: z2__namespace.optional(content())
|
|
281
282
|
})
|
|
282
283
|
);
|
|
283
284
|
function grantMoney(value, currency) {
|
|
284
285
|
return { amount: value?.amount ?? 0, currency: value?.currency || currency };
|
|
285
286
|
}
|
|
286
|
-
var rewardGrant = () =>
|
|
287
|
+
var rewardGrant = () => z2__namespace.pipe(
|
|
287
288
|
extension.wire({
|
|
288
289
|
state: protoEnum("CAMPAIGN_PLAYER_REWARD_GRANT_STATE_"),
|
|
289
|
-
granted:
|
|
290
|
-
balance:
|
|
291
|
-
converted:
|
|
292
|
-
expires_at:
|
|
293
|
-
wagering:
|
|
294
|
-
extension.wire({ required:
|
|
290
|
+
granted: z2__namespace.optional(money()),
|
|
291
|
+
balance: z2__namespace.optional(money()),
|
|
292
|
+
converted: z2__namespace.optional(money()),
|
|
293
|
+
expires_at: z2__namespace.optional(z2__namespace.string()),
|
|
294
|
+
wagering: z2__namespace.optional(
|
|
295
|
+
extension.wire({ required: z2__namespace.optional(money()), accumulated: z2__namespace.optional(money()), completed_at: z2__namespace.optional(z2__namespace.string()) })
|
|
295
296
|
)
|
|
296
297
|
}),
|
|
297
|
-
|
|
298
|
+
z2__namespace.transform(({ state, granted, balance, converted, expiresAt, wagering }) => {
|
|
298
299
|
const currency = [granted, balance, converted, wagering?.required, wagering?.accumulated].find((m) => m?.currency)?.currency ?? "";
|
|
299
300
|
const out = {
|
|
300
301
|
state,
|
|
@@ -314,40 +315,40 @@ var rewardGrant = () => mini.z.pipe(
|
|
|
314
315
|
})
|
|
315
316
|
);
|
|
316
317
|
var participationSchema = /* @__PURE__ */ extension.lazy(
|
|
317
|
-
() =>
|
|
318
|
+
() => z2__namespace.pipe(
|
|
318
319
|
extension.wire({
|
|
319
320
|
id: text(),
|
|
320
321
|
campaign_id: text(),
|
|
321
322
|
campaign_version_id: text(),
|
|
322
323
|
reward_key: text(),
|
|
323
|
-
qualification_snapshot:
|
|
324
|
+
qualification_snapshot: z2__namespace.optional(qualification()),
|
|
324
325
|
// oneof `state`: only one of the cases is filled in.
|
|
325
|
-
enrolled:
|
|
326
|
-
qualifying:
|
|
327
|
-
qualified:
|
|
328
|
-
reward_pending:
|
|
329
|
-
completed:
|
|
330
|
-
reward_failed:
|
|
331
|
-
expired:
|
|
332
|
-
cancelled:
|
|
333
|
-
reward_grant:
|
|
334
|
-
snapshot:
|
|
326
|
+
enrolled: z2__namespace.optional(empty()),
|
|
327
|
+
qualifying: z2__namespace.optional(empty()),
|
|
328
|
+
qualified: z2__namespace.optional(extension.wire({ qualified_at: z2__namespace.optional(z2__namespace.string()) })),
|
|
329
|
+
reward_pending: z2__namespace.optional(empty()),
|
|
330
|
+
completed: z2__namespace.optional(extension.wire({ completed_at: z2__namespace.optional(z2__namespace.string()) })),
|
|
331
|
+
reward_failed: z2__namespace.optional(empty()),
|
|
332
|
+
expired: z2__namespace.optional(extension.wire({ expired_at: z2__namespace.optional(z2__namespace.string()) })),
|
|
333
|
+
cancelled: z2__namespace.optional(empty()),
|
|
334
|
+
reward_grant: z2__namespace.optional(rewardGrant()),
|
|
335
|
+
snapshot: z2__namespace.optional(
|
|
335
336
|
extension.wire({
|
|
336
|
-
reward:
|
|
337
|
-
content:
|
|
338
|
-
terms_acceptance:
|
|
337
|
+
reward: z2__namespace.optional(reward()),
|
|
338
|
+
content: z2__namespace.optional(content()),
|
|
339
|
+
terms_acceptance: z2__namespace.optional(
|
|
339
340
|
extension.wire({
|
|
340
341
|
locale: text(),
|
|
341
342
|
terms_revision: text(),
|
|
342
343
|
terms_digest_sha256_hex: text(),
|
|
343
|
-
accepted_at:
|
|
344
|
+
accepted_at: z2__namespace.optional(z2__namespace.string())
|
|
344
345
|
})
|
|
345
346
|
)
|
|
346
347
|
})
|
|
347
348
|
)
|
|
348
349
|
}),
|
|
349
350
|
// The oneof becomes `status` (+ the timestamp of the case); the oneof's keys are not passed on.
|
|
350
|
-
|
|
351
|
+
z2__namespace.transform(
|
|
351
352
|
({ enrolled, qualifying, qualified, rewardPending, completed, rewardFailed, expired, cancelled, ...rest }) => {
|
|
352
353
|
const out = { ...rest, status: "unspecified" };
|
|
353
354
|
if (enrolled) out.status = "enrolled";
|
|
@@ -369,7 +370,7 @@ var participationSchema = /* @__PURE__ */ extension.lazy(
|
|
|
369
370
|
)
|
|
370
371
|
)
|
|
371
372
|
);
|
|
372
|
-
var cursorPageSchema = (key, item) => extension.wire({ [key]: list(item), next_cursor:
|
|
373
|
+
var cursorPageSchema = (key, item) => extension.wire({ [key]: list(item), next_cursor: z2__namespace.optional(z2__namespace.string()) });
|
|
373
374
|
var offersPage = /* @__PURE__ */ extension.lazy(() => cursorPageSchema("offers", offerSchema()));
|
|
374
375
|
var participationsPage = /* @__PURE__ */ extension.lazy(() => cursorPageSchema("participations", participationSchema()));
|
|
375
376
|
var offerEnvelope = /* @__PURE__ */ extension.lazy(() => extension.wire({ offer: offerSchema() }));
|
|
@@ -382,64 +383,64 @@ function toCursorPage(key, data) {
|
|
|
382
383
|
if (data.nextCursor) page.nextCursor = data.nextCursor;
|
|
383
384
|
return page;
|
|
384
385
|
}
|
|
385
|
-
var nullableDate = () =>
|
|
386
|
-
|
|
387
|
-
|
|
386
|
+
var nullableDate = () => z2__namespace.pipe(
|
|
387
|
+
z2__namespace.nullish(z2__namespace.string()),
|
|
388
|
+
z2__namespace.transform((value) => value ?? void 0)
|
|
388
389
|
);
|
|
389
390
|
function compact(value) {
|
|
390
391
|
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0));
|
|
391
392
|
}
|
|
392
393
|
var overviewSchema = /* @__PURE__ */ extension.lazy(
|
|
393
|
-
() =>
|
|
394
|
+
() => z2__namespace.pipe(
|
|
394
395
|
extension.wire({
|
|
395
396
|
currencies: list(
|
|
396
|
-
|
|
397
|
+
z2__namespace.pipe(
|
|
397
398
|
extension.wire({
|
|
398
399
|
currency: currencyOrEmpty(),
|
|
399
|
-
decimal_places:
|
|
400
|
+
decimal_places: z2__namespace.number(),
|
|
400
401
|
restricted_total: minorUnits(),
|
|
401
402
|
expiring_7d: minorUnits(),
|
|
402
|
-
open_positions:
|
|
403
|
+
open_positions: z2__namespace.number(),
|
|
403
404
|
next_expires_at: nullableDate(),
|
|
404
405
|
converted: minorUnits(),
|
|
405
|
-
converted_campaigns:
|
|
406
|
+
converted_campaigns: z2__namespace.number()
|
|
406
407
|
}),
|
|
407
|
-
|
|
408
|
+
z2__namespace.transform(compact)
|
|
408
409
|
)
|
|
409
410
|
),
|
|
410
411
|
as_of: nullableDate()
|
|
411
412
|
}),
|
|
412
|
-
|
|
413
|
+
z2__namespace.transform(compact)
|
|
413
414
|
)
|
|
414
415
|
);
|
|
415
416
|
var positionsPage = /* @__PURE__ */ extension.lazy(
|
|
416
417
|
() => extension.wire({
|
|
417
418
|
rows: list(
|
|
418
|
-
|
|
419
|
+
z2__namespace.pipe(
|
|
419
420
|
extension.wire({
|
|
420
|
-
position_id:
|
|
421
|
-
campaign_id:
|
|
421
|
+
position_id: z2__namespace.string(),
|
|
422
|
+
campaign_id: z2__namespace.string(),
|
|
422
423
|
currency: currencyOrEmpty(),
|
|
423
|
-
decimal_places:
|
|
424
|
+
decimal_places: z2__namespace.number(),
|
|
424
425
|
granted: minorUnits(),
|
|
425
426
|
restricted: minorUnits(),
|
|
426
427
|
converted: minorUnits(),
|
|
427
428
|
required: minorUnits(),
|
|
428
429
|
wagered: minorUnits(),
|
|
429
430
|
remaining: minorUnits(),
|
|
430
|
-
state:
|
|
431
|
+
state: z2__namespace.string(),
|
|
431
432
|
// The gateway answers `null` for an action it does not know; known ones are uppercase (`CONVERT`).
|
|
432
|
-
terminal_action:
|
|
433
|
-
|
|
434
|
-
|
|
433
|
+
terminal_action: z2__namespace.pipe(
|
|
434
|
+
z2__namespace.nullish(z2__namespace.string()),
|
|
435
|
+
z2__namespace.transform((value) => value ? value.toLowerCase() : void 0)
|
|
435
436
|
),
|
|
436
437
|
expires_at: nullableDate(),
|
|
437
438
|
created_at: nullableDate()
|
|
438
439
|
}),
|
|
439
|
-
|
|
440
|
+
z2__namespace.transform((row) => compact(row))
|
|
440
441
|
)
|
|
441
442
|
),
|
|
442
|
-
next_cursor:
|
|
443
|
+
next_cursor: z2__namespace.optional(z2__namespace.string())
|
|
443
444
|
})
|
|
444
445
|
);
|
|
445
446
|
var terms = (acceptance) => acceptance && { locale: acceptance.locale, terms_revision: acceptance.termsRevision };
|
|
@@ -533,51 +534,51 @@ function createBonusApi(transport) {
|
|
|
533
534
|
}
|
|
534
535
|
var gameSchema = /* @__PURE__ */ extension.lazy(
|
|
535
536
|
() => extension.wire({
|
|
536
|
-
id:
|
|
537
|
-
name:
|
|
538
|
-
provider:
|
|
539
|
-
category:
|
|
540
|
-
type:
|
|
541
|
-
thumbnail:
|
|
542
|
-
is_new:
|
|
543
|
-
is_popular:
|
|
544
|
-
is_live:
|
|
545
|
-
demo_available:
|
|
546
|
-
rtp:
|
|
547
|
-
volatility:
|
|
548
|
-
priority:
|
|
537
|
+
id: z2__namespace.string(),
|
|
538
|
+
name: z2__namespace.string(),
|
|
539
|
+
provider: z2__namespace.string(),
|
|
540
|
+
category: z2__namespace.string(),
|
|
541
|
+
type: z2__namespace.string(),
|
|
542
|
+
thumbnail: z2__namespace.string(),
|
|
543
|
+
is_new: z2__namespace.boolean(),
|
|
544
|
+
is_popular: z2__namespace.boolean(),
|
|
545
|
+
is_live: z2__namespace.boolean(),
|
|
546
|
+
demo_available: z2__namespace.boolean(),
|
|
547
|
+
rtp: z2__namespace.number(),
|
|
548
|
+
volatility: z2__namespace.string(),
|
|
549
|
+
priority: z2__namespace.number()
|
|
549
550
|
})
|
|
550
551
|
);
|
|
551
552
|
var categoriesSchema = /* @__PURE__ */ extension.lazy(
|
|
552
|
-
() =>
|
|
553
|
-
extension.wire({ slug:
|
|
553
|
+
() => z2__namespace.array(
|
|
554
|
+
extension.wire({ slug: z2__namespace.string(), name: z2__namespace.string(), icon: z2__namespace.string(), game_count: z2__namespace.number(), priority: z2__namespace.number() })
|
|
554
555
|
)
|
|
555
556
|
);
|
|
556
557
|
var providersSchema = /* @__PURE__ */ extension.lazy(
|
|
557
|
-
() =>
|
|
558
|
+
() => z2__namespace.array(extension.wire({ id: z2__namespace.string(), name: z2__namespace.string(), game_count: z2__namespace.number() }))
|
|
558
559
|
);
|
|
559
560
|
var launchSchema = /* @__PURE__ */ extension.lazy(
|
|
560
|
-
() =>
|
|
561
|
+
() => z2__namespace.pipe(
|
|
561
562
|
extension.wire({
|
|
562
|
-
session_id:
|
|
563
|
-
game_url:
|
|
563
|
+
session_id: z2__namespace.string().check(z2__namespace.minLength(1)),
|
|
564
|
+
game_url: z2__namespace.string().check(z2__namespace.minLength(1)),
|
|
564
565
|
// Any text: a target the SDK does not know yet must not fail the (strict) launch.
|
|
565
|
-
launch_target:
|
|
566
|
-
provider_code:
|
|
567
|
-
expires_at:
|
|
566
|
+
launch_target: z2__namespace.optional(z2__namespace.string()),
|
|
567
|
+
provider_code: z2__namespace.optional(z2__namespace.string()),
|
|
568
|
+
expires_at: z2__namespace.optional(z2__namespace.string())
|
|
568
569
|
}),
|
|
569
570
|
// Without a target (an older gateway, or a custom mock), the launch keeps the behavior the SDK documented
|
|
570
571
|
// before the field existed: an iframe.
|
|
571
|
-
|
|
572
|
+
z2__namespace.transform(({ launchTarget, ...rest }) => ({ ...rest, launchTarget: launchTarget || "iframe" }))
|
|
572
573
|
)
|
|
573
574
|
);
|
|
574
575
|
var sessionSchema = /* @__PURE__ */ extension.lazy(
|
|
575
576
|
() => extension.wire({
|
|
576
|
-
id:
|
|
577
|
-
game_id:
|
|
578
|
-
game_name:
|
|
579
|
-
provider:
|
|
580
|
-
start_time:
|
|
577
|
+
id: z2__namespace.string(),
|
|
578
|
+
game_id: z2__namespace.string(),
|
|
579
|
+
game_name: z2__namespace.string(),
|
|
580
|
+
provider: z2__namespace.string(),
|
|
581
|
+
start_time: z2__namespace.string(),
|
|
581
582
|
total_bet: extension.money(),
|
|
582
583
|
total_win: extension.money(),
|
|
583
584
|
status: protoEnum("SESSION_STATUS_")
|
|
@@ -585,27 +586,27 @@ var sessionSchema = /* @__PURE__ */ extension.lazy(
|
|
|
585
586
|
);
|
|
586
587
|
var transactionSchema = /* @__PURE__ */ extension.lazy(
|
|
587
588
|
() => extension.wire({
|
|
588
|
-
id:
|
|
589
|
-
game_id:
|
|
590
|
-
game_name:
|
|
591
|
-
round_id:
|
|
589
|
+
id: z2__namespace.string(),
|
|
590
|
+
game_id: z2__namespace.string(),
|
|
591
|
+
game_name: z2__namespace.string(),
|
|
592
|
+
round_id: z2__namespace.string(),
|
|
592
593
|
type: protoEnum("CASINO_TRANSACTION_TYPE_"),
|
|
593
594
|
amount: minorUnits(),
|
|
594
595
|
currency: extension.currencyCode(),
|
|
595
596
|
currency_decimal_places: extension.decimalPlaces(),
|
|
596
|
-
created_at:
|
|
597
|
+
created_at: z2__namespace.string()
|
|
597
598
|
})
|
|
598
599
|
);
|
|
599
600
|
var winnersSchema = /* @__PURE__ */ extension.lazy(
|
|
600
|
-
() =>
|
|
601
|
+
() => z2__namespace.array(
|
|
601
602
|
extension.wire({
|
|
602
|
-
player:
|
|
603
|
+
player: z2__namespace.string(),
|
|
603
604
|
amount: minorUnits(),
|
|
604
605
|
currency: extension.currencyCode(),
|
|
605
606
|
currency_decimal_places: extension.decimalPlaces(),
|
|
606
|
-
game_id:
|
|
607
|
-
game_name:
|
|
608
|
-
won_at:
|
|
607
|
+
game_id: z2__namespace.string(),
|
|
608
|
+
game_name: z2__namespace.string(),
|
|
609
|
+
won_at: z2__namespace.string()
|
|
609
610
|
})
|
|
610
611
|
)
|
|
611
612
|
);
|
|
@@ -695,28 +696,28 @@ function pageInputProblem(name, input) {
|
|
|
695
696
|
return void 0;
|
|
696
697
|
}
|
|
697
698
|
function optionalTimestamp() {
|
|
698
|
-
return
|
|
699
|
-
|
|
700
|
-
|
|
699
|
+
return z2__namespace.pipe(
|
|
700
|
+
z2__namespace.nullish(z2__namespace.string().check(z2__namespace.refine((value) => value === "" || !Number.isNaN(Date.parse(value)), "invalid date"))),
|
|
701
|
+
z2__namespace.transform((value) => value == null || value === "" || Date.parse(value) === 0 ? null : value)
|
|
701
702
|
);
|
|
702
703
|
}
|
|
703
704
|
function optionalText() {
|
|
704
|
-
return
|
|
705
|
-
|
|
706
|
-
|
|
705
|
+
return z2__namespace.pipe(
|
|
706
|
+
z2__namespace.nullish(z2__namespace.string()),
|
|
707
|
+
z2__namespace.transform((value) => value == null || value === "" ? null : value)
|
|
707
708
|
);
|
|
708
709
|
}
|
|
709
710
|
function nullableList(item) {
|
|
710
|
-
return
|
|
711
|
-
|
|
712
|
-
|
|
711
|
+
return z2__namespace.pipe(
|
|
712
|
+
z2__namespace.nullish(z2__namespace.array(item)),
|
|
713
|
+
z2__namespace.transform((value) => value ?? [])
|
|
713
714
|
);
|
|
714
715
|
}
|
|
715
716
|
|
|
716
717
|
// src/modules/loyalty.ts
|
|
717
|
-
var tierBenefits = () =>
|
|
718
|
-
|
|
719
|
-
|
|
718
|
+
var tierBenefits = () => z2__namespace.pipe(
|
|
719
|
+
z2__namespace.nullish(z2__namespace.string()),
|
|
720
|
+
z2__namespace.transform((text2, ctx) => {
|
|
720
721
|
if (text2 == null || text2.trim() === "") return null;
|
|
721
722
|
let parsed;
|
|
722
723
|
try {
|
|
@@ -727,43 +728,43 @@ var tierBenefits = () => mini.z.pipe(
|
|
|
727
728
|
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed))
|
|
728
729
|
return parsed;
|
|
729
730
|
ctx.issues.push({ code: "custom", message: "tier_benefits_json is not a JSON object", input: void 0 });
|
|
730
|
-
return
|
|
731
|
+
return z2__namespace.NEVER;
|
|
731
732
|
})
|
|
732
733
|
);
|
|
733
734
|
var loyaltySchema = /* @__PURE__ */ extension.lazy(
|
|
734
|
-
() =>
|
|
735
|
+
() => z2__namespace.pipe(
|
|
735
736
|
extension.wire({
|
|
736
737
|
total_points_earned: integerText(),
|
|
737
738
|
current_points: integerText(),
|
|
738
739
|
points_redeemed: integerText(),
|
|
739
740
|
current_tier: optionalText(),
|
|
740
741
|
tier_points: integerText(),
|
|
741
|
-
lifetime_wagered:
|
|
742
|
-
lifetime_deposited:
|
|
742
|
+
lifetime_wagered: z2__namespace._default(minorUnits(), 0),
|
|
743
|
+
lifetime_deposited: z2__namespace._default(minorUnits(), 0),
|
|
743
744
|
tier_benefits_json: tierBenefits(),
|
|
744
745
|
tier_expires_at: optionalTimestamp()
|
|
745
746
|
}),
|
|
746
|
-
|
|
747
|
+
z2__namespace.transform(({ tierBenefitsJson, ...rest }) => {
|
|
747
748
|
const benefits = typeof tierBenefitsJson === "object" && tierBenefitsJson !== null && !Array.isArray(tierBenefitsJson) ? tierBenefitsJson : null;
|
|
748
749
|
return { ...rest, tierBenefits: benefits };
|
|
749
750
|
})
|
|
750
751
|
)
|
|
751
752
|
);
|
|
752
753
|
var redeemSchema = /* @__PURE__ */ extension.lazy(
|
|
753
|
-
() =>
|
|
754
|
+
() => z2__namespace.pipe(
|
|
754
755
|
extension.wire({
|
|
755
|
-
success:
|
|
756
|
-
message:
|
|
756
|
+
success: z2__namespace.optional(z2__namespace.boolean()),
|
|
757
|
+
message: z2__namespace.optional(z2__namespace.string()),
|
|
757
758
|
redeemed_points: integerText(),
|
|
758
|
-
value:
|
|
759
|
+
value: z2__namespace.nullish(minorUnits()),
|
|
759
760
|
// Currency strict even in `'warn'`; absent, `null` and `''` still become `null`.
|
|
760
|
-
currency:
|
|
761
|
-
|
|
762
|
-
|
|
761
|
+
currency: z2__namespace.pipe(
|
|
762
|
+
z2__namespace.nullish(currencyOrEmpty()),
|
|
763
|
+
z2__namespace.transform((value) => value == null || value === "" ? null : value)
|
|
763
764
|
),
|
|
764
765
|
bonus_id: optionalText()
|
|
765
766
|
}),
|
|
766
|
-
|
|
767
|
+
z2__namespace.transform((data) => ({
|
|
767
768
|
success: data.success,
|
|
768
769
|
message: data.message,
|
|
769
770
|
redeemedPoints: data.redeemedPoints,
|
|
@@ -807,12 +808,12 @@ function createLoyaltyApi(transport) {
|
|
|
807
808
|
};
|
|
808
809
|
}
|
|
809
810
|
function openUnion(values) {
|
|
810
|
-
return
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
811
|
+
return z2__namespace.pipe(
|
|
812
|
+
z2__namespace.pipe(
|
|
813
|
+
z2__namespace.string(),
|
|
814
|
+
z2__namespace.transform((value) => value.toLowerCase())
|
|
814
815
|
),
|
|
815
|
-
|
|
816
|
+
z2__namespace.enum(values)
|
|
816
817
|
);
|
|
817
818
|
}
|
|
818
819
|
|
|
@@ -823,14 +824,14 @@ var REWARD_TYPES = ["bonus", "free_spins", "points", "free_bet"];
|
|
|
823
824
|
var USER_MISSION_STATUSES = ["in_progress", "completed", "expired", "claimed"];
|
|
824
825
|
var missionSchema = /* @__PURE__ */ extension.lazy(
|
|
825
826
|
() => extension.wire({
|
|
826
|
-
id:
|
|
827
|
-
name:
|
|
828
|
-
description:
|
|
827
|
+
id: z2__namespace.string(),
|
|
828
|
+
name: z2__namespace.string(),
|
|
829
|
+
description: z2__namespace._default(z2__namespace.string(), ""),
|
|
829
830
|
mission_type: openUnion(MISSION_TYPES),
|
|
830
831
|
objective_type: openUnion(OBJECTIVE_TYPES),
|
|
831
832
|
target_value: integerText(),
|
|
832
833
|
target_game_category: optionalText(),
|
|
833
|
-
target_games: nullableList(
|
|
834
|
+
target_games: nullableList(z2__namespace.string()),
|
|
834
835
|
reward_type: openUnion(REWARD_TYPES),
|
|
835
836
|
reward_value: minorUnits(),
|
|
836
837
|
valid_from: optionalTimestamp(),
|
|
@@ -838,16 +839,16 @@ var missionSchema = /* @__PURE__ */ extension.lazy(
|
|
|
838
839
|
})
|
|
839
840
|
);
|
|
840
841
|
var userMissionsSchema = /* @__PURE__ */ extension.lazy(
|
|
841
|
-
() =>
|
|
842
|
+
() => z2__namespace.pipe(
|
|
842
843
|
extension.wire({
|
|
843
844
|
missions: nullableList(
|
|
844
845
|
extension.wire({
|
|
845
|
-
id:
|
|
846
|
-
mission_id:
|
|
847
|
-
mission_name:
|
|
846
|
+
id: z2__namespace.string(),
|
|
847
|
+
mission_id: z2__namespace.string(),
|
|
848
|
+
mission_name: z2__namespace._default(z2__namespace.string(), ""),
|
|
848
849
|
current_progress: integerText(),
|
|
849
850
|
target_value: integerText(),
|
|
850
|
-
progress_percentage:
|
|
851
|
+
progress_percentage: z2__namespace.number(),
|
|
851
852
|
status: openUnion(USER_MISSION_STATUSES),
|
|
852
853
|
reward_type: openUnion(REWARD_TYPES),
|
|
853
854
|
reward_value: minorUnits(),
|
|
@@ -856,7 +857,7 @@ var userMissionsSchema = /* @__PURE__ */ extension.lazy(
|
|
|
856
857
|
})
|
|
857
858
|
)
|
|
858
859
|
}),
|
|
859
|
-
|
|
860
|
+
z2__namespace.transform((data) => data.missions)
|
|
860
861
|
)
|
|
861
862
|
);
|
|
862
863
|
function createMissionsApi(transport) {
|
|
@@ -886,25 +887,25 @@ function createMissionsApi(transport) {
|
|
|
886
887
|
}
|
|
887
888
|
var DEFAULT_PER_PAGE = 20;
|
|
888
889
|
var HISTORY_PATH = "/referrals/history";
|
|
889
|
-
var count2 = () =>
|
|
890
|
-
var money3 = () =>
|
|
891
|
-
|
|
892
|
-
|
|
890
|
+
var count2 = () => z2__namespace._default(z2__namespace.number().check(z2__namespace.refine((value) => Number.isSafeInteger(value) && value >= 0, "invalid counter")), 0);
|
|
891
|
+
var money3 = () => z2__namespace.pipe(
|
|
892
|
+
z2__namespace.nullish(extension.wire({ minor_units: minorUnits(), currency: z2__namespace._default(currencyOrEmpty(), "") })),
|
|
893
|
+
z2__namespace.transform(
|
|
893
894
|
(value) => value == null ? null : { amount: value.minorUnits, currency: value.currency }
|
|
894
895
|
)
|
|
895
896
|
);
|
|
896
|
-
var rulesSchema = () =>
|
|
897
|
-
|
|
897
|
+
var rulesSchema = () => z2__namespace.pipe(
|
|
898
|
+
z2__namespace.nullish(
|
|
898
899
|
extension.wire({
|
|
899
900
|
reward: money3(),
|
|
900
901
|
minimum_real_net_loss: money3(),
|
|
901
902
|
referee_window_days: count2(),
|
|
902
903
|
hold_hours: count2(),
|
|
903
|
-
wagering_multiplier:
|
|
904
|
+
wagering_multiplier: z2__namespace._default(z2__namespace.string(), ""),
|
|
904
905
|
maximum_conversion: money3()
|
|
905
906
|
})
|
|
906
907
|
),
|
|
907
|
-
|
|
908
|
+
z2__namespace.transform((rules) => {
|
|
908
909
|
if (rules == null || rules.reward === null || rules.minimumRealNetLoss === null) return null;
|
|
909
910
|
return {
|
|
910
911
|
reward: rules.reward,
|
|
@@ -917,12 +918,12 @@ var rulesSchema = () => mini.z.pipe(
|
|
|
917
918
|
})
|
|
918
919
|
);
|
|
919
920
|
var infoSchema = /* @__PURE__ */ extension.lazy(
|
|
920
|
-
() =>
|
|
921
|
+
() => z2__namespace.pipe(
|
|
921
922
|
extension.wire({
|
|
922
|
-
enabled:
|
|
923
|
+
enabled: z2__namespace._default(z2__namespace.boolean(), false),
|
|
923
924
|
referral_code: optionalText(),
|
|
924
925
|
rules: rulesSchema(),
|
|
925
|
-
totals:
|
|
926
|
+
totals: z2__namespace._default(
|
|
926
927
|
extension.wire({
|
|
927
928
|
registered: count2(),
|
|
928
929
|
deposited: count2(),
|
|
@@ -935,7 +936,7 @@ var infoSchema = /* @__PURE__ */ extension.lazy(
|
|
|
935
936
|
{ registered: 0, deposited: 0, inHold: 0, paid: 0, notEligible: 0, expired: 0, cancelled: 0 }
|
|
936
937
|
)
|
|
937
938
|
}),
|
|
938
|
-
|
|
939
|
+
z2__namespace.transform(
|
|
939
940
|
({ enabled, referralCode, rules, totals }) => ({ enabled, code: referralCode, rules, totals })
|
|
940
941
|
)
|
|
941
942
|
)
|
|
@@ -944,16 +945,16 @@ function remainingOf(target, loss) {
|
|
|
944
945
|
const missing = BigInt(target.amount) - BigInt(loss.amount);
|
|
945
946
|
return { amount: missing > 0n ? Number(missing) : 0, currency: target.currency };
|
|
946
947
|
}
|
|
947
|
-
var progressSchema = () =>
|
|
948
|
-
|
|
948
|
+
var progressSchema = () => z2__namespace.pipe(
|
|
949
|
+
z2__namespace.nullish(
|
|
949
950
|
extension.wire({
|
|
950
|
-
deposit_done:
|
|
951
|
+
deposit_done: z2__namespace._default(z2__namespace.boolean(), false),
|
|
951
952
|
real_net_loss: money3(),
|
|
952
953
|
target: money3(),
|
|
953
954
|
remaining: money3()
|
|
954
955
|
})
|
|
955
956
|
),
|
|
956
|
-
|
|
957
|
+
z2__namespace.transform((progress) => {
|
|
957
958
|
if (progress == null || progress.target === null) return null;
|
|
958
959
|
const { target } = progress;
|
|
959
960
|
const realNetLoss = progress.realNetLoss ?? { amount: 0, currency: target.currency };
|
|
@@ -970,9 +971,9 @@ function statusOf(playerStatus, legacy) {
|
|
|
970
971
|
if (playerStatus !== null) return playerStatus.replace(/^CAMPAIGN_REFERRAL_STATUS_/, "").toLowerCase();
|
|
971
972
|
return LEGACY_STATUS[(legacy ?? "").toUpperCase()] ?? "registered";
|
|
972
973
|
}
|
|
973
|
-
var referralSchema = () =>
|
|
974
|
+
var referralSchema = () => z2__namespace.pipe(
|
|
974
975
|
extension.wire({
|
|
975
|
-
id:
|
|
976
|
+
id: z2__namespace.string(),
|
|
976
977
|
referee_name: optionalText(),
|
|
977
978
|
status: optionalText(),
|
|
978
979
|
player_status: optionalText(),
|
|
@@ -980,7 +981,7 @@ var referralSchema = () => mini.z.pipe(
|
|
|
980
981
|
deadline_at: optionalTimestamp(),
|
|
981
982
|
progress: progressSchema()
|
|
982
983
|
}),
|
|
983
|
-
|
|
984
|
+
z2__namespace.transform(
|
|
984
985
|
(r) => ({
|
|
985
986
|
id: r.id,
|
|
986
987
|
refereeName: r.refereeName,
|
|
@@ -995,7 +996,7 @@ var historySchema = /* @__PURE__ */ extension.lazy(
|
|
|
995
996
|
() => extension.wire({
|
|
996
997
|
referral_code: optionalText(),
|
|
997
998
|
referrals: nullableList(referralSchema()),
|
|
998
|
-
pagination:
|
|
999
|
+
pagination: z2__namespace.optional(extension.wire({ page: count2(), limit: count2(), total_items: count2() }))
|
|
999
1000
|
})
|
|
1000
1001
|
);
|
|
1001
1002
|
var positiveInt = (value, fallback) => typeof value === "number" && Number.isSafeInteger(value) && value >= 1 ? value : fallback;
|
|
@@ -1035,12 +1036,12 @@ function createReferralsApi(transport) {
|
|
|
1035
1036
|
}
|
|
1036
1037
|
var HTTP_URL = "Expected an absolute http(s) URL";
|
|
1037
1038
|
var sessionSchema2 = /* @__PURE__ */ extension.lazy(
|
|
1038
|
-
() =>
|
|
1039
|
+
() => z2__namespace.pipe(
|
|
1039
1040
|
extension.wire({
|
|
1040
1041
|
// The separate token only exists on the wire: the schema declares it (strict contract) and the output drops it.
|
|
1041
|
-
operator_token:
|
|
1042
|
-
launch_url:
|
|
1043
|
-
|
|
1042
|
+
operator_token: z2__namespace.string(),
|
|
1043
|
+
launch_url: z2__namespace.string().check(
|
|
1044
|
+
z2__namespace.refine(
|
|
1044
1045
|
(value) => {
|
|
1045
1046
|
try {
|
|
1046
1047
|
const { protocol } = new URL(value);
|
|
@@ -1052,10 +1053,10 @@ var sessionSchema2 = /* @__PURE__ */ extension.lazy(
|
|
|
1052
1053
|
{ message: HTTP_URL }
|
|
1053
1054
|
)
|
|
1054
1055
|
),
|
|
1055
|
-
expires_in_seconds:
|
|
1056
|
+
expires_in_seconds: z2__namespace.number().check(z2__namespace.refine((n) => Number.isFinite(n) && n > 0, { message: "Esperava > 0" }))
|
|
1056
1057
|
}),
|
|
1057
1058
|
// The clock is read when the response is interpreted (= moment of the response).
|
|
1058
|
-
|
|
1059
|
+
z2__namespace.transform(({ launchUrl, expiresInSeconds }) => ({
|
|
1059
1060
|
launchUrl,
|
|
1060
1061
|
expiresInSeconds,
|
|
1061
1062
|
expiresAt: Date.now() + expiresInSeconds * 1e3
|