@getenginex/sdk-igaming 0.10.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/README.md +4 -3
- package/dist/chunk-5ERRD3OA.js +648 -0
- package/dist/chunk-5ERRD3OA.js.map +1 -0
- package/dist/index.cjs +725 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +895 -8
- package/dist/index.d.ts +895 -8
- package/dist/index.js +427 -397
- package/dist/index.js.map +1 -1
- package/dist/query/index.cjs +73 -7
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +24 -5
- package/dist/query/index.d.ts +24 -5
- package/dist/query/index.js +61 -8
- package/dist/query/index.js.map +1 -1
- package/dist/testing/index.cjs +499 -14
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +42 -4
- package/dist/testing/index.d.ts +42 -4
- package/dist/testing/index.js +499 -14
- package/dist/testing/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# @getenginex/sdk-igaming
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c7f6758: `loyalty.get()` models the VIP redemption program the gateway sends: `available`, `programActive`, `historyAvailable`,
|
|
8
|
+
`canRedeem`, `minRedemption`, `pointValue` (`point_value_cents`), `redemptionCurrency`, `redemptionDecimalPlaces` and
|
|
9
|
+
`pendingRedemption` (`{ idempotencyKey, points, currency }`). Each one is `null` when the gateway omits it (an older
|
|
10
|
+
bonus service sends no program). The payout currency and its scale are strict in every validation mode. In `'warn'`, a
|
|
11
|
+
malformed flag, minimum, point value (never rounded: the page renders, only the redemption is unavailable), pending
|
|
12
|
+
redemption or pending redemption currency (not money: the gateway copies it unvalidated) becomes `null` (reported)
|
|
13
|
+
instead of arriving raw. The counters come as `0` when absent.
|
|
14
|
+
|
|
15
|
+
`loyalty.redeem()` reads `value` from the exact int64 text `value_minor` (the JSON number `value` is the fallback of an
|
|
16
|
+
older gateway) and returns `currencyDecimalPlaces`. A `value_minor` that is not canonical digits, a value ≥ 2^53, a
|
|
17
|
+
negative value or `value` and `value_minor` that disagree reject with `VALIDATION_ERROR`. The `loyalty.redeem` mutation carries
|
|
18
|
+
`invalidatesOnError`: after an ambiguous failure (network, timeout, 5xx, `KEY_IN_USE`, or an unconfirmed 2xx) it
|
|
19
|
+
refetches `loyalty` and `wallet`.
|
|
20
|
+
|
|
21
|
+
New `missions.getMine({ includeHistory? })` returns `{ missions, available, offersAvailable, historyAvailable }`. With
|
|
22
|
+
`includeHistory: true` it sends `include_history=true` and gets the past missions too. `UserMission` gains the optional
|
|
23
|
+
`claimedAt`, `offerActive`, `description`, `missionType`, `objectiveType` and `targetGameCategory`, present (`null`
|
|
24
|
+
without history) only on `getMine` entries. `listMine()` is unchanged: it neither reads nor validates them. In `createIgamingQueries`, `getMine()`, `getMine({})` and
|
|
25
|
+
`getMine({ includeHistory: false })` share one query key.
|
|
26
|
+
|
|
27
|
+
## 0.11.0
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- e186fba: New `club` namespace (IE-666): the casino club the player used to call directly. `getOverview`, `listHistory`,
|
|
32
|
+
`listTournaments`, `listRelatedTournaments`, `getTournament` and `getRanking` read the program, the player's balances,
|
|
33
|
+
activities, missions, store, history and club tournaments; `setMembership`, `play` (also opens a mission chest),
|
|
34
|
+
`redeem` and `registerForTournament` are idempotent writes (`Idempotency-Key`, up to 128 characters, replayed by the
|
|
35
|
+
club service). The routes answer without the envelope, in protojson or (`?relatedTo=`) plain JSON: omitted or `null`
|
|
36
|
+
lists become `[]`, absent messages `null`, absent dates (epoch, Go's zero time) `null`, codes come in lowercase and
|
|
37
|
+
a repeated id keeps the first occurrence. Money is strict also under `'warn'` (negative, fraction, exponent or
|
|
38
|
+
≥ 2^53 rejects). `createIgamingQueries`/`createIgamingMutations` get the `club` factories and `/testing` mocks
|
|
39
|
+
every route with in-memory state.
|
|
40
|
+
|
|
41
|
+
The `club` writes keep the `Idempotency-Key` after a 409 or a 429 and release it only on 400/403/404/422: the club
|
|
42
|
+
answers a duplicate still in flight with a plain 409, so releasing it there would let the next tap pay twice
|
|
43
|
+
(core `>=0.12.0` for the factories). `keepsClubIdempotencyKey(error)` exposes the rule to apps that persist their
|
|
44
|
+
own key.
|
|
45
|
+
|
|
46
|
+
An invalid `announcedAmount` on an external tournament prize no longer rejects the whole `listTournaments` page under
|
|
47
|
+
`'warn'`: it is reported and only that prize is dropped (never rounded; `'strict'` still rejects).
|
|
48
|
+
|
|
49
|
+
The `club` query keys end with `{ locale }` (the client's locale): after `setLocale` the program is fetched again
|
|
50
|
+
with the new `termsLocale` instead of a join recording consent under the old terms.
|
|
51
|
+
|
|
52
|
+
`club.play`/`redeem` invalidate only `club.getOverview`, `club.listHistory`, `bonus` and `wallet` (not the
|
|
53
|
+
tournaments nor the rankings), and the four club writes carry `invalidatesOnError`: a 409 refreshes the overview (and,
|
|
54
|
+
for `registerForTournament`, the tournaments).
|
|
55
|
+
|
|
56
|
+
The `/testing` club mock records a chest as `sourceKind: 'chest'` (the real value), accepts
|
|
57
|
+
`createIgamingRoutes({ club: { program: 'paused' | 'disabled' } })` (also through `withIgamingRoutes`), serves the
|
|
58
|
+
related page with a `null` title and Go zero times, and reproduces writes that fail in the middle (keys starting with
|
|
59
|
+
`inflight-` answer 409 once, `lost-` apply and answer 503 once).
|
|
60
|
+
|
|
61
|
+
The club input checks count ids in UTF-8 bytes (the gateway's limit is 128 bytes), and an `idempotencyKey` must be
|
|
62
|
+
printable ASCII (a header value travels as bytes: an emoji would make `fetch` throw).
|
|
63
|
+
|
|
3
64
|
## 0.10.1
|
|
4
65
|
|
|
5
66
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# @getenginex/sdk-igaming
|
|
2
2
|
|
|
3
|
-
Casino, bonuses, missions, loyalty, referrals and the FIRST sportsbook for EngineX, built on the `@getenginex/sdk` client.
|
|
3
|
+
Casino, casino club, bonuses, missions, loyalty, referrals and the FIRST sportsbook for EngineX, built on the `@getenginex/sdk` client.
|
|
4
4
|
|
|
5
5
|
[Docs](https://game-engine-io.github.io/enginex-frontend-sdk/igaming/) · [Português](https://game-engine-io.github.io/enginex-frontend-sdk/pt/igaming/) · [Español](https://game-engine-io.github.io/enginex-frontend-sdk/es/igaming/)
|
|
6
6
|
|
|
7
|
-
Namespaces: `casino` (catalog, lobby jackpots, launch game, sessions, history, winners ranking), `
|
|
7
|
+
Namespaces: `casino` (catalog, lobby jackpots, launch game, sessions, history, winners ranking), `club` (casino club: program, wheel, mission chests, coin store,
|
|
8
|
+
history, tournaments), `bonus` (campaigns, opt-in,
|
|
8
9
|
claim, promo codes), `missions`, `loyalty` (points, tier, redeem), `referrals`, `sportsbook` (FIRST session for the iframe)
|
|
9
10
|
and `bets` (sportsbook bet history and cash-out).
|
|
10
11
|
|
|
@@ -45,7 +46,7 @@ created by `createEnginexClient` (for example a copy `{ ...enginex }`) is reject
|
|
|
45
46
|
|
|
46
47
|
| Subpath | Purpose |
|
|
47
48
|
| --- | --- |
|
|
48
|
-
| `@getenginex/sdk-igaming` | `createIgaming` and the casino, bonus, missions, loyalty, referrals, sportsbook and bets namespaces |
|
|
49
|
+
| `@getenginex/sdk-igaming` | `createIgaming` and the casino, club, bonus, missions, loyalty, referrals, sportsbook and bets namespaces |
|
|
49
50
|
| `@getenginex/sdk-igaming/testing` | Mock routes for iGaming (`withIgamingRoutes`) on top of the core's `createMockFetch` |
|
|
50
51
|
| `@getenginex/sdk-igaming/first-frame` | Origin-checked `postMessage` events and commands for the FIRST sportsbook iframe |
|
|
51
52
|
| `@getenginex/sdk-igaming/query` | Query and mutation factories for TanStack Query v5 |
|