@getenginex/sdk-igaming 0.0.0-stage → 0.6.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 +179 -0
- package/LICENSE +202 -0
- package/README.md +110 -2
- package/dist/first-frame/index.cjs +136 -0
- package/dist/first-frame/index.cjs.map +1 -0
- package/dist/first-frame/index.d.cts +135 -0
- package/dist/first-frame/index.d.ts +135 -0
- package/dist/first-frame/index.js +134 -0
- package/dist/first-frame/index.js.map +1 -0
- package/dist/index.cjs +1046 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1588 -0
- package/dist/index.d.ts +1588 -0
- package/dist/index.js +1025 -0
- package/dist/index.js.map +1 -0
- package/dist/query/index.cjs +84 -0
- package/dist/query/index.cjs.map +1 -0
- package/dist/query/index.d.cts +103 -0
- package/dist/query/index.d.ts +103 -0
- package/dist/query/index.js +81 -0
- package/dist/query/index.js.map +1 -0
- package/dist/testing/index.cjs +743 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +75 -0
- package/dist/testing/index.d.ts +75 -0
- package/dist/testing/index.js +740 -0
- package/dist/testing/index.js.map +1 -0
- package/first-frame/package.json +5 -0
- package/package.json +159 -3
- package/query/package.json +5 -0
- package/testing/package.json +5 -0
|
@@ -0,0 +1,743 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var testing = require('@getenginex/sdk/testing');
|
|
4
|
+
|
|
5
|
+
// src/testing/bonus.ts
|
|
6
|
+
var uuid = (n) => `c0000000-0000-4000-8000-${String(n).padStart(12, "0")}`;
|
|
7
|
+
var WINDOW = { starts_at: "2026-09-01T03:00:00Z", ends_at: "2027-01-01T03:00:00Z" };
|
|
8
|
+
var brl = (minor) => ({ amount: String(minor), currency: "BRL" });
|
|
9
|
+
var TERMS_DIGEST = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
|
|
10
|
+
function offer(n, fields, texts) {
|
|
11
|
+
const [displayName, description] = texts;
|
|
12
|
+
return {
|
|
13
|
+
campaign_id: uuid(n),
|
|
14
|
+
campaign_version_id: uuid(100 + n),
|
|
15
|
+
publication_id: uuid(200 + n),
|
|
16
|
+
product_scope: "PRODUCT_SCOPE_CASINO",
|
|
17
|
+
timezone: "America/Sao_Paulo",
|
|
18
|
+
enrollment_window: WINDOW,
|
|
19
|
+
qualification_window: WINDOW,
|
|
20
|
+
publication_starts_at: WINDOW.starts_at,
|
|
21
|
+
publication_ends_at: WINDOW.ends_at,
|
|
22
|
+
...fields,
|
|
23
|
+
content: {
|
|
24
|
+
default_locale: "pt-BR",
|
|
25
|
+
supported_locales: ["pt-BR"],
|
|
26
|
+
localized_content: [
|
|
27
|
+
{
|
|
28
|
+
locale: "pt-BR",
|
|
29
|
+
display_name: displayName,
|
|
30
|
+
description,
|
|
31
|
+
terms: `Termos de "${displayName}": v\xE1lido uma vez por jogador.`,
|
|
32
|
+
terms_revision: "v1"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
var WELCOME = offer(
|
|
39
|
+
1,
|
|
40
|
+
{
|
|
41
|
+
claim_window: WINDOW,
|
|
42
|
+
entry_policy: { code: "ENTRY_POLICY_CODE_OPT_IN", version: 1 },
|
|
43
|
+
reward_claim_policy: { code: "REWARD_CLAIM_POLICY_CODE_PLAYER_CLAIM", version: 1 },
|
|
44
|
+
qualification: { version: 1, immediate: {} },
|
|
45
|
+
reward: {
|
|
46
|
+
reward_key: "welcome-credit",
|
|
47
|
+
reward_kind: "REWARD_KIND_BALANCE_CREDIT",
|
|
48
|
+
reward_kind_version: 1,
|
|
49
|
+
execution_profile_code: "EXECUTION_PROFILE_CODE_ENGINE_MANAGED_BALANCE",
|
|
50
|
+
execution_profile_version: 1,
|
|
51
|
+
balance_credit: {
|
|
52
|
+
fixed_amount: { amount: brl(5e3) },
|
|
53
|
+
balance_class: "BALANCE_CLASS_RESTRICTED",
|
|
54
|
+
proceeds_class: "PROCEEDS_CLASS_RESTRICTED_UNTIL_WAGERING_COMPLETION",
|
|
55
|
+
validity: { duration_from_grant: { duration: "604800s" } }
|
|
56
|
+
},
|
|
57
|
+
wagering_policy: {
|
|
58
|
+
version: 1,
|
|
59
|
+
multiplier: {
|
|
60
|
+
requirement_basis: "REQUIREMENT_BASIS_GRANTED_BALANCE",
|
|
61
|
+
multiplier: { decimal: "30" },
|
|
62
|
+
contribution_rates: [{ casino: { category_codes: ["slots"] }, rate: { basis_points: 1e4 } }],
|
|
63
|
+
rounding: "ROUNDING_MODE_HALF_UP"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
stacking_policy: { version: 1, exclusive_in_group: { stacking_group_key: "welcome" } }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
["B\xF4nus de boas-vindas", "R$ 50 em b\xF4nus para jogar slots, com rollover de 30x."]
|
|
70
|
+
);
|
|
71
|
+
var FREE_SPINS = offer(
|
|
72
|
+
2,
|
|
73
|
+
{
|
|
74
|
+
entry_policy: { code: "ENTRY_POLICY_CODE_AUTOMATIC", version: 1 },
|
|
75
|
+
reward_claim_policy: { code: "REWARD_CLAIM_POLICY_CODE_AUTOMATIC", version: 1 },
|
|
76
|
+
qualification: {
|
|
77
|
+
version: 1,
|
|
78
|
+
activity_aggregate: {
|
|
79
|
+
basis: "BASIS_SETTLED_STAKE",
|
|
80
|
+
product_scope: "PRODUCT_SCOPE_CASINO",
|
|
81
|
+
currency: "BRL",
|
|
82
|
+
window: "604800s",
|
|
83
|
+
timezone: "America/Sao_Paulo",
|
|
84
|
+
casino: { category_codes: ["slots"] }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
reward: {
|
|
88
|
+
reward_key: "weekly-spins",
|
|
89
|
+
reward_kind: "REWARD_KIND_CASINO_FREE_SPINS",
|
|
90
|
+
reward_kind_version: 1,
|
|
91
|
+
execution_profile_code: "EXECUTION_PROFILE_CODE_PROVIDER_ENTITLEMENT",
|
|
92
|
+
execution_profile_version: 1,
|
|
93
|
+
casino_free_spins: {
|
|
94
|
+
provider_code: "pragmatic-play",
|
|
95
|
+
casino_scope: { game_ids: ["mock-game-1"] },
|
|
96
|
+
quantity: 50,
|
|
97
|
+
denomination: brl(20),
|
|
98
|
+
currency: "BRL",
|
|
99
|
+
grant_window: WINDOW,
|
|
100
|
+
proceeds_class: "PROCEEDS_CLASS_REAL"
|
|
101
|
+
},
|
|
102
|
+
wagering_policy: { version: 1, none: {} }
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
["50 giros gr\xE1tis", "Aposte R$ 100 em slots na semana e ganhe 50 giros no Gates of Olympus."]
|
|
106
|
+
);
|
|
107
|
+
var PROMO = offer(
|
|
108
|
+
3,
|
|
109
|
+
{
|
|
110
|
+
entry_policy: { code: "ENTRY_POLICY_CODE_PROMO_CODE", version: 1 },
|
|
111
|
+
reward_claim_policy: { code: "REWARD_CLAIM_POLICY_CODE_AUTOMATIC", version: 1 },
|
|
112
|
+
qualification: {
|
|
113
|
+
version: 1,
|
|
114
|
+
deposit_settled: {
|
|
115
|
+
currency: "BRL",
|
|
116
|
+
eligible_method_codes: ["pix"],
|
|
117
|
+
first_deposit_policy: "FIRST_DEPOSIT_POLICY_REQUIRED",
|
|
118
|
+
minimum_settled_net_amount: brl(2e3),
|
|
119
|
+
amount_basis: "DEPOSIT_AMOUNT_BASIS_SETTLED_NET_DEPOSIT"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
reward: {
|
|
123
|
+
reward_key: "first-deposit",
|
|
124
|
+
reward_kind: "REWARD_KIND_BALANCE_CREDIT",
|
|
125
|
+
reward_kind_version: 1,
|
|
126
|
+
execution_profile_code: "EXECUTION_PROFILE_CODE_ENGINE_MANAGED_BALANCE",
|
|
127
|
+
execution_profile_version: 1,
|
|
128
|
+
balance_credit: {
|
|
129
|
+
percent_of_source_amount: {
|
|
130
|
+
percentage: { basis_points: 1e4 },
|
|
131
|
+
rounding: "ROUNDING_MODE_FLOOR",
|
|
132
|
+
maximum_reward: brl(5e4)
|
|
133
|
+
},
|
|
134
|
+
balance_class: "BALANCE_CLASS_RESTRICTED",
|
|
135
|
+
proceeds_class: "PROCEEDS_CLASS_RESTRICTED_UNTIL_WAGERING_COMPLETION",
|
|
136
|
+
validity: { no_expiry: {} }
|
|
137
|
+
},
|
|
138
|
+
wagering_policy: {
|
|
139
|
+
version: 1,
|
|
140
|
+
multiplier: {
|
|
141
|
+
requirement_basis: "REQUIREMENT_BASIS_GRANTED_BALANCE",
|
|
142
|
+
multiplier: { decimal: "20" },
|
|
143
|
+
rounding: "ROUNDING_MODE_HALF_UP"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
stacking_policy: { version: 1, exclusive_in_group: { stacking_group_key: "welcome" } }
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
["Primeiro dep\xF3sito em dobro", "100% do primeiro dep\xF3sito PIX (m\xEDnimo R$ 20) at\xE9 R$ 500."]
|
|
150
|
+
);
|
|
151
|
+
var OFFERS = [WELCOME, FREE_SPINS, PROMO];
|
|
152
|
+
var CATALOG = [WELCOME, FREE_SPINS];
|
|
153
|
+
var PROMO_CODES = { BEMVINDO: PROMO };
|
|
154
|
+
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
155
|
+
var NIL = "00000000-0000-0000-0000-000000000000";
|
|
156
|
+
function bodyOf(req) {
|
|
157
|
+
return typeof req.body === "object" && req.body !== null ? req.body : {};
|
|
158
|
+
}
|
|
159
|
+
function badId(req, param) {
|
|
160
|
+
const value = req.params?.[param] ?? "";
|
|
161
|
+
return UUID.test(value) && value !== NIL ? void 0 : testing.fail(400, "INVALID_ARGUMENT", `${param} must be a valid non-zero UUID`);
|
|
162
|
+
}
|
|
163
|
+
function cursorPage(req, key, items) {
|
|
164
|
+
const q = req.url.searchParams;
|
|
165
|
+
let size = 20;
|
|
166
|
+
if (q.has("page_size")) {
|
|
167
|
+
size = Number(q.get("page_size"));
|
|
168
|
+
if (!Number.isInteger(size) || size <= 0)
|
|
169
|
+
return testing.fail(400, "INVALID_ARGUMENT", "page_size must be a positive integer");
|
|
170
|
+
}
|
|
171
|
+
let start = 0;
|
|
172
|
+
if (q.has("cursor")) {
|
|
173
|
+
const match = /^mock-cursor-(\d+)$/.exec(q.get("cursor") ?? "");
|
|
174
|
+
if (!match) return testing.fail(400, "INVALID_ARGUMENT", "invalid cursor");
|
|
175
|
+
start = Number(match[1]);
|
|
176
|
+
}
|
|
177
|
+
const page = items.slice(start, start + size);
|
|
178
|
+
const data = {};
|
|
179
|
+
if (page.length > 0) data[key] = page;
|
|
180
|
+
if (start + size < items.length) data.next_cursor = `mock-cursor-${start + size}`;
|
|
181
|
+
return testing.ok(data);
|
|
182
|
+
}
|
|
183
|
+
function localized(o, locale) {
|
|
184
|
+
const content = o.content;
|
|
185
|
+
return content.localized_content.find((c) => c.locale === locale) ?? content.localized_content.find((c) => c.locale === content.default_locale);
|
|
186
|
+
}
|
|
187
|
+
function createBonusRoutes() {
|
|
188
|
+
const now = () => (/* @__PURE__ */ new Date()).toISOString();
|
|
189
|
+
let seq = 0;
|
|
190
|
+
const participations = [
|
|
191
|
+
participation(uuid(900), FREE_SPINS, { completed: { completed_at: "2026-09-20T15:00:00Z" } })
|
|
192
|
+
];
|
|
193
|
+
const replays = /* @__PURE__ */ new Map();
|
|
194
|
+
const redeemed = /* @__PURE__ */ new Map();
|
|
195
|
+
function participation(id, o, state, termsAcceptance) {
|
|
196
|
+
const snapshot = { reward: o.reward, content: o.content };
|
|
197
|
+
if (termsAcceptance) snapshot.terms_acceptance = termsAcceptance;
|
|
198
|
+
return {
|
|
199
|
+
id,
|
|
200
|
+
campaign_id: o.campaign_id,
|
|
201
|
+
campaign_version_id: o.campaign_version_id,
|
|
202
|
+
reward_key: o.reward.reward_key,
|
|
203
|
+
qualification_snapshot: o.qualification,
|
|
204
|
+
...state,
|
|
205
|
+
snapshot
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function acceptance(body) {
|
|
209
|
+
const t = body.terms_acceptance;
|
|
210
|
+
if (typeof t !== "object" || t === null) return void 0;
|
|
211
|
+
const { locale, terms_revision } = t;
|
|
212
|
+
return { locale, terms_revision, terms_digest_sha256_hex: TERMS_DIGEST, accepted_at: now() };
|
|
213
|
+
}
|
|
214
|
+
const idempotent = (route, handler) => async (req) => {
|
|
215
|
+
const key = req.headers.get("idempotency-key") ?? "";
|
|
216
|
+
if (key === "" || key !== key.trim()) {
|
|
217
|
+
return testing.fail(400, "INVALID_ARGUMENT", "Idempotency-Key must be normalized and non-empty");
|
|
218
|
+
}
|
|
219
|
+
const id = `${route} ${req.url.pathname} ${key}`;
|
|
220
|
+
const payload = JSON.stringify(req.body ?? null);
|
|
221
|
+
const hit = replays.get(id);
|
|
222
|
+
if (hit && hit.payload !== payload)
|
|
223
|
+
return testing.fail(422, "PAYLOAD_MISMATCH", "payload does not match original request");
|
|
224
|
+
if (hit) return new Response(hit.text, { status: hit.status, headers: { "content-type": "application/json" } });
|
|
225
|
+
const res = await handler(req);
|
|
226
|
+
if (res.status < 500 && res.status !== 429) {
|
|
227
|
+
replays.set(id, { payload, status: res.status, text: await res.clone().text() });
|
|
228
|
+
}
|
|
229
|
+
return res;
|
|
230
|
+
};
|
|
231
|
+
const created = (p) => testing.ok({ participation: p }, void 0, 201);
|
|
232
|
+
const notFound = (what) => testing.fail(404, "BONUS_NOT_FOUND", `${what} not found`);
|
|
233
|
+
const notEligible = (message) => testing.fail(500, "BONUS_NOT_ELIGIBLE", message);
|
|
234
|
+
const joined = (o) => participations.some((p) => p.campaign_id === o.campaign_id);
|
|
235
|
+
const add = (p) => {
|
|
236
|
+
participations.unshift(p);
|
|
237
|
+
return p;
|
|
238
|
+
};
|
|
239
|
+
const nextId = () => uuid(1e3 + ++seq);
|
|
240
|
+
return {
|
|
241
|
+
"GET /api/v1/bonus-campaigns/public-offers": (req) => cursorPage(req, "offers", CATALOG),
|
|
242
|
+
"GET /api/v1/bonus-campaigns/offers": (req) => cursorPage(req, "offers", CATALOG),
|
|
243
|
+
"GET /api/v1/bonus-campaigns/offers/:campaignId": (req) => {
|
|
244
|
+
const bad = badId(req, "campaignId");
|
|
245
|
+
if (bad) return bad;
|
|
246
|
+
const o = CATALOG.find((x) => x.campaign_id === req.params?.campaignId);
|
|
247
|
+
return o ? testing.ok({ offer: o }) : notFound("campaign offer");
|
|
248
|
+
},
|
|
249
|
+
"POST /api/v1/bonus-campaigns/offers/:campaignId/opt-in": idempotent("opt-in", (req) => {
|
|
250
|
+
const bad = badId(req, "campaignId");
|
|
251
|
+
if (bad) return bad;
|
|
252
|
+
const body = bodyOf(req);
|
|
253
|
+
if (req.body === void 0) return testing.fail(400, "INVALID_ARGUMENT", "request body is required");
|
|
254
|
+
const o = OFFERS.find((x) => x.campaign_id === req.params?.campaignId);
|
|
255
|
+
if (!o) return notFound("campaign offer");
|
|
256
|
+
if (o.entry_policy.code !== "ENTRY_POLICY_CODE_OPT_IN")
|
|
257
|
+
return notEligible("campaign does not accept opt-in");
|
|
258
|
+
if (body.campaign_version_id !== o.campaign_version_id) {
|
|
259
|
+
return testing.fail(422, "FAILED_PRECONDITION", "campaign version is not the published one");
|
|
260
|
+
}
|
|
261
|
+
if (joined(o)) return testing.fail(409, "ALREADY_EXISTS", "player already participates in this campaign");
|
|
262
|
+
return created(add(participation(nextId(), o, { qualified: { qualified_at: now() } }, acceptance(body))));
|
|
263
|
+
}),
|
|
264
|
+
"POST /api/v1/bonus-campaigns/participations/:participationId/claim": idempotent("claim", (req) => {
|
|
265
|
+
const bad = badId(req, "participationId");
|
|
266
|
+
if (bad) return bad;
|
|
267
|
+
const p = participations.find((x) => x.id === req.params?.participationId);
|
|
268
|
+
if (!p) return notFound("participation");
|
|
269
|
+
if (p.completed) return testing.fail(409, "BONUS_ALREADY_CLAIMED", "reward already claimed");
|
|
270
|
+
const o = OFFERS.find((x) => x.campaign_id === p.campaign_id);
|
|
271
|
+
if (o.reward_claim_policy.code !== "REWARD_CLAIM_POLICY_CODE_PLAYER_CLAIM" || !p.qualified) {
|
|
272
|
+
return notEligible("participation is not claimable");
|
|
273
|
+
}
|
|
274
|
+
delete p.qualified;
|
|
275
|
+
p.completed = { completed_at: now() };
|
|
276
|
+
return testing.ok({ participation: p });
|
|
277
|
+
}),
|
|
278
|
+
"POST /api/v1/bonus-campaigns/promo-codes/resolve": (req) => {
|
|
279
|
+
const { plaintext, locale } = bodyOf(req);
|
|
280
|
+
if (typeof plaintext !== "string" || plaintext.trim() === "") {
|
|
281
|
+
return testing.fail(400, "INVALID_ARGUMENT", "invalid typed campaign request");
|
|
282
|
+
}
|
|
283
|
+
const o = PROMO_CODES[plaintext.trim().toUpperCase()];
|
|
284
|
+
if (!o) return notFound("promo code");
|
|
285
|
+
return testing.ok({ offer: o, localized_content: localized(o, typeof locale === "string" ? locale : "") });
|
|
286
|
+
},
|
|
287
|
+
// Without the transport's idempotency middleware (the body holds a secret): the handler only requires the
|
|
288
|
+
// header and passes the key on to the bonus service, which does the command's idempotency — here, the same
|
|
289
|
+
// key returns the participation created by it.
|
|
290
|
+
"POST /api/v1/bonus-campaigns/promo-codes/redeem": (req) => {
|
|
291
|
+
const key = req.headers.get("idempotency-key") ?? "";
|
|
292
|
+
if (key === "" || key !== key.trim()) {
|
|
293
|
+
return testing.fail(400, "INVALID_ARGUMENT", "Idempotency-Key must be normalized and non-empty");
|
|
294
|
+
}
|
|
295
|
+
const body = bodyOf(req);
|
|
296
|
+
const plaintext = typeof body.plaintext === "string" ? body.plaintext.trim().toUpperCase() : "";
|
|
297
|
+
if (plaintext === "") return testing.fail(400, "INVALID_ARGUMENT", "invalid typed campaign request");
|
|
298
|
+
const o = PROMO_CODES[plaintext];
|
|
299
|
+
if (!o) return notFound("promo code");
|
|
300
|
+
const previous = participations.find((p2) => p2.id === redeemed.get(key));
|
|
301
|
+
if (previous) return created(previous);
|
|
302
|
+
if (joined(o)) return testing.fail(409, "BONUS_ALREADY_CLAIMED", "promo code already redeemed");
|
|
303
|
+
const p = add(participation(nextId(), o, { enrolled: {} }, acceptance(body)));
|
|
304
|
+
redeemed.set(key, String(p.id));
|
|
305
|
+
return created(p);
|
|
306
|
+
},
|
|
307
|
+
"GET /api/v1/bonus-campaigns/participations": (req) => cursorPage(req, "participations", participations),
|
|
308
|
+
"GET /api/v1/bonus-campaigns/participations/:participationId": (req) => {
|
|
309
|
+
const bad = badId(req, "participationId");
|
|
310
|
+
if (bad) return bad;
|
|
311
|
+
const p = participations.find((x) => x.id === req.params?.participationId);
|
|
312
|
+
return p ? testing.ok({ participation: p }) : notFound("participation");
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
var PROVIDERS = [
|
|
317
|
+
["pragmatic-play", "Pragmatic Play"],
|
|
318
|
+
["evolution", "Evolution"],
|
|
319
|
+
["spribe", "Spribe"]
|
|
320
|
+
];
|
|
321
|
+
var CATEGORIES = [
|
|
322
|
+
["slots", "Slots", "slot-machine", 1],
|
|
323
|
+
["live", "Ao vivo", "live", 2],
|
|
324
|
+
["crash", "Crash", "rocket", 3]
|
|
325
|
+
];
|
|
326
|
+
var GAMES = [
|
|
327
|
+
["Gates of Olympus", "pragmatic-play", "slots", "slot", false, true, false, true, 96.5, "high"],
|
|
328
|
+
["Sweet Bonanza", "pragmatic-play", "slots", "slot", false, true, false, true, 96.48, "medium"],
|
|
329
|
+
["Sugar Rush 1000", "pragmatic-play", "slots", "slot", true, false, false, true, 96.53, "high"],
|
|
330
|
+
["Lightning Roulette", "evolution", "live", "roulette", false, true, true, false, 97.3, "low"],
|
|
331
|
+
["Crazy Time", "evolution", "live", "game_show", true, false, true, false, 96.08, "high"],
|
|
332
|
+
["Blackjack Classic", "evolution", "live", "blackjack", false, false, true, false, 99.29, "low"],
|
|
333
|
+
["Aviator", "spribe", "crash", "crash", false, true, false, true, 97, "medium"]
|
|
334
|
+
].map(([name, provider, category, type, isNew, popular, live, demo, rtp, volatility], i) => ({
|
|
335
|
+
id: `mock-game-${i + 1}`,
|
|
336
|
+
name,
|
|
337
|
+
provider,
|
|
338
|
+
category,
|
|
339
|
+
type,
|
|
340
|
+
thumbnail: `https://cdn.mock.local/games/mock-game-${i + 1}.webp`,
|
|
341
|
+
is_new: isNew,
|
|
342
|
+
is_popular: popular,
|
|
343
|
+
is_live: live,
|
|
344
|
+
demo_available: demo,
|
|
345
|
+
rtp,
|
|
346
|
+
volatility,
|
|
347
|
+
priority: i + 1
|
|
348
|
+
}));
|
|
349
|
+
var HISTORY = [
|
|
350
|
+
["mock-game-1", "mock-round-1", "win", 7e3, "2026-09-02T12:01:00Z"],
|
|
351
|
+
["mock-game-1", "mock-round-1", "bet", 2e3, "2026-09-02T12:00:00Z"],
|
|
352
|
+
["mock-game-7", "mock-round-0", "bet", 1e3, "2026-09-01T20:00:00Z"]
|
|
353
|
+
].map(([gameId, roundId, type, amount, createdAt], i) => ({
|
|
354
|
+
id: `mock-casino-tx-${3 - i}`,
|
|
355
|
+
game_id: gameId,
|
|
356
|
+
game_name: GAMES.find((g) => g.id === gameId)?.name,
|
|
357
|
+
round_id: roundId,
|
|
358
|
+
type,
|
|
359
|
+
amount: String(amount),
|
|
360
|
+
// the gateway sends int64 as text
|
|
361
|
+
currency: "BRL",
|
|
362
|
+
currency_decimal_places: 2,
|
|
363
|
+
created_at: createdAt
|
|
364
|
+
}));
|
|
365
|
+
var WINNERS = [
|
|
366
|
+
["Jo***", 15e5, "mock-game-5", "2026-09-28T20:00:00Z"],
|
|
367
|
+
["Ma***", 82e4, "mock-game-1", "2026-09-27T18:30:00Z"],
|
|
368
|
+
["Pe***", 455e3, "mock-game-7", "2026-09-26T22:10:00Z"],
|
|
369
|
+
["An***", 21e4, "mock-game-4", "2026-09-25T14:45:00Z"],
|
|
370
|
+
["***", 98e3, "mock-game-2", "2026-09-24T09:05:00Z"]
|
|
371
|
+
].map(([player, amount, gameId, wonAt]) => ({
|
|
372
|
+
player,
|
|
373
|
+
amount: String(amount),
|
|
374
|
+
currency: "BRL",
|
|
375
|
+
currency_decimal_places: 2,
|
|
376
|
+
game_id: gameId,
|
|
377
|
+
game_name: GAMES.find((g) => g.id === gameId)?.name,
|
|
378
|
+
won_at: wonAt
|
|
379
|
+
}));
|
|
380
|
+
function json(body, status = 200) {
|
|
381
|
+
return new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
|
|
382
|
+
}
|
|
383
|
+
function pageOf(req, items) {
|
|
384
|
+
const q = req.url.searchParams;
|
|
385
|
+
const page = Math.max(1, Number.parseInt(q.get("page") ?? "", 10) || 1);
|
|
386
|
+
const raw = Number.parseInt(q.get("limit") ?? "", 10);
|
|
387
|
+
const limit = raw >= 1 && raw <= 100 ? raw : 20;
|
|
388
|
+
return {
|
|
389
|
+
items: items.slice((page - 1) * limit, page * limit),
|
|
390
|
+
meta: { page, per_page: limit, total_pages: Math.ceil(items.length / limit), total_items: items.length }
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
var SORTS = {
|
|
394
|
+
popular: (a, b) => Number(b.is_popular) - Number(a.is_popular),
|
|
395
|
+
new: (a, b) => Number(b.is_new) - Number(a.is_new),
|
|
396
|
+
az: (a, b) => String(a.name).localeCompare(String(b.name))
|
|
397
|
+
};
|
|
398
|
+
function listGames(req) {
|
|
399
|
+
const q = req.url.searchParams;
|
|
400
|
+
const search = (q.get("search") ?? "").toLowerCase();
|
|
401
|
+
if (search.length > 100) return testing.fail(400, "INVALID_ARGUMENT", "search parameter too long");
|
|
402
|
+
const ids = (q.get("ids") ?? "").split(",").map((id) => id.trim()).filter(Boolean);
|
|
403
|
+
if (ids.length > 100) return testing.fail(400, "INVALID_ARGUMENT", "ids parameter too long");
|
|
404
|
+
const category = (q.get("category") ?? "").trim().toLowerCase();
|
|
405
|
+
const provider = q.get("provider") ?? "";
|
|
406
|
+
const games = GAMES.filter(
|
|
407
|
+
(g) => (!category || g.category === category) && (!provider || g.provider === provider) && (!search || String(g.name).toLowerCase().includes(search)) && (ids.length === 0 || ids.includes(String(g.id)))
|
|
408
|
+
);
|
|
409
|
+
const sort = SORTS[q.get("sort") ?? ""];
|
|
410
|
+
const { items, meta } = pageOf(req, sort ? [...games].sort(sort) : games);
|
|
411
|
+
return json({
|
|
412
|
+
success: true,
|
|
413
|
+
data: items,
|
|
414
|
+
availability: { status: "available", primary_provider_code: "pragmatic-play", missing: false },
|
|
415
|
+
meta
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
function launchLanguage(req, body) {
|
|
419
|
+
if (typeof body.language === "string" && body.language.trim() !== "") return body.language.trim();
|
|
420
|
+
return (req.headers.get("accept-language") ?? "").split(",")[0].split(";")[0].trim();
|
|
421
|
+
}
|
|
422
|
+
function createCasinoRoutes() {
|
|
423
|
+
const sessions = [
|
|
424
|
+
{
|
|
425
|
+
id: "mock-game-session-0",
|
|
426
|
+
game_id: "mock-game-1",
|
|
427
|
+
game_name: "Gates of Olympus",
|
|
428
|
+
provider: "pragmatic-play",
|
|
429
|
+
start_time: "2026-09-02T11:58:00Z",
|
|
430
|
+
total_bet: 2e3,
|
|
431
|
+
total_win: 7e3,
|
|
432
|
+
status: "SESSION_STATUS_ENDED"
|
|
433
|
+
}
|
|
434
|
+
];
|
|
435
|
+
let seq = 0;
|
|
436
|
+
return {
|
|
437
|
+
"GET /api/v1/games": listGames,
|
|
438
|
+
"GET /api/v1/games/categories": () => testing.ok(
|
|
439
|
+
CATEGORIES.map(([slug, name, icon, priority]) => ({
|
|
440
|
+
slug,
|
|
441
|
+
name,
|
|
442
|
+
icon,
|
|
443
|
+
game_count: GAMES.filter((g) => g.category === slug).length,
|
|
444
|
+
priority
|
|
445
|
+
}))
|
|
446
|
+
),
|
|
447
|
+
"GET /api/v1/games/providers": () => testing.ok(PROVIDERS.map(([id, name]) => ({ id, name, game_count: GAMES.filter((g) => g.provider === id).length }))),
|
|
448
|
+
"GET /api/v1/games/:gameId": (req) => {
|
|
449
|
+
const game = GAMES.find((g) => g.id === req.params?.gameId);
|
|
450
|
+
return game ? testing.ok(game) : testing.fail(404, "GAME_NOT_FOUND", "game not found");
|
|
451
|
+
},
|
|
452
|
+
"POST /api/v1/games/:gameId/launch": (req) => {
|
|
453
|
+
const game = GAMES.find((g) => g.id === req.params?.gameId);
|
|
454
|
+
if (!game) return testing.fail(404, "GAME_NOT_FOUND", "game not found");
|
|
455
|
+
const body = typeof req.body === "object" && req.body !== null ? req.body : {};
|
|
456
|
+
for (const s of sessions) if (s.status === "SESSION_STATUS_ACTIVE") s.status = "SESSION_STATUS_ENDED";
|
|
457
|
+
seq += 1;
|
|
458
|
+
const session = {
|
|
459
|
+
id: `mock-game-session-${seq}`,
|
|
460
|
+
game_id: game.id,
|
|
461
|
+
game_name: game.name,
|
|
462
|
+
provider: game.provider,
|
|
463
|
+
start_time: (/* @__PURE__ */ new Date()).toISOString(),
|
|
464
|
+
total_bet: 0,
|
|
465
|
+
total_win: 0,
|
|
466
|
+
status: "SESSION_STATUS_ACTIVE"
|
|
467
|
+
};
|
|
468
|
+
sessions.unshift(session);
|
|
469
|
+
const url = new URL(`https://games.mock.local/play/${String(game.id)}`);
|
|
470
|
+
url.searchParams.set("token", `mock-launch-token-${seq}`);
|
|
471
|
+
url.searchParams.set("lang", launchLanguage(req, body));
|
|
472
|
+
if (body.is_demo === true) url.searchParams.set("demo", "true");
|
|
473
|
+
return testing.ok({
|
|
474
|
+
session_id: session.id,
|
|
475
|
+
game_url: url.href,
|
|
476
|
+
launch_target: "iframe",
|
|
477
|
+
provider_code: game.provider,
|
|
478
|
+
expires_at: new Date(Date.now() + 36e5).toISOString().replace(/\.\d{3}Z$/, "Z")
|
|
479
|
+
});
|
|
480
|
+
},
|
|
481
|
+
"GET /api/v1/games/sessions": (req) => {
|
|
482
|
+
const { items, meta } = pageOf(req, sessions);
|
|
483
|
+
return testing.ok(items, meta);
|
|
484
|
+
},
|
|
485
|
+
"GET /api/v1/games/history": (req) => {
|
|
486
|
+
const { items, meta } = pageOf(req, HISTORY);
|
|
487
|
+
return testing.ok(items, meta);
|
|
488
|
+
},
|
|
489
|
+
"GET /api/v1/games/biggest-winners": (req) => {
|
|
490
|
+
const raw = Number.parseInt(req.url.searchParams.get("limit") ?? "", 10);
|
|
491
|
+
return testing.ok(WINNERS.slice(0, raw >= 1 ? raw : 10));
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
var POINT_VALUE_CENTS = 5;
|
|
496
|
+
function createLoyaltyRoutes() {
|
|
497
|
+
const state = { total: 5200, current: 1500, redeemed: 3700 };
|
|
498
|
+
return {
|
|
499
|
+
"GET /api/v1/loyalty": () => testing.ok({
|
|
500
|
+
total_points_earned: state.total,
|
|
501
|
+
current_points: state.current,
|
|
502
|
+
points_redeemed: state.redeemed,
|
|
503
|
+
current_tier: "gold",
|
|
504
|
+
tier_points: 1200,
|
|
505
|
+
lifetime_wagered: 125e4,
|
|
506
|
+
lifetime_deposited: 8e5,
|
|
507
|
+
tier_benefits_json: JSON.stringify({ cashback_percent: 5, perks: ["vip_support"] }),
|
|
508
|
+
tier_expires_at: "2027-01-01T00:00:00Z"
|
|
509
|
+
}),
|
|
510
|
+
"POST /api/v1/loyalty/redeem": (req) => {
|
|
511
|
+
const body = req.body ?? {};
|
|
512
|
+
const points = body.points;
|
|
513
|
+
if (typeof points !== "number" || !Number.isInteger(points) || points <= 0)
|
|
514
|
+
return testing.fail(400, "INVALID_ARGUMENT", "points must be greater than 0");
|
|
515
|
+
if (typeof body.redemption_type !== "string" || body.redemption_type === "")
|
|
516
|
+
return testing.fail(400, "INVALID_ARGUMENT", "redemption_type is required");
|
|
517
|
+
if (points > state.current) return testing.fail(422, "INSUFFICIENT_BALANCE", "insufficient loyalty points");
|
|
518
|
+
state.current -= points;
|
|
519
|
+
state.redeemed += points;
|
|
520
|
+
const bonus = body.redemption_type === "bonus";
|
|
521
|
+
return testing.ok({
|
|
522
|
+
success: true,
|
|
523
|
+
redeemed_points: points,
|
|
524
|
+
value: points * POINT_VALUE_CENTS,
|
|
525
|
+
currency: "BRL",
|
|
526
|
+
...bonus ? { bonus_id: `mock-loyalty-bonus-${state.redeemed}` } : {}
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
var EPOCH = "1970-01-01T00:00:00Z";
|
|
532
|
+
var MISSIONS = [
|
|
533
|
+
[
|
|
534
|
+
"Aposte R$ 100 hoje",
|
|
535
|
+
"daily",
|
|
536
|
+
"wager",
|
|
537
|
+
1e4,
|
|
538
|
+
"",
|
|
539
|
+
null,
|
|
540
|
+
"points",
|
|
541
|
+
50,
|
|
542
|
+
"2026-09-01T00:00:00Z",
|
|
543
|
+
"2026-12-31T23:59:59Z"
|
|
544
|
+
],
|
|
545
|
+
[
|
|
546
|
+
"Fa\xE7a 20 apostas na semana",
|
|
547
|
+
"weekly",
|
|
548
|
+
"bet_count",
|
|
549
|
+
20,
|
|
550
|
+
"slots",
|
|
551
|
+
null,
|
|
552
|
+
"free_spins",
|
|
553
|
+
10,
|
|
554
|
+
"2026-09-01T00:00:00Z",
|
|
555
|
+
EPOCH
|
|
556
|
+
],
|
|
557
|
+
["Jogue Aviator", "event", "play_game", 5, "", ["mock-game-7"], "bonus", 500, EPOCH, EPOCH],
|
|
558
|
+
["Primeiro dep\xF3sito do m\xEAs", "permanent", "deposit", 5e3, "", null, "free_bet", 1e3, EPOCH, EPOCH]
|
|
559
|
+
].map(([name, type, objective, target, category, games, rewardType, rewardValue, from, to], i) => ({
|
|
560
|
+
id: `mock-mission-${i + 1}`,
|
|
561
|
+
name,
|
|
562
|
+
description: `Descri\xE7\xE3o da miss\xE3o ${i + 1}`,
|
|
563
|
+
mission_type: type,
|
|
564
|
+
objective_type: objective,
|
|
565
|
+
target_value: target,
|
|
566
|
+
target_game_category: category,
|
|
567
|
+
target_games: games === null ? null : [...games],
|
|
568
|
+
reward_type: rewardType,
|
|
569
|
+
reward_value: rewardValue,
|
|
570
|
+
valid_from: from,
|
|
571
|
+
valid_to: to
|
|
572
|
+
}));
|
|
573
|
+
var USER_MISSIONS = [
|
|
574
|
+
{
|
|
575
|
+
id: "mock-user-mission-1",
|
|
576
|
+
mission_id: "mock-mission-1",
|
|
577
|
+
mission_name: "Aposte R$ 100 hoje",
|
|
578
|
+
current_progress: 3750,
|
|
579
|
+
target_value: 1e4,
|
|
580
|
+
progress_percentage: 37.5,
|
|
581
|
+
status: "in_progress",
|
|
582
|
+
reward_type: "points",
|
|
583
|
+
reward_value: 50,
|
|
584
|
+
period_end: "2026-10-08T00:00:00Z"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
id: "mock-user-mission-2",
|
|
588
|
+
mission_id: "mock-mission-4",
|
|
589
|
+
mission_name: "Primeiro dep\xF3sito do m\xEAs",
|
|
590
|
+
current_progress: 5e3,
|
|
591
|
+
target_value: 5e3,
|
|
592
|
+
progress_percentage: 100,
|
|
593
|
+
status: "completed",
|
|
594
|
+
reward_type: "free_bet",
|
|
595
|
+
reward_value: 1e3,
|
|
596
|
+
completed_at: "2026-10-02T15:30:00Z"
|
|
597
|
+
}
|
|
598
|
+
];
|
|
599
|
+
function json2(body) {
|
|
600
|
+
return new Response(JSON.stringify(body), { status: 200, headers: { "content-type": "application/json" } });
|
|
601
|
+
}
|
|
602
|
+
function listMissions(req) {
|
|
603
|
+
const q = req.url.searchParams;
|
|
604
|
+
const page = Math.max(1, Number.parseInt(q.get("page") ?? "", 10) || 1);
|
|
605
|
+
const raw = Number.parseInt(q.get("limit") ?? "", 10);
|
|
606
|
+
const limit = raw >= 1 && raw <= 100 ? raw : 20;
|
|
607
|
+
return json2({
|
|
608
|
+
success: true,
|
|
609
|
+
data: MISSIONS.slice((page - 1) * limit, page * limit),
|
|
610
|
+
meta: { page, per_page: limit, total_pages: Math.ceil(MISSIONS.length / limit), total_items: MISSIONS.length }
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
function createMissionsRoutes() {
|
|
614
|
+
return {
|
|
615
|
+
"GET /api/v1/missions": listMissions,
|
|
616
|
+
"GET /api/v1/my/missions": () => testing.ok({ missions: USER_MISSIONS })
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
var REFERRALS = [
|
|
620
|
+
{
|
|
621
|
+
id: "mock-referral-1",
|
|
622
|
+
referee_id: "mock-referee-1",
|
|
623
|
+
referee_email: "ana.mock@exemplo.com",
|
|
624
|
+
referee_name: "Ana Mock",
|
|
625
|
+
referral_code: "MOCK123",
|
|
626
|
+
status: "REFERRAL_STATUS_COMPLETED",
|
|
627
|
+
referrer_bonus: 10,
|
|
628
|
+
referee_bonus: 5.5,
|
|
629
|
+
created_at: "2026-09-01T10:00:00Z",
|
|
630
|
+
completed_at: "2026-09-05T10:00:00Z",
|
|
631
|
+
expires_at: "2026-12-01T10:00:00Z"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
id: "mock-referral-2",
|
|
635
|
+
referee_id: "mock-referee-2",
|
|
636
|
+
referee_email: "bruno.mock@exemplo.com",
|
|
637
|
+
referee_name: "Bruno Mock",
|
|
638
|
+
referral_code: "MOCK123",
|
|
639
|
+
status: "REFERRAL_STATUS_PENDING",
|
|
640
|
+
referrer_bonus: 10,
|
|
641
|
+
referee_bonus: 5.5,
|
|
642
|
+
created_at: "2026-09-20T10:00:00Z",
|
|
643
|
+
expires_at: "2026-12-20T10:00:00Z"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
id: "mock-referral-3",
|
|
647
|
+
referee_id: "mock-referee-3",
|
|
648
|
+
referee_email: "c@exemplo.com",
|
|
649
|
+
referee_name: "",
|
|
650
|
+
referral_code: "MOCK123",
|
|
651
|
+
status: "REFERRAL_STATUS_EXPIRED",
|
|
652
|
+
referrer_bonus: 0,
|
|
653
|
+
referee_bonus: 0,
|
|
654
|
+
created_at: "2026-06-01T10:00:00Z"
|
|
655
|
+
}
|
|
656
|
+
];
|
|
657
|
+
var COMPLETED = REFERRALS.filter((r) => r.status === "REFERRAL_STATUS_COMPLETED").length;
|
|
658
|
+
function json3(body, status) {
|
|
659
|
+
return new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
|
|
660
|
+
}
|
|
661
|
+
function listHistory(req) {
|
|
662
|
+
const q = req.url.searchParams;
|
|
663
|
+
const page = Math.max(1, Number.parseInt(q.get("page") ?? "", 10) || 1);
|
|
664
|
+
const raw = Number.parseInt(q.get("limit") ?? "", 10);
|
|
665
|
+
const limit = raw >= 1 && raw <= 100 ? raw : 20;
|
|
666
|
+
return testing.ok({
|
|
667
|
+
referrals: REFERRALS.slice((page - 1) * limit, page * limit),
|
|
668
|
+
completed_count: COMPLETED,
|
|
669
|
+
total_earned: 10,
|
|
670
|
+
pagination: {
|
|
671
|
+
page,
|
|
672
|
+
page_size: limit,
|
|
673
|
+
total_items: REFERRALS.length,
|
|
674
|
+
total_pages: Math.ceil(REFERRALS.length / limit)
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
function createReferralsRoutes() {
|
|
679
|
+
return {
|
|
680
|
+
"GET /api/v1/referrals": () => testing.ok({
|
|
681
|
+
referral_code: "MOCK123",
|
|
682
|
+
referral_link: "https://casino.mock.local/r/MOCK123",
|
|
683
|
+
total_referrals: REFERRALS.length,
|
|
684
|
+
completed_referrals: COMPLETED,
|
|
685
|
+
pending_referrals: 1,
|
|
686
|
+
total_earned: 10,
|
|
687
|
+
bonus_per_referral: 10,
|
|
688
|
+
min_deposit: 50
|
|
689
|
+
}),
|
|
690
|
+
"GET /api/v1/referrals/history": listHistory,
|
|
691
|
+
"POST /api/v1/referrals/register": (req) => {
|
|
692
|
+
const code = (req.body ?? {}).referral_code;
|
|
693
|
+
if (typeof code !== "string" || code === "") return testing.fail(400, "INVALID_ARGUMENT", "referral_code is required");
|
|
694
|
+
if (code !== "BEMVINDO") return testing.fail(404, "NOT_FOUND", "referral code not found");
|
|
695
|
+
return json3(
|
|
696
|
+
{
|
|
697
|
+
success: true,
|
|
698
|
+
data: {
|
|
699
|
+
id: "mock-referral-new",
|
|
700
|
+
referral_code: code,
|
|
701
|
+
status: "REFERRAL_STATUS_PENDING",
|
|
702
|
+
referee_bonus: 5.5,
|
|
703
|
+
created_at: "2026-10-07T12:00:00Z"
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
201
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
var SESSION_TTL_SECONDS = 24 * 60 * 60;
|
|
712
|
+
function createSportsbookRoutes() {
|
|
713
|
+
let seq = 0;
|
|
714
|
+
return {
|
|
715
|
+
"GET /api/v1/first/session": () => {
|
|
716
|
+
seq += 1;
|
|
717
|
+
const token = `mock-operator-token-${seq}`;
|
|
718
|
+
const url = new URL("https://first.mock.local/sportsbook");
|
|
719
|
+
url.searchParams.set("operatorToken", token);
|
|
720
|
+
return testing.ok({ operator_token: token, launch_url: url.href, expires_in_seconds: SESSION_TTL_SECONDS });
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
// src/testing/index.ts
|
|
726
|
+
function createIgamingRoutes() {
|
|
727
|
+
return {
|
|
728
|
+
...createCasinoRoutes(),
|
|
729
|
+
...createBonusRoutes(),
|
|
730
|
+
...createSportsbookRoutes(),
|
|
731
|
+
...createMissionsRoutes(),
|
|
732
|
+
...createLoyaltyRoutes(),
|
|
733
|
+
...createReferralsRoutes()
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
function withIgamingRoutes(options = {}) {
|
|
737
|
+
return { ...options, routes: { ...createIgamingRoutes(), ...options.routes } };
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
exports.createIgamingRoutes = createIgamingRoutes;
|
|
741
|
+
exports.withIgamingRoutes = withIgamingRoutes;
|
|
742
|
+
//# sourceMappingURL=index.cjs.map
|
|
743
|
+
//# sourceMappingURL=index.cjs.map
|