@invonetwork/web-sdk 3.20.0 → 3.21.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.
@@ -620,6 +620,33 @@ declare class InvoError extends Error {
620
620
  * `getPlayerRewards` answers it when no player has that email in this game.
621
621
  */
622
622
  get isPlayerNotFound(): boolean;
623
+ /**
624
+ * True when an approve was refused because the player token predates a change to the
625
+ * sender's identity (`PLAYER_TOKEN_STALE`, 403): their phone was added (for example on
626
+ * the initiate), which gives them a new identity. Nothing moved and the token stays
627
+ * refused. Re-mint the player token (or use the `playerToken` from the initiate result)
628
+ * and retry once. The SDK never retries a money call on its own.
629
+ */
630
+ get isPlayerTokenStale(): boolean;
631
+ /**
632
+ * True when `updatePlayerPhone` was refused because the player has secured this account,
633
+ * so the change needs the player's own confirmation (`PHONE_CHANGE_REQUIRES_VERIFICATION`,
634
+ * 409). Nothing changed. Until that confirmation flow is available, contact INVO support.
635
+ */
636
+ get isPhoneChangeRequiresVerification(): boolean;
637
+ /**
638
+ * True when `registerPlayer` found the player already in your game with a DIFFERENT
639
+ * phone (`PHONE_MISMATCH`, 409). Nothing changed; use `updatePlayerPhone` to change it.
640
+ * (`mintPlayerToken` reports the same situation as `phoneMismatch: true` on success.)
641
+ */
642
+ get isPhoneMismatch(): boolean;
643
+ /**
644
+ * True when the phone you supplied belongs to another email
645
+ * (`PHONE_SHARE_APPROVAL_REQUIRED`, 409) on `mintPlayerToken`, `registerPlayer` or
646
+ * `updatePlayerPhone`. Nothing was created or changed. The same condition as
647
+ * {@link isPhoneShareApprovalRequired}, named for these registration calls.
648
+ */
649
+ get isPhoneShareRefused(): boolean;
623
650
  /**
624
651
  * True when `cards.createSetupSession` was asked to create a new member (`playerName`
625
652
  * sent) and INVO could not create them (`PLAYER_CREATE_FAILED`, 503). Nothing was
@@ -831,7 +858,76 @@ interface PlayerToken {
831
858
  token: string;
832
859
  expiresAt: string;
833
860
  identityId: string;
861
+ /**
862
+ * `true` when this call CREATED the player in your game (you passed `playerPhone` and
863
+ * no player with `playerEmail` existed). Absent otherwise.
864
+ */
865
+ created?: boolean;
866
+ /**
867
+ * `true` when the player already exists in your game with a DIFFERENT phone than the
868
+ * `playerPhone` you passed. The token is still minted for the existing player and their
869
+ * phone is NOT changed; use `updatePlayerPhone` to change it. Absent otherwise.
870
+ */
871
+ phoneMismatch?: boolean;
872
+ }
873
+ /** Input to `InvoServer.mintPlayerToken`. */
874
+ interface MintPlayerTokenInput {
875
+ playerEmail: string;
876
+ /**
877
+ * Optional, E.164. When the player is not in your game yet, passing it CREATES the
878
+ * player (so a first-time receiver can collect without buying first). An existing
879
+ * player's phone is never changed here. Without it, an unknown player is a 404.
880
+ */
881
+ playerPhone?: string;
882
+ /** Optional display name, used only when the player is created. */
883
+ playerName?: string;
884
+ }
885
+ /** Input to `InvoServer.registerPlayer`. */
886
+ interface RegisterPlayerInput {
887
+ playerEmail: string;
888
+ /** Required, E.164. */
889
+ playerPhone: string;
890
+ /** Optional display name for the new player. */
891
+ playerName?: string;
892
+ }
893
+ /** Result of `InvoServer.registerPlayer`. */
894
+ interface RegisterPlayerResult {
895
+ /** `"created"` (HTTP 201) or `"exists"` (HTTP 200, already in your game with that phone). */
896
+ status: "created" | "exists";
897
+ identityId: string;
898
+ /** A player token for this player, when INVO can issue one for your game. */
899
+ playerToken?: string;
900
+ playerTokenExpiresAt?: string;
901
+ raw: Record<string, unknown>;
902
+ }
903
+ /** Input to `InvoServer.updatePlayerPhone`. */
904
+ interface UpdatePlayerPhoneInput {
905
+ playerEmail: string;
906
+ /** The player's new phone, E.164. */
907
+ newPhone: string;
834
908
  }
909
+ /** Result of `InvoServer.updatePlayerPhone`. */
910
+ interface UpdatePlayerPhoneResult {
911
+ /** `"updated"`, or `"unchanged"` when the player already has that phone. */
912
+ status: "updated" | "unchanged";
913
+ /**
914
+ * `true` when the change gave the player a new INVO identity. Any player token minted
915
+ * before this call is then out of date: use `playerToken` below (or mint a new one).
916
+ */
917
+ identityRekeyed: boolean;
918
+ identityId: string;
919
+ /** A player token for the player's current identity, when INVO can issue one for your game. */
920
+ playerToken?: string;
921
+ playerTokenExpiresAt?: string;
922
+ raw: Record<string, unknown>;
923
+ }
924
+ /**
925
+ * How INVO will deliver (initiate: `claimDeliveryPlanned`) or delivered (approve:
926
+ * `claimDelivery`) the claim link or code: `"email"`, `"none"` (nothing is sent), or
927
+ * `"sms"` (legacy, only when no email is on file). Typed as `string` so a value added
928
+ * later is passed through rather than dropped.
929
+ */
930
+ type ClaimDelivery = "email" | "none" | "sms" | (string & {});
835
931
  interface InitiateSendInput {
836
932
  clientRequestId: string;
837
933
  senderPlayerName: string;
@@ -869,6 +965,20 @@ interface InitiateResult {
869
965
  verificationMethod: VerificationMethod | undefined;
870
966
  /** Present on the minor/guardian path (HTTP 202): the backend's guardian_approval block. */
871
967
  guardianApproval?: unknown;
968
+ /**
969
+ * `true` when THIS initiate gave the sender a new INVO identity (for example their phone
970
+ * was added to an email-only player). A player token minted before the initiate is then
971
+ * out of date and approve refuses it (`err.isPlayerTokenStale`). Hand the browser
972
+ * `playerToken` below before it approves. Absent when the identity did not change.
973
+ */
974
+ identityRekeyed?: boolean;
975
+ /** A fresh player token for the sender's new identity; present only with `identityRekeyed`. */
976
+ playerToken?: string;
977
+ playerTokenExpiresAt?: string;
978
+ /** The sender's identity id after the re-key; present only with `identityRekeyed`. */
979
+ identityId?: string;
980
+ /** How the claim link or code will be delivered. See {@link ClaimDelivery}. */
981
+ claimDeliveryPlanned?: ClaimDelivery;
872
982
  /** Full raw backend body (fees preview, order id, new balance, guardian block, …). */
873
983
  raw: Record<string, unknown>;
874
984
  }
@@ -1642,6 +1752,8 @@ interface ApproveResult {
1642
1752
  guardianApproval?: unknown;
1643
1753
  /** Poll endpoint for guardian status (transfer holds only). */
1644
1754
  pollEndpoint?: string;
1755
+ /** How the claim link or code was delivered, on success. See {@link ClaimDelivery}. */
1756
+ claimDelivery?: ClaimDelivery;
1645
1757
  raw: Record<string, unknown>;
1646
1758
  }
1647
1759
  interface ConfirmReceiptResult {
@@ -3245,4 +3357,4 @@ interface RewardsPageLink {
3245
3357
  raw: Record<string, unknown>;
3246
3358
  }
3247
3359
 
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 };
3360
+ export { type CardSetupConfirmInput as $, type ApproveResult as A, type BalanceResult as B, type ConfirmReceiptResult as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type LoyaltyCardReward as F, type LoyaltyCardStep as G, Http as H, InvoError as I, type LoyaltyRewardState as J, type LoyaltyStepProgress as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type LoyaltyStepState as N, type LoyaltyVaultEntry as O, type PurchaseStatusResult as P, type PendingCollectItem as Q, type RedeemRewardResult as R, type PurchaseRefusalReason as S, type Rail as T, type AuthHeader as U, type VerificationMethod as V, type WaitForPurchaseInput as W, type CardSetupSessionInput as X, type CardSetupSessionResult as Y, type CardSetupInput as Z, type CardSetupResult as _, type PurchaseCredited as a, type ClaimTransferInput as a$, type CardSetupConfirmResult as a0, type PlayerCardsResult as a1, type PlatformPurchaseInput as a2, type PlatformPurchaseResult as a3, type PlatformOrderStatusResult as a4, type PlatformRefundInput as a5, type PlatformRefundResult as a6, type CreateSubscriptionInput as a7, type SubscriptionResult as a8, type GetSubscriptionOptions as a9, type InitiateTransferInput as aA, type CreateCheckoutInput as aB, type CreateCheckoutResult as aC, type PurchaseInput as aD, type PurchaseResult as aE, type CurrencyPurchaseQuoteInput as aF, type CurrencyPurchaseQuote as aG, type ConfirmPaymentResult as aH, type OrderDetailsResult as aI, type SteamPacksQuery as aJ, type SteamPacksResult as aK, type SteamInitPurchaseInput as aL, type SteamInitPurchaseResult as aM, type SteamFinalizeInput as aN, type SteamFinalizeResult as aO, type PurchaseItemInput as aP, type PurchaseItemResult as aQ, type ItemHistoryQuery as aR, type ItemHistoryResult as aS, type ItemOrderQuery as aT, type PlayerBalanceQuery as aU, type PlayerBalanceResult as aV, type InboundPendingQuery as aW, type InboundPendingResult as aX, type LinkedIdentitiesQuery as aY, type LinkedIdentitiesResult as aZ, type SmsVerifyResult as a_, type GetSubscriptionResult as aa, type ListSubscriptionsOptions as ab, type SubscriptionListResult as ac, type CancelSubscriptionOptions as ad, type CancelResult as ae, type ChangeAmountResult as af, type SetPaymentMethodInput as ag, type SetPaymentMethodResult as ah, type RefundSubscriptionInput as ai, type RefundResult as aj, type SteamSubscriptionInitInput as ak, type SteamInitResult as al, type SteamFinalizeSubscriptionResult as am, type SandboxClockResult as an, type SandboxFailureOutcome as ao, type SandboxForceFailureOptions as ap, type SandboxForceAuthChallengeOptions as aq, type ServerConfig as ar, type MintPlayerTokenInput as as, type PlayerToken as at, type RegisterPlayerInput as au, type RegisterPlayerResult as av, type UpdatePlayerPhoneInput as aw, type UpdatePlayerPhoneResult as ax, type InitiateSendInput as ay, type InitiateResult as az, type PurchaseExpired as b, type ClaimResult as b0, type ClaimCurrencyInput as b1, type TransactionStatusResult as b2, type GuardianApprovalStatusResult as b3, type ServerDestinationsQuery as b4, type PhoneShareContact as b5, type PhoneShareInitiateResult as b6, type PhoneShareApproveInput as b7, type PhoneShareApproveResult as b8, type PhoneShareStatusResult as b9, type MinPurchaseWarning as bA, type PlatformPurchaseStatus as bB, type RefundInitiation as bC, type RefundPendingApproval as bD, type RefundProcessingFeeBasis as bE, type RefundReceipt as bF, type RefundRevenueShareAttribution as bG, type RefundWarning as bH, type SandboxClockState as bI, type SavedCard as bJ, type SteamPack as bK, type SteamUserSession as bL, type Subscription as bM, type SubscriptionBaseInput as bN, type SubscriptionConsent as bO, type SubscriptionConsentInput as bP, type SubscriptionFundingRail as bQ, type SubscriptionInterval as bR, type SubscriptionRevenueShare as bS, type SubscriptionRevenueShareInput as bT, type SubscriptionStatus as bU, type UnacknowledgedPurchaseOutcome as bV, isRefundPendingApproval as bW, type BeginDeviceApprovalInput as ba, type DeviceApprovalGrant as bb, type PollDeviceApprovalInput as bc, type DeviceApprovalPollResult as bd, type ConfirmDeviceEnrollmentInput as be, type ConfirmDeviceEnrollmentResult as bf, type ApproveWithDeviceCodeInput as bg, type DeviceApprovalSettleResult as bh, type CompleteDeviceApprovalInput as bi, type CompleteDeviceApprovalResult as bj, type CardSetupStatus as bk, type CheckoutWarning as bl, type CurrencyBalance as bm, type CurrencyPurchaseQuoteBreakdown as bn, type DeviceApprovalChannel as bo, type DeviceApprovalEnrollment as bp, type DeviceApprovalFlow as bq, type DeviceApprovalPollStatus as br, type DeviceEnrollmentDecision as bs, type DeviceEnrollmentRespond as bt, type FeeTakenFrom as bu, type FirstCharge as bv, type FirstChargeStatus as bw, type FundingSource as bx, type InboundPendingItem as by, type LinkedIdentityEmail 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 ClaimDelivery as t, type DestinationGame as u, type InvoErrorInfo as v, type InvoHooks as w, type InvoRequestInfo as x, type InvoResponseInfo as y, type LoyaltyCard as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invonetwork/web-sdk",
3
- "version": "3.20.0",
3
+ "version": "3.21.0",
4
4
  "description": "INVO Web SDK — currency purchase + passkey (WebAuthn) verification for partner web platforms.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,