@invonetwork/web-sdk 3.19.0 → 3.20.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 +15 -0
- package/README.md +90 -0
- package/dist/{chunk-YW2PYARQ.js → chunk-6IY4473A.js} +143 -4
- package/dist/index.cjs +212 -6
- package/dist/index.d.cts +32 -3
- package/dist/index.d.ts +32 -3
- package/dist/index.js +69 -2
- package/dist/server.cjs +142 -11
- package/dist/server.d.cts +20 -4
- package/dist/server.d.ts +20 -4
- package/dist/server.js +29 -3
- package/dist/{types-CCqgVhzf.d.cts → types-BwgkJoM6.d.cts} +160 -2
- package/dist/{types-CCqgVhzf.d.ts → types-BwgkJoM6.d.ts} +160 -2
- package/package.json +1 -1
|
@@ -617,6 +617,7 @@ declare class InvoError extends Error {
|
|
|
617
617
|
* The same code comes back from `cards.beginSetup` and from `mintPlayerToken` for the
|
|
618
618
|
* same reason; those two never create players, so create the member first (for
|
|
619
619
|
* example with `createSetupSession` and a `playerName`, or a currency purchase).
|
|
620
|
+
* `getPlayerRewards` answers it when no player has that email in this game.
|
|
620
621
|
*/
|
|
621
622
|
get isPlayerNotFound(): boolean;
|
|
622
623
|
/**
|
|
@@ -627,7 +628,8 @@ declare class InvoError extends Error {
|
|
|
627
628
|
get isPlayerCreateFailed(): boolean;
|
|
628
629
|
/**
|
|
629
630
|
* True when `cards.createSetupSession` was refused because `playerEmail` was missing or
|
|
630
|
-
* is not an email address (`INVALID_PLAYER_EMAIL`, 400).
|
|
631
|
+
* is not an email address (`INVALID_PLAYER_EMAIL`, 400). `getPlayerRewards` answers it
|
|
632
|
+
* for an email that is not an email address (a blank one never leaves the SDK).
|
|
631
633
|
*/
|
|
632
634
|
get isInvalidPlayerEmail(): boolean;
|
|
633
635
|
/**
|
|
@@ -665,6 +667,17 @@ declare class InvoError extends Error {
|
|
|
665
667
|
* from `CONFIRMATION_SEND_FAILED`, which means a confirmation text could not be sent.
|
|
666
668
|
*/
|
|
667
669
|
get isIdentityCheckUnavailable(): boolean;
|
|
670
|
+
/** True when a reward was already redeemed and its code can no longer be shown (`already_redeemed`, 409). */
|
|
671
|
+
get isRewardAlreadyRedeemed(): boolean;
|
|
672
|
+
/** True when the player has no such reward (`vault_entry_not_found`, 404). */
|
|
673
|
+
get isRewardNotFound(): boolean;
|
|
674
|
+
/**
|
|
675
|
+
* True when the reward cannot be redeemed right now (409): `inventory_exhausted` (no units or
|
|
676
|
+
* codes are left for it) or `conflict` (the reward is reserved or revoked).
|
|
677
|
+
*/
|
|
678
|
+
get isRewardUnavailable(): boolean;
|
|
679
|
+
/** True when the reward expired before it was redeemed (`vault_entry_expired`, 410). */
|
|
680
|
+
get isRewardExpired(): boolean;
|
|
668
681
|
/** Seconds to wait before retrying, when the backend throttled the call (429 `retry_after`). */
|
|
669
682
|
get retryAfter(): number | undefined;
|
|
670
683
|
/** `body` as a plain object, or `{}` if it's a string/number/null (non-JSON responses).
|
|
@@ -3086,5 +3099,150 @@ interface CheckoutClientConfig {
|
|
|
3086
3099
|
retryBaseDelayMs?: number;
|
|
3087
3100
|
hooks?: InvoHooks;
|
|
3088
3101
|
}
|
|
3102
|
+
/** A step's state on a loyalty card. `complete` is the only authority on "done". */
|
|
3103
|
+
type LoyaltyStepState = "complete" | "open" | "locked" | (string & {});
|
|
3104
|
+
/**
|
|
3105
|
+
* How far a player is through one step: "3 / 5". `target` is the step's count (1 unless
|
|
3106
|
+
* the developer set a count). `current` reaches `target` only when the step's `state` is
|
|
3107
|
+
* `complete`, so render progress and let `state` decide completion.
|
|
3108
|
+
*/
|
|
3109
|
+
interface LoyaltyStepProgress {
|
|
3110
|
+
current: number;
|
|
3111
|
+
target: number;
|
|
3112
|
+
}
|
|
3113
|
+
/** One step on a {@link LoyaltyCard}. */
|
|
3114
|
+
interface LoyaltyCardStep {
|
|
3115
|
+
/** The step's id on a developer program; `null` on other offers. */
|
|
3116
|
+
stepId: string | null;
|
|
3117
|
+
index: number;
|
|
3118
|
+
/** The action id, e.g. `buy_currency`, `custom_event`. */
|
|
3119
|
+
action: string;
|
|
3120
|
+
/** The action's display name, e.g. "Buy currency". */
|
|
3121
|
+
label: string;
|
|
3122
|
+
/** A ready-to-show line for the step, e.g. "Buy currency (at least $10.00)". */
|
|
3123
|
+
summary: string;
|
|
3124
|
+
windowHours: number | null;
|
|
3125
|
+
state: LoyaltyStepState;
|
|
3126
|
+
/**
|
|
3127
|
+
* `{ current, target }` on a live card. `null` on a preview, and on a live step whose
|
|
3128
|
+
* number could not be read this time: render the step's `state` alone then.
|
|
3129
|
+
*/
|
|
3130
|
+
progress: LoyaltyStepProgress | null;
|
|
3131
|
+
raw: Record<string, unknown>;
|
|
3132
|
+
}
|
|
3133
|
+
/** A reward's state. Only `unlocked` can be redeemed. */
|
|
3134
|
+
type LoyaltyRewardState = "unlocked" | "reserved" | "redeemed" | "expired" | "revoked" | (string & {});
|
|
3135
|
+
/** A reward the player unlocked from a card. Never carries a code: a redeemed one shows its mask. */
|
|
3136
|
+
interface LoyaltyCardReward {
|
|
3137
|
+
/** Pass this to `InvoClient.redeemReward`. */
|
|
3138
|
+
vaultEntryId: string;
|
|
3139
|
+
rewardId: string;
|
|
3140
|
+
state: LoyaltyRewardState;
|
|
3141
|
+
unlockedAt: string;
|
|
3142
|
+
expiresAt: string;
|
|
3143
|
+
redeemedAt: string | null;
|
|
3144
|
+
/** The masked code once redeemed, e.g. "••••ABCD"; otherwise `null`. */
|
|
3145
|
+
codeMasked: string | null;
|
|
3146
|
+
canRedeem: boolean;
|
|
3147
|
+
/** True while calling redeem again will show the code once more. */
|
|
3148
|
+
canRevealAgain: boolean;
|
|
3149
|
+
revealUntil: string | null;
|
|
3150
|
+
raw: Record<string, unknown>;
|
|
3151
|
+
}
|
|
3152
|
+
/** One loyalty program as the player sees it: steps, progress and unlocked rewards. */
|
|
3153
|
+
interface LoyaltyCard {
|
|
3154
|
+
/** Passed through exactly as INVO sent it (as are `stepsRequired` / `stepsComplete`); never defaulted by the SDK. */
|
|
3155
|
+
cardVersion: number;
|
|
3156
|
+
/** `live` for a player's card; `preview` only in the console. */
|
|
3157
|
+
mode: "live" | "preview" | (string & {});
|
|
3158
|
+
programId: string | null;
|
|
3159
|
+
questId: string | null;
|
|
3160
|
+
questVersion: number | null;
|
|
3161
|
+
campaignId: string | null;
|
|
3162
|
+
title: string;
|
|
3163
|
+
description: string;
|
|
3164
|
+
brand: {
|
|
3165
|
+
name: string | null;
|
|
3166
|
+
logoUrl: string | null;
|
|
3167
|
+
};
|
|
3168
|
+
artUrl: string | null;
|
|
3169
|
+
reward: {
|
|
3170
|
+
rewardId: string | null;
|
|
3171
|
+
name: string | null;
|
|
3172
|
+
};
|
|
3173
|
+
orderMode: "ordered" | "any_order" | (string & {});
|
|
3174
|
+
/** `available`, `in_progress`, `completed`, `expired` or `in_review`. */
|
|
3175
|
+
status: string;
|
|
3176
|
+
startsAt: string | null;
|
|
3177
|
+
endsAt: string | null;
|
|
3178
|
+
completionHours: number | null;
|
|
3179
|
+
/** A ready-to-show sentence when the program has no fixed time limit; otherwise `null`. */
|
|
3180
|
+
completionNote: string | null;
|
|
3181
|
+
windowEndsAt: string | null;
|
|
3182
|
+
completedAt: string | null;
|
|
3183
|
+
/** Steps needed to unlock the reward, as INVO sent it. */
|
|
3184
|
+
stepsRequired: number;
|
|
3185
|
+
/** Steps done, as INVO sent it (never recounted from `steps`). */
|
|
3186
|
+
stepsComplete: number;
|
|
3187
|
+
steps: LoyaltyCardStep[];
|
|
3188
|
+
rewards: LoyaltyCardReward[];
|
|
3189
|
+
raw: Record<string, unknown>;
|
|
3190
|
+
}
|
|
3191
|
+
/**
|
|
3192
|
+
* A player's loyalty cards: `InvoClient.getMyRewards()` (the signed-in player) or
|
|
3193
|
+
* `InvoServer.getPlayerRewards(playerEmail)` (your server). The same shape either way.
|
|
3194
|
+
*/
|
|
3195
|
+
interface LoyaltyCardsResult {
|
|
3196
|
+
/** Passed through exactly as INVO sent it. */
|
|
3197
|
+
cardVersion: number;
|
|
3198
|
+
/** One card per program offered to the player in this game. Empty when there is nothing to show. */
|
|
3199
|
+
cards: LoyaltyCard[];
|
|
3200
|
+
raw: Record<string, unknown>;
|
|
3201
|
+
}
|
|
3202
|
+
/** One reward the player holds or held (`InvoClient.getMyVault()`). Never the code. */
|
|
3203
|
+
interface LoyaltyVaultEntry {
|
|
3204
|
+
vaultEntryId: string;
|
|
3205
|
+
rewardRef: string;
|
|
3206
|
+
programId: string;
|
|
3207
|
+
questId: string | null;
|
|
3208
|
+
/** A decimal string. */
|
|
3209
|
+
units: string;
|
|
3210
|
+
state: LoyaltyRewardState;
|
|
3211
|
+
unlockedAt: string | null;
|
|
3212
|
+
expiresAt: string | null;
|
|
3213
|
+
redeemedAt: string | null;
|
|
3214
|
+
codeMasked: string | null;
|
|
3215
|
+
raw: Record<string, unknown>;
|
|
3216
|
+
}
|
|
3217
|
+
interface LoyaltyVaultResult {
|
|
3218
|
+
/** Newest first. */
|
|
3219
|
+
items: LoyaltyVaultEntry[];
|
|
3220
|
+
raw: Record<string, unknown>;
|
|
3221
|
+
}
|
|
3222
|
+
/**
|
|
3223
|
+
* The result of `InvoClient.redeemReward`. The ONLY response that carries a code: show it
|
|
3224
|
+
* to the player straight away, and never log, cache or store it (`raw` holds it too).
|
|
3225
|
+
*/
|
|
3226
|
+
interface RedeemRewardResult {
|
|
3227
|
+
vaultEntryId: string;
|
|
3228
|
+
rewardRef: string;
|
|
3229
|
+
state: LoyaltyRewardState;
|
|
3230
|
+
redeemedAt: string | null;
|
|
3231
|
+
/** The reward code. `null` when it cannot be shown in this response. */
|
|
3232
|
+
code: string | null;
|
|
3233
|
+
codeMasked: string | null;
|
|
3234
|
+
/** True when `code` is shown again for a reward this player already redeemed. */
|
|
3235
|
+
revealedAgain: boolean;
|
|
3236
|
+
/** Until when the player can see the code again; `null` once past. */
|
|
3237
|
+
revealUntil: string | null;
|
|
3238
|
+
raw: Record<string, unknown>;
|
|
3239
|
+
}
|
|
3240
|
+
/** A short-lived link to INVO's hosted "My rewards" page (`InvoClient.getRewardsPageLink()`). */
|
|
3241
|
+
interface RewardsPageLink {
|
|
3242
|
+
/** Open in a browser or web view. Personal to the player: never share or store it. */
|
|
3243
|
+
url: string;
|
|
3244
|
+
expiresAt: string;
|
|
3245
|
+
raw: Record<string, unknown>;
|
|
3246
|
+
}
|
|
3089
3247
|
|
|
3090
|
-
export { type
|
|
3248
|
+
export { type CardSetupConfirmResult as $, type ApproveResult as A, type BalanceResult as B, type ConfirmReceiptResult as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type LoyaltyCardStep as F, type LoyaltyRewardState as G, Http as H, InvoError as I, type LoyaltyStepProgress as J, type LoyaltyStepState as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type LoyaltyVaultEntry as N, type PendingCollectItem as O, type PurchaseStatusResult as P, type PurchaseRefusalReason as Q, type RedeemRewardResult as R, type Rail as S, type AuthHeader as T, type CardSetupSessionInput as U, type VerificationMethod as V, type WaitForPurchaseInput as W, type CardSetupSessionResult as X, type CardSetupInput as Y, type CardSetupResult as Z, type CardSetupConfirmInput as _, type PurchaseCredited as a, type PhoneShareContact as a$, type PlayerCardsResult as a0, type PlatformPurchaseInput as a1, type PlatformPurchaseResult as a2, type PlatformOrderStatusResult as a3, type PlatformRefundInput as a4, type PlatformRefundResult as a5, type CreateSubscriptionInput as a6, type SubscriptionResult as a7, type GetSubscriptionOptions as a8, type GetSubscriptionResult as a9, type CurrencyPurchaseQuote as aA, type ConfirmPaymentResult as aB, type OrderDetailsResult as aC, type SteamPacksQuery as aD, type SteamPacksResult as aE, type SteamInitPurchaseInput as aF, type SteamInitPurchaseResult as aG, type SteamFinalizeInput as aH, type SteamFinalizeResult as aI, type PurchaseItemInput as aJ, type PurchaseItemResult as aK, type ItemHistoryQuery as aL, type ItemHistoryResult as aM, type ItemOrderQuery as aN, type PlayerBalanceQuery as aO, type PlayerBalanceResult as aP, type InboundPendingQuery as aQ, type InboundPendingResult as aR, type LinkedIdentitiesQuery as aS, type LinkedIdentitiesResult as aT, type SmsVerifyResult as aU, type ClaimTransferInput as aV, type ClaimResult as aW, type ClaimCurrencyInput as aX, type TransactionStatusResult as aY, type GuardianApprovalStatusResult as aZ, type ServerDestinationsQuery as a_, type ListSubscriptionsOptions as aa, type SubscriptionListResult as ab, type CancelSubscriptionOptions as ac, type CancelResult as ad, type ChangeAmountResult as ae, type SetPaymentMethodInput as af, type SetPaymentMethodResult as ag, type RefundSubscriptionInput as ah, type RefundResult as ai, type SteamSubscriptionInitInput as aj, type SteamInitResult as ak, type SteamFinalizeSubscriptionResult as al, type SandboxClockResult as am, type SandboxFailureOutcome as an, type SandboxForceFailureOptions as ao, type SandboxForceAuthChallengeOptions as ap, type ServerConfig as aq, type PlayerToken as ar, type InitiateSendInput as as, type InitiateResult as at, type InitiateTransferInput as au, type CreateCheckoutInput as av, type CreateCheckoutResult as aw, type PurchaseInput as ax, type PurchaseResult as ay, type CurrencyPurchaseQuoteInput as az, type PurchaseExpired as b, type PhoneShareInitiateResult as b0, type PhoneShareApproveInput as b1, type PhoneShareApproveResult as b2, type PhoneShareStatusResult as b3, type BeginDeviceApprovalInput as b4, type DeviceApprovalGrant as b5, type PollDeviceApprovalInput as b6, type DeviceApprovalPollResult as b7, type ConfirmDeviceEnrollmentInput as b8, type ConfirmDeviceEnrollmentResult as b9, type RefundRevenueShareAttribution as bA, type RefundWarning as bB, type SandboxClockState as bC, type SavedCard as bD, type SteamPack as bE, type SteamUserSession as bF, type Subscription as bG, type SubscriptionBaseInput as bH, type SubscriptionConsent as bI, type SubscriptionConsentInput as bJ, type SubscriptionFundingRail as bK, type SubscriptionInterval as bL, type SubscriptionRevenueShare as bM, type SubscriptionRevenueShareInput as bN, type SubscriptionStatus as bO, type UnacknowledgedPurchaseOutcome as bP, isRefundPendingApproval as bQ, type ApproveWithDeviceCodeInput as ba, type DeviceApprovalSettleResult as bb, type CompleteDeviceApprovalInput as bc, type CompleteDeviceApprovalResult as bd, type CardSetupStatus as be, type CheckoutWarning as bf, type CurrencyBalance as bg, type CurrencyPurchaseQuoteBreakdown as bh, type DeviceApprovalChannel as bi, type DeviceApprovalEnrollment as bj, type DeviceApprovalFlow as bk, type DeviceApprovalPollStatus as bl, type DeviceEnrollmentDecision as bm, type DeviceEnrollmentRespond as bn, type FeeTakenFrom as bo, type FirstCharge as bp, type FirstChargeStatus as bq, type FundingSource as br, type InboundPendingItem as bs, type LinkedIdentityEmail as bt, type MinPurchaseWarning as bu, type PlatformPurchaseStatus as bv, type RefundInitiation as bw, type RefundPendingApproval as bx, type RefundProcessingFeeBasis as by, type RefundReceipt as bz, type PurchaseRefunded as c, type PurchaseRefused as d, type CheckoutClientConfig as e, type PurchaseStatusInput as f, type CallOptions as g, type CheckoutMountHandle as h, type ClientConfig as i, type PendingCollectResult as j, type DestinationsResult as k, type LoyaltyCardsResult as l, type LoyaltyVaultResult as m, type RewardsPageLink as n, type EnrollmentVerifyResult as o, type RecoveryBeginResult as p, type RecoveryCompleteResult as q, type BalanceRow as r, type CheckoutPurchaseStatus as s, type DestinationGame as t, type InvoErrorInfo as u, type InvoHooks as v, type InvoRequestInfo as w, type InvoResponseInfo as x, type LoyaltyCard as y, type LoyaltyCardReward as z };
|
|
@@ -617,6 +617,7 @@ declare class InvoError extends Error {
|
|
|
617
617
|
* The same code comes back from `cards.beginSetup` and from `mintPlayerToken` for the
|
|
618
618
|
* same reason; those two never create players, so create the member first (for
|
|
619
619
|
* example with `createSetupSession` and a `playerName`, or a currency purchase).
|
|
620
|
+
* `getPlayerRewards` answers it when no player has that email in this game.
|
|
620
621
|
*/
|
|
621
622
|
get isPlayerNotFound(): boolean;
|
|
622
623
|
/**
|
|
@@ -627,7 +628,8 @@ declare class InvoError extends Error {
|
|
|
627
628
|
get isPlayerCreateFailed(): boolean;
|
|
628
629
|
/**
|
|
629
630
|
* True when `cards.createSetupSession` was refused because `playerEmail` was missing or
|
|
630
|
-
* is not an email address (`INVALID_PLAYER_EMAIL`, 400).
|
|
631
|
+
* is not an email address (`INVALID_PLAYER_EMAIL`, 400). `getPlayerRewards` answers it
|
|
632
|
+
* for an email that is not an email address (a blank one never leaves the SDK).
|
|
631
633
|
*/
|
|
632
634
|
get isInvalidPlayerEmail(): boolean;
|
|
633
635
|
/**
|
|
@@ -665,6 +667,17 @@ declare class InvoError extends Error {
|
|
|
665
667
|
* from `CONFIRMATION_SEND_FAILED`, which means a confirmation text could not be sent.
|
|
666
668
|
*/
|
|
667
669
|
get isIdentityCheckUnavailable(): boolean;
|
|
670
|
+
/** True when a reward was already redeemed and its code can no longer be shown (`already_redeemed`, 409). */
|
|
671
|
+
get isRewardAlreadyRedeemed(): boolean;
|
|
672
|
+
/** True when the player has no such reward (`vault_entry_not_found`, 404). */
|
|
673
|
+
get isRewardNotFound(): boolean;
|
|
674
|
+
/**
|
|
675
|
+
* True when the reward cannot be redeemed right now (409): `inventory_exhausted` (no units or
|
|
676
|
+
* codes are left for it) or `conflict` (the reward is reserved or revoked).
|
|
677
|
+
*/
|
|
678
|
+
get isRewardUnavailable(): boolean;
|
|
679
|
+
/** True when the reward expired before it was redeemed (`vault_entry_expired`, 410). */
|
|
680
|
+
get isRewardExpired(): boolean;
|
|
668
681
|
/** Seconds to wait before retrying, when the backend throttled the call (429 `retry_after`). */
|
|
669
682
|
get retryAfter(): number | undefined;
|
|
670
683
|
/** `body` as a plain object, or `{}` if it's a string/number/null (non-JSON responses).
|
|
@@ -3086,5 +3099,150 @@ interface CheckoutClientConfig {
|
|
|
3086
3099
|
retryBaseDelayMs?: number;
|
|
3087
3100
|
hooks?: InvoHooks;
|
|
3088
3101
|
}
|
|
3102
|
+
/** A step's state on a loyalty card. `complete` is the only authority on "done". */
|
|
3103
|
+
type LoyaltyStepState = "complete" | "open" | "locked" | (string & {});
|
|
3104
|
+
/**
|
|
3105
|
+
* How far a player is through one step: "3 / 5". `target` is the step's count (1 unless
|
|
3106
|
+
* the developer set a count). `current` reaches `target` only when the step's `state` is
|
|
3107
|
+
* `complete`, so render progress and let `state` decide completion.
|
|
3108
|
+
*/
|
|
3109
|
+
interface LoyaltyStepProgress {
|
|
3110
|
+
current: number;
|
|
3111
|
+
target: number;
|
|
3112
|
+
}
|
|
3113
|
+
/** One step on a {@link LoyaltyCard}. */
|
|
3114
|
+
interface LoyaltyCardStep {
|
|
3115
|
+
/** The step's id on a developer program; `null` on other offers. */
|
|
3116
|
+
stepId: string | null;
|
|
3117
|
+
index: number;
|
|
3118
|
+
/** The action id, e.g. `buy_currency`, `custom_event`. */
|
|
3119
|
+
action: string;
|
|
3120
|
+
/** The action's display name, e.g. "Buy currency". */
|
|
3121
|
+
label: string;
|
|
3122
|
+
/** A ready-to-show line for the step, e.g. "Buy currency (at least $10.00)". */
|
|
3123
|
+
summary: string;
|
|
3124
|
+
windowHours: number | null;
|
|
3125
|
+
state: LoyaltyStepState;
|
|
3126
|
+
/**
|
|
3127
|
+
* `{ current, target }` on a live card. `null` on a preview, and on a live step whose
|
|
3128
|
+
* number could not be read this time: render the step's `state` alone then.
|
|
3129
|
+
*/
|
|
3130
|
+
progress: LoyaltyStepProgress | null;
|
|
3131
|
+
raw: Record<string, unknown>;
|
|
3132
|
+
}
|
|
3133
|
+
/** A reward's state. Only `unlocked` can be redeemed. */
|
|
3134
|
+
type LoyaltyRewardState = "unlocked" | "reserved" | "redeemed" | "expired" | "revoked" | (string & {});
|
|
3135
|
+
/** A reward the player unlocked from a card. Never carries a code: a redeemed one shows its mask. */
|
|
3136
|
+
interface LoyaltyCardReward {
|
|
3137
|
+
/** Pass this to `InvoClient.redeemReward`. */
|
|
3138
|
+
vaultEntryId: string;
|
|
3139
|
+
rewardId: string;
|
|
3140
|
+
state: LoyaltyRewardState;
|
|
3141
|
+
unlockedAt: string;
|
|
3142
|
+
expiresAt: string;
|
|
3143
|
+
redeemedAt: string | null;
|
|
3144
|
+
/** The masked code once redeemed, e.g. "••••ABCD"; otherwise `null`. */
|
|
3145
|
+
codeMasked: string | null;
|
|
3146
|
+
canRedeem: boolean;
|
|
3147
|
+
/** True while calling redeem again will show the code once more. */
|
|
3148
|
+
canRevealAgain: boolean;
|
|
3149
|
+
revealUntil: string | null;
|
|
3150
|
+
raw: Record<string, unknown>;
|
|
3151
|
+
}
|
|
3152
|
+
/** One loyalty program as the player sees it: steps, progress and unlocked rewards. */
|
|
3153
|
+
interface LoyaltyCard {
|
|
3154
|
+
/** Passed through exactly as INVO sent it (as are `stepsRequired` / `stepsComplete`); never defaulted by the SDK. */
|
|
3155
|
+
cardVersion: number;
|
|
3156
|
+
/** `live` for a player's card; `preview` only in the console. */
|
|
3157
|
+
mode: "live" | "preview" | (string & {});
|
|
3158
|
+
programId: string | null;
|
|
3159
|
+
questId: string | null;
|
|
3160
|
+
questVersion: number | null;
|
|
3161
|
+
campaignId: string | null;
|
|
3162
|
+
title: string;
|
|
3163
|
+
description: string;
|
|
3164
|
+
brand: {
|
|
3165
|
+
name: string | null;
|
|
3166
|
+
logoUrl: string | null;
|
|
3167
|
+
};
|
|
3168
|
+
artUrl: string | null;
|
|
3169
|
+
reward: {
|
|
3170
|
+
rewardId: string | null;
|
|
3171
|
+
name: string | null;
|
|
3172
|
+
};
|
|
3173
|
+
orderMode: "ordered" | "any_order" | (string & {});
|
|
3174
|
+
/** `available`, `in_progress`, `completed`, `expired` or `in_review`. */
|
|
3175
|
+
status: string;
|
|
3176
|
+
startsAt: string | null;
|
|
3177
|
+
endsAt: string | null;
|
|
3178
|
+
completionHours: number | null;
|
|
3179
|
+
/** A ready-to-show sentence when the program has no fixed time limit; otherwise `null`. */
|
|
3180
|
+
completionNote: string | null;
|
|
3181
|
+
windowEndsAt: string | null;
|
|
3182
|
+
completedAt: string | null;
|
|
3183
|
+
/** Steps needed to unlock the reward, as INVO sent it. */
|
|
3184
|
+
stepsRequired: number;
|
|
3185
|
+
/** Steps done, as INVO sent it (never recounted from `steps`). */
|
|
3186
|
+
stepsComplete: number;
|
|
3187
|
+
steps: LoyaltyCardStep[];
|
|
3188
|
+
rewards: LoyaltyCardReward[];
|
|
3189
|
+
raw: Record<string, unknown>;
|
|
3190
|
+
}
|
|
3191
|
+
/**
|
|
3192
|
+
* A player's loyalty cards: `InvoClient.getMyRewards()` (the signed-in player) or
|
|
3193
|
+
* `InvoServer.getPlayerRewards(playerEmail)` (your server). The same shape either way.
|
|
3194
|
+
*/
|
|
3195
|
+
interface LoyaltyCardsResult {
|
|
3196
|
+
/** Passed through exactly as INVO sent it. */
|
|
3197
|
+
cardVersion: number;
|
|
3198
|
+
/** One card per program offered to the player in this game. Empty when there is nothing to show. */
|
|
3199
|
+
cards: LoyaltyCard[];
|
|
3200
|
+
raw: Record<string, unknown>;
|
|
3201
|
+
}
|
|
3202
|
+
/** One reward the player holds or held (`InvoClient.getMyVault()`). Never the code. */
|
|
3203
|
+
interface LoyaltyVaultEntry {
|
|
3204
|
+
vaultEntryId: string;
|
|
3205
|
+
rewardRef: string;
|
|
3206
|
+
programId: string;
|
|
3207
|
+
questId: string | null;
|
|
3208
|
+
/** A decimal string. */
|
|
3209
|
+
units: string;
|
|
3210
|
+
state: LoyaltyRewardState;
|
|
3211
|
+
unlockedAt: string | null;
|
|
3212
|
+
expiresAt: string | null;
|
|
3213
|
+
redeemedAt: string | null;
|
|
3214
|
+
codeMasked: string | null;
|
|
3215
|
+
raw: Record<string, unknown>;
|
|
3216
|
+
}
|
|
3217
|
+
interface LoyaltyVaultResult {
|
|
3218
|
+
/** Newest first. */
|
|
3219
|
+
items: LoyaltyVaultEntry[];
|
|
3220
|
+
raw: Record<string, unknown>;
|
|
3221
|
+
}
|
|
3222
|
+
/**
|
|
3223
|
+
* The result of `InvoClient.redeemReward`. The ONLY response that carries a code: show it
|
|
3224
|
+
* to the player straight away, and never log, cache or store it (`raw` holds it too).
|
|
3225
|
+
*/
|
|
3226
|
+
interface RedeemRewardResult {
|
|
3227
|
+
vaultEntryId: string;
|
|
3228
|
+
rewardRef: string;
|
|
3229
|
+
state: LoyaltyRewardState;
|
|
3230
|
+
redeemedAt: string | null;
|
|
3231
|
+
/** The reward code. `null` when it cannot be shown in this response. */
|
|
3232
|
+
code: string | null;
|
|
3233
|
+
codeMasked: string | null;
|
|
3234
|
+
/** True when `code` is shown again for a reward this player already redeemed. */
|
|
3235
|
+
revealedAgain: boolean;
|
|
3236
|
+
/** Until when the player can see the code again; `null` once past. */
|
|
3237
|
+
revealUntil: string | null;
|
|
3238
|
+
raw: Record<string, unknown>;
|
|
3239
|
+
}
|
|
3240
|
+
/** A short-lived link to INVO's hosted "My rewards" page (`InvoClient.getRewardsPageLink()`). */
|
|
3241
|
+
interface RewardsPageLink {
|
|
3242
|
+
/** Open in a browser or web view. Personal to the player: never share or store it. */
|
|
3243
|
+
url: string;
|
|
3244
|
+
expiresAt: string;
|
|
3245
|
+
raw: Record<string, unknown>;
|
|
3246
|
+
}
|
|
3089
3247
|
|
|
3090
|
-
export { type
|
|
3248
|
+
export { type CardSetupConfirmResult as $, type ApproveResult as A, type BalanceResult as B, type ConfirmReceiptResult as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type LoyaltyCardStep as F, type LoyaltyRewardState as G, Http as H, InvoError as I, type LoyaltyStepProgress as J, type LoyaltyStepState as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type LoyaltyVaultEntry as N, type PendingCollectItem as O, type PurchaseStatusResult as P, type PurchaseRefusalReason as Q, type RedeemRewardResult as R, type Rail as S, type AuthHeader as T, type CardSetupSessionInput as U, type VerificationMethod as V, type WaitForPurchaseInput as W, type CardSetupSessionResult as X, type CardSetupInput as Y, type CardSetupResult as Z, type CardSetupConfirmInput as _, type PurchaseCredited as a, type PhoneShareContact as a$, type PlayerCardsResult as a0, type PlatformPurchaseInput as a1, type PlatformPurchaseResult as a2, type PlatformOrderStatusResult as a3, type PlatformRefundInput as a4, type PlatformRefundResult as a5, type CreateSubscriptionInput as a6, type SubscriptionResult as a7, type GetSubscriptionOptions as a8, type GetSubscriptionResult as a9, type CurrencyPurchaseQuote as aA, type ConfirmPaymentResult as aB, type OrderDetailsResult as aC, type SteamPacksQuery as aD, type SteamPacksResult as aE, type SteamInitPurchaseInput as aF, type SteamInitPurchaseResult as aG, type SteamFinalizeInput as aH, type SteamFinalizeResult as aI, type PurchaseItemInput as aJ, type PurchaseItemResult as aK, type ItemHistoryQuery as aL, type ItemHistoryResult as aM, type ItemOrderQuery as aN, type PlayerBalanceQuery as aO, type PlayerBalanceResult as aP, type InboundPendingQuery as aQ, type InboundPendingResult as aR, type LinkedIdentitiesQuery as aS, type LinkedIdentitiesResult as aT, type SmsVerifyResult as aU, type ClaimTransferInput as aV, type ClaimResult as aW, type ClaimCurrencyInput as aX, type TransactionStatusResult as aY, type GuardianApprovalStatusResult as aZ, type ServerDestinationsQuery as a_, type ListSubscriptionsOptions as aa, type SubscriptionListResult as ab, type CancelSubscriptionOptions as ac, type CancelResult as ad, type ChangeAmountResult as ae, type SetPaymentMethodInput as af, type SetPaymentMethodResult as ag, type RefundSubscriptionInput as ah, type RefundResult as ai, type SteamSubscriptionInitInput as aj, type SteamInitResult as ak, type SteamFinalizeSubscriptionResult as al, type SandboxClockResult as am, type SandboxFailureOutcome as an, type SandboxForceFailureOptions as ao, type SandboxForceAuthChallengeOptions as ap, type ServerConfig as aq, type PlayerToken as ar, type InitiateSendInput as as, type InitiateResult as at, type InitiateTransferInput as au, type CreateCheckoutInput as av, type CreateCheckoutResult as aw, type PurchaseInput as ax, type PurchaseResult as ay, type CurrencyPurchaseQuoteInput as az, type PurchaseExpired as b, type PhoneShareInitiateResult as b0, type PhoneShareApproveInput as b1, type PhoneShareApproveResult as b2, type PhoneShareStatusResult as b3, type BeginDeviceApprovalInput as b4, type DeviceApprovalGrant as b5, type PollDeviceApprovalInput as b6, type DeviceApprovalPollResult as b7, type ConfirmDeviceEnrollmentInput as b8, type ConfirmDeviceEnrollmentResult as b9, type RefundRevenueShareAttribution as bA, type RefundWarning as bB, type SandboxClockState as bC, type SavedCard as bD, type SteamPack as bE, type SteamUserSession as bF, type Subscription as bG, type SubscriptionBaseInput as bH, type SubscriptionConsent as bI, type SubscriptionConsentInput as bJ, type SubscriptionFundingRail as bK, type SubscriptionInterval as bL, type SubscriptionRevenueShare as bM, type SubscriptionRevenueShareInput as bN, type SubscriptionStatus as bO, type UnacknowledgedPurchaseOutcome as bP, isRefundPendingApproval as bQ, type ApproveWithDeviceCodeInput as ba, type DeviceApprovalSettleResult as bb, type CompleteDeviceApprovalInput as bc, type CompleteDeviceApprovalResult as bd, type CardSetupStatus as be, type CheckoutWarning as bf, type CurrencyBalance as bg, type CurrencyPurchaseQuoteBreakdown as bh, type DeviceApprovalChannel as bi, type DeviceApprovalEnrollment as bj, type DeviceApprovalFlow as bk, type DeviceApprovalPollStatus as bl, type DeviceEnrollmentDecision as bm, type DeviceEnrollmentRespond as bn, type FeeTakenFrom as bo, type FirstCharge as bp, type FirstChargeStatus as bq, type FundingSource as br, type InboundPendingItem as bs, type LinkedIdentityEmail as bt, type MinPurchaseWarning as bu, type PlatformPurchaseStatus as bv, type RefundInitiation as bw, type RefundPendingApproval as bx, type RefundProcessingFeeBasis as by, type RefundReceipt as bz, type PurchaseRefunded as c, type PurchaseRefused as d, type CheckoutClientConfig as e, type PurchaseStatusInput as f, type CallOptions as g, type CheckoutMountHandle as h, type ClientConfig as i, type PendingCollectResult as j, type DestinationsResult as k, type LoyaltyCardsResult as l, type LoyaltyVaultResult as m, type RewardsPageLink as n, type EnrollmentVerifyResult as o, type RecoveryBeginResult as p, type RecoveryCompleteResult as q, type BalanceRow as r, type CheckoutPurchaseStatus as s, type DestinationGame as t, type InvoErrorInfo as u, type InvoHooks as v, type InvoRequestInfo as w, type InvoResponseInfo as x, type LoyaltyCard as y, type LoyaltyCardReward as z };
|
package/package.json
CHANGED