@getenginex/sdk-igaming 0.9.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +4 -3
- package/dist/index.cjs +586 -316
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +335 -10
- package/dist/index.d.ts +335 -10
- package/dist/index.js +586 -316
- package/dist/index.js.map +1 -1
- package/dist/query/index.cjs +5 -3
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +10 -5
- package/dist/query/index.d.ts +10 -5
- package/dist/query/index.js +5 -3
- package/dist/query/index.js.map +1 -1
- package/dist/testing/index.cjs +189 -11
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +10 -0
- package/dist/testing/index.d.ts +10 -0
- package/dist/testing/index.js +190 -12
- package/dist/testing/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var sdk = require('@getenginex/sdk');
|
|
4
4
|
var extension = require('@getenginex/sdk/extension');
|
|
5
|
-
var
|
|
5
|
+
var z4 = require('zod/mini');
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -23,13 +23,48 @@ function _interopNamespace(e) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var extension__namespace = /*#__PURE__*/_interopNamespace(extension);
|
|
26
|
-
var
|
|
26
|
+
var z4__namespace = /*#__PURE__*/_interopNamespace(z4);
|
|
27
27
|
|
|
28
28
|
// src/client.ts
|
|
29
|
+
|
|
30
|
+
// src/internal/input.ts
|
|
31
|
+
function rejectInput(transport, message, route) {
|
|
32
|
+
return Promise.reject(
|
|
33
|
+
transport.reportError({ code: "CONFIGURATION_ERROR", message, status: 0 }, { ...route, attempt: 0 })
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function pageInputProblem(name, input) {
|
|
37
|
+
if (input === void 0) return void 0;
|
|
38
|
+
if (typeof input !== "object" || input === null || Array.isArray(input)) return `${name}: input must be an object.`;
|
|
39
|
+
const { page, perPage } = input;
|
|
40
|
+
if (page !== void 0 && (typeof page !== "number" || !Number.isSafeInteger(page) || page < 1))
|
|
41
|
+
return `${name}: page must be an integer \u2265 1.`;
|
|
42
|
+
if (perPage !== void 0 && (typeof perPage !== "number" || !Number.isInteger(perPage) || perPage < 1 || perPage > 100))
|
|
43
|
+
return `${name}: perPage must be an integer from 1 to 100.`;
|
|
44
|
+
return void 0;
|
|
45
|
+
}
|
|
46
|
+
function optionalTimestamp() {
|
|
47
|
+
return z4__namespace.pipe(
|
|
48
|
+
z4__namespace.nullish(z4__namespace.string().check(z4__namespace.refine((value) => value === "" || !Number.isNaN(Date.parse(value)), "invalid date"))),
|
|
49
|
+
z4__namespace.transform((value) => value == null || value === "" || Date.parse(value) === 0 ? null : value)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function optionalText() {
|
|
53
|
+
return z4__namespace.pipe(
|
|
54
|
+
z4__namespace.nullish(z4__namespace.string()),
|
|
55
|
+
z4__namespace.transform((value) => value == null || value === "" ? null : value)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function nullableList(item) {
|
|
59
|
+
return z4__namespace.pipe(
|
|
60
|
+
z4__namespace.nullish(z4__namespace.array(item)),
|
|
61
|
+
z4__namespace.transform((value) => value ?? [])
|
|
62
|
+
);
|
|
63
|
+
}
|
|
29
64
|
function protoEnum(prefix) {
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
65
|
+
return z4__namespace.pipe(
|
|
66
|
+
z4__namespace.optional(z4__namespace.union([z4__namespace.string(), z4__namespace.number()])),
|
|
67
|
+
z4__namespace.transform((value) => {
|
|
33
68
|
if (value === void 0 || value === 0) return "unspecified";
|
|
34
69
|
if (typeof value === "number") return String(value);
|
|
35
70
|
return (value.startsWith(prefix) ? value.slice(prefix.length) : value).toLowerCase();
|
|
@@ -42,177 +77,292 @@ function minorUnits() {
|
|
|
42
77
|
function currencyOrEmpty() {
|
|
43
78
|
return extension.currencyCode({ allowEmpty: true });
|
|
44
79
|
}
|
|
80
|
+
var NON_NEGATIVE_MONEY = "Expected money in minor units: a non-negative integer within the safe range of number";
|
|
81
|
+
function nonNegativeMinorUnits() {
|
|
82
|
+
return z4__namespace.pipe(
|
|
83
|
+
extension.strictValue(
|
|
84
|
+
(v) => typeof v === "number" && Number.isSafeInteger(v) && v >= 0 || typeof v === "string" && /^\d+$/.test(v) && Number.isSafeInteger(Number(v)),
|
|
85
|
+
NON_NEGATIVE_MONEY
|
|
86
|
+
),
|
|
87
|
+
// `|| 0`: a JSON `-0` comes out as `0`.
|
|
88
|
+
z4__namespace.transform((v) => Number(v) || 0)
|
|
89
|
+
);
|
|
90
|
+
}
|
|
45
91
|
var INTEGER_TEXT = "Expected an integer within the safe range of number";
|
|
46
92
|
function integerText() {
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
93
|
+
return z4__namespace.pipe(
|
|
94
|
+
z4__namespace.union([
|
|
95
|
+
z4__namespace.string().check(
|
|
96
|
+
z4__namespace.refine((value) => /^-?\d+$/.test(value) && Number.isSafeInteger(Number(value)), { message: INTEGER_TEXT })
|
|
51
97
|
),
|
|
52
|
-
|
|
98
|
+
z4__namespace.number().check(z4__namespace.refine((value) => Number.isSafeInteger(value), { message: INTEGER_TEXT }))
|
|
53
99
|
]),
|
|
54
|
-
|
|
100
|
+
z4__namespace.transform(Number)
|
|
55
101
|
);
|
|
56
102
|
}
|
|
57
103
|
function text() {
|
|
58
|
-
return
|
|
104
|
+
return z4__namespace._default(z4__namespace.string(), "");
|
|
59
105
|
}
|
|
60
106
|
function count() {
|
|
61
|
-
return
|
|
107
|
+
return z4__namespace._default(z4__namespace.number(), 0);
|
|
62
108
|
}
|
|
63
109
|
function list(item) {
|
|
64
|
-
return
|
|
110
|
+
return nullableList(item);
|
|
65
111
|
}
|
|
66
112
|
function durationSeconds() {
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
|
|
113
|
+
return z4__namespace.pipe(
|
|
114
|
+
z4__namespace.string().check(z4__namespace.regex(/^-?\d+(\.\d+)?s$/, { message: 'Expected a protobuf duration, e.g. "86400s"' })),
|
|
115
|
+
z4__namespace.transform((value) => Number(value.slice(0, -1)))
|
|
70
116
|
);
|
|
71
117
|
}
|
|
72
118
|
|
|
73
|
-
// src/modules/
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
119
|
+
// src/modules/bets.ts
|
|
120
|
+
var betFields = () => ({
|
|
121
|
+
id: z4__namespace.string(),
|
|
122
|
+
status: protoEnum("BET_STATUS_"),
|
|
123
|
+
stake: nonNegativeMinorUnits(),
|
|
124
|
+
potential_return: nonNegativeMinorUnits(),
|
|
125
|
+
total_odds: z4__namespace.number(),
|
|
126
|
+
created_at: optionalTimestamp()
|
|
127
|
+
});
|
|
128
|
+
var betSchema = /* @__PURE__ */ extension.lazy(() => extension.wire(betFields()));
|
|
129
|
+
var betDetailsSchema = /* @__PURE__ */ extension.lazy(
|
|
130
|
+
() => extension.wire({
|
|
131
|
+
...betFields(),
|
|
132
|
+
selections: nullableList(
|
|
133
|
+
extension.wire({
|
|
134
|
+
event_name: z4__namespace.string(),
|
|
135
|
+
market_name: z4__namespace.string(),
|
|
136
|
+
selection_name: z4__namespace.string(),
|
|
137
|
+
odds: z4__namespace.number(),
|
|
138
|
+
result: protoEnum("SELECTION_RESULT_")
|
|
139
|
+
})
|
|
140
|
+
)
|
|
141
|
+
})
|
|
142
|
+
);
|
|
143
|
+
var offerSchema = /* @__PURE__ */ extension.lazy(
|
|
144
|
+
() => extension.wire({
|
|
145
|
+
bet_id: z4__namespace.string(),
|
|
146
|
+
available: z4__namespace.boolean(),
|
|
147
|
+
cashout_amount: nonNegativeMinorUnits(),
|
|
148
|
+
expires_at: optionalTimestamp()
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
var cashoutSchema = /* @__PURE__ */ extension.lazy(
|
|
152
|
+
() => extension.wire({ bet_id: z4__namespace.string(), cashout_amount: nonNegativeMinorUnits(), status: z4__namespace.string() })
|
|
153
|
+
);
|
|
154
|
+
var LIST_ROUTE = { method: "GET", path: "/bets" };
|
|
155
|
+
var GET_ROUTE = { method: "GET", path: "/bets/{betId}" };
|
|
156
|
+
var OFFER_ROUTE = { method: "GET", path: "/bets/{betId}/cashout" };
|
|
157
|
+
var CASHOUT_ROUTE = { method: "POST", path: "/bets/{betId}/cashout" };
|
|
158
|
+
var MAX_IDEMPOTENCY_KEY = 255;
|
|
159
|
+
function betIdProblem(name, input) {
|
|
160
|
+
if (typeof input !== "object" || input === null || Array.isArray(input)) return `${name}: input must be { betId }.`;
|
|
161
|
+
const { betId } = input;
|
|
162
|
+
return typeof betId === "string" && betId.trim() !== "" ? void 0 : `${name}: betId must be non-empty text.`;
|
|
163
|
+
}
|
|
164
|
+
function idempotencyKeyProblem(options) {
|
|
165
|
+
const key = options?.idempotencyKey;
|
|
166
|
+
if (key === void 0 || key === "") return void 0;
|
|
167
|
+
if (typeof key !== "string" || key !== key.trim() || key.length > MAX_IDEMPOTENCY_KEY)
|
|
168
|
+
return `bets.cashout: idempotencyKey must be text without surrounding spaces, up to ${MAX_IDEMPOTENCY_KEY} characters.`;
|
|
169
|
+
return void 0;
|
|
170
|
+
}
|
|
171
|
+
var betPath = (betId, suffix = "") => `/bets/${encodeURIComponent(betId)}${suffix}`;
|
|
172
|
+
function createBetsApi(transport) {
|
|
173
|
+
return {
|
|
174
|
+
list: (input, options) => {
|
|
175
|
+
const problem = pageInputProblem("bets.list", input);
|
|
176
|
+
if (problem !== void 0) return rejectInput(transport, problem, LIST_ROUTE);
|
|
177
|
+
return transport.requestPage({
|
|
178
|
+
...LIST_ROUTE,
|
|
179
|
+
page: input?.page,
|
|
180
|
+
perPage: input?.perPage,
|
|
181
|
+
perPageParam: "limit",
|
|
182
|
+
auth: "required",
|
|
183
|
+
item: betSchema(),
|
|
184
|
+
options
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
get: (input, options) => {
|
|
188
|
+
const problem = betIdProblem("bets.get", input);
|
|
189
|
+
if (problem !== void 0) return rejectInput(transport, problem, GET_ROUTE);
|
|
190
|
+
return transport.request({
|
|
191
|
+
method: "GET",
|
|
192
|
+
path: betPath(input.betId),
|
|
193
|
+
auth: "required",
|
|
194
|
+
schema: betDetailsSchema(),
|
|
195
|
+
options
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
getCashoutOffer: (input, options) => {
|
|
199
|
+
const problem = betIdProblem("bets.getCashoutOffer", input);
|
|
200
|
+
if (problem !== void 0) return rejectInput(transport, problem, OFFER_ROUTE);
|
|
201
|
+
return transport.request({
|
|
202
|
+
method: "GET",
|
|
203
|
+
path: betPath(input.betId, "/cashout"),
|
|
204
|
+
auth: "required",
|
|
205
|
+
schema: offerSchema(),
|
|
206
|
+
options
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
cashout: (input, options) => {
|
|
210
|
+
const problem = betIdProblem("bets.cashout", input) ?? idempotencyKeyProblem(options);
|
|
211
|
+
if (problem !== void 0) return rejectInput(transport, problem, CASHOUT_ROUTE);
|
|
212
|
+
return transport.request({
|
|
213
|
+
method: "POST",
|
|
214
|
+
path: betPath(input.betId, "/cashout"),
|
|
215
|
+
auth: "required",
|
|
216
|
+
// No body: the gateway's idempotency middleware fingerprints the (empty) body, so a replay always matches.
|
|
217
|
+
idempotent: true,
|
|
218
|
+
schema: cashoutSchema(),
|
|
219
|
+
options
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
var campaignCurrency = () => z4__namespace._default(currencyOrEmpty(), "");
|
|
225
|
+
var money = () => extension.wire({ amount: z4__namespace._default(minorUnits(), 0), currency: campaignCurrency() });
|
|
226
|
+
var timeWindow = () => extension.wire({ starts_at: z4__namespace.optional(z4__namespace.string()), ends_at: z4__namespace.optional(z4__namespace.string()) });
|
|
227
|
+
var ratio = () => extension.wire({ decimal: z4__namespace.optional(z4__namespace.string()), basis_points: z4__namespace.optional(z4__namespace.number()), maximum_scale: count() });
|
|
78
228
|
var empty = () => extension.wire({});
|
|
79
229
|
var policy = (prefix) => extension.wire({ code: protoEnum(prefix), version: count() });
|
|
80
230
|
var casinoSelector = () => extension.wire({
|
|
81
231
|
provider_instance_id: text(),
|
|
82
|
-
software_ids: list(
|
|
83
|
-
game_ids: list(
|
|
84
|
-
category_codes: list(
|
|
232
|
+
software_ids: list(z4__namespace.string()),
|
|
233
|
+
game_ids: list(z4__namespace.string()),
|
|
234
|
+
category_codes: list(z4__namespace.string())
|
|
85
235
|
});
|
|
86
236
|
var sportsSelector = () => extension.wire({
|
|
87
|
-
sport_codes: list(
|
|
88
|
-
competition_ids: list(
|
|
89
|
-
event_ids: list(
|
|
90
|
-
market_codes: list(
|
|
91
|
-
live:
|
|
237
|
+
sport_codes: list(z4__namespace.string()),
|
|
238
|
+
competition_ids: list(z4__namespace.string()),
|
|
239
|
+
event_ids: list(z4__namespace.string()),
|
|
240
|
+
market_codes: list(z4__namespace.string()),
|
|
241
|
+
live: z4__namespace.optional(z4__namespace.boolean()),
|
|
92
242
|
bet_types: list(protoEnum("SPORTS_BET_TYPE_"))
|
|
93
243
|
});
|
|
94
244
|
var qualification = () => extension.wire({
|
|
95
245
|
version: count(),
|
|
96
|
-
immediate:
|
|
97
|
-
user_event:
|
|
246
|
+
immediate: z4__namespace.optional(empty()),
|
|
247
|
+
user_event: z4__namespace.optional(
|
|
98
248
|
extension.wire({
|
|
99
249
|
event_code: text(),
|
|
100
250
|
event_version: count(),
|
|
101
251
|
source_authority: text(),
|
|
102
|
-
identity_fields: list(
|
|
252
|
+
identity_fields: list(z4__namespace.string())
|
|
103
253
|
})
|
|
104
254
|
),
|
|
105
|
-
deposit_settled:
|
|
255
|
+
deposit_settled: z4__namespace.optional(
|
|
106
256
|
extension.wire({
|
|
107
257
|
currency: campaignCurrency(),
|
|
108
|
-
eligible_method_codes: list(
|
|
258
|
+
eligible_method_codes: list(z4__namespace.string()),
|
|
109
259
|
first_deposit_policy: protoEnum("FIRST_DEPOSIT_POLICY_"),
|
|
110
|
-
minimum_settled_net_amount:
|
|
111
|
-
maximum_settled_net_amount:
|
|
260
|
+
minimum_settled_net_amount: z4__namespace.optional(money()),
|
|
261
|
+
maximum_settled_net_amount: z4__namespace.optional(money()),
|
|
112
262
|
amount_basis: protoEnum("DEPOSIT_AMOUNT_BASIS_")
|
|
113
263
|
})
|
|
114
264
|
),
|
|
115
|
-
activity_aggregate:
|
|
265
|
+
activity_aggregate: z4__namespace.optional(
|
|
116
266
|
extension.wire({
|
|
117
267
|
basis: protoEnum("BASIS_"),
|
|
118
268
|
product_scope: protoEnum("PRODUCT_SCOPE_"),
|
|
119
269
|
currency: campaignCurrency(),
|
|
120
|
-
window:
|
|
270
|
+
window: z4__namespace.optional(durationSeconds()),
|
|
121
271
|
timezone: text(),
|
|
122
|
-
late_event_grace:
|
|
123
|
-
casino:
|
|
124
|
-
sportsbook:
|
|
272
|
+
late_event_grace: z4__namespace.optional(durationSeconds()),
|
|
273
|
+
casino: z4__namespace.optional(casinoSelector()),
|
|
274
|
+
sportsbook: z4__namespace.optional(sportsSelector())
|
|
125
275
|
})
|
|
126
276
|
)
|
|
127
277
|
});
|
|
128
278
|
var validity = () => extension.wire({
|
|
129
|
-
no_expiry:
|
|
130
|
-
absolute_expiry:
|
|
131
|
-
duration_from_grant:
|
|
279
|
+
no_expiry: z4__namespace.optional(empty()),
|
|
280
|
+
absolute_expiry: z4__namespace.optional(extension.wire({ expires_at: z4__namespace.optional(z4__namespace.string()) })),
|
|
281
|
+
duration_from_grant: z4__namespace.optional(extension.wire({ duration: z4__namespace.optional(durationSeconds()) }))
|
|
132
282
|
});
|
|
133
283
|
var rounding = () => protoEnum("ROUNDING_MODE_");
|
|
134
284
|
var proceedsClass = () => protoEnum("PROCEEDS_CLASS_");
|
|
135
285
|
var percent = () => extension.wire({
|
|
136
|
-
percentage:
|
|
286
|
+
percentage: z4__namespace.optional(ratio()),
|
|
137
287
|
rounding: rounding(),
|
|
138
|
-
minimum_reward:
|
|
139
|
-
maximum_reward:
|
|
288
|
+
minimum_reward: z4__namespace.optional(money()),
|
|
289
|
+
maximum_reward: z4__namespace.optional(money())
|
|
140
290
|
});
|
|
141
291
|
var balanceCredit = () => extension.wire({
|
|
142
|
-
fixed_amount:
|
|
143
|
-
percent_of_source_amount:
|
|
144
|
-
aggregate_rebate:
|
|
292
|
+
fixed_amount: z4__namespace.optional(extension.wire({ amount: z4__namespace.optional(money()) })),
|
|
293
|
+
percent_of_source_amount: z4__namespace.optional(percent()),
|
|
294
|
+
aggregate_rebate: z4__namespace.optional(
|
|
145
295
|
extension.wire({
|
|
146
|
-
percentage:
|
|
296
|
+
percentage: z4__namespace.optional(ratio()),
|
|
147
297
|
rounding: rounding(),
|
|
148
|
-
minimum_basis:
|
|
149
|
-
maximum_reward:
|
|
298
|
+
minimum_basis: z4__namespace.optional(money()),
|
|
299
|
+
maximum_reward: z4__namespace.optional(money())
|
|
150
300
|
})
|
|
151
301
|
),
|
|
152
302
|
balance_class: protoEnum("BALANCE_CLASS_"),
|
|
153
303
|
proceeds_class: proceedsClass(),
|
|
154
|
-
validity:
|
|
304
|
+
validity: z4__namespace.optional(validity())
|
|
155
305
|
});
|
|
156
|
-
var maximumBet = () => extension.wire({ mode: protoEnum("MAXIMUM_BET_MODE_"), campaign_maximum:
|
|
306
|
+
var maximumBet = () => extension.wire({ mode: protoEnum("MAXIMUM_BET_MODE_"), campaign_maximum: z4__namespace.optional(money()) });
|
|
157
307
|
var oddsPolicy = () => extension.wire({
|
|
158
308
|
mode: protoEnum("MODE_"),
|
|
159
|
-
minimum_total_odds_decimal:
|
|
160
|
-
minimum_odds_per_leg_decimal:
|
|
161
|
-
minimum_legs:
|
|
162
|
-
maximum_legs:
|
|
309
|
+
minimum_total_odds_decimal: z4__namespace.optional(z4__namespace.string()),
|
|
310
|
+
minimum_odds_per_leg_decimal: z4__namespace.optional(z4__namespace.string()),
|
|
311
|
+
minimum_legs: z4__namespace.optional(z4__namespace.number()),
|
|
312
|
+
maximum_legs: z4__namespace.optional(z4__namespace.number())
|
|
163
313
|
});
|
|
164
314
|
var cashoutMode = () => protoEnum("RESTRICTED_CASHOUT_MODE_");
|
|
165
315
|
var usePolicy = () => extension.wire({
|
|
166
316
|
version: count(),
|
|
167
|
-
funds_consumption:
|
|
168
|
-
casino:
|
|
169
|
-
sportsbook:
|
|
317
|
+
funds_consumption: z4__namespace.optional(policy("FUNDS_CONSUMPTION_POLICY_CODE_")),
|
|
318
|
+
casino: z4__namespace.optional(extension.wire({ allowed_scopes: list(casinoSelector()), maximum_bet: z4__namespace.optional(maximumBet()) })),
|
|
319
|
+
sportsbook: z4__namespace.optional(
|
|
170
320
|
extension.wire({
|
|
171
321
|
allowed_scopes: list(sportsSelector()),
|
|
172
322
|
excluded_scopes: list(sportsSelector()),
|
|
173
|
-
maximum_bet:
|
|
174
|
-
funding_odds:
|
|
323
|
+
maximum_bet: z4__namespace.optional(maximumBet()),
|
|
324
|
+
funding_odds: z4__namespace.optional(oddsPolicy()),
|
|
175
325
|
cashout_mode: cashoutMode()
|
|
176
326
|
})
|
|
177
327
|
),
|
|
178
|
-
casino_and_sportsbook:
|
|
328
|
+
casino_and_sportsbook: z4__namespace.optional(
|
|
179
329
|
extension.wire({
|
|
180
330
|
allowed_casino_scopes: list(casinoSelector()),
|
|
181
331
|
allowed_sportsbook_scopes: list(sportsSelector()),
|
|
182
332
|
excluded_sportsbook_scopes: list(sportsSelector()),
|
|
183
|
-
maximum_casino_bet:
|
|
184
|
-
maximum_sportsbook_bet:
|
|
185
|
-
sportsbook_funding_odds:
|
|
333
|
+
maximum_casino_bet: z4__namespace.optional(maximumBet()),
|
|
334
|
+
maximum_sportsbook_bet: z4__namespace.optional(maximumBet()),
|
|
335
|
+
sportsbook_funding_odds: z4__namespace.optional(oddsPolicy()),
|
|
186
336
|
sportsbook_cashout_mode: cashoutMode()
|
|
187
337
|
})
|
|
188
338
|
),
|
|
189
|
-
payout_allocation:
|
|
339
|
+
payout_allocation: z4__namespace.optional(policy("PAYOUT_ALLOCATION_POLICY_CODE_"))
|
|
190
340
|
});
|
|
191
341
|
var wageringPolicy = () => extension.wire({
|
|
192
342
|
version: count(),
|
|
193
|
-
none:
|
|
194
|
-
multiplier:
|
|
343
|
+
none: z4__namespace.optional(empty()),
|
|
344
|
+
multiplier: z4__namespace.optional(
|
|
195
345
|
extension.wire({
|
|
196
346
|
requirement_basis: protoEnum("REQUIREMENT_BASIS_"),
|
|
197
|
-
multiplier:
|
|
347
|
+
multiplier: z4__namespace.optional(ratio()),
|
|
198
348
|
contribution_rates: list(
|
|
199
349
|
extension.wire({
|
|
200
|
-
casino:
|
|
201
|
-
sportsbook:
|
|
202
|
-
rate:
|
|
350
|
+
casino: z4__namespace.optional(casinoSelector()),
|
|
351
|
+
sportsbook: z4__namespace.optional(sportsSelector()),
|
|
352
|
+
rate: z4__namespace.optional(ratio())
|
|
203
353
|
})
|
|
204
354
|
),
|
|
205
|
-
deadline:
|
|
355
|
+
deadline: z4__namespace.optional(validity()),
|
|
206
356
|
rounding: rounding(),
|
|
207
|
-
sportsbook_contribution_odds:
|
|
208
|
-
maximum_conversion:
|
|
357
|
+
sportsbook_contribution_odds: z4__namespace.optional(oddsPolicy()),
|
|
358
|
+
maximum_conversion: z4__namespace.optional(money())
|
|
209
359
|
})
|
|
210
360
|
)
|
|
211
361
|
});
|
|
212
362
|
var stackingPolicy = () => extension.wire({
|
|
213
363
|
version: count(),
|
|
214
|
-
exclusive_in_group:
|
|
215
|
-
multiple_in_group:
|
|
364
|
+
exclusive_in_group: z4__namespace.optional(extension.wire({ stacking_group_key: text() })),
|
|
365
|
+
multiple_in_group: z4__namespace.optional(extension.wire({ stacking_group_key: text(), maximum_active_per_player: count() }))
|
|
216
366
|
});
|
|
217
367
|
var reward = () => extension.wire({
|
|
218
368
|
reward_key: text(),
|
|
@@ -220,83 +370,83 @@ var reward = () => extension.wire({
|
|
|
220
370
|
reward_kind_version: count(),
|
|
221
371
|
execution_profile_code: protoEnum("EXECUTION_PROFILE_CODE_"),
|
|
222
372
|
execution_profile_version: count(),
|
|
223
|
-
balance_credit:
|
|
224
|
-
provider_managed_balance:
|
|
225
|
-
casino_free_spins:
|
|
373
|
+
balance_credit: z4__namespace.optional(balanceCredit()),
|
|
374
|
+
provider_managed_balance: z4__namespace.optional(extension.wire({ provider_code: text() })),
|
|
375
|
+
casino_free_spins: z4__namespace.optional(
|
|
226
376
|
extension.wire({
|
|
227
377
|
provider_code: text(),
|
|
228
|
-
casino_scope:
|
|
378
|
+
casino_scope: z4__namespace.optional(casinoSelector()),
|
|
229
379
|
quantity: count(),
|
|
230
|
-
denomination:
|
|
380
|
+
denomination: z4__namespace.optional(money()),
|
|
231
381
|
currency: campaignCurrency(),
|
|
232
|
-
grant_window:
|
|
382
|
+
grant_window: z4__namespace.optional(timeWindow()),
|
|
233
383
|
proceeds_class: proceedsClass(),
|
|
234
|
-
maximum_winnings:
|
|
384
|
+
maximum_winnings: z4__namespace.optional(money())
|
|
235
385
|
})
|
|
236
386
|
),
|
|
237
|
-
sports_bonus_bet:
|
|
387
|
+
sports_bonus_bet: z4__namespace.optional(
|
|
238
388
|
extension.wire({
|
|
239
389
|
provider_code: text(),
|
|
240
|
-
sportsbook_scope:
|
|
241
|
-
amount:
|
|
390
|
+
sportsbook_scope: z4__namespace.optional(sportsSelector()),
|
|
391
|
+
amount: z4__namespace.optional(money()),
|
|
242
392
|
quantity: count(),
|
|
243
|
-
validity:
|
|
393
|
+
validity: z4__namespace.optional(validity())
|
|
244
394
|
})
|
|
245
395
|
),
|
|
246
|
-
sports_bet_coverage:
|
|
396
|
+
sports_bet_coverage: z4__namespace.optional(
|
|
247
397
|
extension.wire({
|
|
248
398
|
provider_code: text(),
|
|
249
|
-
qualifying_bet_scope:
|
|
250
|
-
coverage_cap:
|
|
251
|
-
validity:
|
|
399
|
+
qualifying_bet_scope: z4__namespace.optional(sportsSelector()),
|
|
400
|
+
coverage_cap: z4__namespace.optional(money()),
|
|
401
|
+
validity: z4__namespace.optional(validity())
|
|
252
402
|
})
|
|
253
403
|
),
|
|
254
|
-
use_policy:
|
|
255
|
-
wagering_policy:
|
|
256
|
-
stacking_policy:
|
|
257
|
-
restricted_position_selection_policy:
|
|
404
|
+
use_policy: z4__namespace.optional(usePolicy()),
|
|
405
|
+
wagering_policy: z4__namespace.optional(wageringPolicy()),
|
|
406
|
+
stacking_policy: z4__namespace.optional(stackingPolicy()),
|
|
407
|
+
restricted_position_selection_policy: z4__namespace.optional(
|
|
258
408
|
extension.wire({
|
|
259
409
|
version: count(),
|
|
260
|
-
priority_then_earliest_expiry:
|
|
410
|
+
priority_then_earliest_expiry: z4__namespace.optional(extension.wire({ selection_priority: z4__namespace.optional(z4__namespace.number()) }))
|
|
261
411
|
})
|
|
262
412
|
)
|
|
263
413
|
});
|
|
264
414
|
var localizedContent = () => extension.wire({ locale: text(), display_name: text(), description: text(), terms: text(), terms_revision: text() });
|
|
265
|
-
var content = () => extension.wire({ default_locale: text(), supported_locales: list(
|
|
266
|
-
var
|
|
415
|
+
var content = () => extension.wire({ default_locale: text(), supported_locales: list(z4__namespace.string()), localized_content: list(localizedContent()) });
|
|
416
|
+
var offerSchema2 = /* @__PURE__ */ extension.lazy(
|
|
267
417
|
() => extension.wire({
|
|
268
418
|
campaign_id: text(),
|
|
269
419
|
campaign_version_id: text(),
|
|
270
420
|
publication_id: text(),
|
|
271
421
|
product_scope: protoEnum("PRODUCT_SCOPE_"),
|
|
272
422
|
timezone: text(),
|
|
273
|
-
enrollment_window:
|
|
274
|
-
qualification_window:
|
|
275
|
-
claim_window:
|
|
276
|
-
entry_policy:
|
|
277
|
-
reward_claim_policy:
|
|
278
|
-
qualification:
|
|
279
|
-
reward:
|
|
280
|
-
publication_starts_at:
|
|
281
|
-
publication_ends_at:
|
|
282
|
-
content:
|
|
423
|
+
enrollment_window: z4__namespace.optional(timeWindow()),
|
|
424
|
+
qualification_window: z4__namespace.optional(timeWindow()),
|
|
425
|
+
claim_window: z4__namespace.optional(timeWindow()),
|
|
426
|
+
entry_policy: z4__namespace.optional(policy("ENTRY_POLICY_CODE_")),
|
|
427
|
+
reward_claim_policy: z4__namespace.optional(policy("REWARD_CLAIM_POLICY_CODE_")),
|
|
428
|
+
qualification: z4__namespace.optional(qualification()),
|
|
429
|
+
reward: z4__namespace.optional(reward()),
|
|
430
|
+
publication_starts_at: z4__namespace.optional(z4__namespace.string()),
|
|
431
|
+
publication_ends_at: z4__namespace.optional(z4__namespace.string()),
|
|
432
|
+
content: z4__namespace.optional(content())
|
|
283
433
|
})
|
|
284
434
|
);
|
|
285
435
|
function grantMoney(value, currency) {
|
|
286
436
|
return { amount: value?.amount ?? 0, currency: value?.currency || currency };
|
|
287
437
|
}
|
|
288
|
-
var rewardGrant = () =>
|
|
438
|
+
var rewardGrant = () => z4__namespace.pipe(
|
|
289
439
|
extension.wire({
|
|
290
440
|
state: protoEnum("CAMPAIGN_PLAYER_REWARD_GRANT_STATE_"),
|
|
291
|
-
granted:
|
|
292
|
-
balance:
|
|
293
|
-
converted:
|
|
294
|
-
expires_at:
|
|
295
|
-
wagering:
|
|
296
|
-
extension.wire({ required:
|
|
441
|
+
granted: z4__namespace.optional(money()),
|
|
442
|
+
balance: z4__namespace.optional(money()),
|
|
443
|
+
converted: z4__namespace.optional(money()),
|
|
444
|
+
expires_at: z4__namespace.optional(z4__namespace.string()),
|
|
445
|
+
wagering: z4__namespace.optional(
|
|
446
|
+
extension.wire({ required: z4__namespace.optional(money()), accumulated: z4__namespace.optional(money()), completed_at: z4__namespace.optional(z4__namespace.string()) })
|
|
297
447
|
)
|
|
298
448
|
}),
|
|
299
|
-
|
|
449
|
+
z4__namespace.transform(({ state, granted, balance, converted, expiresAt, wagering }) => {
|
|
300
450
|
const currency = [granted, balance, converted, wagering?.required, wagering?.accumulated].find((m) => m?.currency)?.currency ?? "";
|
|
301
451
|
const out = {
|
|
302
452
|
state,
|
|
@@ -316,40 +466,40 @@ var rewardGrant = () => z2__namespace.pipe(
|
|
|
316
466
|
})
|
|
317
467
|
);
|
|
318
468
|
var participationSchema = /* @__PURE__ */ extension.lazy(
|
|
319
|
-
() =>
|
|
469
|
+
() => z4__namespace.pipe(
|
|
320
470
|
extension.wire({
|
|
321
471
|
id: text(),
|
|
322
472
|
campaign_id: text(),
|
|
323
473
|
campaign_version_id: text(),
|
|
324
474
|
reward_key: text(),
|
|
325
|
-
qualification_snapshot:
|
|
475
|
+
qualification_snapshot: z4__namespace.optional(qualification()),
|
|
326
476
|
// oneof `state`: only one of the cases is filled in.
|
|
327
|
-
enrolled:
|
|
328
|
-
qualifying:
|
|
329
|
-
qualified:
|
|
330
|
-
reward_pending:
|
|
331
|
-
completed:
|
|
332
|
-
reward_failed:
|
|
333
|
-
expired:
|
|
334
|
-
cancelled:
|
|
335
|
-
reward_grant:
|
|
336
|
-
snapshot:
|
|
477
|
+
enrolled: z4__namespace.optional(empty()),
|
|
478
|
+
qualifying: z4__namespace.optional(empty()),
|
|
479
|
+
qualified: z4__namespace.optional(extension.wire({ qualified_at: z4__namespace.optional(z4__namespace.string()) })),
|
|
480
|
+
reward_pending: z4__namespace.optional(empty()),
|
|
481
|
+
completed: z4__namespace.optional(extension.wire({ completed_at: z4__namespace.optional(z4__namespace.string()) })),
|
|
482
|
+
reward_failed: z4__namespace.optional(empty()),
|
|
483
|
+
expired: z4__namespace.optional(extension.wire({ expired_at: z4__namespace.optional(z4__namespace.string()) })),
|
|
484
|
+
cancelled: z4__namespace.optional(empty()),
|
|
485
|
+
reward_grant: z4__namespace.optional(rewardGrant()),
|
|
486
|
+
snapshot: z4__namespace.optional(
|
|
337
487
|
extension.wire({
|
|
338
|
-
reward:
|
|
339
|
-
content:
|
|
340
|
-
terms_acceptance:
|
|
488
|
+
reward: z4__namespace.optional(reward()),
|
|
489
|
+
content: z4__namespace.optional(content()),
|
|
490
|
+
terms_acceptance: z4__namespace.optional(
|
|
341
491
|
extension.wire({
|
|
342
492
|
locale: text(),
|
|
343
493
|
terms_revision: text(),
|
|
344
494
|
terms_digest_sha256_hex: text(),
|
|
345
|
-
accepted_at:
|
|
495
|
+
accepted_at: z4__namespace.optional(z4__namespace.string())
|
|
346
496
|
})
|
|
347
497
|
)
|
|
348
498
|
})
|
|
349
499
|
)
|
|
350
500
|
}),
|
|
351
501
|
// The oneof becomes `status` (+ the timestamp of the case); the oneof's keys are not passed on.
|
|
352
|
-
|
|
502
|
+
z4__namespace.transform(
|
|
353
503
|
({ enrolled, qualifying, qualified, rewardPending, completed, rewardFailed, expired, cancelled, ...rest }) => {
|
|
354
504
|
const out = { ...rest, status: "unspecified" };
|
|
355
505
|
if (enrolled) out.status = "enrolled";
|
|
@@ -371,77 +521,78 @@ var participationSchema = /* @__PURE__ */ extension.lazy(
|
|
|
371
521
|
)
|
|
372
522
|
)
|
|
373
523
|
);
|
|
374
|
-
var cursorPageSchema = (key, item) => extension.wire({ [key]: list(item), next_cursor:
|
|
375
|
-
var offersPage = /* @__PURE__ */ extension.lazy(() => cursorPageSchema("offers",
|
|
524
|
+
var cursorPageSchema = (key, item) => extension.wire({ [key]: list(item), next_cursor: z4__namespace.optional(z4__namespace.string()) });
|
|
525
|
+
var offersPage = /* @__PURE__ */ extension.lazy(() => cursorPageSchema("offers", offerSchema2()));
|
|
376
526
|
var participationsPage = /* @__PURE__ */ extension.lazy(() => cursorPageSchema("participations", participationSchema()));
|
|
377
|
-
var offerEnvelope = /* @__PURE__ */ extension.lazy(() => extension.wire({ offer:
|
|
527
|
+
var offerEnvelope = /* @__PURE__ */ extension.lazy(() => extension.wire({ offer: offerSchema2() }));
|
|
378
528
|
var participationEnvelope = /* @__PURE__ */ extension.lazy(() => extension.wire({ participation: participationSchema() }));
|
|
379
529
|
var promoCodeOfferSchema = /* @__PURE__ */ extension.lazy(
|
|
380
|
-
() => extension.wire({ offer:
|
|
530
|
+
() => extension.wire({ offer: offerSchema2(), localized_content: localizedContent() })
|
|
381
531
|
);
|
|
382
532
|
function toCursorPage(key, data) {
|
|
383
|
-
const
|
|
533
|
+
const items = data[key];
|
|
534
|
+
const page = { items: Array.isArray(items) ? items : [] };
|
|
384
535
|
if (data.nextCursor) page.nextCursor = data.nextCursor;
|
|
385
536
|
return page;
|
|
386
537
|
}
|
|
387
|
-
var nullableDate = () =>
|
|
388
|
-
|
|
389
|
-
|
|
538
|
+
var nullableDate = () => z4__namespace.pipe(
|
|
539
|
+
z4__namespace.nullish(z4__namespace.string()),
|
|
540
|
+
z4__namespace.transform((value) => value ?? void 0)
|
|
390
541
|
);
|
|
391
542
|
function compact(value) {
|
|
392
543
|
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0));
|
|
393
544
|
}
|
|
394
545
|
var overviewSchema = /* @__PURE__ */ extension.lazy(
|
|
395
|
-
() =>
|
|
546
|
+
() => z4__namespace.pipe(
|
|
396
547
|
extension.wire({
|
|
397
548
|
currencies: list(
|
|
398
|
-
|
|
549
|
+
z4__namespace.pipe(
|
|
399
550
|
extension.wire({
|
|
400
551
|
currency: currencyOrEmpty(),
|
|
401
|
-
decimal_places:
|
|
552
|
+
decimal_places: z4__namespace.number(),
|
|
402
553
|
restricted_total: minorUnits(),
|
|
403
554
|
expiring_7d: minorUnits(),
|
|
404
|
-
open_positions:
|
|
555
|
+
open_positions: z4__namespace.number(),
|
|
405
556
|
next_expires_at: nullableDate(),
|
|
406
557
|
converted: minorUnits(),
|
|
407
|
-
converted_campaigns:
|
|
558
|
+
converted_campaigns: z4__namespace.number()
|
|
408
559
|
}),
|
|
409
|
-
|
|
560
|
+
z4__namespace.transform(compact)
|
|
410
561
|
)
|
|
411
562
|
),
|
|
412
563
|
as_of: nullableDate()
|
|
413
564
|
}),
|
|
414
|
-
|
|
565
|
+
z4__namespace.transform(compact)
|
|
415
566
|
)
|
|
416
567
|
);
|
|
417
568
|
var positionsPage = /* @__PURE__ */ extension.lazy(
|
|
418
569
|
() => extension.wire({
|
|
419
570
|
rows: list(
|
|
420
|
-
|
|
571
|
+
z4__namespace.pipe(
|
|
421
572
|
extension.wire({
|
|
422
|
-
position_id:
|
|
423
|
-
campaign_id:
|
|
573
|
+
position_id: z4__namespace.string(),
|
|
574
|
+
campaign_id: z4__namespace.string(),
|
|
424
575
|
currency: currencyOrEmpty(),
|
|
425
|
-
decimal_places:
|
|
576
|
+
decimal_places: z4__namespace.number(),
|
|
426
577
|
granted: minorUnits(),
|
|
427
578
|
restricted: minorUnits(),
|
|
428
579
|
converted: minorUnits(),
|
|
429
580
|
required: minorUnits(),
|
|
430
581
|
wagered: minorUnits(),
|
|
431
582
|
remaining: minorUnits(),
|
|
432
|
-
state:
|
|
583
|
+
state: z4__namespace.string(),
|
|
433
584
|
// The gateway answers `null` for an action it does not know; known ones are uppercase (`CONVERT`).
|
|
434
|
-
terminal_action:
|
|
435
|
-
|
|
436
|
-
|
|
585
|
+
terminal_action: z4__namespace.pipe(
|
|
586
|
+
z4__namespace.nullish(z4__namespace.string()),
|
|
587
|
+
z4__namespace.transform((value) => value ? value.toLowerCase() : void 0)
|
|
437
588
|
),
|
|
438
589
|
expires_at: nullableDate(),
|
|
439
590
|
created_at: nullableDate()
|
|
440
591
|
}),
|
|
441
|
-
|
|
592
|
+
z4__namespace.transform((row) => compact(row))
|
|
442
593
|
)
|
|
443
594
|
),
|
|
444
|
-
next_cursor:
|
|
595
|
+
next_cursor: z4__namespace.optional(z4__namespace.string())
|
|
445
596
|
})
|
|
446
597
|
);
|
|
447
598
|
var terms = (acceptance) => acceptance && { locale: acceptance.locale, terms_revision: acceptance.termsRevision };
|
|
@@ -535,51 +686,51 @@ function createBonusApi(transport) {
|
|
|
535
686
|
}
|
|
536
687
|
var gameSchema = /* @__PURE__ */ extension.lazy(
|
|
537
688
|
() => extension.wire({
|
|
538
|
-
id:
|
|
539
|
-
name:
|
|
540
|
-
provider:
|
|
541
|
-
category:
|
|
542
|
-
type:
|
|
543
|
-
thumbnail:
|
|
544
|
-
is_new:
|
|
545
|
-
is_popular:
|
|
546
|
-
is_live:
|
|
547
|
-
demo_available:
|
|
548
|
-
rtp:
|
|
549
|
-
volatility:
|
|
550
|
-
priority:
|
|
689
|
+
id: z4__namespace.string(),
|
|
690
|
+
name: z4__namespace.string(),
|
|
691
|
+
provider: z4__namespace.string(),
|
|
692
|
+
category: z4__namespace.string(),
|
|
693
|
+
type: z4__namespace.string(),
|
|
694
|
+
thumbnail: z4__namespace.string(),
|
|
695
|
+
is_new: z4__namespace.boolean(),
|
|
696
|
+
is_popular: z4__namespace.boolean(),
|
|
697
|
+
is_live: z4__namespace.boolean(),
|
|
698
|
+
demo_available: z4__namespace.boolean(),
|
|
699
|
+
rtp: z4__namespace.number(),
|
|
700
|
+
volatility: z4__namespace.string(),
|
|
701
|
+
priority: z4__namespace.number()
|
|
551
702
|
})
|
|
552
703
|
);
|
|
553
704
|
var categoriesSchema = /* @__PURE__ */ extension.lazy(
|
|
554
|
-
() =>
|
|
555
|
-
extension.wire({ slug:
|
|
705
|
+
() => nullableList(
|
|
706
|
+
extension.wire({ slug: z4__namespace.string(), name: z4__namespace.string(), icon: z4__namespace.string(), game_count: z4__namespace.number(), priority: z4__namespace.number() })
|
|
556
707
|
)
|
|
557
708
|
);
|
|
558
709
|
var providersSchema = /* @__PURE__ */ extension.lazy(
|
|
559
|
-
() =>
|
|
710
|
+
() => nullableList(extension.wire({ id: z4__namespace.string(), name: z4__namespace.string(), game_count: z4__namespace.number() }))
|
|
560
711
|
);
|
|
561
712
|
var launchSchema = /* @__PURE__ */ extension.lazy(
|
|
562
|
-
() =>
|
|
713
|
+
() => z4__namespace.pipe(
|
|
563
714
|
extension.wire({
|
|
564
|
-
session_id:
|
|
565
|
-
game_url:
|
|
715
|
+
session_id: z4__namespace.string().check(z4__namespace.minLength(1)),
|
|
716
|
+
game_url: z4__namespace.string().check(z4__namespace.minLength(1)),
|
|
566
717
|
// Any text: a target the SDK does not know yet must not fail the (strict) launch.
|
|
567
|
-
launch_target:
|
|
568
|
-
provider_code:
|
|
569
|
-
expires_at:
|
|
718
|
+
launch_target: z4__namespace.optional(z4__namespace.string()),
|
|
719
|
+
provider_code: z4__namespace.optional(z4__namespace.string()),
|
|
720
|
+
expires_at: z4__namespace.optional(z4__namespace.string())
|
|
570
721
|
}),
|
|
571
722
|
// Without a target (an older gateway, or a custom mock), the launch keeps the behavior the SDK documented
|
|
572
723
|
// before the field existed: an iframe.
|
|
573
|
-
|
|
724
|
+
z4__namespace.transform(({ launchTarget, ...rest }) => ({ ...rest, launchTarget: launchTarget || "iframe" }))
|
|
574
725
|
)
|
|
575
726
|
);
|
|
576
727
|
var sessionSchema = /* @__PURE__ */ extension.lazy(
|
|
577
728
|
() => extension.wire({
|
|
578
|
-
id:
|
|
579
|
-
game_id:
|
|
580
|
-
game_name:
|
|
581
|
-
provider:
|
|
582
|
-
start_time:
|
|
729
|
+
id: z4__namespace.string(),
|
|
730
|
+
game_id: z4__namespace.string(),
|
|
731
|
+
game_name: z4__namespace.string(),
|
|
732
|
+
provider: z4__namespace.string(),
|
|
733
|
+
start_time: z4__namespace.string(),
|
|
583
734
|
total_bet: extension.money(),
|
|
584
735
|
total_win: extension.money(),
|
|
585
736
|
status: protoEnum("SESSION_STATUS_")
|
|
@@ -587,49 +738,155 @@ var sessionSchema = /* @__PURE__ */ extension.lazy(
|
|
|
587
738
|
);
|
|
588
739
|
var transactionSchema = /* @__PURE__ */ extension.lazy(
|
|
589
740
|
() => extension.wire({
|
|
590
|
-
id:
|
|
591
|
-
game_id:
|
|
592
|
-
game_name:
|
|
593
|
-
round_id:
|
|
741
|
+
id: z4__namespace.string(),
|
|
742
|
+
game_id: z4__namespace.string(),
|
|
743
|
+
game_name: z4__namespace.string(),
|
|
744
|
+
round_id: z4__namespace.string(),
|
|
594
745
|
type: protoEnum("CASINO_TRANSACTION_TYPE_"),
|
|
595
746
|
amount: minorUnits(),
|
|
596
747
|
currency: extension.currencyCode(),
|
|
597
748
|
currency_decimal_places: extension.decimalPlaces(),
|
|
598
|
-
created_at:
|
|
749
|
+
created_at: z4__namespace.string()
|
|
599
750
|
})
|
|
600
751
|
);
|
|
601
752
|
var winnersSchema = /* @__PURE__ */ extension.lazy(
|
|
602
|
-
() =>
|
|
753
|
+
() => nullableList(
|
|
603
754
|
extension.wire({
|
|
604
|
-
player:
|
|
755
|
+
player: z4__namespace.string(),
|
|
605
756
|
amount: minorUnits(),
|
|
606
757
|
currency: extension.currencyCode(),
|
|
607
758
|
currency_decimal_places: extension.decimalPlaces(),
|
|
608
|
-
game_id:
|
|
609
|
-
game_name:
|
|
610
|
-
won_at:
|
|
759
|
+
game_id: z4__namespace.string(),
|
|
760
|
+
game_name: z4__namespace.string(),
|
|
761
|
+
won_at: z4__namespace.string()
|
|
611
762
|
})
|
|
612
763
|
)
|
|
613
764
|
);
|
|
765
|
+
var gamesEnvelopeSchema = /* @__PURE__ */ extension.lazy(
|
|
766
|
+
() => extension.wire({
|
|
767
|
+
availability: z4__namespace.pipe(
|
|
768
|
+
z4__namespace.nullish(
|
|
769
|
+
extension.wire({
|
|
770
|
+
// The gateway reports an unset status as `available`; the SDK does the same for an absent/empty one.
|
|
771
|
+
status: z4__namespace.pipe(
|
|
772
|
+
z4__namespace.nullish(z4__namespace.string()),
|
|
773
|
+
z4__namespace.transform((value) => value ? value.toLowerCase() : "available")
|
|
774
|
+
),
|
|
775
|
+
primary_provider_code: optionalText(),
|
|
776
|
+
missing: nullableList(z4__namespace.string())
|
|
777
|
+
})
|
|
778
|
+
),
|
|
779
|
+
z4__namespace.transform((value) => value ?? null)
|
|
780
|
+
)
|
|
781
|
+
})
|
|
782
|
+
);
|
|
783
|
+
var CURRENCY = /^[A-Z]{3}$/;
|
|
784
|
+
var DECIMAL_PLACES_MAX = 20;
|
|
785
|
+
var jackpotSchema = /* @__PURE__ */ extension.lazy(
|
|
786
|
+
() => z4__namespace.pipe(
|
|
787
|
+
z4__namespace.object({
|
|
788
|
+
id: z4__namespace.string().check(z4__namespace.refine((value) => value.trim() !== "")),
|
|
789
|
+
name: z4__namespace.string().check(z4__namespace.refine((value) => value.trim() !== "")),
|
|
790
|
+
currency: z4__namespace.string().check(z4__namespace.regex(CURRENCY)),
|
|
791
|
+
amount_minor: z4__namespace.union([
|
|
792
|
+
z4__namespace.string().check(z4__namespace.refine((value) => /^(0|[1-9]\d*)$/.test(value) && Number.isSafeInteger(Number(value)))),
|
|
793
|
+
z4__namespace.number().check(z4__namespace.refine((value) => Number.isSafeInteger(value) && value >= 0))
|
|
794
|
+
]),
|
|
795
|
+
decimal_places: z4__namespace.number().check(z4__namespace.refine((value) => Number.isInteger(value) && value >= 0 && value <= DECIMAL_PLACES_MAX))
|
|
796
|
+
}),
|
|
797
|
+
z4__namespace.transform((raw) => ({
|
|
798
|
+
id: raw.id,
|
|
799
|
+
name: raw.name,
|
|
800
|
+
currency: raw.currency,
|
|
801
|
+
amount: Number(raw.amount_minor) || 0,
|
|
802
|
+
currencyDecimalPlaces: raw.decimal_places
|
|
803
|
+
}))
|
|
804
|
+
)
|
|
805
|
+
);
|
|
806
|
+
var jackpotsSchema = /* @__PURE__ */ extension.lazy(
|
|
807
|
+
() => extension.wire({ items: nullableList(z4__namespace.unknown()), featured_id: optionalText() })
|
|
808
|
+
);
|
|
809
|
+
var jackpotGamesSchema = /* @__PURE__ */ extension.lazy(
|
|
810
|
+
() => z4__namespace.pipe(
|
|
811
|
+
extension.wire({
|
|
812
|
+
games: nullableList(gameSchema()),
|
|
813
|
+
mode: z4__namespace.pipe(
|
|
814
|
+
z4__namespace.string(),
|
|
815
|
+
z4__namespace.transform((value) => value.toLowerCase())
|
|
816
|
+
),
|
|
817
|
+
pagination: extension.wire({
|
|
818
|
+
page: z4__namespace.number(),
|
|
819
|
+
per_page: z4__namespace.number(),
|
|
820
|
+
has_next: z4__namespace.boolean(),
|
|
821
|
+
next_cursor: optionalText()
|
|
822
|
+
})
|
|
823
|
+
}),
|
|
824
|
+
z4__namespace.transform(({ games, mode, pagination }) => ({
|
|
825
|
+
items: games,
|
|
826
|
+
mode,
|
|
827
|
+
page: pagination.page,
|
|
828
|
+
perPage: pagination.perPage,
|
|
829
|
+
// A page that says there is more but has no cursor cannot be followed: it is the last one.
|
|
830
|
+
hasNext: pagination.hasNext && pagination.nextCursor !== null,
|
|
831
|
+
nextCursor: pagination.hasNext ? pagination.nextCursor : null
|
|
832
|
+
}))
|
|
833
|
+
)
|
|
834
|
+
);
|
|
835
|
+
var DEVICES = ["mobile", "desktop"];
|
|
836
|
+
var GAMES_ROUTE = { method: "GET", path: "/games" };
|
|
837
|
+
var JACKPOTS_ROUTE = { method: "GET", path: "/games/jackpots" };
|
|
838
|
+
var JACKPOT_GAMES_ROUTE = { method: "GET", path: "/games/jackpots/{jackpotId}/games" };
|
|
839
|
+
var JACKPOT_GAMES_MAX = 48;
|
|
840
|
+
function deviceProblem(name, device) {
|
|
841
|
+
return device === void 0 || DEVICES.includes(device) ? void 0 : `${name}: device must be 'mobile' or 'desktop' (or omitted).`;
|
|
842
|
+
}
|
|
843
|
+
function currencyProblem(name, currency) {
|
|
844
|
+
return typeof currency === "string" && CURRENCY.test(currency) ? void 0 : `${name}: currency must be an ISO 4217 code in uppercase (e.g. BRL).`;
|
|
845
|
+
}
|
|
846
|
+
function jackpotGamesProblem(input) {
|
|
847
|
+
const name = "casino.listJackpotGames";
|
|
848
|
+
if (typeof input !== "object" || input === null || Array.isArray(input))
|
|
849
|
+
return `${name}: input must be an object { jackpotId, currency }.`;
|
|
850
|
+
const { jackpotId, currency, device, page, perPage, cursor } = input;
|
|
851
|
+
if (typeof jackpotId !== "string" || jackpotId.trim() === "") return `${name}: jackpotId must be non-empty text.`;
|
|
852
|
+
const problem = currencyProblem(name, currency) ?? deviceProblem(name, device);
|
|
853
|
+
if (problem !== void 0) return problem;
|
|
854
|
+
if (page !== void 0 && (typeof page !== "number" || !Number.isSafeInteger(page) || page < 1))
|
|
855
|
+
return `${name}: page must be an integer \u2265 1.`;
|
|
856
|
+
if (perPage !== void 0 && (typeof perPage !== "number" || !Number.isInteger(perPage) || perPage < 1 || perPage > JACKPOT_GAMES_MAX))
|
|
857
|
+
return `${name}: perPage must be an integer from 1 to ${JACKPOT_GAMES_MAX}.`;
|
|
858
|
+
if (cursor !== void 0 && typeof cursor !== "string") return `${name}: cursor must be text.`;
|
|
859
|
+
if (typeof page === "number" && page > 1 && (cursor === void 0 || cursor === ""))
|
|
860
|
+
return `${name}: a page above 1 requires the previous page's nextCursor.`;
|
|
861
|
+
return void 0;
|
|
862
|
+
}
|
|
614
863
|
function createCasinoApi(transport) {
|
|
615
864
|
return {
|
|
616
|
-
listGames: (input, options) =>
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
865
|
+
listGames: async (input, options) => {
|
|
866
|
+
const problem = deviceProblem("casino.listGames", input?.device);
|
|
867
|
+
if (problem !== void 0) return rejectInput(transport, problem, GAMES_ROUTE);
|
|
868
|
+
const spec = {
|
|
869
|
+
...GAMES_ROUTE,
|
|
870
|
+
query: {
|
|
871
|
+
category: input?.category,
|
|
872
|
+
provider: input?.provider,
|
|
873
|
+
search: input?.search,
|
|
874
|
+
ids: input?.ids?.length ? input.ids.join(",") : void 0,
|
|
875
|
+
sort: input?.sort,
|
|
876
|
+
device: input?.device
|
|
877
|
+
},
|
|
878
|
+
page: input?.page,
|
|
879
|
+
perPage: input?.perPage,
|
|
880
|
+
perPageParam: "limit",
|
|
881
|
+
auth: "none",
|
|
882
|
+
item: gameSchema(),
|
|
883
|
+
options
|
|
884
|
+
};
|
|
885
|
+
if (typeof transport.requestPageWithEnvelope !== "function")
|
|
886
|
+
return { ...await transport.requestPage(spec), availability: null };
|
|
887
|
+
const { page, envelope } = await transport.requestPageWithEnvelope({ ...spec, envelope: gamesEnvelopeSchema() });
|
|
888
|
+
return { ...page, availability: envelope.availability };
|
|
889
|
+
},
|
|
633
890
|
listCategories: (_params, options) => transport.request({ method: "GET", path: "/games/categories", schema: categoriesSchema(), options }),
|
|
634
891
|
listProviders: (_params, options) => transport.request({ method: "GET", path: "/games/providers", schema: providersSchema(), options }),
|
|
635
892
|
getGame: ({ gameId }, options) => transport.request({
|
|
@@ -638,10 +895,16 @@ function createCasinoApi(transport) {
|
|
|
638
895
|
schema: gameSchema(),
|
|
639
896
|
options
|
|
640
897
|
}),
|
|
641
|
-
launchGame: ({ gameId, mode, isMobile, returnUrl, language }, options) => transport.request({
|
|
898
|
+
launchGame: ({ gameId, mode, isMobile, returnUrl, depositUrl, language }, options) => transport.request({
|
|
642
899
|
method: "POST",
|
|
643
900
|
path: `/games/${encodeURIComponent(gameId)}/launch`,
|
|
644
|
-
body: {
|
|
901
|
+
body: {
|
|
902
|
+
is_demo: mode === "demo",
|
|
903
|
+
is_mobile: isMobile === true,
|
|
904
|
+
return_url: returnUrl,
|
|
905
|
+
deposit_url: depositUrl,
|
|
906
|
+
language
|
|
907
|
+
},
|
|
645
908
|
auth: "required",
|
|
646
909
|
// The response carries the URL with the game session token: never through `warn` mode's recovery
|
|
647
910
|
// (which would deliver a raw field and the response to `onValidationIssue`).
|
|
@@ -676,55 +939,57 @@ function createCasinoApi(transport) {
|
|
|
676
939
|
auth: "required",
|
|
677
940
|
schema: winnersSchema(),
|
|
678
941
|
options
|
|
679
|
-
})
|
|
942
|
+
}),
|
|
943
|
+
listJackpots: async (input, options) => {
|
|
944
|
+
const currency = input?.currency;
|
|
945
|
+
const problem = currencyProblem("casino.listJackpots", currency);
|
|
946
|
+
if (problem !== void 0) return rejectInput(transport, problem, JACKPOTS_ROUTE);
|
|
947
|
+
const raw = await transport.request({
|
|
948
|
+
...JACKPOTS_ROUTE,
|
|
949
|
+
query: { currency },
|
|
950
|
+
auth: "none",
|
|
951
|
+
schema: jackpotsSchema(),
|
|
952
|
+
options
|
|
953
|
+
});
|
|
954
|
+
const items = [];
|
|
955
|
+
for (const entry of Array.isArray(raw.items) ? raw.items : []) {
|
|
956
|
+
const parsed = z4__namespace.safeParse(jackpotSchema(), entry);
|
|
957
|
+
if (!parsed.success || parsed.data.currency !== currency) continue;
|
|
958
|
+
if (items.some((item) => item.id === parsed.data.id)) continue;
|
|
959
|
+
items.push(parsed.data);
|
|
960
|
+
}
|
|
961
|
+
const featured = typeof raw.featuredId === "string" ? raw.featuredId : null;
|
|
962
|
+
return { items, featuredId: items.some((item) => item.id === featured) ? featured : null };
|
|
963
|
+
},
|
|
964
|
+
listJackpotGames: (input, options) => {
|
|
965
|
+
const problem = jackpotGamesProblem(input);
|
|
966
|
+
if (problem !== void 0) return rejectInput(transport, problem, JACKPOT_GAMES_ROUTE);
|
|
967
|
+
return transport.request({
|
|
968
|
+
method: "GET",
|
|
969
|
+
path: `/games/jackpots/${encodeURIComponent(input.jackpotId)}/games`,
|
|
970
|
+
query: {
|
|
971
|
+
currency: input.currency,
|
|
972
|
+
device: input.device,
|
|
973
|
+
page: input.page,
|
|
974
|
+
limit: input.perPage,
|
|
975
|
+
cursor: input.cursor === "" ? void 0 : input.cursor
|
|
976
|
+
},
|
|
977
|
+
auth: "none",
|
|
978
|
+
schema: jackpotGamesSchema(),
|
|
979
|
+
options
|
|
980
|
+
});
|
|
981
|
+
}
|
|
680
982
|
};
|
|
681
983
|
}
|
|
682
|
-
|
|
683
|
-
// src/internal/input.ts
|
|
684
|
-
function rejectInput(transport, message, route) {
|
|
685
|
-
return Promise.reject(
|
|
686
|
-
transport.reportError({ code: "CONFIGURATION_ERROR", message, status: 0 }, { ...route, attempt: 0 })
|
|
687
|
-
);
|
|
688
|
-
}
|
|
689
|
-
function pageInputProblem(name, input) {
|
|
690
|
-
if (input === void 0) return void 0;
|
|
691
|
-
if (typeof input !== "object" || input === null || Array.isArray(input)) return `${name}: input must be an object.`;
|
|
692
|
-
const { page, perPage } = input;
|
|
693
|
-
if (page !== void 0 && (typeof page !== "number" || !Number.isSafeInteger(page) || page < 1))
|
|
694
|
-
return `${name}: page must be an integer \u2265 1.`;
|
|
695
|
-
if (perPage !== void 0 && (typeof perPage !== "number" || !Number.isInteger(perPage) || perPage < 1 || perPage > 100))
|
|
696
|
-
return `${name}: perPage must be an integer from 1 to 100.`;
|
|
697
|
-
return void 0;
|
|
698
|
-
}
|
|
699
|
-
function optionalTimestamp() {
|
|
700
|
-
return z2__namespace.pipe(
|
|
701
|
-
z2__namespace.nullish(z2__namespace.string().check(z2__namespace.refine((value) => value === "" || !Number.isNaN(Date.parse(value)), "invalid date"))),
|
|
702
|
-
z2__namespace.transform((value) => value == null || value === "" || Date.parse(value) === 0 ? null : value)
|
|
703
|
-
);
|
|
704
|
-
}
|
|
705
|
-
function optionalText() {
|
|
706
|
-
return z2__namespace.pipe(
|
|
707
|
-
z2__namespace.nullish(z2__namespace.string()),
|
|
708
|
-
z2__namespace.transform((value) => value == null || value === "" ? null : value)
|
|
709
|
-
);
|
|
710
|
-
}
|
|
711
|
-
function nullableList(item) {
|
|
712
|
-
return z2__namespace.pipe(
|
|
713
|
-
z2__namespace.nullish(z2__namespace.array(item)),
|
|
714
|
-
z2__namespace.transform((value) => value ?? [])
|
|
715
|
-
);
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
// src/modules/loyalty.ts
|
|
719
984
|
var ParsedBenefits = class {
|
|
720
985
|
constructor(value) {
|
|
721
986
|
this.value = value;
|
|
722
987
|
}
|
|
723
988
|
value;
|
|
724
989
|
};
|
|
725
|
-
var tierBenefits = () =>
|
|
726
|
-
|
|
727
|
-
|
|
990
|
+
var tierBenefits = () => z4__namespace.pipe(
|
|
991
|
+
z4__namespace.nullish(z4__namespace.string()),
|
|
992
|
+
z4__namespace.transform((text2, ctx) => {
|
|
728
993
|
if (text2 == null || text2.trim() === "") return null;
|
|
729
994
|
let parsed;
|
|
730
995
|
try {
|
|
@@ -738,43 +1003,43 @@ var tierBenefits = () => z2__namespace.pipe(
|
|
|
738
1003
|
message: "tier_benefits_json is not a JSON object or array",
|
|
739
1004
|
input: void 0
|
|
740
1005
|
});
|
|
741
|
-
return
|
|
1006
|
+
return z4__namespace.NEVER;
|
|
742
1007
|
})
|
|
743
1008
|
);
|
|
744
1009
|
var loyaltySchema = /* @__PURE__ */ extension.lazy(
|
|
745
|
-
() =>
|
|
1010
|
+
() => z4__namespace.pipe(
|
|
746
1011
|
extension.wire({
|
|
747
1012
|
total_points_earned: integerText(),
|
|
748
1013
|
current_points: integerText(),
|
|
749
1014
|
points_redeemed: integerText(),
|
|
750
1015
|
current_tier: optionalText(),
|
|
751
1016
|
tier_points: integerText(),
|
|
752
|
-
lifetime_wagered:
|
|
753
|
-
lifetime_deposited:
|
|
1017
|
+
lifetime_wagered: z4__namespace._default(minorUnits(), 0),
|
|
1018
|
+
lifetime_deposited: z4__namespace._default(minorUnits(), 0),
|
|
754
1019
|
tier_benefits_json: tierBenefits(),
|
|
755
1020
|
tier_expires_at: optionalTimestamp()
|
|
756
1021
|
}),
|
|
757
|
-
|
|
1022
|
+
z4__namespace.transform(({ tierBenefitsJson, ...rest }) => {
|
|
758
1023
|
const benefits = tierBenefitsJson instanceof ParsedBenefits ? tierBenefitsJson.value : null;
|
|
759
1024
|
return { ...rest, tierBenefits: benefits };
|
|
760
1025
|
})
|
|
761
1026
|
)
|
|
762
1027
|
);
|
|
763
1028
|
var redeemSchema = /* @__PURE__ */ extension.lazy(
|
|
764
|
-
() =>
|
|
1029
|
+
() => z4__namespace.pipe(
|
|
765
1030
|
extension.wire({
|
|
766
|
-
success:
|
|
767
|
-
message:
|
|
1031
|
+
success: z4__namespace.optional(z4__namespace.boolean()),
|
|
1032
|
+
message: z4__namespace.optional(z4__namespace.string()),
|
|
768
1033
|
redeemed_points: integerText(),
|
|
769
|
-
value:
|
|
1034
|
+
value: z4__namespace.nullish(minorUnits()),
|
|
770
1035
|
// Currency strict even in `'warn'`; absent, `null` and `''` still become `null`.
|
|
771
|
-
currency:
|
|
772
|
-
|
|
773
|
-
|
|
1036
|
+
currency: z4__namespace.pipe(
|
|
1037
|
+
z4__namespace.nullish(currencyOrEmpty()),
|
|
1038
|
+
z4__namespace.transform((value) => value == null || value === "" ? null : value)
|
|
774
1039
|
),
|
|
775
1040
|
bonus_id: optionalText()
|
|
776
1041
|
}),
|
|
777
|
-
|
|
1042
|
+
z4__namespace.transform((data) => ({
|
|
778
1043
|
success: data.success,
|
|
779
1044
|
message: data.message,
|
|
780
1045
|
redeemedPoints: data.redeemedPoints,
|
|
@@ -818,12 +1083,12 @@ function createLoyaltyApi(transport) {
|
|
|
818
1083
|
};
|
|
819
1084
|
}
|
|
820
1085
|
function openUnion(values) {
|
|
821
|
-
return
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
1086
|
+
return z4__namespace.pipe(
|
|
1087
|
+
z4__namespace.pipe(
|
|
1088
|
+
z4__namespace.string(),
|
|
1089
|
+
z4__namespace.transform((value) => value.toLowerCase())
|
|
825
1090
|
),
|
|
826
|
-
|
|
1091
|
+
z4__namespace.enum(values)
|
|
827
1092
|
);
|
|
828
1093
|
}
|
|
829
1094
|
|
|
@@ -834,14 +1099,14 @@ var REWARD_TYPES = ["bonus", "free_spins", "points", "free_bet"];
|
|
|
834
1099
|
var USER_MISSION_STATUSES = ["in_progress", "completed", "expired", "claimed"];
|
|
835
1100
|
var missionSchema = /* @__PURE__ */ extension.lazy(
|
|
836
1101
|
() => extension.wire({
|
|
837
|
-
id:
|
|
838
|
-
name:
|
|
839
|
-
description:
|
|
1102
|
+
id: z4__namespace.string(),
|
|
1103
|
+
name: z4__namespace.string(),
|
|
1104
|
+
description: z4__namespace._default(z4__namespace.string(), ""),
|
|
840
1105
|
mission_type: openUnion(MISSION_TYPES),
|
|
841
1106
|
objective_type: openUnion(OBJECTIVE_TYPES),
|
|
842
1107
|
target_value: integerText(),
|
|
843
1108
|
target_game_category: optionalText(),
|
|
844
|
-
target_games: nullableList(
|
|
1109
|
+
target_games: nullableList(z4__namespace.string()),
|
|
845
1110
|
reward_type: openUnion(REWARD_TYPES),
|
|
846
1111
|
reward_value: minorUnits(),
|
|
847
1112
|
valid_from: optionalTimestamp(),
|
|
@@ -849,16 +1114,16 @@ var missionSchema = /* @__PURE__ */ extension.lazy(
|
|
|
849
1114
|
})
|
|
850
1115
|
);
|
|
851
1116
|
var userMissionsSchema = /* @__PURE__ */ extension.lazy(
|
|
852
|
-
() =>
|
|
1117
|
+
() => z4__namespace.pipe(
|
|
853
1118
|
extension.wire({
|
|
854
1119
|
missions: nullableList(
|
|
855
1120
|
extension.wire({
|
|
856
|
-
id:
|
|
857
|
-
mission_id:
|
|
858
|
-
mission_name:
|
|
1121
|
+
id: z4__namespace.string(),
|
|
1122
|
+
mission_id: z4__namespace.string(),
|
|
1123
|
+
mission_name: z4__namespace._default(z4__namespace.string(), ""),
|
|
859
1124
|
current_progress: integerText(),
|
|
860
1125
|
target_value: integerText(),
|
|
861
|
-
progress_percentage:
|
|
1126
|
+
progress_percentage: z4__namespace.number(),
|
|
862
1127
|
status: openUnion(USER_MISSION_STATUSES),
|
|
863
1128
|
reward_type: openUnion(REWARD_TYPES),
|
|
864
1129
|
reward_value: minorUnits(),
|
|
@@ -867,7 +1132,7 @@ var userMissionsSchema = /* @__PURE__ */ extension.lazy(
|
|
|
867
1132
|
})
|
|
868
1133
|
)
|
|
869
1134
|
}),
|
|
870
|
-
|
|
1135
|
+
z4__namespace.transform((data) => data.missions)
|
|
871
1136
|
)
|
|
872
1137
|
);
|
|
873
1138
|
function createMissionsApi(transport) {
|
|
@@ -897,25 +1162,25 @@ function createMissionsApi(transport) {
|
|
|
897
1162
|
}
|
|
898
1163
|
var DEFAULT_PER_PAGE = 20;
|
|
899
1164
|
var HISTORY_PATH = "/referrals/history";
|
|
900
|
-
var count2 = () =>
|
|
901
|
-
var money3 = () =>
|
|
902
|
-
|
|
903
|
-
|
|
1165
|
+
var count2 = () => z4__namespace._default(z4__namespace.number().check(z4__namespace.refine((value) => Number.isSafeInteger(value) && value >= 0, "invalid counter")), 0);
|
|
1166
|
+
var money3 = () => z4__namespace.pipe(
|
|
1167
|
+
z4__namespace.nullish(extension.wire({ minor_units: minorUnits(), currency: z4__namespace._default(currencyOrEmpty(), "") })),
|
|
1168
|
+
z4__namespace.transform(
|
|
904
1169
|
(value) => value == null ? null : { amount: value.minorUnits, currency: value.currency }
|
|
905
1170
|
)
|
|
906
1171
|
);
|
|
907
|
-
var rulesSchema = () =>
|
|
908
|
-
|
|
1172
|
+
var rulesSchema = () => z4__namespace.pipe(
|
|
1173
|
+
z4__namespace.nullish(
|
|
909
1174
|
extension.wire({
|
|
910
1175
|
reward: money3(),
|
|
911
1176
|
minimum_real_net_loss: money3(),
|
|
912
1177
|
referee_window_days: count2(),
|
|
913
1178
|
hold_hours: count2(),
|
|
914
|
-
wagering_multiplier:
|
|
1179
|
+
wagering_multiplier: z4__namespace._default(z4__namespace.string(), ""),
|
|
915
1180
|
maximum_conversion: money3()
|
|
916
1181
|
})
|
|
917
1182
|
),
|
|
918
|
-
|
|
1183
|
+
z4__namespace.transform((rules) => {
|
|
919
1184
|
if (rules == null || rules.reward === null || rules.minimumRealNetLoss === null) return null;
|
|
920
1185
|
return {
|
|
921
1186
|
reward: rules.reward,
|
|
@@ -928,12 +1193,12 @@ var rulesSchema = () => z2__namespace.pipe(
|
|
|
928
1193
|
})
|
|
929
1194
|
);
|
|
930
1195
|
var infoSchema = /* @__PURE__ */ extension.lazy(
|
|
931
|
-
() =>
|
|
1196
|
+
() => z4__namespace.pipe(
|
|
932
1197
|
extension.wire({
|
|
933
|
-
enabled:
|
|
1198
|
+
enabled: z4__namespace._default(z4__namespace.boolean(), false),
|
|
934
1199
|
referral_code: optionalText(),
|
|
935
1200
|
rules: rulesSchema(),
|
|
936
|
-
totals:
|
|
1201
|
+
totals: z4__namespace._default(
|
|
937
1202
|
extension.wire({
|
|
938
1203
|
registered: count2(),
|
|
939
1204
|
deposited: count2(),
|
|
@@ -946,7 +1211,7 @@ var infoSchema = /* @__PURE__ */ extension.lazy(
|
|
|
946
1211
|
{ registered: 0, deposited: 0, inHold: 0, paid: 0, notEligible: 0, expired: 0, cancelled: 0 }
|
|
947
1212
|
)
|
|
948
1213
|
}),
|
|
949
|
-
|
|
1214
|
+
z4__namespace.transform(
|
|
950
1215
|
({ enabled, referralCode, rules, totals }) => ({ enabled, code: referralCode, rules, totals })
|
|
951
1216
|
)
|
|
952
1217
|
)
|
|
@@ -955,16 +1220,16 @@ function remainingOf(target, loss) {
|
|
|
955
1220
|
const missing = BigInt(target.amount) - BigInt(loss.amount);
|
|
956
1221
|
return { amount: missing > 0n ? Number(missing) : 0, currency: target.currency };
|
|
957
1222
|
}
|
|
958
|
-
var progressSchema = () =>
|
|
959
|
-
|
|
1223
|
+
var progressSchema = () => z4__namespace.pipe(
|
|
1224
|
+
z4__namespace.nullish(
|
|
960
1225
|
extension.wire({
|
|
961
|
-
deposit_done:
|
|
1226
|
+
deposit_done: z4__namespace._default(z4__namespace.boolean(), false),
|
|
962
1227
|
real_net_loss: money3(),
|
|
963
1228
|
target: money3(),
|
|
964
1229
|
remaining: money3()
|
|
965
1230
|
})
|
|
966
1231
|
),
|
|
967
|
-
|
|
1232
|
+
z4__namespace.transform((progress) => {
|
|
968
1233
|
if (progress == null || progress.target === null) return null;
|
|
969
1234
|
const { target } = progress;
|
|
970
1235
|
const realNetLoss = progress.realNetLoss ?? { amount: 0, currency: target.currency };
|
|
@@ -981,9 +1246,9 @@ function statusOf(playerStatus, legacy) {
|
|
|
981
1246
|
if (playerStatus !== null) return playerStatus.replace(/^CAMPAIGN_REFERRAL_STATUS_/, "").toLowerCase();
|
|
982
1247
|
return LEGACY_STATUS[(legacy ?? "").toUpperCase()] ?? "registered";
|
|
983
1248
|
}
|
|
984
|
-
var referralSchema = () =>
|
|
1249
|
+
var referralSchema = () => z4__namespace.pipe(
|
|
985
1250
|
extension.wire({
|
|
986
|
-
id:
|
|
1251
|
+
id: z4__namespace.string(),
|
|
987
1252
|
referee_name: optionalText(),
|
|
988
1253
|
status: optionalText(),
|
|
989
1254
|
player_status: optionalText(),
|
|
@@ -991,7 +1256,7 @@ var referralSchema = () => z2__namespace.pipe(
|
|
|
991
1256
|
deadline_at: optionalTimestamp(),
|
|
992
1257
|
progress: progressSchema()
|
|
993
1258
|
}),
|
|
994
|
-
|
|
1259
|
+
z4__namespace.transform(
|
|
995
1260
|
(r) => ({
|
|
996
1261
|
id: r.id,
|
|
997
1262
|
refereeName: r.refereeName,
|
|
@@ -1006,7 +1271,11 @@ var historySchema = /* @__PURE__ */ extension.lazy(
|
|
|
1006
1271
|
() => extension.wire({
|
|
1007
1272
|
referral_code: optionalText(),
|
|
1008
1273
|
referrals: nullableList(referralSchema()),
|
|
1009
|
-
|
|
1274
|
+
// A nil pointer (`null`) reads as absent, like an omitted pagination.
|
|
1275
|
+
pagination: z4__namespace.pipe(
|
|
1276
|
+
z4__namespace.nullish(extension.wire({ page: count2(), limit: count2(), total_items: count2() })),
|
|
1277
|
+
z4__namespace.transform((value) => value ?? void 0)
|
|
1278
|
+
)
|
|
1010
1279
|
})
|
|
1011
1280
|
);
|
|
1012
1281
|
var positiveInt = (value, fallback) => typeof value === "number" && Number.isSafeInteger(value) && value >= 1 ? value : fallback;
|
|
@@ -1046,12 +1315,12 @@ function createReferralsApi(transport) {
|
|
|
1046
1315
|
}
|
|
1047
1316
|
var HTTP_URL = "Expected an absolute http(s) URL";
|
|
1048
1317
|
var sessionSchema2 = /* @__PURE__ */ extension.lazy(
|
|
1049
|
-
() =>
|
|
1318
|
+
() => z4__namespace.pipe(
|
|
1050
1319
|
extension.wire({
|
|
1051
1320
|
// The separate token only exists on the wire: the schema declares it (strict contract) and the output drops it.
|
|
1052
|
-
operator_token:
|
|
1053
|
-
launch_url:
|
|
1054
|
-
|
|
1321
|
+
operator_token: z4__namespace.string(),
|
|
1322
|
+
launch_url: z4__namespace.string().check(
|
|
1323
|
+
z4__namespace.refine(
|
|
1055
1324
|
(value) => {
|
|
1056
1325
|
try {
|
|
1057
1326
|
const { protocol } = new URL(value);
|
|
@@ -1063,10 +1332,10 @@ var sessionSchema2 = /* @__PURE__ */ extension.lazy(
|
|
|
1063
1332
|
{ message: HTTP_URL }
|
|
1064
1333
|
)
|
|
1065
1334
|
),
|
|
1066
|
-
expires_in_seconds:
|
|
1335
|
+
expires_in_seconds: z4__namespace.number().check(z4__namespace.refine((n) => Number.isFinite(n) && n > 0, { message: "Esperava > 0" }))
|
|
1067
1336
|
}),
|
|
1068
1337
|
// The clock is read when the response is interpreted (= moment of the response).
|
|
1069
|
-
|
|
1338
|
+
z4__namespace.transform(({ launchUrl, expiresInSeconds }) => ({
|
|
1070
1339
|
launchUrl,
|
|
1071
1340
|
expiresInSeconds,
|
|
1072
1341
|
expiresAt: Date.now() + expiresInSeconds * 1e3
|
|
@@ -1097,7 +1366,8 @@ function createIgaming(client) {
|
|
|
1097
1366
|
missions: createMissionsApi(transport),
|
|
1098
1367
|
loyalty: createLoyaltyApi(transport),
|
|
1099
1368
|
referrals: createReferralsApi(transport),
|
|
1100
|
-
sportsbook: createSportsbookApi(transport)
|
|
1369
|
+
sportsbook: createSportsbookApi(transport),
|
|
1370
|
+
bets: createBetsApi(transport)
|
|
1101
1371
|
};
|
|
1102
1372
|
if (typeof extension__namespace.registerProductClient !== "function") {
|
|
1103
1373
|
throw new sdk.EnginexError({
|