@getenginex/sdk-igaming 0.11.0 → 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 +24 -0
- package/dist/{chunk-LMBQDSFV.js → chunk-5ERRD3OA.js} +31 -3
- package/dist/chunk-5ERRD3OA.js.map +1 -0
- package/dist/index.cjs +188 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +149 -8
- package/dist/index.d.ts +149 -8
- package/dist/index.js +163 -47
- package/dist/index.js.map +1 -1
- package/dist/query/index.cjs +36 -9
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +7 -3
- package/dist/query/index.d.ts +7 -3
- package/dist/query/index.js +37 -10
- package/dist/query/index.js.map +1 -1
- package/dist/testing/index.cjs +49 -2
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.js +49 -2
- package/dist/testing/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-LMBQDSFV.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -2391,6 +2391,63 @@ interface LoyaltyStatus {
|
|
|
2391
2391
|
tierBenefits: LoyaltyTierBenefits | null;
|
|
2392
2392
|
/** When the tier expires (ISO 8601, UTC); `null` when the gateway does not send it. */
|
|
2393
2393
|
tierExpiresAt: string | null;
|
|
2394
|
+
/**
|
|
2395
|
+
* Whether the VIP points area exists for this player (the program is active or the player has points
|
|
2396
|
+
* history). Show the VIP page only on `true`. `null` when the gateway does not send the program (an older
|
|
2397
|
+
* bonus service): treat it as unknown, not as `false`.
|
|
2398
|
+
*/
|
|
2399
|
+
available: boolean | null;
|
|
2400
|
+
/** Whether the operator's loyalty program is active; `null` when the gateway does not send the program. */
|
|
2401
|
+
programActive: boolean | null;
|
|
2402
|
+
/** Whether the player has points or redemption history; `null` when the gateway does not send the program. */
|
|
2403
|
+
historyAvailable: boolean | null;
|
|
2404
|
+
/**
|
|
2405
|
+
* Whether the player can start a redemption now: the program is active, the balance reaches the minimum and
|
|
2406
|
+
* the gateway confirmed the payout currency of the player's wallet. `false` while a redemption is pending.
|
|
2407
|
+
* The gateway only sends `true` together with {@link LoyaltyStatus.redemptionCurrency} and
|
|
2408
|
+
* {@link LoyaltyStatus.redemptionDecimalPlaces}; check them before showing a value. `null` when the
|
|
2409
|
+
* gateway does not send the program.
|
|
2410
|
+
*/
|
|
2411
|
+
canRedeem: boolean | null;
|
|
2412
|
+
/** Minimum points per redemption (integer ≥ 0; `0` means no minimum besides 1); `null` when absent. */
|
|
2413
|
+
minRedemption: number | null;
|
|
2414
|
+
/**
|
|
2415
|
+
* Value of one point in minor units of {@link LoyaltyStatus.redemptionCurrency} (the contract field is called
|
|
2416
|
+
* `point_value_cents`), never negative; `null` when absent and, in `validation: 'warn'`, when malformed (a
|
|
2417
|
+
* negative, a fraction, ≥ 2^53: reported, never rounded; treat the redemption as unavailable). Preview a redemption as
|
|
2418
|
+
* `points × pointValue` (use `BigInt` if the product can pass `Number.MAX_SAFE_INTEGER`).
|
|
2419
|
+
*/
|
|
2420
|
+
pointValue: number | null;
|
|
2421
|
+
/** ISO 4217 code of the redemption payout (e.g. `BRL`); only comes with `canRedeem: true`, otherwise `null`. */
|
|
2422
|
+
redemptionCurrency: string | null;
|
|
2423
|
+
/**
|
|
2424
|
+
* Decimal places of {@link LoyaltyStatus.pointValue} as the gateway resolved them for
|
|
2425
|
+
* {@link LoyaltyStatus.redemptionCurrency} (an integer from 0 to 8, the platform's minor-unit scale); only comes
|
|
2426
|
+
* with `canRedeem: true`, otherwise `null`.
|
|
2427
|
+
*/
|
|
2428
|
+
redemptionDecimalPlaces: number | null;
|
|
2429
|
+
/**
|
|
2430
|
+
* A redemption the service started and has not settled yet; `null` when there is none. While it exists,
|
|
2431
|
+
* `canRedeem` is `false`: resume it with {@link LoyaltyApi.redeem} and `options.idempotencyKey` set to
|
|
2432
|
+
* its `idempotencyKey` instead of starting another.
|
|
2433
|
+
*/
|
|
2434
|
+
pendingRedemption: PendingLoyaltyRedemption | null;
|
|
2435
|
+
}
|
|
2436
|
+
/**
|
|
2437
|
+
* A pending points redemption ({@link LoyaltyStatus.pendingRedemption}).
|
|
2438
|
+
* @category Loyalty
|
|
2439
|
+
*/
|
|
2440
|
+
interface PendingLoyaltyRedemption {
|
|
2441
|
+
/** Idempotency key of the redemption command; `null` when the gateway sends it empty. */
|
|
2442
|
+
idempotencyKey: string | null;
|
|
2443
|
+
/** Points being redeemed (integer ≥ 0). */
|
|
2444
|
+
points: number;
|
|
2445
|
+
/**
|
|
2446
|
+
* ISO 4217-shaped code of the payout, as the bonus service recorded it; `null` when empty or absent. It is not
|
|
2447
|
+
* money (no amount comes with it), so a malformed code follows the normal rule: `VALIDATION_ERROR` in
|
|
2448
|
+
* `validation: 'strict'`, `null` (reported) in `'warn'`, never the whole page.
|
|
2449
|
+
*/
|
|
2450
|
+
currency: string | null;
|
|
2394
2451
|
}
|
|
2395
2452
|
/**
|
|
2396
2453
|
* Input of {@link LoyaltyApi.redeem}.
|
|
@@ -2409,10 +2466,19 @@ interface RedeemPointsInput {
|
|
|
2409
2466
|
interface RedeemedPoints {
|
|
2410
2467
|
/** Points actually redeemed (integer). */
|
|
2411
2468
|
redeemedPoints: number;
|
|
2412
|
-
/**
|
|
2469
|
+
/**
|
|
2470
|
+
* Redemption value in minor units of `currency`, never negative; `null` when the gateway does not send it. Read
|
|
2471
|
+
* from the exact int64 text `value_minor` when the gateway sends it (the JSON number `value` is only the fallback
|
|
2472
|
+
* of an older gateway); a value ≥ 2^53 rejects the response instead of being rounded.
|
|
2473
|
+
*/
|
|
2413
2474
|
value: number | null;
|
|
2414
2475
|
/** Currency of `value`; `null` when absent. */
|
|
2415
2476
|
currency: string | null;
|
|
2477
|
+
/**
|
|
2478
|
+
* Decimal places of `value` as the gateway resolved them for `currency` (an integer from 0 to 8, the platform's
|
|
2479
|
+
* minor-unit scale); `null` when the gateway does not send them (no value, or a currency it does not know).
|
|
2480
|
+
*/
|
|
2481
|
+
currencyDecimalPlaces: number | null;
|
|
2416
2482
|
/** Id of the bonus generated, when the redemption was into a bonus; `null` otherwise. */
|
|
2417
2483
|
bonusId: string | null;
|
|
2418
2484
|
}
|
|
@@ -2426,15 +2492,24 @@ interface LoyaltyApi {
|
|
|
2426
2492
|
* @example
|
|
2427
2493
|
* const loyalty = await igaming.loyalty.get()
|
|
2428
2494
|
* console.log(loyalty.currentPoints, loyalty.currentTier, loyalty.tierBenefits)
|
|
2429
|
-
* @
|
|
2430
|
-
*
|
|
2495
|
+
* @example
|
|
2496
|
+
* const vip = await igaming.loyalty.get()
|
|
2497
|
+
* if (vip.available !== true) return showUnavailable()
|
|
2498
|
+
* if (vip.canRedeem && vip.redemptionCurrency && vip.redemptionDecimalPlaces !== null && vip.pointValue)
|
|
2499
|
+
* showPreview(BigInt(points) * BigInt(vip.pointValue), vip.redemptionCurrency, vip.redemptionDecimalPlaces)
|
|
2500
|
+
* @throws {EnginexError} `UNAUTHENTICATED` without a session. `VALIDATION_ERROR`, in every validation mode, for
|
|
2501
|
+
* a malformed `redemption_currency` or `redemption_decimal_places` (the payout currency is strict). With
|
|
2502
|
+
* `validation: 'strict'`, also `VALIDATION_ERROR` if `tier_benefits_json` is neither a JSON object nor a JSON
|
|
2503
|
+
* array or another field is malformed (in `'warn'`, a malformed program flag, minimum, point value, pending
|
|
2504
|
+
* redemption or pending redemption currency becomes `null` and is reported).
|
|
2431
2505
|
*/
|
|
2432
2506
|
get(params?: NoParams, options?: CallOptions): Promise<LoyaltyStatus>;
|
|
2433
2507
|
/**
|
|
2434
2508
|
* Exchanges points for a bonus, cash or a free bet. It sends `Idempotency-Key` (generated per call
|
|
2435
|
-
* or the one in `options.idempotencyKey`, kept on the retry after renewing the session)
|
|
2436
|
-
*
|
|
2437
|
-
*
|
|
2509
|
+
* or the one in `options.idempotencyKey`, kept on the retry after renewing the session). The gateway forwards it to
|
|
2510
|
+
* the bonus service, which reserves the redemption by that key: a retry with the same key resumes it (as for
|
|
2511
|
+
* {@link LoyaltyStatus.pendingRedemption}) instead of redeeming again. The service only accepts a UUID (another key
|
|
2512
|
+
* is refused with `INVALID_ARGUMENT`). Two separate clicks are two keys: lock the button until the call finishes.
|
|
2438
2513
|
* @example
|
|
2439
2514
|
* const result = await igaming.loyalty.redeem({ points: 500, redemptionType: 'bonus' })
|
|
2440
2515
|
* console.log(result.redeemedPoints, result.bonusId)
|
|
@@ -2444,7 +2519,10 @@ interface LoyaltyApi {
|
|
|
2444
2519
|
* answers without confirming the redemption (`success: false`, absent or malformed; it also applies in
|
|
2445
2520
|
* `validation: 'warn'`; `message` is the gateway's when it comes, otherwise the SDK's). General rule:
|
|
2446
2521
|
* `UNKNOWN` with a 2xx `status` = unconfirmed operation: re-read the state ({@link LoyaltyApi.get})
|
|
2447
|
-
* before trying again. `
|
|
2522
|
+
* before trying again. `VALIDATION_ERROR`, in every validation mode, when the value or its currency is malformed
|
|
2523
|
+
* (`value_minor` that is not canonical int64 text or is ≥ 2^53, a negative value, `value` and `value_minor`
|
|
2524
|
+
* that disagree, a currency that is not an ISO 4217 code or decimal places outside 0–8): the redemption may have
|
|
2525
|
+
* happened, so re-read {@link LoyaltyApi.get} too. `UNAUTHENTICATED` without a session.
|
|
2448
2526
|
*/
|
|
2449
2527
|
redeem(input: RedeemPointsInput, options?: CallOptions): Promise<RedeemedPoints>;
|
|
2450
2528
|
}
|
|
@@ -2535,6 +2613,56 @@ interface UserMission {
|
|
|
2535
2613
|
periodEnd: string | null;
|
|
2536
2614
|
/** When it was completed (ISO 8601, UTC); `null` while not completed. */
|
|
2537
2615
|
completedAt: string | null;
|
|
2616
|
+
/**
|
|
2617
|
+
* When the reward was claimed (ISO 8601, UTC); `null` when the gateway does not send it. Only on
|
|
2618
|
+
* {@link MissionsApi.getMine} entries (absent from `listMine`), sent with `includeHistory: true`.
|
|
2619
|
+
*/
|
|
2620
|
+
claimedAt?: string | null;
|
|
2621
|
+
/**
|
|
2622
|
+
* Whether the mission is still offered (`true`) or is a past record of the player (`false`). Only
|
|
2623
|
+
* {@link MissionsApi.getMine} with `includeHistory: true` sends it; otherwise `null` (absent from `listMine`). An offer the player has not
|
|
2624
|
+
* progressed on yet comes with `id: ''`.
|
|
2625
|
+
*/
|
|
2626
|
+
offerActive?: boolean | null;
|
|
2627
|
+
/** Description of the mission; `null` when empty or absent (only sent with `includeHistory: true`). */
|
|
2628
|
+
description?: string | null;
|
|
2629
|
+
/** Periodicity; `null` when absent (only sent with `includeHistory: true`). */
|
|
2630
|
+
missionType?: MissionType | null;
|
|
2631
|
+
/** Objective; `null` when absent (only sent with `includeHistory: true`). */
|
|
2632
|
+
objectiveType?: MissionObjectiveType | null;
|
|
2633
|
+
/**
|
|
2634
|
+
* Slug of the game category that counts toward the target; `null` when there is no restriction or the gateway
|
|
2635
|
+
* does not send it (only sent with `includeHistory: true`).
|
|
2636
|
+
*/
|
|
2637
|
+
targetGameCategory?: string | null;
|
|
2638
|
+
}
|
|
2639
|
+
/**
|
|
2640
|
+
* Input of {@link MissionsApi.getMine}.
|
|
2641
|
+
* @category Missions
|
|
2642
|
+
*/
|
|
2643
|
+
interface GetMyMissionsInput {
|
|
2644
|
+
/**
|
|
2645
|
+
* Also return the player's past missions (completed, claimed or expired, with `offerActive: false`) and the
|
|
2646
|
+
* availability flags. Default `false` (only the active missions; the flags come as `null`).
|
|
2647
|
+
*/
|
|
2648
|
+
includeHistory?: boolean;
|
|
2649
|
+
}
|
|
2650
|
+
/**
|
|
2651
|
+
* Result of {@link MissionsApi.getMine}: the player's missions and the availability of the area.
|
|
2652
|
+
* @category Missions
|
|
2653
|
+
*/
|
|
2654
|
+
interface MyMissions {
|
|
2655
|
+
/** The player's missions (the active ones and, with `includeHistory: true`, the past ones). */
|
|
2656
|
+
missions: UserMission[];
|
|
2657
|
+
/**
|
|
2658
|
+
* Whether the missions area exists for this player (there are offers or history). `null` when the gateway did not
|
|
2659
|
+
* answer with the flags (without `includeHistory: true`, or with an older bonus service): unknown, not `false`.
|
|
2660
|
+
*/
|
|
2661
|
+
available: boolean | null;
|
|
2662
|
+
/** Whether the operator offers active missions; `null` as in {@link MyMissions.available}. */
|
|
2663
|
+
offersAvailable: boolean | null;
|
|
2664
|
+
/** Whether the player has mission history; `null` as in {@link MyMissions.available}. */
|
|
2665
|
+
historyAvailable: boolean | null;
|
|
2538
2666
|
}
|
|
2539
2667
|
/**
|
|
2540
2668
|
* Input of {@link MissionsApi.list}.
|
|
@@ -2569,6 +2697,19 @@ interface MissionsApi {
|
|
|
2569
2697
|
* @throws {EnginexError} `UNAUTHENTICATED` without a session.
|
|
2570
2698
|
*/
|
|
2571
2699
|
listMine(params?: NoParams, options?: CallOptions): Promise<UserMission[]>;
|
|
2700
|
+
/**
|
|
2701
|
+
* The player's missions with the availability flags of the area. With `includeHistory: true` it also returns
|
|
2702
|
+
* the past missions and `available`, `offersAvailable` and `historyAvailable`; without it, the same list as
|
|
2703
|
+
* {@link MissionsApi.listMine} and the flags as `null`.
|
|
2704
|
+
* @example
|
|
2705
|
+
* const { missions, available, offersAvailable } = await igaming.missions.getMine({ includeHistory: true })
|
|
2706
|
+
* if (available !== true) return showUnavailable()
|
|
2707
|
+
* const past = missions.filter((m) => m.offerActive === false)
|
|
2708
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (without a request) when the input is not an object or
|
|
2709
|
+
* `includeHistory` is not a boolean; `UNAUTHENTICATED` without a session. With `validation: 'strict'`,
|
|
2710
|
+
* `VALIDATION_ERROR` for a malformed response (in `'warn'`, a malformed flag becomes `null` and is reported).
|
|
2711
|
+
*/
|
|
2712
|
+
getMine(input?: GetMyMissionsInput, options?: CallOptions): Promise<MyMissions>;
|
|
2572
2713
|
}
|
|
2573
2714
|
|
|
2574
2715
|
/**
|
|
@@ -2838,4 +2979,4 @@ interface IgamingClient {
|
|
|
2838
2979
|
*/
|
|
2839
2980
|
declare function createIgaming(client: EnginexClient): IgamingClient;
|
|
2840
2981
|
|
|
2841
|
-
export { type ActivityAggregateQualification, type BalanceCreditReward, type Bet, type BetDetails, type BetSelection, type BetSelectionResult, type BetStatus, type BetsApi, type BiggestWinner, type BonusApi, type BonusOverview, type BonusOverviewCurrency, type BonusPosition, type BonusPositionState, type BonusPositionTerminalAction, type CampaignCashoutMode, type CampaignContent, type CampaignEntryPolicyCode, type CampaignExactRatio, type CampaignLocalizedContent, type CampaignMaximumBet, type CampaignMoney, type CampaignOddsPolicy, type CampaignOffer, type CampaignParticipation, type CampaignParticipationStatus, type CampaignPercentCalculation, type CampaignPolicy, type CampaignProductScope, type CampaignQualification, type CampaignReward, type CampaignRewardClaimPolicyCode, type CampaignRewardGrant, type CampaignRewardGrantState, type CampaignRewardKind, type CampaignRewardValidity, type CampaignRoundingMode, type CampaignStackingPolicy, type CampaignTermsAcceptance, type CampaignTermsAcceptanceRecord, type CampaignTimeWindow, type CampaignUsePolicy, type CampaignWageringPolicy, type CampaignWageringProgress, type CashoutOffer, type CashoutResult, type CasinoActivitySelector, type CasinoApi, type CasinoAvailability, type CasinoAvailabilityStatus, type CasinoFreeSpinsReward, type CasinoJackpot, type CasinoJackpots, type CasinoPageInput, type CasinoTransaction, type CasinoTransactionType, type ClubActivityKind, type ClubActivityState, type ClubAlternateReward, type ClubApi, type ClubCashbackTerms, type ClubCursorInput, type ClubHistory, type ClubLevel, type ClubLocalized, type ClubMissionState, type ClubMoney, type ClubMovement, type ClubOverview, type ClubPlayResult, type ClubProgram, type ClubRank, type ClubRanking, type ClubReceipt, type ClubReceiptStatus, type ClubRelatedTournament, type ClubRelatedTournamentPage, type ClubReward, type ClubRewardKind, type ClubRewards, type ClubStoreItemState, type ClubTournament, type ClubTournamentPage, type ClubTournamentPrize, type ClubTournamentRegistration, type ClubTournamentStatus, type DepositSettledQualification, type Game, type GameCategory, type GameDevice, type GameLaunch, type GameProvider, type GameSession, type GameSessionStatus, type GameSort, type GamesPage, type GetBiggestWinnersInput, type GetClubRankingInput, type IgamingClient, type JackpotGamesMode, type JackpotGamesPage, type LaunchGameInput, type LaunchTarget, type ListBetsInput, type ListBonusPositionsInput, type ListGamesInput, type ListJackpotGamesInput, type ListJackpotsInput, type ListMissionsInput, type ListReferralsInput, type ListRelatedClubTournamentsInput, type LoyaltyApi, type LoyaltyStatus, type LoyaltyTierBenefits, type Mission, type MissionObjectiveType, type MissionRewardType, type MissionType, type MissionsApi, type OptInInput, type PlayClubActivityInput, type PromoCodeOffer, type RedeemClubRewardInput, type RedeemPointsInput, type RedeemedPoints, type RedemptionType, type Referral, type ReferralHistory, type ReferralInfo, type ReferralMoney, type ReferralProgress, type ReferralRules, type ReferralStatus, type ReferralTotals, type ReferralsApi, type RegisterClubTournamentInput, type SetClubMembershipInput, type SportsActivitySelector, type SportsBetCoverageReward, type SportsBetType, type SportsBonusBetReward, type SportsbookApi, type SportsbookSession, type UserEventQualification, type UserMission, type UserMissionStatus, createIgaming, keepsClubIdempotencyKey };
|
|
2982
|
+
export { type ActivityAggregateQualification, type BalanceCreditReward, type Bet, type BetDetails, type BetSelection, type BetSelectionResult, type BetStatus, type BetsApi, type BiggestWinner, type BonusApi, type BonusOverview, type BonusOverviewCurrency, type BonusPosition, type BonusPositionState, type BonusPositionTerminalAction, type CampaignCashoutMode, type CampaignContent, type CampaignEntryPolicyCode, type CampaignExactRatio, type CampaignLocalizedContent, type CampaignMaximumBet, type CampaignMoney, type CampaignOddsPolicy, type CampaignOffer, type CampaignParticipation, type CampaignParticipationStatus, type CampaignPercentCalculation, type CampaignPolicy, type CampaignProductScope, type CampaignQualification, type CampaignReward, type CampaignRewardClaimPolicyCode, type CampaignRewardGrant, type CampaignRewardGrantState, type CampaignRewardKind, type CampaignRewardValidity, type CampaignRoundingMode, type CampaignStackingPolicy, type CampaignTermsAcceptance, type CampaignTermsAcceptanceRecord, type CampaignTimeWindow, type CampaignUsePolicy, type CampaignWageringPolicy, type CampaignWageringProgress, type CashoutOffer, type CashoutResult, type CasinoActivitySelector, type CasinoApi, type CasinoAvailability, type CasinoAvailabilityStatus, type CasinoFreeSpinsReward, type CasinoJackpot, type CasinoJackpots, type CasinoPageInput, type CasinoTransaction, type CasinoTransactionType, type ClubActivityKind, type ClubActivityState, type ClubAlternateReward, type ClubApi, type ClubCashbackTerms, type ClubCursorInput, type ClubHistory, type ClubLevel, type ClubLocalized, type ClubMissionState, type ClubMoney, type ClubMovement, type ClubOverview, type ClubPlayResult, type ClubProgram, type ClubRank, type ClubRanking, type ClubReceipt, type ClubReceiptStatus, type ClubRelatedTournament, type ClubRelatedTournamentPage, type ClubReward, type ClubRewardKind, type ClubRewards, type ClubStoreItemState, type ClubTournament, type ClubTournamentPage, type ClubTournamentPrize, type ClubTournamentRegistration, type ClubTournamentStatus, type DepositSettledQualification, type Game, type GameCategory, type GameDevice, type GameLaunch, type GameProvider, type GameSession, type GameSessionStatus, type GameSort, type GamesPage, type GetBiggestWinnersInput, type GetClubRankingInput, type GetMyMissionsInput, type IgamingClient, type JackpotGamesMode, type JackpotGamesPage, type LaunchGameInput, type LaunchTarget, type ListBetsInput, type ListBonusPositionsInput, type ListGamesInput, type ListJackpotGamesInput, type ListJackpotsInput, type ListMissionsInput, type ListReferralsInput, type ListRelatedClubTournamentsInput, type LoyaltyApi, type LoyaltyStatus, type LoyaltyTierBenefits, type Mission, type MissionObjectiveType, type MissionRewardType, type MissionType, type MissionsApi, type MyMissions, type OptInInput, type PendingLoyaltyRedemption, type PlayClubActivityInput, type PromoCodeOffer, type RedeemClubRewardInput, type RedeemPointsInput, type RedeemedPoints, type RedemptionType, type Referral, type ReferralHistory, type ReferralInfo, type ReferralMoney, type ReferralProgress, type ReferralRules, type ReferralStatus, type ReferralTotals, type ReferralsApi, type RegisterClubTournamentInput, type SetClubMembershipInput, type SportsActivitySelector, type SportsBetCoverageReward, type SportsBetType, type SportsBonusBetReward, type SportsbookApi, type SportsbookSession, type UserEventQualification, type UserMission, type UserMissionStatus, createIgaming, keepsClubIdempotencyKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -2391,6 +2391,63 @@ interface LoyaltyStatus {
|
|
|
2391
2391
|
tierBenefits: LoyaltyTierBenefits | null;
|
|
2392
2392
|
/** When the tier expires (ISO 8601, UTC); `null` when the gateway does not send it. */
|
|
2393
2393
|
tierExpiresAt: string | null;
|
|
2394
|
+
/**
|
|
2395
|
+
* Whether the VIP points area exists for this player (the program is active or the player has points
|
|
2396
|
+
* history). Show the VIP page only on `true`. `null` when the gateway does not send the program (an older
|
|
2397
|
+
* bonus service): treat it as unknown, not as `false`.
|
|
2398
|
+
*/
|
|
2399
|
+
available: boolean | null;
|
|
2400
|
+
/** Whether the operator's loyalty program is active; `null` when the gateway does not send the program. */
|
|
2401
|
+
programActive: boolean | null;
|
|
2402
|
+
/** Whether the player has points or redemption history; `null` when the gateway does not send the program. */
|
|
2403
|
+
historyAvailable: boolean | null;
|
|
2404
|
+
/**
|
|
2405
|
+
* Whether the player can start a redemption now: the program is active, the balance reaches the minimum and
|
|
2406
|
+
* the gateway confirmed the payout currency of the player's wallet. `false` while a redemption is pending.
|
|
2407
|
+
* The gateway only sends `true` together with {@link LoyaltyStatus.redemptionCurrency} and
|
|
2408
|
+
* {@link LoyaltyStatus.redemptionDecimalPlaces}; check them before showing a value. `null` when the
|
|
2409
|
+
* gateway does not send the program.
|
|
2410
|
+
*/
|
|
2411
|
+
canRedeem: boolean | null;
|
|
2412
|
+
/** Minimum points per redemption (integer ≥ 0; `0` means no minimum besides 1); `null` when absent. */
|
|
2413
|
+
minRedemption: number | null;
|
|
2414
|
+
/**
|
|
2415
|
+
* Value of one point in minor units of {@link LoyaltyStatus.redemptionCurrency} (the contract field is called
|
|
2416
|
+
* `point_value_cents`), never negative; `null` when absent and, in `validation: 'warn'`, when malformed (a
|
|
2417
|
+
* negative, a fraction, ≥ 2^53: reported, never rounded; treat the redemption as unavailable). Preview a redemption as
|
|
2418
|
+
* `points × pointValue` (use `BigInt` if the product can pass `Number.MAX_SAFE_INTEGER`).
|
|
2419
|
+
*/
|
|
2420
|
+
pointValue: number | null;
|
|
2421
|
+
/** ISO 4217 code of the redemption payout (e.g. `BRL`); only comes with `canRedeem: true`, otherwise `null`. */
|
|
2422
|
+
redemptionCurrency: string | null;
|
|
2423
|
+
/**
|
|
2424
|
+
* Decimal places of {@link LoyaltyStatus.pointValue} as the gateway resolved them for
|
|
2425
|
+
* {@link LoyaltyStatus.redemptionCurrency} (an integer from 0 to 8, the platform's minor-unit scale); only comes
|
|
2426
|
+
* with `canRedeem: true`, otherwise `null`.
|
|
2427
|
+
*/
|
|
2428
|
+
redemptionDecimalPlaces: number | null;
|
|
2429
|
+
/**
|
|
2430
|
+
* A redemption the service started and has not settled yet; `null` when there is none. While it exists,
|
|
2431
|
+
* `canRedeem` is `false`: resume it with {@link LoyaltyApi.redeem} and `options.idempotencyKey` set to
|
|
2432
|
+
* its `idempotencyKey` instead of starting another.
|
|
2433
|
+
*/
|
|
2434
|
+
pendingRedemption: PendingLoyaltyRedemption | null;
|
|
2435
|
+
}
|
|
2436
|
+
/**
|
|
2437
|
+
* A pending points redemption ({@link LoyaltyStatus.pendingRedemption}).
|
|
2438
|
+
* @category Loyalty
|
|
2439
|
+
*/
|
|
2440
|
+
interface PendingLoyaltyRedemption {
|
|
2441
|
+
/** Idempotency key of the redemption command; `null` when the gateway sends it empty. */
|
|
2442
|
+
idempotencyKey: string | null;
|
|
2443
|
+
/** Points being redeemed (integer ≥ 0). */
|
|
2444
|
+
points: number;
|
|
2445
|
+
/**
|
|
2446
|
+
* ISO 4217-shaped code of the payout, as the bonus service recorded it; `null` when empty or absent. It is not
|
|
2447
|
+
* money (no amount comes with it), so a malformed code follows the normal rule: `VALIDATION_ERROR` in
|
|
2448
|
+
* `validation: 'strict'`, `null` (reported) in `'warn'`, never the whole page.
|
|
2449
|
+
*/
|
|
2450
|
+
currency: string | null;
|
|
2394
2451
|
}
|
|
2395
2452
|
/**
|
|
2396
2453
|
* Input of {@link LoyaltyApi.redeem}.
|
|
@@ -2409,10 +2466,19 @@ interface RedeemPointsInput {
|
|
|
2409
2466
|
interface RedeemedPoints {
|
|
2410
2467
|
/** Points actually redeemed (integer). */
|
|
2411
2468
|
redeemedPoints: number;
|
|
2412
|
-
/**
|
|
2469
|
+
/**
|
|
2470
|
+
* Redemption value in minor units of `currency`, never negative; `null` when the gateway does not send it. Read
|
|
2471
|
+
* from the exact int64 text `value_minor` when the gateway sends it (the JSON number `value` is only the fallback
|
|
2472
|
+
* of an older gateway); a value ≥ 2^53 rejects the response instead of being rounded.
|
|
2473
|
+
*/
|
|
2413
2474
|
value: number | null;
|
|
2414
2475
|
/** Currency of `value`; `null` when absent. */
|
|
2415
2476
|
currency: string | null;
|
|
2477
|
+
/**
|
|
2478
|
+
* Decimal places of `value` as the gateway resolved them for `currency` (an integer from 0 to 8, the platform's
|
|
2479
|
+
* minor-unit scale); `null` when the gateway does not send them (no value, or a currency it does not know).
|
|
2480
|
+
*/
|
|
2481
|
+
currencyDecimalPlaces: number | null;
|
|
2416
2482
|
/** Id of the bonus generated, when the redemption was into a bonus; `null` otherwise. */
|
|
2417
2483
|
bonusId: string | null;
|
|
2418
2484
|
}
|
|
@@ -2426,15 +2492,24 @@ interface LoyaltyApi {
|
|
|
2426
2492
|
* @example
|
|
2427
2493
|
* const loyalty = await igaming.loyalty.get()
|
|
2428
2494
|
* console.log(loyalty.currentPoints, loyalty.currentTier, loyalty.tierBenefits)
|
|
2429
|
-
* @
|
|
2430
|
-
*
|
|
2495
|
+
* @example
|
|
2496
|
+
* const vip = await igaming.loyalty.get()
|
|
2497
|
+
* if (vip.available !== true) return showUnavailable()
|
|
2498
|
+
* if (vip.canRedeem && vip.redemptionCurrency && vip.redemptionDecimalPlaces !== null && vip.pointValue)
|
|
2499
|
+
* showPreview(BigInt(points) * BigInt(vip.pointValue), vip.redemptionCurrency, vip.redemptionDecimalPlaces)
|
|
2500
|
+
* @throws {EnginexError} `UNAUTHENTICATED` without a session. `VALIDATION_ERROR`, in every validation mode, for
|
|
2501
|
+
* a malformed `redemption_currency` or `redemption_decimal_places` (the payout currency is strict). With
|
|
2502
|
+
* `validation: 'strict'`, also `VALIDATION_ERROR` if `tier_benefits_json` is neither a JSON object nor a JSON
|
|
2503
|
+
* array or another field is malformed (in `'warn'`, a malformed program flag, minimum, point value, pending
|
|
2504
|
+
* redemption or pending redemption currency becomes `null` and is reported).
|
|
2431
2505
|
*/
|
|
2432
2506
|
get(params?: NoParams, options?: CallOptions): Promise<LoyaltyStatus>;
|
|
2433
2507
|
/**
|
|
2434
2508
|
* Exchanges points for a bonus, cash or a free bet. It sends `Idempotency-Key` (generated per call
|
|
2435
|
-
* or the one in `options.idempotencyKey`, kept on the retry after renewing the session)
|
|
2436
|
-
*
|
|
2437
|
-
*
|
|
2509
|
+
* or the one in `options.idempotencyKey`, kept on the retry after renewing the session). The gateway forwards it to
|
|
2510
|
+
* the bonus service, which reserves the redemption by that key: a retry with the same key resumes it (as for
|
|
2511
|
+
* {@link LoyaltyStatus.pendingRedemption}) instead of redeeming again. The service only accepts a UUID (another key
|
|
2512
|
+
* is refused with `INVALID_ARGUMENT`). Two separate clicks are two keys: lock the button until the call finishes.
|
|
2438
2513
|
* @example
|
|
2439
2514
|
* const result = await igaming.loyalty.redeem({ points: 500, redemptionType: 'bonus' })
|
|
2440
2515
|
* console.log(result.redeemedPoints, result.bonusId)
|
|
@@ -2444,7 +2519,10 @@ interface LoyaltyApi {
|
|
|
2444
2519
|
* answers without confirming the redemption (`success: false`, absent or malformed; it also applies in
|
|
2445
2520
|
* `validation: 'warn'`; `message` is the gateway's when it comes, otherwise the SDK's). General rule:
|
|
2446
2521
|
* `UNKNOWN` with a 2xx `status` = unconfirmed operation: re-read the state ({@link LoyaltyApi.get})
|
|
2447
|
-
* before trying again. `
|
|
2522
|
+
* before trying again. `VALIDATION_ERROR`, in every validation mode, when the value or its currency is malformed
|
|
2523
|
+
* (`value_minor` that is not canonical int64 text or is ≥ 2^53, a negative value, `value` and `value_minor`
|
|
2524
|
+
* that disagree, a currency that is not an ISO 4217 code or decimal places outside 0–8): the redemption may have
|
|
2525
|
+
* happened, so re-read {@link LoyaltyApi.get} too. `UNAUTHENTICATED` without a session.
|
|
2448
2526
|
*/
|
|
2449
2527
|
redeem(input: RedeemPointsInput, options?: CallOptions): Promise<RedeemedPoints>;
|
|
2450
2528
|
}
|
|
@@ -2535,6 +2613,56 @@ interface UserMission {
|
|
|
2535
2613
|
periodEnd: string | null;
|
|
2536
2614
|
/** When it was completed (ISO 8601, UTC); `null` while not completed. */
|
|
2537
2615
|
completedAt: string | null;
|
|
2616
|
+
/**
|
|
2617
|
+
* When the reward was claimed (ISO 8601, UTC); `null` when the gateway does not send it. Only on
|
|
2618
|
+
* {@link MissionsApi.getMine} entries (absent from `listMine`), sent with `includeHistory: true`.
|
|
2619
|
+
*/
|
|
2620
|
+
claimedAt?: string | null;
|
|
2621
|
+
/**
|
|
2622
|
+
* Whether the mission is still offered (`true`) or is a past record of the player (`false`). Only
|
|
2623
|
+
* {@link MissionsApi.getMine} with `includeHistory: true` sends it; otherwise `null` (absent from `listMine`). An offer the player has not
|
|
2624
|
+
* progressed on yet comes with `id: ''`.
|
|
2625
|
+
*/
|
|
2626
|
+
offerActive?: boolean | null;
|
|
2627
|
+
/** Description of the mission; `null` when empty or absent (only sent with `includeHistory: true`). */
|
|
2628
|
+
description?: string | null;
|
|
2629
|
+
/** Periodicity; `null` when absent (only sent with `includeHistory: true`). */
|
|
2630
|
+
missionType?: MissionType | null;
|
|
2631
|
+
/** Objective; `null` when absent (only sent with `includeHistory: true`). */
|
|
2632
|
+
objectiveType?: MissionObjectiveType | null;
|
|
2633
|
+
/**
|
|
2634
|
+
* Slug of the game category that counts toward the target; `null` when there is no restriction or the gateway
|
|
2635
|
+
* does not send it (only sent with `includeHistory: true`).
|
|
2636
|
+
*/
|
|
2637
|
+
targetGameCategory?: string | null;
|
|
2638
|
+
}
|
|
2639
|
+
/**
|
|
2640
|
+
* Input of {@link MissionsApi.getMine}.
|
|
2641
|
+
* @category Missions
|
|
2642
|
+
*/
|
|
2643
|
+
interface GetMyMissionsInput {
|
|
2644
|
+
/**
|
|
2645
|
+
* Also return the player's past missions (completed, claimed or expired, with `offerActive: false`) and the
|
|
2646
|
+
* availability flags. Default `false` (only the active missions; the flags come as `null`).
|
|
2647
|
+
*/
|
|
2648
|
+
includeHistory?: boolean;
|
|
2649
|
+
}
|
|
2650
|
+
/**
|
|
2651
|
+
* Result of {@link MissionsApi.getMine}: the player's missions and the availability of the area.
|
|
2652
|
+
* @category Missions
|
|
2653
|
+
*/
|
|
2654
|
+
interface MyMissions {
|
|
2655
|
+
/** The player's missions (the active ones and, with `includeHistory: true`, the past ones). */
|
|
2656
|
+
missions: UserMission[];
|
|
2657
|
+
/**
|
|
2658
|
+
* Whether the missions area exists for this player (there are offers or history). `null` when the gateway did not
|
|
2659
|
+
* answer with the flags (without `includeHistory: true`, or with an older bonus service): unknown, not `false`.
|
|
2660
|
+
*/
|
|
2661
|
+
available: boolean | null;
|
|
2662
|
+
/** Whether the operator offers active missions; `null` as in {@link MyMissions.available}. */
|
|
2663
|
+
offersAvailable: boolean | null;
|
|
2664
|
+
/** Whether the player has mission history; `null` as in {@link MyMissions.available}. */
|
|
2665
|
+
historyAvailable: boolean | null;
|
|
2538
2666
|
}
|
|
2539
2667
|
/**
|
|
2540
2668
|
* Input of {@link MissionsApi.list}.
|
|
@@ -2569,6 +2697,19 @@ interface MissionsApi {
|
|
|
2569
2697
|
* @throws {EnginexError} `UNAUTHENTICATED` without a session.
|
|
2570
2698
|
*/
|
|
2571
2699
|
listMine(params?: NoParams, options?: CallOptions): Promise<UserMission[]>;
|
|
2700
|
+
/**
|
|
2701
|
+
* The player's missions with the availability flags of the area. With `includeHistory: true` it also returns
|
|
2702
|
+
* the past missions and `available`, `offersAvailable` and `historyAvailable`; without it, the same list as
|
|
2703
|
+
* {@link MissionsApi.listMine} and the flags as `null`.
|
|
2704
|
+
* @example
|
|
2705
|
+
* const { missions, available, offersAvailable } = await igaming.missions.getMine({ includeHistory: true })
|
|
2706
|
+
* if (available !== true) return showUnavailable()
|
|
2707
|
+
* const past = missions.filter((m) => m.offerActive === false)
|
|
2708
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (without a request) when the input is not an object or
|
|
2709
|
+
* `includeHistory` is not a boolean; `UNAUTHENTICATED` without a session. With `validation: 'strict'`,
|
|
2710
|
+
* `VALIDATION_ERROR` for a malformed response (in `'warn'`, a malformed flag becomes `null` and is reported).
|
|
2711
|
+
*/
|
|
2712
|
+
getMine(input?: GetMyMissionsInput, options?: CallOptions): Promise<MyMissions>;
|
|
2572
2713
|
}
|
|
2573
2714
|
|
|
2574
2715
|
/**
|
|
@@ -2838,4 +2979,4 @@ interface IgamingClient {
|
|
|
2838
2979
|
*/
|
|
2839
2980
|
declare function createIgaming(client: EnginexClient): IgamingClient;
|
|
2840
2981
|
|
|
2841
|
-
export { type ActivityAggregateQualification, type BalanceCreditReward, type Bet, type BetDetails, type BetSelection, type BetSelectionResult, type BetStatus, type BetsApi, type BiggestWinner, type BonusApi, type BonusOverview, type BonusOverviewCurrency, type BonusPosition, type BonusPositionState, type BonusPositionTerminalAction, type CampaignCashoutMode, type CampaignContent, type CampaignEntryPolicyCode, type CampaignExactRatio, type CampaignLocalizedContent, type CampaignMaximumBet, type CampaignMoney, type CampaignOddsPolicy, type CampaignOffer, type CampaignParticipation, type CampaignParticipationStatus, type CampaignPercentCalculation, type CampaignPolicy, type CampaignProductScope, type CampaignQualification, type CampaignReward, type CampaignRewardClaimPolicyCode, type CampaignRewardGrant, type CampaignRewardGrantState, type CampaignRewardKind, type CampaignRewardValidity, type CampaignRoundingMode, type CampaignStackingPolicy, type CampaignTermsAcceptance, type CampaignTermsAcceptanceRecord, type CampaignTimeWindow, type CampaignUsePolicy, type CampaignWageringPolicy, type CampaignWageringProgress, type CashoutOffer, type CashoutResult, type CasinoActivitySelector, type CasinoApi, type CasinoAvailability, type CasinoAvailabilityStatus, type CasinoFreeSpinsReward, type CasinoJackpot, type CasinoJackpots, type CasinoPageInput, type CasinoTransaction, type CasinoTransactionType, type ClubActivityKind, type ClubActivityState, type ClubAlternateReward, type ClubApi, type ClubCashbackTerms, type ClubCursorInput, type ClubHistory, type ClubLevel, type ClubLocalized, type ClubMissionState, type ClubMoney, type ClubMovement, type ClubOverview, type ClubPlayResult, type ClubProgram, type ClubRank, type ClubRanking, type ClubReceipt, type ClubReceiptStatus, type ClubRelatedTournament, type ClubRelatedTournamentPage, type ClubReward, type ClubRewardKind, type ClubRewards, type ClubStoreItemState, type ClubTournament, type ClubTournamentPage, type ClubTournamentPrize, type ClubTournamentRegistration, type ClubTournamentStatus, type DepositSettledQualification, type Game, type GameCategory, type GameDevice, type GameLaunch, type GameProvider, type GameSession, type GameSessionStatus, type GameSort, type GamesPage, type GetBiggestWinnersInput, type GetClubRankingInput, type IgamingClient, type JackpotGamesMode, type JackpotGamesPage, type LaunchGameInput, type LaunchTarget, type ListBetsInput, type ListBonusPositionsInput, type ListGamesInput, type ListJackpotGamesInput, type ListJackpotsInput, type ListMissionsInput, type ListReferralsInput, type ListRelatedClubTournamentsInput, type LoyaltyApi, type LoyaltyStatus, type LoyaltyTierBenefits, type Mission, type MissionObjectiveType, type MissionRewardType, type MissionType, type MissionsApi, type OptInInput, type PlayClubActivityInput, type PromoCodeOffer, type RedeemClubRewardInput, type RedeemPointsInput, type RedeemedPoints, type RedemptionType, type Referral, type ReferralHistory, type ReferralInfo, type ReferralMoney, type ReferralProgress, type ReferralRules, type ReferralStatus, type ReferralTotals, type ReferralsApi, type RegisterClubTournamentInput, type SetClubMembershipInput, type SportsActivitySelector, type SportsBetCoverageReward, type SportsBetType, type SportsBonusBetReward, type SportsbookApi, type SportsbookSession, type UserEventQualification, type UserMission, type UserMissionStatus, createIgaming, keepsClubIdempotencyKey };
|
|
2982
|
+
export { type ActivityAggregateQualification, type BalanceCreditReward, type Bet, type BetDetails, type BetSelection, type BetSelectionResult, type BetStatus, type BetsApi, type BiggestWinner, type BonusApi, type BonusOverview, type BonusOverviewCurrency, type BonusPosition, type BonusPositionState, type BonusPositionTerminalAction, type CampaignCashoutMode, type CampaignContent, type CampaignEntryPolicyCode, type CampaignExactRatio, type CampaignLocalizedContent, type CampaignMaximumBet, type CampaignMoney, type CampaignOddsPolicy, type CampaignOffer, type CampaignParticipation, type CampaignParticipationStatus, type CampaignPercentCalculation, type CampaignPolicy, type CampaignProductScope, type CampaignQualification, type CampaignReward, type CampaignRewardClaimPolicyCode, type CampaignRewardGrant, type CampaignRewardGrantState, type CampaignRewardKind, type CampaignRewardValidity, type CampaignRoundingMode, type CampaignStackingPolicy, type CampaignTermsAcceptance, type CampaignTermsAcceptanceRecord, type CampaignTimeWindow, type CampaignUsePolicy, type CampaignWageringPolicy, type CampaignWageringProgress, type CashoutOffer, type CashoutResult, type CasinoActivitySelector, type CasinoApi, type CasinoAvailability, type CasinoAvailabilityStatus, type CasinoFreeSpinsReward, type CasinoJackpot, type CasinoJackpots, type CasinoPageInput, type CasinoTransaction, type CasinoTransactionType, type ClubActivityKind, type ClubActivityState, type ClubAlternateReward, type ClubApi, type ClubCashbackTerms, type ClubCursorInput, type ClubHistory, type ClubLevel, type ClubLocalized, type ClubMissionState, type ClubMoney, type ClubMovement, type ClubOverview, type ClubPlayResult, type ClubProgram, type ClubRank, type ClubRanking, type ClubReceipt, type ClubReceiptStatus, type ClubRelatedTournament, type ClubRelatedTournamentPage, type ClubReward, type ClubRewardKind, type ClubRewards, type ClubStoreItemState, type ClubTournament, type ClubTournamentPage, type ClubTournamentPrize, type ClubTournamentRegistration, type ClubTournamentStatus, type DepositSettledQualification, type Game, type GameCategory, type GameDevice, type GameLaunch, type GameProvider, type GameSession, type GameSessionStatus, type GameSort, type GamesPage, type GetBiggestWinnersInput, type GetClubRankingInput, type GetMyMissionsInput, type IgamingClient, type JackpotGamesMode, type JackpotGamesPage, type LaunchGameInput, type LaunchTarget, type ListBetsInput, type ListBonusPositionsInput, type ListGamesInput, type ListJackpotGamesInput, type ListJackpotsInput, type ListMissionsInput, type ListReferralsInput, type ListRelatedClubTournamentsInput, type LoyaltyApi, type LoyaltyStatus, type LoyaltyTierBenefits, type Mission, type MissionObjectiveType, type MissionRewardType, type MissionType, type MissionsApi, type MyMissions, type OptInInput, type PendingLoyaltyRedemption, type PlayClubActivityInput, type PromoCodeOffer, type RedeemClubRewardInput, type RedeemPointsInput, type RedeemedPoints, type RedemptionType, type Referral, type ReferralHistory, type ReferralInfo, type ReferralMoney, type ReferralProgress, type ReferralRules, type ReferralStatus, type ReferralTotals, type ReferralsApi, type RegisterClubTournamentInput, type SetClubMembershipInput, type SportsActivitySelector, type SportsBetCoverageReward, type SportsBetType, type SportsBonusBetReward, type SportsbookApi, type SportsbookSession, type UserEventQualification, type UserMission, type UserMissionStatus, createIgaming, keepsClubIdempotencyKey };
|