@getenginex/sdk-igaming 0.10.1 → 0.11.0
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 +37 -0
- package/README.md +4 -3
- package/dist/chunk-LMBQDSFV.js +620 -0
- package/dist/chunk-LMBQDSFV.js.map +1 -0
- package/dist/index.cjs +537 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +747 -1
- package/dist/index.d.ts +747 -1
- package/dist/index.js +279 -365
- package/dist/index.js.map +1 -1
- package/dist/query/index.cjs +44 -5
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +17 -2
- package/dist/query/index.d.ts +17 -2
- package/dist/query/index.js +32 -6
- package/dist/query/index.js.map +1 -1
- package/dist/testing/index.cjs +450 -12
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +42 -4
- package/dist/testing/index.d.ts +42 -4
- package/dist/testing/index.js +450 -12
- package/dist/testing/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,106 +1,16 @@
|
|
|
1
|
+
import { createClubApi, LOCALE, rejectInput, pageInputProblem, nonNegativeMinorUnits, optionalTimestamp, nullableList, protoEnum, optionalText, currencyOrEmpty, minorUnits, integerText, list, text, count, durationSeconds } from './chunk-LMBQDSFV.js';
|
|
2
|
+
export { keepsClubIdempotencyKey } from './chunk-LMBQDSFV.js';
|
|
1
3
|
import { EnginexError } from '@getenginex/sdk';
|
|
2
4
|
import * as extension from '@getenginex/sdk/extension';
|
|
3
|
-
import { lazy, wire, decimalPlaces, currencyCode, money as money$1
|
|
4
|
-
import * as
|
|
5
|
+
import { lazy, wire, decimalPlaces, currencyCode, money as money$1 } from '@getenginex/sdk/extension';
|
|
6
|
+
import * as z2 from 'zod/mini';
|
|
5
7
|
|
|
6
|
-
// src/client.ts
|
|
7
|
-
|
|
8
|
-
// src/internal/input.ts
|
|
9
|
-
function rejectInput(transport, message, route) {
|
|
10
|
-
return Promise.reject(
|
|
11
|
-
transport.reportError({ code: "CONFIGURATION_ERROR", message, status: 0 }, { ...route, attempt: 0 })
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
function pageInputProblem(name, input) {
|
|
15
|
-
if (input === void 0) return void 0;
|
|
16
|
-
if (typeof input !== "object" || input === null || Array.isArray(input)) return `${name}: input must be an object.`;
|
|
17
|
-
const { page, perPage } = input;
|
|
18
|
-
if (page !== void 0 && (typeof page !== "number" || !Number.isSafeInteger(page) || page < 1))
|
|
19
|
-
return `${name}: page must be an integer \u2265 1.`;
|
|
20
|
-
if (perPage !== void 0 && (typeof perPage !== "number" || !Number.isInteger(perPage) || perPage < 1 || perPage > 100))
|
|
21
|
-
return `${name}: perPage must be an integer from 1 to 100.`;
|
|
22
|
-
return void 0;
|
|
23
|
-
}
|
|
24
|
-
function optionalTimestamp() {
|
|
25
|
-
return z4.pipe(
|
|
26
|
-
z4.nullish(z4.string().check(z4.refine((value) => value === "" || !Number.isNaN(Date.parse(value)), "invalid date"))),
|
|
27
|
-
z4.transform((value) => value == null || value === "" || Date.parse(value) === 0 ? null : value)
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
function optionalText() {
|
|
31
|
-
return z4.pipe(
|
|
32
|
-
z4.nullish(z4.string()),
|
|
33
|
-
z4.transform((value) => value == null || value === "" ? null : value)
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
function nullableList(item) {
|
|
37
|
-
return z4.pipe(
|
|
38
|
-
z4.nullish(z4.array(item)),
|
|
39
|
-
z4.transform((value) => value ?? [])
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
function protoEnum(prefix) {
|
|
43
|
-
return z4.pipe(
|
|
44
|
-
z4.optional(z4.union([z4.string(), z4.number()])),
|
|
45
|
-
z4.transform((value) => {
|
|
46
|
-
if (value === void 0 || value === 0) return "unspecified";
|
|
47
|
-
if (typeof value === "number") return String(value);
|
|
48
|
-
return (value.startsWith(prefix) ? value.slice(prefix.length) : value).toLowerCase();
|
|
49
|
-
})
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
function minorUnits() {
|
|
53
|
-
return moneyText();
|
|
54
|
-
}
|
|
55
|
-
function currencyOrEmpty() {
|
|
56
|
-
return currencyCode({ allowEmpty: true });
|
|
57
|
-
}
|
|
58
|
-
var NON_NEGATIVE_MONEY = "Expected money in minor units: a non-negative integer within the safe range of number";
|
|
59
|
-
function nonNegativeMinorUnits() {
|
|
60
|
-
return z4.pipe(
|
|
61
|
-
strictValue(
|
|
62
|
-
(v) => typeof v === "number" && Number.isSafeInteger(v) && v >= 0 || typeof v === "string" && /^\d+$/.test(v) && Number.isSafeInteger(Number(v)),
|
|
63
|
-
NON_NEGATIVE_MONEY
|
|
64
|
-
),
|
|
65
|
-
// `|| 0`: a JSON `-0` comes out as `0`.
|
|
66
|
-
z4.transform((v) => Number(v) || 0)
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
var INTEGER_TEXT = "Expected an integer within the safe range of number";
|
|
70
|
-
function integerText() {
|
|
71
|
-
return z4.pipe(
|
|
72
|
-
z4.union([
|
|
73
|
-
z4.string().check(
|
|
74
|
-
z4.refine((value) => /^-?\d+$/.test(value) && Number.isSafeInteger(Number(value)), { message: INTEGER_TEXT })
|
|
75
|
-
),
|
|
76
|
-
z4.number().check(z4.refine((value) => Number.isSafeInteger(value), { message: INTEGER_TEXT }))
|
|
77
|
-
]),
|
|
78
|
-
z4.transform(Number)
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
function text() {
|
|
82
|
-
return z4._default(z4.string(), "");
|
|
83
|
-
}
|
|
84
|
-
function count() {
|
|
85
|
-
return z4._default(z4.number(), 0);
|
|
86
|
-
}
|
|
87
|
-
function list(item) {
|
|
88
|
-
return nullableList(item);
|
|
89
|
-
}
|
|
90
|
-
function durationSeconds() {
|
|
91
|
-
return z4.pipe(
|
|
92
|
-
z4.string().check(z4.regex(/^-?\d+(\.\d+)?s$/, { message: 'Expected a protobuf duration, e.g. "86400s"' })),
|
|
93
|
-
z4.transform((value) => Number(value.slice(0, -1)))
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// src/modules/bets.ts
|
|
98
8
|
var betFields = () => ({
|
|
99
|
-
id:
|
|
9
|
+
id: z2.string(),
|
|
100
10
|
status: protoEnum("BET_STATUS_"),
|
|
101
11
|
stake: nonNegativeMinorUnits(),
|
|
102
12
|
potential_return: nonNegativeMinorUnits(),
|
|
103
|
-
total_odds:
|
|
13
|
+
total_odds: z2.number(),
|
|
104
14
|
created_at: optionalTimestamp()
|
|
105
15
|
});
|
|
106
16
|
var betSchema = /* @__PURE__ */ lazy(() => wire(betFields()));
|
|
@@ -109,10 +19,10 @@ var betDetailsSchema = /* @__PURE__ */ lazy(
|
|
|
109
19
|
...betFields(),
|
|
110
20
|
selections: nullableList(
|
|
111
21
|
wire({
|
|
112
|
-
event_name:
|
|
113
|
-
market_name:
|
|
114
|
-
selection_name:
|
|
115
|
-
odds:
|
|
22
|
+
event_name: z2.string(),
|
|
23
|
+
market_name: z2.string(),
|
|
24
|
+
selection_name: z2.string(),
|
|
25
|
+
odds: z2.number(),
|
|
116
26
|
result: protoEnum("SELECTION_RESULT_")
|
|
117
27
|
})
|
|
118
28
|
)
|
|
@@ -120,14 +30,14 @@ var betDetailsSchema = /* @__PURE__ */ lazy(
|
|
|
120
30
|
);
|
|
121
31
|
var offerSchema = /* @__PURE__ */ lazy(
|
|
122
32
|
() => wire({
|
|
123
|
-
bet_id:
|
|
124
|
-
available:
|
|
33
|
+
bet_id: z2.string(),
|
|
34
|
+
available: z2.boolean(),
|
|
125
35
|
cashout_amount: nonNegativeMinorUnits(),
|
|
126
36
|
expires_at: optionalTimestamp()
|
|
127
37
|
})
|
|
128
38
|
);
|
|
129
39
|
var cashoutSchema = /* @__PURE__ */ lazy(
|
|
130
|
-
() => wire({ bet_id:
|
|
40
|
+
() => wire({ bet_id: z2.string(), cashout_amount: nonNegativeMinorUnits(), status: z2.string() })
|
|
131
41
|
);
|
|
132
42
|
var LIST_ROUTE = { method: "GET", path: "/bets" };
|
|
133
43
|
var GET_ROUTE = { method: "GET", path: "/bets/{betId}" };
|
|
@@ -199,148 +109,148 @@ function createBetsApi(transport) {
|
|
|
199
109
|
}
|
|
200
110
|
};
|
|
201
111
|
}
|
|
202
|
-
var campaignCurrency = () =>
|
|
203
|
-
var money = () => wire({ amount:
|
|
204
|
-
var timeWindow = () => wire({ starts_at:
|
|
205
|
-
var ratio = () => wire({ decimal:
|
|
112
|
+
var campaignCurrency = () => z2._default(currencyOrEmpty(), "");
|
|
113
|
+
var money = () => wire({ amount: z2._default(minorUnits(), 0), currency: campaignCurrency() });
|
|
114
|
+
var timeWindow = () => wire({ starts_at: z2.optional(z2.string()), ends_at: z2.optional(z2.string()) });
|
|
115
|
+
var ratio = () => wire({ decimal: z2.optional(z2.string()), basis_points: z2.optional(z2.number()), maximum_scale: count() });
|
|
206
116
|
var empty = () => wire({});
|
|
207
117
|
var policy = (prefix) => wire({ code: protoEnum(prefix), version: count() });
|
|
208
118
|
var casinoSelector = () => wire({
|
|
209
119
|
provider_instance_id: text(),
|
|
210
|
-
software_ids: list(
|
|
211
|
-
game_ids: list(
|
|
212
|
-
category_codes: list(
|
|
120
|
+
software_ids: list(z2.string()),
|
|
121
|
+
game_ids: list(z2.string()),
|
|
122
|
+
category_codes: list(z2.string())
|
|
213
123
|
});
|
|
214
124
|
var sportsSelector = () => wire({
|
|
215
|
-
sport_codes: list(
|
|
216
|
-
competition_ids: list(
|
|
217
|
-
event_ids: list(
|
|
218
|
-
market_codes: list(
|
|
219
|
-
live:
|
|
125
|
+
sport_codes: list(z2.string()),
|
|
126
|
+
competition_ids: list(z2.string()),
|
|
127
|
+
event_ids: list(z2.string()),
|
|
128
|
+
market_codes: list(z2.string()),
|
|
129
|
+
live: z2.optional(z2.boolean()),
|
|
220
130
|
bet_types: list(protoEnum("SPORTS_BET_TYPE_"))
|
|
221
131
|
});
|
|
222
132
|
var qualification = () => wire({
|
|
223
133
|
version: count(),
|
|
224
|
-
immediate:
|
|
225
|
-
user_event:
|
|
134
|
+
immediate: z2.optional(empty()),
|
|
135
|
+
user_event: z2.optional(
|
|
226
136
|
wire({
|
|
227
137
|
event_code: text(),
|
|
228
138
|
event_version: count(),
|
|
229
139
|
source_authority: text(),
|
|
230
|
-
identity_fields: list(
|
|
140
|
+
identity_fields: list(z2.string())
|
|
231
141
|
})
|
|
232
142
|
),
|
|
233
|
-
deposit_settled:
|
|
143
|
+
deposit_settled: z2.optional(
|
|
234
144
|
wire({
|
|
235
145
|
currency: campaignCurrency(),
|
|
236
|
-
eligible_method_codes: list(
|
|
146
|
+
eligible_method_codes: list(z2.string()),
|
|
237
147
|
first_deposit_policy: protoEnum("FIRST_DEPOSIT_POLICY_"),
|
|
238
|
-
minimum_settled_net_amount:
|
|
239
|
-
maximum_settled_net_amount:
|
|
148
|
+
minimum_settled_net_amount: z2.optional(money()),
|
|
149
|
+
maximum_settled_net_amount: z2.optional(money()),
|
|
240
150
|
amount_basis: protoEnum("DEPOSIT_AMOUNT_BASIS_")
|
|
241
151
|
})
|
|
242
152
|
),
|
|
243
|
-
activity_aggregate:
|
|
153
|
+
activity_aggregate: z2.optional(
|
|
244
154
|
wire({
|
|
245
155
|
basis: protoEnum("BASIS_"),
|
|
246
156
|
product_scope: protoEnum("PRODUCT_SCOPE_"),
|
|
247
157
|
currency: campaignCurrency(),
|
|
248
|
-
window:
|
|
158
|
+
window: z2.optional(durationSeconds()),
|
|
249
159
|
timezone: text(),
|
|
250
|
-
late_event_grace:
|
|
251
|
-
casino:
|
|
252
|
-
sportsbook:
|
|
160
|
+
late_event_grace: z2.optional(durationSeconds()),
|
|
161
|
+
casino: z2.optional(casinoSelector()),
|
|
162
|
+
sportsbook: z2.optional(sportsSelector())
|
|
253
163
|
})
|
|
254
164
|
)
|
|
255
165
|
});
|
|
256
166
|
var validity = () => wire({
|
|
257
|
-
no_expiry:
|
|
258
|
-
absolute_expiry:
|
|
259
|
-
duration_from_grant:
|
|
167
|
+
no_expiry: z2.optional(empty()),
|
|
168
|
+
absolute_expiry: z2.optional(wire({ expires_at: z2.optional(z2.string()) })),
|
|
169
|
+
duration_from_grant: z2.optional(wire({ duration: z2.optional(durationSeconds()) }))
|
|
260
170
|
});
|
|
261
171
|
var rounding = () => protoEnum("ROUNDING_MODE_");
|
|
262
172
|
var proceedsClass = () => protoEnum("PROCEEDS_CLASS_");
|
|
263
173
|
var percent = () => wire({
|
|
264
|
-
percentage:
|
|
174
|
+
percentage: z2.optional(ratio()),
|
|
265
175
|
rounding: rounding(),
|
|
266
|
-
minimum_reward:
|
|
267
|
-
maximum_reward:
|
|
176
|
+
minimum_reward: z2.optional(money()),
|
|
177
|
+
maximum_reward: z2.optional(money())
|
|
268
178
|
});
|
|
269
179
|
var balanceCredit = () => wire({
|
|
270
|
-
fixed_amount:
|
|
271
|
-
percent_of_source_amount:
|
|
272
|
-
aggregate_rebate:
|
|
180
|
+
fixed_amount: z2.optional(wire({ amount: z2.optional(money()) })),
|
|
181
|
+
percent_of_source_amount: z2.optional(percent()),
|
|
182
|
+
aggregate_rebate: z2.optional(
|
|
273
183
|
wire({
|
|
274
|
-
percentage:
|
|
184
|
+
percentage: z2.optional(ratio()),
|
|
275
185
|
rounding: rounding(),
|
|
276
|
-
minimum_basis:
|
|
277
|
-
maximum_reward:
|
|
186
|
+
minimum_basis: z2.optional(money()),
|
|
187
|
+
maximum_reward: z2.optional(money())
|
|
278
188
|
})
|
|
279
189
|
),
|
|
280
190
|
balance_class: protoEnum("BALANCE_CLASS_"),
|
|
281
191
|
proceeds_class: proceedsClass(),
|
|
282
|
-
validity:
|
|
192
|
+
validity: z2.optional(validity())
|
|
283
193
|
});
|
|
284
|
-
var maximumBet = () => wire({ mode: protoEnum("MAXIMUM_BET_MODE_"), campaign_maximum:
|
|
194
|
+
var maximumBet = () => wire({ mode: protoEnum("MAXIMUM_BET_MODE_"), campaign_maximum: z2.optional(money()) });
|
|
285
195
|
var oddsPolicy = () => wire({
|
|
286
196
|
mode: protoEnum("MODE_"),
|
|
287
|
-
minimum_total_odds_decimal:
|
|
288
|
-
minimum_odds_per_leg_decimal:
|
|
289
|
-
minimum_legs:
|
|
290
|
-
maximum_legs:
|
|
197
|
+
minimum_total_odds_decimal: z2.optional(z2.string()),
|
|
198
|
+
minimum_odds_per_leg_decimal: z2.optional(z2.string()),
|
|
199
|
+
minimum_legs: z2.optional(z2.number()),
|
|
200
|
+
maximum_legs: z2.optional(z2.number())
|
|
291
201
|
});
|
|
292
202
|
var cashoutMode = () => protoEnum("RESTRICTED_CASHOUT_MODE_");
|
|
293
203
|
var usePolicy = () => wire({
|
|
294
204
|
version: count(),
|
|
295
|
-
funds_consumption:
|
|
296
|
-
casino:
|
|
297
|
-
sportsbook:
|
|
205
|
+
funds_consumption: z2.optional(policy("FUNDS_CONSUMPTION_POLICY_CODE_")),
|
|
206
|
+
casino: z2.optional(wire({ allowed_scopes: list(casinoSelector()), maximum_bet: z2.optional(maximumBet()) })),
|
|
207
|
+
sportsbook: z2.optional(
|
|
298
208
|
wire({
|
|
299
209
|
allowed_scopes: list(sportsSelector()),
|
|
300
210
|
excluded_scopes: list(sportsSelector()),
|
|
301
|
-
maximum_bet:
|
|
302
|
-
funding_odds:
|
|
211
|
+
maximum_bet: z2.optional(maximumBet()),
|
|
212
|
+
funding_odds: z2.optional(oddsPolicy()),
|
|
303
213
|
cashout_mode: cashoutMode()
|
|
304
214
|
})
|
|
305
215
|
),
|
|
306
|
-
casino_and_sportsbook:
|
|
216
|
+
casino_and_sportsbook: z2.optional(
|
|
307
217
|
wire({
|
|
308
218
|
allowed_casino_scopes: list(casinoSelector()),
|
|
309
219
|
allowed_sportsbook_scopes: list(sportsSelector()),
|
|
310
220
|
excluded_sportsbook_scopes: list(sportsSelector()),
|
|
311
|
-
maximum_casino_bet:
|
|
312
|
-
maximum_sportsbook_bet:
|
|
313
|
-
sportsbook_funding_odds:
|
|
221
|
+
maximum_casino_bet: z2.optional(maximumBet()),
|
|
222
|
+
maximum_sportsbook_bet: z2.optional(maximumBet()),
|
|
223
|
+
sportsbook_funding_odds: z2.optional(oddsPolicy()),
|
|
314
224
|
sportsbook_cashout_mode: cashoutMode()
|
|
315
225
|
})
|
|
316
226
|
),
|
|
317
|
-
payout_allocation:
|
|
227
|
+
payout_allocation: z2.optional(policy("PAYOUT_ALLOCATION_POLICY_CODE_"))
|
|
318
228
|
});
|
|
319
229
|
var wageringPolicy = () => wire({
|
|
320
230
|
version: count(),
|
|
321
|
-
none:
|
|
322
|
-
multiplier:
|
|
231
|
+
none: z2.optional(empty()),
|
|
232
|
+
multiplier: z2.optional(
|
|
323
233
|
wire({
|
|
324
234
|
requirement_basis: protoEnum("REQUIREMENT_BASIS_"),
|
|
325
|
-
multiplier:
|
|
235
|
+
multiplier: z2.optional(ratio()),
|
|
326
236
|
contribution_rates: list(
|
|
327
237
|
wire({
|
|
328
|
-
casino:
|
|
329
|
-
sportsbook:
|
|
330
|
-
rate:
|
|
238
|
+
casino: z2.optional(casinoSelector()),
|
|
239
|
+
sportsbook: z2.optional(sportsSelector()),
|
|
240
|
+
rate: z2.optional(ratio())
|
|
331
241
|
})
|
|
332
242
|
),
|
|
333
|
-
deadline:
|
|
243
|
+
deadline: z2.optional(validity()),
|
|
334
244
|
rounding: rounding(),
|
|
335
|
-
sportsbook_contribution_odds:
|
|
336
|
-
maximum_conversion:
|
|
245
|
+
sportsbook_contribution_odds: z2.optional(oddsPolicy()),
|
|
246
|
+
maximum_conversion: z2.optional(money())
|
|
337
247
|
})
|
|
338
248
|
)
|
|
339
249
|
});
|
|
340
250
|
var stackingPolicy = () => wire({
|
|
341
251
|
version: count(),
|
|
342
|
-
exclusive_in_group:
|
|
343
|
-
multiple_in_group:
|
|
252
|
+
exclusive_in_group: z2.optional(wire({ stacking_group_key: text() })),
|
|
253
|
+
multiple_in_group: z2.optional(wire({ stacking_group_key: text(), maximum_active_per_player: count() }))
|
|
344
254
|
});
|
|
345
255
|
var reward = () => wire({
|
|
346
256
|
reward_key: text(),
|
|
@@ -348,49 +258,49 @@ var reward = () => wire({
|
|
|
348
258
|
reward_kind_version: count(),
|
|
349
259
|
execution_profile_code: protoEnum("EXECUTION_PROFILE_CODE_"),
|
|
350
260
|
execution_profile_version: count(),
|
|
351
|
-
balance_credit:
|
|
352
|
-
provider_managed_balance:
|
|
353
|
-
casino_free_spins:
|
|
261
|
+
balance_credit: z2.optional(balanceCredit()),
|
|
262
|
+
provider_managed_balance: z2.optional(wire({ provider_code: text() })),
|
|
263
|
+
casino_free_spins: z2.optional(
|
|
354
264
|
wire({
|
|
355
265
|
provider_code: text(),
|
|
356
|
-
casino_scope:
|
|
266
|
+
casino_scope: z2.optional(casinoSelector()),
|
|
357
267
|
quantity: count(),
|
|
358
|
-
denomination:
|
|
268
|
+
denomination: z2.optional(money()),
|
|
359
269
|
currency: campaignCurrency(),
|
|
360
|
-
grant_window:
|
|
270
|
+
grant_window: z2.optional(timeWindow()),
|
|
361
271
|
proceeds_class: proceedsClass(),
|
|
362
|
-
maximum_winnings:
|
|
272
|
+
maximum_winnings: z2.optional(money())
|
|
363
273
|
})
|
|
364
274
|
),
|
|
365
|
-
sports_bonus_bet:
|
|
275
|
+
sports_bonus_bet: z2.optional(
|
|
366
276
|
wire({
|
|
367
277
|
provider_code: text(),
|
|
368
|
-
sportsbook_scope:
|
|
369
|
-
amount:
|
|
278
|
+
sportsbook_scope: z2.optional(sportsSelector()),
|
|
279
|
+
amount: z2.optional(money()),
|
|
370
280
|
quantity: count(),
|
|
371
|
-
validity:
|
|
281
|
+
validity: z2.optional(validity())
|
|
372
282
|
})
|
|
373
283
|
),
|
|
374
|
-
sports_bet_coverage:
|
|
284
|
+
sports_bet_coverage: z2.optional(
|
|
375
285
|
wire({
|
|
376
286
|
provider_code: text(),
|
|
377
|
-
qualifying_bet_scope:
|
|
378
|
-
coverage_cap:
|
|
379
|
-
validity:
|
|
287
|
+
qualifying_bet_scope: z2.optional(sportsSelector()),
|
|
288
|
+
coverage_cap: z2.optional(money()),
|
|
289
|
+
validity: z2.optional(validity())
|
|
380
290
|
})
|
|
381
291
|
),
|
|
382
|
-
use_policy:
|
|
383
|
-
wagering_policy:
|
|
384
|
-
stacking_policy:
|
|
385
|
-
restricted_position_selection_policy:
|
|
292
|
+
use_policy: z2.optional(usePolicy()),
|
|
293
|
+
wagering_policy: z2.optional(wageringPolicy()),
|
|
294
|
+
stacking_policy: z2.optional(stackingPolicy()),
|
|
295
|
+
restricted_position_selection_policy: z2.optional(
|
|
386
296
|
wire({
|
|
387
297
|
version: count(),
|
|
388
|
-
priority_then_earliest_expiry:
|
|
298
|
+
priority_then_earliest_expiry: z2.optional(wire({ selection_priority: z2.optional(z2.number()) }))
|
|
389
299
|
})
|
|
390
300
|
)
|
|
391
301
|
});
|
|
392
302
|
var localizedContent = () => wire({ locale: text(), display_name: text(), description: text(), terms: text(), terms_revision: text() });
|
|
393
|
-
var content = () => wire({ default_locale: text(), supported_locales: list(
|
|
303
|
+
var content = () => wire({ default_locale: text(), supported_locales: list(z2.string()), localized_content: list(localizedContent()) });
|
|
394
304
|
var offerSchema2 = /* @__PURE__ */ lazy(
|
|
395
305
|
() => wire({
|
|
396
306
|
campaign_id: text(),
|
|
@@ -398,33 +308,33 @@ var offerSchema2 = /* @__PURE__ */ lazy(
|
|
|
398
308
|
publication_id: text(),
|
|
399
309
|
product_scope: protoEnum("PRODUCT_SCOPE_"),
|
|
400
310
|
timezone: text(),
|
|
401
|
-
enrollment_window:
|
|
402
|
-
qualification_window:
|
|
403
|
-
claim_window:
|
|
404
|
-
entry_policy:
|
|
405
|
-
reward_claim_policy:
|
|
406
|
-
qualification:
|
|
407
|
-
reward:
|
|
408
|
-
publication_starts_at:
|
|
409
|
-
publication_ends_at:
|
|
410
|
-
content:
|
|
311
|
+
enrollment_window: z2.optional(timeWindow()),
|
|
312
|
+
qualification_window: z2.optional(timeWindow()),
|
|
313
|
+
claim_window: z2.optional(timeWindow()),
|
|
314
|
+
entry_policy: z2.optional(policy("ENTRY_POLICY_CODE_")),
|
|
315
|
+
reward_claim_policy: z2.optional(policy("REWARD_CLAIM_POLICY_CODE_")),
|
|
316
|
+
qualification: z2.optional(qualification()),
|
|
317
|
+
reward: z2.optional(reward()),
|
|
318
|
+
publication_starts_at: z2.optional(z2.string()),
|
|
319
|
+
publication_ends_at: z2.optional(z2.string()),
|
|
320
|
+
content: z2.optional(content())
|
|
411
321
|
})
|
|
412
322
|
);
|
|
413
323
|
function grantMoney(value, currency) {
|
|
414
324
|
return { amount: value?.amount ?? 0, currency: value?.currency || currency };
|
|
415
325
|
}
|
|
416
|
-
var rewardGrant = () =>
|
|
326
|
+
var rewardGrant = () => z2.pipe(
|
|
417
327
|
wire({
|
|
418
328
|
state: protoEnum("CAMPAIGN_PLAYER_REWARD_GRANT_STATE_"),
|
|
419
|
-
granted:
|
|
420
|
-
balance:
|
|
421
|
-
converted:
|
|
422
|
-
expires_at:
|
|
423
|
-
wagering:
|
|
424
|
-
wire({ required:
|
|
329
|
+
granted: z2.optional(money()),
|
|
330
|
+
balance: z2.optional(money()),
|
|
331
|
+
converted: z2.optional(money()),
|
|
332
|
+
expires_at: z2.optional(z2.string()),
|
|
333
|
+
wagering: z2.optional(
|
|
334
|
+
wire({ required: z2.optional(money()), accumulated: z2.optional(money()), completed_at: z2.optional(z2.string()) })
|
|
425
335
|
)
|
|
426
336
|
}),
|
|
427
|
-
|
|
337
|
+
z2.transform(({ state, granted, balance, converted, expiresAt, wagering }) => {
|
|
428
338
|
const currency = [granted, balance, converted, wagering?.required, wagering?.accumulated].find((m) => m?.currency)?.currency ?? "";
|
|
429
339
|
const out = {
|
|
430
340
|
state,
|
|
@@ -444,40 +354,40 @@ var rewardGrant = () => z4.pipe(
|
|
|
444
354
|
})
|
|
445
355
|
);
|
|
446
356
|
var participationSchema = /* @__PURE__ */ lazy(
|
|
447
|
-
() =>
|
|
357
|
+
() => z2.pipe(
|
|
448
358
|
wire({
|
|
449
359
|
id: text(),
|
|
450
360
|
campaign_id: text(),
|
|
451
361
|
campaign_version_id: text(),
|
|
452
362
|
reward_key: text(),
|
|
453
|
-
qualification_snapshot:
|
|
363
|
+
qualification_snapshot: z2.optional(qualification()),
|
|
454
364
|
// oneof `state`: only one of the cases is filled in.
|
|
455
|
-
enrolled:
|
|
456
|
-
qualifying:
|
|
457
|
-
qualified:
|
|
458
|
-
reward_pending:
|
|
459
|
-
completed:
|
|
460
|
-
reward_failed:
|
|
461
|
-
expired:
|
|
462
|
-
cancelled:
|
|
463
|
-
reward_grant:
|
|
464
|
-
snapshot:
|
|
365
|
+
enrolled: z2.optional(empty()),
|
|
366
|
+
qualifying: z2.optional(empty()),
|
|
367
|
+
qualified: z2.optional(wire({ qualified_at: z2.optional(z2.string()) })),
|
|
368
|
+
reward_pending: z2.optional(empty()),
|
|
369
|
+
completed: z2.optional(wire({ completed_at: z2.optional(z2.string()) })),
|
|
370
|
+
reward_failed: z2.optional(empty()),
|
|
371
|
+
expired: z2.optional(wire({ expired_at: z2.optional(z2.string()) })),
|
|
372
|
+
cancelled: z2.optional(empty()),
|
|
373
|
+
reward_grant: z2.optional(rewardGrant()),
|
|
374
|
+
snapshot: z2.optional(
|
|
465
375
|
wire({
|
|
466
|
-
reward:
|
|
467
|
-
content:
|
|
468
|
-
terms_acceptance:
|
|
376
|
+
reward: z2.optional(reward()),
|
|
377
|
+
content: z2.optional(content()),
|
|
378
|
+
terms_acceptance: z2.optional(
|
|
469
379
|
wire({
|
|
470
380
|
locale: text(),
|
|
471
381
|
terms_revision: text(),
|
|
472
382
|
terms_digest_sha256_hex: text(),
|
|
473
|
-
accepted_at:
|
|
383
|
+
accepted_at: z2.optional(z2.string())
|
|
474
384
|
})
|
|
475
385
|
)
|
|
476
386
|
})
|
|
477
387
|
)
|
|
478
388
|
}),
|
|
479
389
|
// The oneof becomes `status` (+ the timestamp of the case); the oneof's keys are not passed on.
|
|
480
|
-
|
|
390
|
+
z2.transform(
|
|
481
391
|
({ enrolled, qualifying, qualified, rewardPending, completed, rewardFailed, expired, cancelled, ...rest }) => {
|
|
482
392
|
const out = { ...rest, status: "unspecified" };
|
|
483
393
|
if (enrolled) out.status = "enrolled";
|
|
@@ -499,7 +409,7 @@ var participationSchema = /* @__PURE__ */ lazy(
|
|
|
499
409
|
)
|
|
500
410
|
)
|
|
501
411
|
);
|
|
502
|
-
var cursorPageSchema = (key, item) => wire({ [key]: list(item), next_cursor:
|
|
412
|
+
var cursorPageSchema = (key, item) => wire({ [key]: list(item), next_cursor: z2.optional(z2.string()) });
|
|
503
413
|
var offersPage = /* @__PURE__ */ lazy(() => cursorPageSchema("offers", offerSchema2()));
|
|
504
414
|
var participationsPage = /* @__PURE__ */ lazy(() => cursorPageSchema("participations", participationSchema()));
|
|
505
415
|
var offerEnvelope = /* @__PURE__ */ lazy(() => wire({ offer: offerSchema2() }));
|
|
@@ -513,64 +423,64 @@ function toCursorPage(key, data) {
|
|
|
513
423
|
if (data.nextCursor) page.nextCursor = data.nextCursor;
|
|
514
424
|
return page;
|
|
515
425
|
}
|
|
516
|
-
var nullableDate = () =>
|
|
517
|
-
|
|
518
|
-
|
|
426
|
+
var nullableDate = () => z2.pipe(
|
|
427
|
+
z2.nullish(z2.string()),
|
|
428
|
+
z2.transform((value) => value ?? void 0)
|
|
519
429
|
);
|
|
520
430
|
function compact(value) {
|
|
521
431
|
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0));
|
|
522
432
|
}
|
|
523
433
|
var overviewSchema = /* @__PURE__ */ lazy(
|
|
524
|
-
() =>
|
|
434
|
+
() => z2.pipe(
|
|
525
435
|
wire({
|
|
526
436
|
currencies: list(
|
|
527
|
-
|
|
437
|
+
z2.pipe(
|
|
528
438
|
wire({
|
|
529
439
|
currency: currencyOrEmpty(),
|
|
530
|
-
decimal_places:
|
|
440
|
+
decimal_places: z2.number(),
|
|
531
441
|
restricted_total: minorUnits(),
|
|
532
442
|
expiring_7d: minorUnits(),
|
|
533
|
-
open_positions:
|
|
443
|
+
open_positions: z2.number(),
|
|
534
444
|
next_expires_at: nullableDate(),
|
|
535
445
|
converted: minorUnits(),
|
|
536
|
-
converted_campaigns:
|
|
446
|
+
converted_campaigns: z2.number()
|
|
537
447
|
}),
|
|
538
|
-
|
|
448
|
+
z2.transform(compact)
|
|
539
449
|
)
|
|
540
450
|
),
|
|
541
451
|
as_of: nullableDate()
|
|
542
452
|
}),
|
|
543
|
-
|
|
453
|
+
z2.transform(compact)
|
|
544
454
|
)
|
|
545
455
|
);
|
|
546
456
|
var positionsPage = /* @__PURE__ */ lazy(
|
|
547
457
|
() => wire({
|
|
548
458
|
rows: list(
|
|
549
|
-
|
|
459
|
+
z2.pipe(
|
|
550
460
|
wire({
|
|
551
|
-
position_id:
|
|
552
|
-
campaign_id:
|
|
461
|
+
position_id: z2.string(),
|
|
462
|
+
campaign_id: z2.string(),
|
|
553
463
|
currency: currencyOrEmpty(),
|
|
554
|
-
decimal_places:
|
|
464
|
+
decimal_places: z2.number(),
|
|
555
465
|
granted: minorUnits(),
|
|
556
466
|
restricted: minorUnits(),
|
|
557
467
|
converted: minorUnits(),
|
|
558
468
|
required: minorUnits(),
|
|
559
469
|
wagered: minorUnits(),
|
|
560
470
|
remaining: minorUnits(),
|
|
561
|
-
state:
|
|
471
|
+
state: z2.string(),
|
|
562
472
|
// The gateway answers `null` for an action it does not know; known ones are uppercase (`CONVERT`).
|
|
563
|
-
terminal_action:
|
|
564
|
-
|
|
565
|
-
|
|
473
|
+
terminal_action: z2.pipe(
|
|
474
|
+
z2.nullish(z2.string()),
|
|
475
|
+
z2.transform((value) => value ? value.toLowerCase() : void 0)
|
|
566
476
|
),
|
|
567
477
|
expires_at: nullableDate(),
|
|
568
478
|
created_at: nullableDate()
|
|
569
479
|
}),
|
|
570
|
-
|
|
480
|
+
z2.transform((row) => compact(row))
|
|
571
481
|
)
|
|
572
482
|
),
|
|
573
|
-
next_cursor:
|
|
483
|
+
next_cursor: z2.optional(z2.string())
|
|
574
484
|
})
|
|
575
485
|
);
|
|
576
486
|
var terms = (acceptance) => acceptance && { locale: acceptance.locale, terms_revision: acceptance.termsRevision };
|
|
@@ -664,51 +574,51 @@ function createBonusApi(transport) {
|
|
|
664
574
|
}
|
|
665
575
|
var gameSchema = /* @__PURE__ */ lazy(
|
|
666
576
|
() => wire({
|
|
667
|
-
id:
|
|
668
|
-
name:
|
|
669
|
-
provider:
|
|
670
|
-
category:
|
|
671
|
-
type:
|
|
672
|
-
thumbnail:
|
|
673
|
-
is_new:
|
|
674
|
-
is_popular:
|
|
675
|
-
is_live:
|
|
676
|
-
demo_available:
|
|
677
|
-
rtp:
|
|
678
|
-
volatility:
|
|
679
|
-
priority:
|
|
577
|
+
id: z2.string(),
|
|
578
|
+
name: z2.string(),
|
|
579
|
+
provider: z2.string(),
|
|
580
|
+
category: z2.string(),
|
|
581
|
+
type: z2.string(),
|
|
582
|
+
thumbnail: z2.string(),
|
|
583
|
+
is_new: z2.boolean(),
|
|
584
|
+
is_popular: z2.boolean(),
|
|
585
|
+
is_live: z2.boolean(),
|
|
586
|
+
demo_available: z2.boolean(),
|
|
587
|
+
rtp: z2.number(),
|
|
588
|
+
volatility: z2.string(),
|
|
589
|
+
priority: z2.number()
|
|
680
590
|
})
|
|
681
591
|
);
|
|
682
592
|
var categoriesSchema = /* @__PURE__ */ lazy(
|
|
683
593
|
() => nullableList(
|
|
684
|
-
wire({ slug:
|
|
594
|
+
wire({ slug: z2.string(), name: z2.string(), icon: z2.string(), game_count: z2.number(), priority: z2.number() })
|
|
685
595
|
)
|
|
686
596
|
);
|
|
687
597
|
var providersSchema = /* @__PURE__ */ lazy(
|
|
688
|
-
() => nullableList(wire({ id:
|
|
598
|
+
() => nullableList(wire({ id: z2.string(), name: z2.string(), game_count: z2.number() }))
|
|
689
599
|
);
|
|
690
600
|
var launchSchema = /* @__PURE__ */ lazy(
|
|
691
|
-
() =>
|
|
601
|
+
() => z2.pipe(
|
|
692
602
|
wire({
|
|
693
|
-
session_id:
|
|
694
|
-
game_url:
|
|
603
|
+
session_id: z2.string().check(z2.minLength(1)),
|
|
604
|
+
game_url: z2.string().check(z2.minLength(1)),
|
|
695
605
|
// Any text: a target the SDK does not know yet must not fail the (strict) launch.
|
|
696
|
-
launch_target:
|
|
697
|
-
provider_code:
|
|
698
|
-
expires_at:
|
|
606
|
+
launch_target: z2.optional(z2.string()),
|
|
607
|
+
provider_code: z2.optional(z2.string()),
|
|
608
|
+
expires_at: z2.optional(z2.string())
|
|
699
609
|
}),
|
|
700
610
|
// Without a target (an older gateway, or a custom mock), the launch keeps the behavior the SDK documented
|
|
701
611
|
// before the field existed: an iframe.
|
|
702
|
-
|
|
612
|
+
z2.transform(({ launchTarget, ...rest }) => ({ ...rest, launchTarget: launchTarget || "iframe" }))
|
|
703
613
|
)
|
|
704
614
|
);
|
|
705
615
|
var sessionSchema = /* @__PURE__ */ lazy(
|
|
706
616
|
() => wire({
|
|
707
|
-
id:
|
|
708
|
-
game_id:
|
|
709
|
-
game_name:
|
|
710
|
-
provider:
|
|
711
|
-
start_time:
|
|
617
|
+
id: z2.string(),
|
|
618
|
+
game_id: z2.string(),
|
|
619
|
+
game_name: z2.string(),
|
|
620
|
+
provider: z2.string(),
|
|
621
|
+
start_time: z2.string(),
|
|
712
622
|
total_bet: money$1(),
|
|
713
623
|
total_win: money$1(),
|
|
714
624
|
status: protoEnum("SESSION_STATUS_")
|
|
@@ -716,63 +626,63 @@ var sessionSchema = /* @__PURE__ */ lazy(
|
|
|
716
626
|
);
|
|
717
627
|
var transactionSchema = /* @__PURE__ */ lazy(
|
|
718
628
|
() => wire({
|
|
719
|
-
id:
|
|
720
|
-
game_id:
|
|
721
|
-
game_name:
|
|
722
|
-
round_id:
|
|
629
|
+
id: z2.string(),
|
|
630
|
+
game_id: z2.string(),
|
|
631
|
+
game_name: z2.string(),
|
|
632
|
+
round_id: z2.string(),
|
|
723
633
|
type: protoEnum("CASINO_TRANSACTION_TYPE_"),
|
|
724
634
|
amount: minorUnits(),
|
|
725
635
|
currency: currencyCode(),
|
|
726
636
|
currency_decimal_places: decimalPlaces(),
|
|
727
|
-
created_at:
|
|
637
|
+
created_at: z2.string()
|
|
728
638
|
})
|
|
729
639
|
);
|
|
730
640
|
var winnersSchema = /* @__PURE__ */ lazy(
|
|
731
641
|
() => nullableList(
|
|
732
642
|
wire({
|
|
733
|
-
player:
|
|
643
|
+
player: z2.string(),
|
|
734
644
|
amount: minorUnits(),
|
|
735
645
|
currency: currencyCode(),
|
|
736
646
|
currency_decimal_places: decimalPlaces(),
|
|
737
|
-
game_id:
|
|
738
|
-
game_name:
|
|
739
|
-
won_at:
|
|
647
|
+
game_id: z2.string(),
|
|
648
|
+
game_name: z2.string(),
|
|
649
|
+
won_at: z2.string()
|
|
740
650
|
})
|
|
741
651
|
)
|
|
742
652
|
);
|
|
743
653
|
var gamesEnvelopeSchema = /* @__PURE__ */ lazy(
|
|
744
654
|
() => wire({
|
|
745
|
-
availability:
|
|
746
|
-
|
|
655
|
+
availability: z2.pipe(
|
|
656
|
+
z2.nullish(
|
|
747
657
|
wire({
|
|
748
658
|
// The gateway reports an unset status as `available`; the SDK does the same for an absent/empty one.
|
|
749
|
-
status:
|
|
750
|
-
|
|
751
|
-
|
|
659
|
+
status: z2.pipe(
|
|
660
|
+
z2.nullish(z2.string()),
|
|
661
|
+
z2.transform((value) => value ? value.toLowerCase() : "available")
|
|
752
662
|
),
|
|
753
663
|
primary_provider_code: optionalText(),
|
|
754
|
-
missing: nullableList(
|
|
664
|
+
missing: nullableList(z2.string())
|
|
755
665
|
})
|
|
756
666
|
),
|
|
757
|
-
|
|
667
|
+
z2.transform((value) => value ?? null)
|
|
758
668
|
)
|
|
759
669
|
})
|
|
760
670
|
);
|
|
761
671
|
var CURRENCY = /^[A-Z]{3}$/;
|
|
762
672
|
var DECIMAL_PLACES_MAX = 20;
|
|
763
673
|
var jackpotSchema = /* @__PURE__ */ lazy(
|
|
764
|
-
() =>
|
|
765
|
-
|
|
766
|
-
id:
|
|
767
|
-
name:
|
|
768
|
-
currency:
|
|
769
|
-
amount_minor:
|
|
770
|
-
|
|
771
|
-
|
|
674
|
+
() => z2.pipe(
|
|
675
|
+
z2.object({
|
|
676
|
+
id: z2.string().check(z2.refine((value) => value.trim() !== "")),
|
|
677
|
+
name: z2.string().check(z2.refine((value) => value.trim() !== "")),
|
|
678
|
+
currency: z2.string().check(z2.regex(CURRENCY)),
|
|
679
|
+
amount_minor: z2.union([
|
|
680
|
+
z2.string().check(z2.refine((value) => /^(0|[1-9]\d*)$/.test(value) && Number.isSafeInteger(Number(value)))),
|
|
681
|
+
z2.number().check(z2.refine((value) => Number.isSafeInteger(value) && value >= 0))
|
|
772
682
|
]),
|
|
773
|
-
decimal_places:
|
|
683
|
+
decimal_places: z2.number().check(z2.refine((value) => Number.isInteger(value) && value >= 0 && value <= DECIMAL_PLACES_MAX))
|
|
774
684
|
}),
|
|
775
|
-
|
|
685
|
+
z2.transform((raw) => ({
|
|
776
686
|
id: raw.id,
|
|
777
687
|
name: raw.name,
|
|
778
688
|
currency: raw.currency,
|
|
@@ -782,24 +692,24 @@ var jackpotSchema = /* @__PURE__ */ lazy(
|
|
|
782
692
|
)
|
|
783
693
|
);
|
|
784
694
|
var jackpotsSchema = /* @__PURE__ */ lazy(
|
|
785
|
-
() => wire({ items: nullableList(
|
|
695
|
+
() => wire({ items: nullableList(z2.unknown()), featured_id: optionalText() })
|
|
786
696
|
);
|
|
787
697
|
var jackpotGamesSchema = /* @__PURE__ */ lazy(
|
|
788
|
-
() =>
|
|
698
|
+
() => z2.pipe(
|
|
789
699
|
wire({
|
|
790
700
|
games: nullableList(gameSchema()),
|
|
791
|
-
mode:
|
|
792
|
-
|
|
793
|
-
|
|
701
|
+
mode: z2.pipe(
|
|
702
|
+
z2.string(),
|
|
703
|
+
z2.transform((value) => value.toLowerCase())
|
|
794
704
|
),
|
|
795
705
|
pagination: wire({
|
|
796
|
-
page:
|
|
797
|
-
per_page:
|
|
798
|
-
has_next:
|
|
706
|
+
page: z2.number(),
|
|
707
|
+
per_page: z2.number(),
|
|
708
|
+
has_next: z2.boolean(),
|
|
799
709
|
next_cursor: optionalText()
|
|
800
710
|
})
|
|
801
711
|
}),
|
|
802
|
-
|
|
712
|
+
z2.transform(({ games, mode, pagination }) => ({
|
|
803
713
|
items: games,
|
|
804
714
|
mode,
|
|
805
715
|
page: pagination.page,
|
|
@@ -931,7 +841,7 @@ function createCasinoApi(transport) {
|
|
|
931
841
|
});
|
|
932
842
|
const items = [];
|
|
933
843
|
for (const entry of Array.isArray(raw.items) ? raw.items : []) {
|
|
934
|
-
const parsed =
|
|
844
|
+
const parsed = z2.safeParse(jackpotSchema(), entry);
|
|
935
845
|
if (!parsed.success || parsed.data.currency !== currency) continue;
|
|
936
846
|
if (items.some((item) => item.id === parsed.data.id)) continue;
|
|
937
847
|
items.push(parsed.data);
|
|
@@ -965,9 +875,9 @@ var ParsedBenefits = class {
|
|
|
965
875
|
}
|
|
966
876
|
value;
|
|
967
877
|
};
|
|
968
|
-
var tierBenefits = () =>
|
|
969
|
-
|
|
970
|
-
|
|
878
|
+
var tierBenefits = () => z2.pipe(
|
|
879
|
+
z2.nullish(z2.string()),
|
|
880
|
+
z2.transform((text2, ctx) => {
|
|
971
881
|
if (text2 == null || text2.trim() === "") return null;
|
|
972
882
|
let parsed;
|
|
973
883
|
try {
|
|
@@ -981,43 +891,43 @@ var tierBenefits = () => z4.pipe(
|
|
|
981
891
|
message: "tier_benefits_json is not a JSON object or array",
|
|
982
892
|
input: void 0
|
|
983
893
|
});
|
|
984
|
-
return
|
|
894
|
+
return z2.NEVER;
|
|
985
895
|
})
|
|
986
896
|
);
|
|
987
897
|
var loyaltySchema = /* @__PURE__ */ lazy(
|
|
988
|
-
() =>
|
|
898
|
+
() => z2.pipe(
|
|
989
899
|
wire({
|
|
990
900
|
total_points_earned: integerText(),
|
|
991
901
|
current_points: integerText(),
|
|
992
902
|
points_redeemed: integerText(),
|
|
993
903
|
current_tier: optionalText(),
|
|
994
904
|
tier_points: integerText(),
|
|
995
|
-
lifetime_wagered:
|
|
996
|
-
lifetime_deposited:
|
|
905
|
+
lifetime_wagered: z2._default(minorUnits(), 0),
|
|
906
|
+
lifetime_deposited: z2._default(minorUnits(), 0),
|
|
997
907
|
tier_benefits_json: tierBenefits(),
|
|
998
908
|
tier_expires_at: optionalTimestamp()
|
|
999
909
|
}),
|
|
1000
|
-
|
|
910
|
+
z2.transform(({ tierBenefitsJson, ...rest }) => {
|
|
1001
911
|
const benefits = tierBenefitsJson instanceof ParsedBenefits ? tierBenefitsJson.value : null;
|
|
1002
912
|
return { ...rest, tierBenefits: benefits };
|
|
1003
913
|
})
|
|
1004
914
|
)
|
|
1005
915
|
);
|
|
1006
916
|
var redeemSchema = /* @__PURE__ */ lazy(
|
|
1007
|
-
() =>
|
|
917
|
+
() => z2.pipe(
|
|
1008
918
|
wire({
|
|
1009
|
-
success:
|
|
1010
|
-
message:
|
|
919
|
+
success: z2.optional(z2.boolean()),
|
|
920
|
+
message: z2.optional(z2.string()),
|
|
1011
921
|
redeemed_points: integerText(),
|
|
1012
|
-
value:
|
|
922
|
+
value: z2.nullish(minorUnits()),
|
|
1013
923
|
// Currency strict even in `'warn'`; absent, `null` and `''` still become `null`.
|
|
1014
|
-
currency:
|
|
1015
|
-
|
|
1016
|
-
|
|
924
|
+
currency: z2.pipe(
|
|
925
|
+
z2.nullish(currencyOrEmpty()),
|
|
926
|
+
z2.transform((value) => value == null || value === "" ? null : value)
|
|
1017
927
|
),
|
|
1018
928
|
bonus_id: optionalText()
|
|
1019
929
|
}),
|
|
1020
|
-
|
|
930
|
+
z2.transform((data) => ({
|
|
1021
931
|
success: data.success,
|
|
1022
932
|
message: data.message,
|
|
1023
933
|
redeemedPoints: data.redeemedPoints,
|
|
@@ -1061,12 +971,12 @@ function createLoyaltyApi(transport) {
|
|
|
1061
971
|
};
|
|
1062
972
|
}
|
|
1063
973
|
function openUnion(values) {
|
|
1064
|
-
return
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
974
|
+
return z2.pipe(
|
|
975
|
+
z2.pipe(
|
|
976
|
+
z2.string(),
|
|
977
|
+
z2.transform((value) => value.toLowerCase())
|
|
1068
978
|
),
|
|
1069
|
-
|
|
979
|
+
z2.enum(values)
|
|
1070
980
|
);
|
|
1071
981
|
}
|
|
1072
982
|
|
|
@@ -1077,14 +987,14 @@ var REWARD_TYPES = ["bonus", "free_spins", "points", "free_bet"];
|
|
|
1077
987
|
var USER_MISSION_STATUSES = ["in_progress", "completed", "expired", "claimed"];
|
|
1078
988
|
var missionSchema = /* @__PURE__ */ lazy(
|
|
1079
989
|
() => wire({
|
|
1080
|
-
id:
|
|
1081
|
-
name:
|
|
1082
|
-
description:
|
|
990
|
+
id: z2.string(),
|
|
991
|
+
name: z2.string(),
|
|
992
|
+
description: z2._default(z2.string(), ""),
|
|
1083
993
|
mission_type: openUnion(MISSION_TYPES),
|
|
1084
994
|
objective_type: openUnion(OBJECTIVE_TYPES),
|
|
1085
995
|
target_value: integerText(),
|
|
1086
996
|
target_game_category: optionalText(),
|
|
1087
|
-
target_games: nullableList(
|
|
997
|
+
target_games: nullableList(z2.string()),
|
|
1088
998
|
reward_type: openUnion(REWARD_TYPES),
|
|
1089
999
|
reward_value: minorUnits(),
|
|
1090
1000
|
valid_from: optionalTimestamp(),
|
|
@@ -1092,16 +1002,16 @@ var missionSchema = /* @__PURE__ */ lazy(
|
|
|
1092
1002
|
})
|
|
1093
1003
|
);
|
|
1094
1004
|
var userMissionsSchema = /* @__PURE__ */ lazy(
|
|
1095
|
-
() =>
|
|
1005
|
+
() => z2.pipe(
|
|
1096
1006
|
wire({
|
|
1097
1007
|
missions: nullableList(
|
|
1098
1008
|
wire({
|
|
1099
|
-
id:
|
|
1100
|
-
mission_id:
|
|
1101
|
-
mission_name:
|
|
1009
|
+
id: z2.string(),
|
|
1010
|
+
mission_id: z2.string(),
|
|
1011
|
+
mission_name: z2._default(z2.string(), ""),
|
|
1102
1012
|
current_progress: integerText(),
|
|
1103
1013
|
target_value: integerText(),
|
|
1104
|
-
progress_percentage:
|
|
1014
|
+
progress_percentage: z2.number(),
|
|
1105
1015
|
status: openUnion(USER_MISSION_STATUSES),
|
|
1106
1016
|
reward_type: openUnion(REWARD_TYPES),
|
|
1107
1017
|
reward_value: minorUnits(),
|
|
@@ -1110,7 +1020,7 @@ var userMissionsSchema = /* @__PURE__ */ lazy(
|
|
|
1110
1020
|
})
|
|
1111
1021
|
)
|
|
1112
1022
|
}),
|
|
1113
|
-
|
|
1023
|
+
z2.transform((data) => data.missions)
|
|
1114
1024
|
)
|
|
1115
1025
|
);
|
|
1116
1026
|
function createMissionsApi(transport) {
|
|
@@ -1140,25 +1050,25 @@ function createMissionsApi(transport) {
|
|
|
1140
1050
|
}
|
|
1141
1051
|
var DEFAULT_PER_PAGE = 20;
|
|
1142
1052
|
var HISTORY_PATH = "/referrals/history";
|
|
1143
|
-
var count2 = () =>
|
|
1144
|
-
var money3 = () =>
|
|
1145
|
-
|
|
1146
|
-
|
|
1053
|
+
var count2 = () => z2._default(z2.number().check(z2.refine((value) => Number.isSafeInteger(value) && value >= 0, "invalid counter")), 0);
|
|
1054
|
+
var money3 = () => z2.pipe(
|
|
1055
|
+
z2.nullish(wire({ minor_units: minorUnits(), currency: z2._default(currencyOrEmpty(), "") })),
|
|
1056
|
+
z2.transform(
|
|
1147
1057
|
(value) => value == null ? null : { amount: value.minorUnits, currency: value.currency }
|
|
1148
1058
|
)
|
|
1149
1059
|
);
|
|
1150
|
-
var rulesSchema = () =>
|
|
1151
|
-
|
|
1060
|
+
var rulesSchema = () => z2.pipe(
|
|
1061
|
+
z2.nullish(
|
|
1152
1062
|
wire({
|
|
1153
1063
|
reward: money3(),
|
|
1154
1064
|
minimum_real_net_loss: money3(),
|
|
1155
1065
|
referee_window_days: count2(),
|
|
1156
1066
|
hold_hours: count2(),
|
|
1157
|
-
wagering_multiplier:
|
|
1067
|
+
wagering_multiplier: z2._default(z2.string(), ""),
|
|
1158
1068
|
maximum_conversion: money3()
|
|
1159
1069
|
})
|
|
1160
1070
|
),
|
|
1161
|
-
|
|
1071
|
+
z2.transform((rules) => {
|
|
1162
1072
|
if (rules == null || rules.reward === null || rules.minimumRealNetLoss === null) return null;
|
|
1163
1073
|
return {
|
|
1164
1074
|
reward: rules.reward,
|
|
@@ -1171,12 +1081,12 @@ var rulesSchema = () => z4.pipe(
|
|
|
1171
1081
|
})
|
|
1172
1082
|
);
|
|
1173
1083
|
var infoSchema = /* @__PURE__ */ lazy(
|
|
1174
|
-
() =>
|
|
1084
|
+
() => z2.pipe(
|
|
1175
1085
|
wire({
|
|
1176
|
-
enabled:
|
|
1086
|
+
enabled: z2._default(z2.boolean(), false),
|
|
1177
1087
|
referral_code: optionalText(),
|
|
1178
1088
|
rules: rulesSchema(),
|
|
1179
|
-
totals:
|
|
1089
|
+
totals: z2._default(
|
|
1180
1090
|
wire({
|
|
1181
1091
|
registered: count2(),
|
|
1182
1092
|
deposited: count2(),
|
|
@@ -1189,7 +1099,7 @@ var infoSchema = /* @__PURE__ */ lazy(
|
|
|
1189
1099
|
{ registered: 0, deposited: 0, inHold: 0, paid: 0, notEligible: 0, expired: 0, cancelled: 0 }
|
|
1190
1100
|
)
|
|
1191
1101
|
}),
|
|
1192
|
-
|
|
1102
|
+
z2.transform(
|
|
1193
1103
|
({ enabled, referralCode, rules, totals }) => ({ enabled, code: referralCode, rules, totals })
|
|
1194
1104
|
)
|
|
1195
1105
|
)
|
|
@@ -1198,16 +1108,16 @@ function remainingOf(target, loss) {
|
|
|
1198
1108
|
const missing = BigInt(target.amount) - BigInt(loss.amount);
|
|
1199
1109
|
return { amount: missing > 0n ? Number(missing) : 0, currency: target.currency };
|
|
1200
1110
|
}
|
|
1201
|
-
var progressSchema = () =>
|
|
1202
|
-
|
|
1111
|
+
var progressSchema = () => z2.pipe(
|
|
1112
|
+
z2.nullish(
|
|
1203
1113
|
wire({
|
|
1204
|
-
deposit_done:
|
|
1114
|
+
deposit_done: z2._default(z2.boolean(), false),
|
|
1205
1115
|
real_net_loss: money3(),
|
|
1206
1116
|
target: money3(),
|
|
1207
1117
|
remaining: money3()
|
|
1208
1118
|
})
|
|
1209
1119
|
),
|
|
1210
|
-
|
|
1120
|
+
z2.transform((progress) => {
|
|
1211
1121
|
if (progress == null || progress.target === null) return null;
|
|
1212
1122
|
const { target } = progress;
|
|
1213
1123
|
const realNetLoss = progress.realNetLoss ?? { amount: 0, currency: target.currency };
|
|
@@ -1224,9 +1134,9 @@ function statusOf(playerStatus, legacy) {
|
|
|
1224
1134
|
if (playerStatus !== null) return playerStatus.replace(/^CAMPAIGN_REFERRAL_STATUS_/, "").toLowerCase();
|
|
1225
1135
|
return LEGACY_STATUS[(legacy ?? "").toUpperCase()] ?? "registered";
|
|
1226
1136
|
}
|
|
1227
|
-
var referralSchema = () =>
|
|
1137
|
+
var referralSchema = () => z2.pipe(
|
|
1228
1138
|
wire({
|
|
1229
|
-
id:
|
|
1139
|
+
id: z2.string(),
|
|
1230
1140
|
referee_name: optionalText(),
|
|
1231
1141
|
status: optionalText(),
|
|
1232
1142
|
player_status: optionalText(),
|
|
@@ -1234,7 +1144,7 @@ var referralSchema = () => z4.pipe(
|
|
|
1234
1144
|
deadline_at: optionalTimestamp(),
|
|
1235
1145
|
progress: progressSchema()
|
|
1236
1146
|
}),
|
|
1237
|
-
|
|
1147
|
+
z2.transform(
|
|
1238
1148
|
(r) => ({
|
|
1239
1149
|
id: r.id,
|
|
1240
1150
|
refereeName: r.refereeName,
|
|
@@ -1250,9 +1160,9 @@ var historySchema = /* @__PURE__ */ lazy(
|
|
|
1250
1160
|
referral_code: optionalText(),
|
|
1251
1161
|
referrals: nullableList(referralSchema()),
|
|
1252
1162
|
// A nil pointer (`null`) reads as absent, like an omitted pagination.
|
|
1253
|
-
pagination:
|
|
1254
|
-
|
|
1255
|
-
|
|
1163
|
+
pagination: z2.pipe(
|
|
1164
|
+
z2.nullish(wire({ page: count2(), limit: count2(), total_items: count2() })),
|
|
1165
|
+
z2.transform((value) => value ?? void 0)
|
|
1256
1166
|
)
|
|
1257
1167
|
})
|
|
1258
1168
|
);
|
|
@@ -1293,12 +1203,12 @@ function createReferralsApi(transport) {
|
|
|
1293
1203
|
}
|
|
1294
1204
|
var HTTP_URL = "Expected an absolute http(s) URL";
|
|
1295
1205
|
var sessionSchema2 = /* @__PURE__ */ lazy(
|
|
1296
|
-
() =>
|
|
1206
|
+
() => z2.pipe(
|
|
1297
1207
|
wire({
|
|
1298
1208
|
// The separate token only exists on the wire: the schema declares it (strict contract) and the output drops it.
|
|
1299
|
-
operator_token:
|
|
1300
|
-
launch_url:
|
|
1301
|
-
|
|
1209
|
+
operator_token: z2.string(),
|
|
1210
|
+
launch_url: z2.string().check(
|
|
1211
|
+
z2.refine(
|
|
1302
1212
|
(value) => {
|
|
1303
1213
|
try {
|
|
1304
1214
|
const { protocol } = new URL(value);
|
|
@@ -1310,10 +1220,10 @@ var sessionSchema2 = /* @__PURE__ */ lazy(
|
|
|
1310
1220
|
{ message: HTTP_URL }
|
|
1311
1221
|
)
|
|
1312
1222
|
),
|
|
1313
|
-
expires_in_seconds:
|
|
1223
|
+
expires_in_seconds: z2.number().check(z2.refine((n) => Number.isFinite(n) && n > 0, { message: "Esperava > 0" }))
|
|
1314
1224
|
}),
|
|
1315
1225
|
// The clock is read when the response is interpreted (= moment of the response).
|
|
1316
|
-
|
|
1226
|
+
z2.transform(({ launchUrl, expiresInSeconds }) => ({
|
|
1317
1227
|
launchUrl,
|
|
1318
1228
|
expiresInSeconds,
|
|
1319
1229
|
expiresAt: Date.now() + expiresInSeconds * 1e3
|
|
@@ -1340,6 +1250,7 @@ function createIgaming(client) {
|
|
|
1340
1250
|
const transport = extension.getExtensionTransport(client);
|
|
1341
1251
|
const igaming = {
|
|
1342
1252
|
casino: createCasinoApi(transport),
|
|
1253
|
+
club: createClubApi(transport),
|
|
1343
1254
|
bonus: createBonusApi(transport),
|
|
1344
1255
|
missions: createMissionsApi(transport),
|
|
1345
1256
|
loyalty: createLoyaltyApi(transport),
|
|
@@ -1355,6 +1266,9 @@ function createIgaming(client) {
|
|
|
1355
1266
|
});
|
|
1356
1267
|
}
|
|
1357
1268
|
extension.registerProductClient(igaming, client);
|
|
1269
|
+
Object.defineProperty(igaming, LOCALE, {
|
|
1270
|
+
value: () => typeof transport.getLocale === "function" ? transport.getLocale() : void 0
|
|
1271
|
+
});
|
|
1358
1272
|
return igaming;
|
|
1359
1273
|
}
|
|
1360
1274
|
|