@getenginex/sdk-igaming 0.10.1 → 0.12.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 +61 -0
- package/README.md +4 -3
- package/dist/chunk-5ERRD3OA.js +648 -0
- package/dist/chunk-5ERRD3OA.js.map +1 -0
- package/dist/index.cjs +725 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +895 -8
- package/dist/index.d.ts +895 -8
- package/dist/index.js +427 -397
- package/dist/index.js.map +1 -1
- package/dist/query/index.cjs +73 -7
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +24 -5
- package/dist/query/index.d.ts +24 -5
- package/dist/query/index.js +61 -8
- package/dist/query/index.js.map +1 -1
- package/dist/testing/index.cjs +499 -14
- 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 +499 -14
- 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, nonNegativeInteger, minorUnits, integerText, flagOrNull, list, currencyOrEmpty, minorUnitsText, text, count, durationSeconds } from './chunk-5ERRD3OA.js';
|
|
2
|
+
export { keepsClubIdempotencyKey } from './chunk-5ERRD3OA.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, strictValue
|
|
4
|
-
import * as
|
|
5
|
+
import { lazy, wire, decimalPlaces, currencyCode, money as money$1, strictValue } 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,48 +891,113 @@ 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
|
);
|
|
897
|
+
var optionalFlag = () => z2.nullish(z2.boolean());
|
|
898
|
+
var countOrNull = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : null;
|
|
899
|
+
var currencyOrNull = () => z2.pipe(
|
|
900
|
+
z2.nullish(currencyOrEmpty()),
|
|
901
|
+
z2.transform((value) => value == null || value === "" ? null : value)
|
|
902
|
+
);
|
|
903
|
+
var ISO_CURRENCY = /^[A-Z]{3}$/;
|
|
904
|
+
var pendingCurrency = () => z2.pipe(
|
|
905
|
+
z2.nullish(
|
|
906
|
+
z2.string().check(z2.refine((value) => value === "" || ISO_CURRENCY.test(value), "Expected a currency code"))
|
|
907
|
+
),
|
|
908
|
+
z2.transform((value) => value == null || value === "" ? null : value)
|
|
909
|
+
);
|
|
910
|
+
var pendingSchema = () => wire({
|
|
911
|
+
idempotency_key: optionalText(),
|
|
912
|
+
points: nonNegativeInteger(),
|
|
913
|
+
currency: pendingCurrency()
|
|
914
|
+
});
|
|
915
|
+
function pendingOrNull(value) {
|
|
916
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
|
|
917
|
+
const { idempotencyKey, points, currency } = value;
|
|
918
|
+
if (idempotencyKey !== null && typeof idempotencyKey !== "string") return null;
|
|
919
|
+
const count3 = countOrNull(points);
|
|
920
|
+
if (count3 === null) return null;
|
|
921
|
+
const code = typeof currency === "string" && ISO_CURRENCY.test(currency) ? currency : null;
|
|
922
|
+
return { idempotencyKey, points: count3, currency: code };
|
|
923
|
+
}
|
|
987
924
|
var loyaltySchema = /* @__PURE__ */ lazy(
|
|
988
|
-
() =>
|
|
925
|
+
() => z2.pipe(
|
|
989
926
|
wire({
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
927
|
+
// Counters: the gateway always writes them; absent (an answer with only `available: false`) is `0`, never
|
|
928
|
+
// `undefined`.
|
|
929
|
+
total_points_earned: z2._default(integerText(), 0),
|
|
930
|
+
current_points: z2._default(integerText(), 0),
|
|
931
|
+
points_redeemed: z2._default(integerText(), 0),
|
|
993
932
|
current_tier: optionalText(),
|
|
994
|
-
tier_points: integerText(),
|
|
995
|
-
lifetime_wagered:
|
|
996
|
-
lifetime_deposited:
|
|
933
|
+
tier_points: z2._default(integerText(), 0),
|
|
934
|
+
lifetime_wagered: z2._default(minorUnits(), 0),
|
|
935
|
+
lifetime_deposited: z2._default(minorUnits(), 0),
|
|
997
936
|
tier_benefits_json: tierBenefits(),
|
|
998
|
-
tier_expires_at: optionalTimestamp()
|
|
937
|
+
tier_expires_at: optionalTimestamp(),
|
|
938
|
+
available: optionalFlag(),
|
|
939
|
+
program_active: optionalFlag(),
|
|
940
|
+
history_available: optionalFlag(),
|
|
941
|
+
can_redeem: optionalFlag(),
|
|
942
|
+
min_redemption: z2.nullish(nonNegativeInteger()),
|
|
943
|
+
// A rate, not an amount to show: a malformed one (a negative, a fraction, ≥ 2^53) follows the normal rule
|
|
944
|
+
// and, in `'warn'`, becomes `null`, so the page still renders and only the redemption is unavailable.
|
|
945
|
+
point_value_cents: z2.nullish(nonNegativeInteger()),
|
|
946
|
+
redemption_currency: currencyOrNull(),
|
|
947
|
+
redemption_decimal_places: z2.nullish(decimalPlaces()),
|
|
948
|
+
pending_redemption: z2.nullish(pendingSchema())
|
|
999
949
|
}),
|
|
1000
|
-
|
|
1001
|
-
const benefits = tierBenefitsJson instanceof ParsedBenefits ? tierBenefitsJson.value : null;
|
|
1002
|
-
return {
|
|
950
|
+
z2.transform((data) => {
|
|
951
|
+
const benefits = data.tierBenefitsJson instanceof ParsedBenefits ? data.tierBenefitsJson.value : null;
|
|
952
|
+
return {
|
|
953
|
+
totalPointsEarned: data.totalPointsEarned,
|
|
954
|
+
currentPoints: data.currentPoints,
|
|
955
|
+
pointsRedeemed: data.pointsRedeemed,
|
|
956
|
+
currentTier: data.currentTier,
|
|
957
|
+
tierPoints: data.tierPoints,
|
|
958
|
+
lifetimeWagered: data.lifetimeWagered,
|
|
959
|
+
lifetimeDeposited: data.lifetimeDeposited,
|
|
960
|
+
tierBenefits: benefits,
|
|
961
|
+
tierExpiresAt: data.tierExpiresAt,
|
|
962
|
+
available: flagOrNull(data.available),
|
|
963
|
+
programActive: flagOrNull(data.programActive),
|
|
964
|
+
historyAvailable: flagOrNull(data.historyAvailable),
|
|
965
|
+
canRedeem: flagOrNull(data.canRedeem),
|
|
966
|
+
minRedemption: countOrNull(data.minRedemption),
|
|
967
|
+
pointValue: countOrNull(data.pointValueCents),
|
|
968
|
+
redemptionCurrency: data.redemptionCurrency,
|
|
969
|
+
redemptionDecimalPlaces: data.redemptionDecimalPlaces ?? null,
|
|
970
|
+
pendingRedemption: pendingOrNull(data.pendingRedemption)
|
|
971
|
+
};
|
|
1003
972
|
})
|
|
1004
973
|
)
|
|
1005
974
|
);
|
|
975
|
+
var VALUE_MISMATCH = "Expected value and value_minor to carry the same amount";
|
|
976
|
+
var redeemWire = () => wire({
|
|
977
|
+
success: z2.optional(z2.boolean()),
|
|
978
|
+
message: z2.optional(z2.string()),
|
|
979
|
+
redeemed_points: integerText(),
|
|
980
|
+
value: z2.nullish(nonNegativeMinorUnits()),
|
|
981
|
+
value_minor: z2.nullish(minorUnitsText()),
|
|
982
|
+
// Currency strict even in `'warn'`; absent, `null` and `''` still become `null`.
|
|
983
|
+
currency: currencyOrNull(),
|
|
984
|
+
currency_decimal_places: z2.nullish(decimalPlaces()),
|
|
985
|
+
bonus_id: optionalText()
|
|
986
|
+
});
|
|
987
|
+
var sameAmount = () => strictValue((v) => {
|
|
988
|
+
const { value, valueMinor } = v;
|
|
989
|
+
return value == null || valueMinor == null || value === valueMinor;
|
|
990
|
+
}, VALUE_MISMATCH);
|
|
1006
991
|
var redeemSchema = /* @__PURE__ */ lazy(
|
|
1007
|
-
() =>
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
message: z4.optional(z4.string()),
|
|
1011
|
-
redeemed_points: integerText(),
|
|
1012
|
-
value: z4.nullish(minorUnits()),
|
|
1013
|
-
// Currency strict even in `'warn'`; absent, `null` and `''` still become `null`.
|
|
1014
|
-
currency: z4.pipe(
|
|
1015
|
-
z4.nullish(currencyOrEmpty()),
|
|
1016
|
-
z4.transform((value) => value == null || value === "" ? null : value)
|
|
1017
|
-
),
|
|
1018
|
-
bonus_id: optionalText()
|
|
1019
|
-
}),
|
|
1020
|
-
z4.transform((data) => ({
|
|
992
|
+
() => z2.pipe(
|
|
993
|
+
z2.pipe(redeemWire(), sameAmount()),
|
|
994
|
+
z2.transform((data) => ({
|
|
1021
995
|
success: data.success,
|
|
1022
996
|
message: data.message,
|
|
1023
997
|
redeemedPoints: data.redeemedPoints,
|
|
1024
|
-
value: data.value ?? null,
|
|
998
|
+
value: data.valueMinor ?? data.value ?? null,
|
|
1025
999
|
currency: data.currency,
|
|
1000
|
+
currencyDecimalPlaces: data.currencyDecimalPlaces ?? null,
|
|
1026
1001
|
bonusId: data.bonusId
|
|
1027
1002
|
}))
|
|
1028
1003
|
)
|
|
@@ -1061,12 +1036,12 @@ function createLoyaltyApi(transport) {
|
|
|
1061
1036
|
};
|
|
1062
1037
|
}
|
|
1063
1038
|
function openUnion(values) {
|
|
1064
|
-
return
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1039
|
+
return z2.pipe(
|
|
1040
|
+
z2.pipe(
|
|
1041
|
+
z2.string(),
|
|
1042
|
+
z2.transform((value) => value.toLowerCase())
|
|
1068
1043
|
),
|
|
1069
|
-
|
|
1044
|
+
z2.enum(values)
|
|
1070
1045
|
);
|
|
1071
1046
|
}
|
|
1072
1047
|
|
|
@@ -1077,42 +1052,87 @@ var REWARD_TYPES = ["bonus", "free_spins", "points", "free_bet"];
|
|
|
1077
1052
|
var USER_MISSION_STATUSES = ["in_progress", "completed", "expired", "claimed"];
|
|
1078
1053
|
var missionSchema = /* @__PURE__ */ lazy(
|
|
1079
1054
|
() => wire({
|
|
1080
|
-
id:
|
|
1081
|
-
name:
|
|
1082
|
-
description:
|
|
1055
|
+
id: z2.string(),
|
|
1056
|
+
name: z2.string(),
|
|
1057
|
+
description: z2._default(z2.string(), ""),
|
|
1083
1058
|
mission_type: openUnion(MISSION_TYPES),
|
|
1084
1059
|
objective_type: openUnion(OBJECTIVE_TYPES),
|
|
1085
1060
|
target_value: integerText(),
|
|
1086
1061
|
target_game_category: optionalText(),
|
|
1087
|
-
target_games: nullableList(
|
|
1062
|
+
target_games: nullableList(z2.string()),
|
|
1088
1063
|
reward_type: openUnion(REWARD_TYPES),
|
|
1089
1064
|
reward_value: minorUnits(),
|
|
1090
1065
|
valid_from: optionalTimestamp(),
|
|
1091
1066
|
valid_to: optionalTimestamp()
|
|
1092
1067
|
})
|
|
1093
1068
|
);
|
|
1069
|
+
var userMissionFields = () => ({
|
|
1070
|
+
id: z2.string(),
|
|
1071
|
+
mission_id: z2.string(),
|
|
1072
|
+
mission_name: z2._default(z2.string(), ""),
|
|
1073
|
+
current_progress: integerText(),
|
|
1074
|
+
target_value: integerText(),
|
|
1075
|
+
progress_percentage: z2.number(),
|
|
1076
|
+
status: openUnion(USER_MISSION_STATUSES),
|
|
1077
|
+
reward_type: openUnion(REWARD_TYPES),
|
|
1078
|
+
reward_value: minorUnits(),
|
|
1079
|
+
period_end: optionalTimestamp(),
|
|
1080
|
+
completed_at: optionalTimestamp()
|
|
1081
|
+
});
|
|
1094
1082
|
var userMissionsSchema = /* @__PURE__ */ lazy(
|
|
1095
|
-
() =>
|
|
1083
|
+
() => z2.pipe(
|
|
1084
|
+
wire({ missions: nullableList(wire(userMissionFields())) }),
|
|
1085
|
+
z2.transform((data) => data.missions)
|
|
1086
|
+
)
|
|
1087
|
+
);
|
|
1088
|
+
var historyMissionSchema = () => z2.pipe(
|
|
1089
|
+
wire({
|
|
1090
|
+
...userMissionFields(),
|
|
1091
|
+
claimed_at: optionalTimestamp(),
|
|
1092
|
+
offer_active: z2.nullish(z2.boolean()),
|
|
1093
|
+
description: optionalText(),
|
|
1094
|
+
mission_type: z2.nullish(openUnion(MISSION_TYPES)),
|
|
1095
|
+
objective_type: z2.nullish(openUnion(OBJECTIVE_TYPES)),
|
|
1096
|
+
target_game_category: optionalText()
|
|
1097
|
+
}),
|
|
1098
|
+
// In `'warn'` a divergent `offer_active` arrives raw: the SDK delivers `null`, never the text `"false"`.
|
|
1099
|
+
z2.transform(
|
|
1100
|
+
(m) => ({
|
|
1101
|
+
...m,
|
|
1102
|
+
offerActive: flagOrNull(m.offerActive),
|
|
1103
|
+
missionType: m.missionType ?? null,
|
|
1104
|
+
objectiveType: m.objectiveType ?? null
|
|
1105
|
+
})
|
|
1106
|
+
)
|
|
1107
|
+
);
|
|
1108
|
+
var myMissionsSchema = /* @__PURE__ */ lazy(
|
|
1109
|
+
() => z2.pipe(
|
|
1096
1110
|
wire({
|
|
1097
|
-
missions: nullableList(
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
mission_name: z4._default(z4.string(), ""),
|
|
1102
|
-
current_progress: integerText(),
|
|
1103
|
-
target_value: integerText(),
|
|
1104
|
-
progress_percentage: z4.number(),
|
|
1105
|
-
status: openUnion(USER_MISSION_STATUSES),
|
|
1106
|
-
reward_type: openUnion(REWARD_TYPES),
|
|
1107
|
-
reward_value: minorUnits(),
|
|
1108
|
-
period_end: optionalTimestamp(),
|
|
1109
|
-
completed_at: optionalTimestamp()
|
|
1110
|
-
})
|
|
1111
|
-
)
|
|
1111
|
+
missions: nullableList(historyMissionSchema()),
|
|
1112
|
+
available: z2.nullish(z2.boolean()),
|
|
1113
|
+
offers_available: z2.nullish(z2.boolean()),
|
|
1114
|
+
history_available: z2.nullish(z2.boolean())
|
|
1112
1115
|
}),
|
|
1113
|
-
|
|
1116
|
+
z2.transform(
|
|
1117
|
+
(data) => ({
|
|
1118
|
+
missions: data.missions,
|
|
1119
|
+
available: flagOrNull(data.available),
|
|
1120
|
+
offersAvailable: flagOrNull(data.offersAvailable),
|
|
1121
|
+
historyAvailable: flagOrNull(data.historyAvailable)
|
|
1122
|
+
})
|
|
1123
|
+
)
|
|
1114
1124
|
)
|
|
1115
1125
|
);
|
|
1126
|
+
var MY_MISSIONS_ROUTE = { method: "GET", path: "/my/missions" };
|
|
1127
|
+
function getMineInputProblem(input) {
|
|
1128
|
+
if (input === void 0) return void 0;
|
|
1129
|
+
if (typeof input !== "object" || input === null || Array.isArray(input))
|
|
1130
|
+
return "missions.getMine: input must be an object { includeHistory? }.";
|
|
1131
|
+
const { includeHistory } = input;
|
|
1132
|
+
if (includeHistory !== void 0 && typeof includeHistory !== "boolean")
|
|
1133
|
+
return "missions.getMine: includeHistory must be a boolean.";
|
|
1134
|
+
return void 0;
|
|
1135
|
+
}
|
|
1116
1136
|
function createMissionsApi(transport) {
|
|
1117
1137
|
return {
|
|
1118
1138
|
list: (input, options) => {
|
|
@@ -1129,36 +1149,42 @@ function createMissionsApi(transport) {
|
|
|
1129
1149
|
options
|
|
1130
1150
|
});
|
|
1131
1151
|
},
|
|
1132
|
-
listMine: (_params, options) => transport.request({
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1152
|
+
listMine: (_params, options) => transport.request({ ...MY_MISSIONS_ROUTE, auth: "required", schema: userMissionsSchema(), options }),
|
|
1153
|
+
getMine: (input, options) => {
|
|
1154
|
+
const problem = getMineInputProblem(input);
|
|
1155
|
+
if (problem !== void 0) return rejectInput(transport, problem, MY_MISSIONS_ROUTE);
|
|
1156
|
+
return transport.request({
|
|
1157
|
+
...MY_MISSIONS_ROUTE,
|
|
1158
|
+
// The gateway only honors the literal `true`; `false` sends nothing (the same request as `listMine`).
|
|
1159
|
+
query: input?.includeHistory === true ? { include_history: "true" } : void 0,
|
|
1160
|
+
auth: "required",
|
|
1161
|
+
schema: myMissionsSchema(),
|
|
1162
|
+
options
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1139
1165
|
};
|
|
1140
1166
|
}
|
|
1141
1167
|
var DEFAULT_PER_PAGE = 20;
|
|
1142
1168
|
var HISTORY_PATH = "/referrals/history";
|
|
1143
|
-
var count2 = () =>
|
|
1144
|
-
var money3 = () =>
|
|
1145
|
-
|
|
1146
|
-
|
|
1169
|
+
var count2 = () => z2._default(z2.number().check(z2.refine((value) => Number.isSafeInteger(value) && value >= 0, "invalid counter")), 0);
|
|
1170
|
+
var money3 = () => z2.pipe(
|
|
1171
|
+
z2.nullish(wire({ minor_units: minorUnits(), currency: z2._default(currencyOrEmpty(), "") })),
|
|
1172
|
+
z2.transform(
|
|
1147
1173
|
(value) => value == null ? null : { amount: value.minorUnits, currency: value.currency }
|
|
1148
1174
|
)
|
|
1149
1175
|
);
|
|
1150
|
-
var rulesSchema = () =>
|
|
1151
|
-
|
|
1176
|
+
var rulesSchema = () => z2.pipe(
|
|
1177
|
+
z2.nullish(
|
|
1152
1178
|
wire({
|
|
1153
1179
|
reward: money3(),
|
|
1154
1180
|
minimum_real_net_loss: money3(),
|
|
1155
1181
|
referee_window_days: count2(),
|
|
1156
1182
|
hold_hours: count2(),
|
|
1157
|
-
wagering_multiplier:
|
|
1183
|
+
wagering_multiplier: z2._default(z2.string(), ""),
|
|
1158
1184
|
maximum_conversion: money3()
|
|
1159
1185
|
})
|
|
1160
1186
|
),
|
|
1161
|
-
|
|
1187
|
+
z2.transform((rules) => {
|
|
1162
1188
|
if (rules == null || rules.reward === null || rules.minimumRealNetLoss === null) return null;
|
|
1163
1189
|
return {
|
|
1164
1190
|
reward: rules.reward,
|
|
@@ -1171,12 +1197,12 @@ var rulesSchema = () => z4.pipe(
|
|
|
1171
1197
|
})
|
|
1172
1198
|
);
|
|
1173
1199
|
var infoSchema = /* @__PURE__ */ lazy(
|
|
1174
|
-
() =>
|
|
1200
|
+
() => z2.pipe(
|
|
1175
1201
|
wire({
|
|
1176
|
-
enabled:
|
|
1202
|
+
enabled: z2._default(z2.boolean(), false),
|
|
1177
1203
|
referral_code: optionalText(),
|
|
1178
1204
|
rules: rulesSchema(),
|
|
1179
|
-
totals:
|
|
1205
|
+
totals: z2._default(
|
|
1180
1206
|
wire({
|
|
1181
1207
|
registered: count2(),
|
|
1182
1208
|
deposited: count2(),
|
|
@@ -1189,7 +1215,7 @@ var infoSchema = /* @__PURE__ */ lazy(
|
|
|
1189
1215
|
{ registered: 0, deposited: 0, inHold: 0, paid: 0, notEligible: 0, expired: 0, cancelled: 0 }
|
|
1190
1216
|
)
|
|
1191
1217
|
}),
|
|
1192
|
-
|
|
1218
|
+
z2.transform(
|
|
1193
1219
|
({ enabled, referralCode, rules, totals }) => ({ enabled, code: referralCode, rules, totals })
|
|
1194
1220
|
)
|
|
1195
1221
|
)
|
|
@@ -1198,16 +1224,16 @@ function remainingOf(target, loss) {
|
|
|
1198
1224
|
const missing = BigInt(target.amount) - BigInt(loss.amount);
|
|
1199
1225
|
return { amount: missing > 0n ? Number(missing) : 0, currency: target.currency };
|
|
1200
1226
|
}
|
|
1201
|
-
var progressSchema = () =>
|
|
1202
|
-
|
|
1227
|
+
var progressSchema = () => z2.pipe(
|
|
1228
|
+
z2.nullish(
|
|
1203
1229
|
wire({
|
|
1204
|
-
deposit_done:
|
|
1230
|
+
deposit_done: z2._default(z2.boolean(), false),
|
|
1205
1231
|
real_net_loss: money3(),
|
|
1206
1232
|
target: money3(),
|
|
1207
1233
|
remaining: money3()
|
|
1208
1234
|
})
|
|
1209
1235
|
),
|
|
1210
|
-
|
|
1236
|
+
z2.transform((progress) => {
|
|
1211
1237
|
if (progress == null || progress.target === null) return null;
|
|
1212
1238
|
const { target } = progress;
|
|
1213
1239
|
const realNetLoss = progress.realNetLoss ?? { amount: 0, currency: target.currency };
|
|
@@ -1224,9 +1250,9 @@ function statusOf(playerStatus, legacy) {
|
|
|
1224
1250
|
if (playerStatus !== null) return playerStatus.replace(/^CAMPAIGN_REFERRAL_STATUS_/, "").toLowerCase();
|
|
1225
1251
|
return LEGACY_STATUS[(legacy ?? "").toUpperCase()] ?? "registered";
|
|
1226
1252
|
}
|
|
1227
|
-
var referralSchema = () =>
|
|
1253
|
+
var referralSchema = () => z2.pipe(
|
|
1228
1254
|
wire({
|
|
1229
|
-
id:
|
|
1255
|
+
id: z2.string(),
|
|
1230
1256
|
referee_name: optionalText(),
|
|
1231
1257
|
status: optionalText(),
|
|
1232
1258
|
player_status: optionalText(),
|
|
@@ -1234,7 +1260,7 @@ var referralSchema = () => z4.pipe(
|
|
|
1234
1260
|
deadline_at: optionalTimestamp(),
|
|
1235
1261
|
progress: progressSchema()
|
|
1236
1262
|
}),
|
|
1237
|
-
|
|
1263
|
+
z2.transform(
|
|
1238
1264
|
(r) => ({
|
|
1239
1265
|
id: r.id,
|
|
1240
1266
|
refereeName: r.refereeName,
|
|
@@ -1250,9 +1276,9 @@ var historySchema = /* @__PURE__ */ lazy(
|
|
|
1250
1276
|
referral_code: optionalText(),
|
|
1251
1277
|
referrals: nullableList(referralSchema()),
|
|
1252
1278
|
// A nil pointer (`null`) reads as absent, like an omitted pagination.
|
|
1253
|
-
pagination:
|
|
1254
|
-
|
|
1255
|
-
|
|
1279
|
+
pagination: z2.pipe(
|
|
1280
|
+
z2.nullish(wire({ page: count2(), limit: count2(), total_items: count2() })),
|
|
1281
|
+
z2.transform((value) => value ?? void 0)
|
|
1256
1282
|
)
|
|
1257
1283
|
})
|
|
1258
1284
|
);
|
|
@@ -1293,12 +1319,12 @@ function createReferralsApi(transport) {
|
|
|
1293
1319
|
}
|
|
1294
1320
|
var HTTP_URL = "Expected an absolute http(s) URL";
|
|
1295
1321
|
var sessionSchema2 = /* @__PURE__ */ lazy(
|
|
1296
|
-
() =>
|
|
1322
|
+
() => z2.pipe(
|
|
1297
1323
|
wire({
|
|
1298
1324
|
// 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
|
-
|
|
1325
|
+
operator_token: z2.string(),
|
|
1326
|
+
launch_url: z2.string().check(
|
|
1327
|
+
z2.refine(
|
|
1302
1328
|
(value) => {
|
|
1303
1329
|
try {
|
|
1304
1330
|
const { protocol } = new URL(value);
|
|
@@ -1310,10 +1336,10 @@ var sessionSchema2 = /* @__PURE__ */ lazy(
|
|
|
1310
1336
|
{ message: HTTP_URL }
|
|
1311
1337
|
)
|
|
1312
1338
|
),
|
|
1313
|
-
expires_in_seconds:
|
|
1339
|
+
expires_in_seconds: z2.number().check(z2.refine((n) => Number.isFinite(n) && n > 0, { message: "Esperava > 0" }))
|
|
1314
1340
|
}),
|
|
1315
1341
|
// The clock is read when the response is interpreted (= moment of the response).
|
|
1316
|
-
|
|
1342
|
+
z2.transform(({ launchUrl, expiresInSeconds }) => ({
|
|
1317
1343
|
launchUrl,
|
|
1318
1344
|
expiresInSeconds,
|
|
1319
1345
|
expiresAt: Date.now() + expiresInSeconds * 1e3
|
|
@@ -1340,6 +1366,7 @@ function createIgaming(client) {
|
|
|
1340
1366
|
const transport = extension.getExtensionTransport(client);
|
|
1341
1367
|
const igaming = {
|
|
1342
1368
|
casino: createCasinoApi(transport),
|
|
1369
|
+
club: createClubApi(transport),
|
|
1343
1370
|
bonus: createBonusApi(transport),
|
|
1344
1371
|
missions: createMissionsApi(transport),
|
|
1345
1372
|
loyalty: createLoyaltyApi(transport),
|
|
@@ -1355,6 +1382,9 @@ function createIgaming(client) {
|
|
|
1355
1382
|
});
|
|
1356
1383
|
}
|
|
1357
1384
|
extension.registerProductClient(igaming, client);
|
|
1385
|
+
Object.defineProperty(igaming, LOCALE, {
|
|
1386
|
+
value: () => typeof transport.getLocale === "function" ? transport.getLocale() : void 0
|
|
1387
|
+
});
|
|
1358
1388
|
return igaming;
|
|
1359
1389
|
}
|
|
1360
1390
|
|