@invonetwork/web-sdk 3.20.0 → 3.22.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.
@@ -18,6 +18,13 @@ declare class InvoError extends Error {
18
18
  * {@link code} or the typed predicates below.
19
19
  */
20
20
  readonly rawCode: string | undefined;
21
+ /**
22
+ * The provider-neutral twin of a code that names a payment processor, when there is one
23
+ * (additive, 3.22.0). From INVO it is the body's `error_code_public`; on the SDK's own
24
+ * local card-floor refusal it is `"BELOW_CARD_MINIMUM"` while {@link code} keeps its
25
+ * original value. `undefined` when the error carries no neutral twin.
26
+ */
27
+ readonly publicCode: string | undefined;
21
28
  /** HTTP status. */
22
29
  readonly status: number;
23
30
  /** Raw parsed body, for debugging / fields not surfaced here. */
@@ -28,6 +35,7 @@ declare class InvoError extends Error {
28
35
  message: string;
29
36
  code?: string;
30
37
  rawCode?: string;
38
+ publicCode?: string;
31
39
  status: number;
32
40
  body?: unknown;
33
41
  requestId?: string;
@@ -620,6 +628,120 @@ declare class InvoError extends Error {
620
628
  * `getPlayerRewards` answers it when no player has that email in this game.
621
629
  */
622
630
  get isPlayerNotFound(): boolean;
631
+ /**
632
+ * True when an approve was refused because the player token predates a change to the
633
+ * sender's identity (`PLAYER_TOKEN_STALE`, 403): their phone was added (for example on
634
+ * the initiate), which gives them a new identity. Nothing moved and the token stays
635
+ * refused. Re-mint the player token (or use the `playerToken` from the initiate result)
636
+ * and retry once. The SDK never retries a money call on its own.
637
+ */
638
+ get isPlayerTokenStale(): boolean;
639
+ /**
640
+ * True when `updatePlayerPhone` was refused because the player has secured this account,
641
+ * so the change needs the player's own confirmation (`PHONE_CHANGE_REQUIRES_VERIFICATION`,
642
+ * 409). Nothing changed. Call `requestPhoneChange`: INVO emails the player, who confirms
643
+ * on INVO's page. {@link changeRequestEndpoint} names the route.
644
+ */
645
+ get isPhoneChangeRequiresVerification(): boolean;
646
+ /**
647
+ * On `PHONE_CHANGE_REQUIRES_VERIFICATION`: the route to create a change request on, as INVO
648
+ * returned it (`change_request_endpoint`; it carries the `/sandbox` prefix in sandbox).
649
+ * `requestPhoneChange` already calls it. `undefined` when the body does not carry it.
650
+ */
651
+ get changeRequestEndpoint(): string | undefined;
652
+ /**
653
+ * True when a game tried to confirm a phone change itself (`CONFIRM_ON_INVO_PAGE`, 409).
654
+ * The player confirms only on INVO's page, from the link in INVO's email; a game never
655
+ * collects the code.
656
+ */
657
+ get isConfirmOnInvoPage(): boolean;
658
+ /**
659
+ * True when the change request is unknown, belongs to another game (`getPhoneChange`), or
660
+ * to another player (`approvePhoneChange`) (`CHANGE_REQUEST_NOT_FOUND`, 404).
661
+ */
662
+ get isChangeRequestNotFound(): boolean;
663
+ /**
664
+ * True when `approvePhoneChange` came before the player entered the emailed code on INVO's
665
+ * page (`CHANGE_REQUEST_NOT_READY`, 409). Nothing changed; approve after they do.
666
+ */
667
+ get isChangeRequestNotReady(): boolean;
668
+ /**
669
+ * True when the change request is no longer pending (`CHANGE_REQUEST_NOT_PENDING`, 409):
670
+ * already confirmed, expired, cancelled, refused or declined. See
671
+ * {@link changeRequestStatus}.
672
+ */
673
+ get isChangeRequestNotPending(): boolean;
674
+ /** On `CHANGE_REQUEST_NOT_PENDING`: the request's current `status`. */
675
+ get changeRequestStatus(): string | undefined;
676
+ /**
677
+ * True when another game's change request for this player is waiting for the player
678
+ * (`CHANGE_REQUEST_IN_PROGRESS`, 409). Retry after it is confirmed or expires.
679
+ */
680
+ get isChangeRequestInProgress(): boolean;
681
+ /**
682
+ * True when phone changes for this player are paused after repeated failed confirmations
683
+ * (`PHONE_CHANGE_LOCKED`, 409). The player has been emailed. Retry later.
684
+ */
685
+ get isPhoneChangeLocked(): boolean;
686
+ /**
687
+ * True when `requestPhoneChange` was refused because there were too many change requests
688
+ * for this player (`TOO_MANY_CHANGE_REQUESTS`, 429). Try again later; do not loop.
689
+ */
690
+ get isTooManyChangeRequests(): boolean;
691
+ /**
692
+ * True when a phone change call could not be served right now (`PHONE_CHANGE_UNAVAILABLE`,
693
+ * 503) or the confirmation email could not be sent (`CONFIRMATION_EMAIL_UNAVAILABLE`, 503;
694
+ * that request is closed). Retry shortly.
695
+ */
696
+ get isPhoneChangeUnavailable(): boolean;
697
+ /**
698
+ * True when a phone change was refused because transfers to the player's CURRENT number
699
+ * are still waiting to be collected (`PENDING_TRANSFERS_TO_OLD_PHONE`, 409), on
700
+ * `updatePlayerPhone`, `requestPhoneChange` or `approvePhoneChange`. Changing the number
701
+ * now would strand them. Nothing changed. Ask the player to collect them first (or wait
702
+ * until they expire), then retry.
703
+ */
704
+ get isPendingTransfersToOldPhone(): boolean;
705
+ /**
706
+ * True when a phone change was refused because transfers to the NEW number are still
707
+ * waiting to be collected (`PENDING_TRANSFERS_TO_NEW_PHONE`, 409), on `updatePlayerPhone`,
708
+ * `requestPhoneChange` or `approvePhoneChange`. Nothing changed. Retry after they are
709
+ * collected or expire.
710
+ */
711
+ get isPendingTransfersToNewPhone(): boolean;
712
+ /**
713
+ * True when the player's account recently went through a sign-in recovery, so the number
714
+ * cannot be changed yet (`PHONE_CHANGE_RECOVERY_COOLDOWN`, 409), on `requestPhoneChange`
715
+ * or `approvePhoneChange`. Nothing changed. Retry later; on `approvePhoneChange`,
716
+ * declining (`decision: "deny"`) still works.
717
+ */
718
+ get isPhoneChangeRecoveryCooldown(): boolean;
719
+ /**
720
+ * True when `approvePhoneChange` was refused because this device (or its key) was set up
721
+ * after the change was requested, so it cannot approve it
722
+ * (`DEVICE_ENROLLED_AFTER_REQUEST`, 409). Nothing changed. The player approves on their
723
+ * earlier device, or your game creates a new request.
724
+ */
725
+ get isDeviceEnrolledAfterRequest(): boolean;
726
+ /**
727
+ * True when `approvePhoneChange` was refused because the device signal did not verify
728
+ * (401, the reason in `error`, for example `SIGNAL_INVALID`). Nothing changed. Sign the
729
+ * exact message again with a fresh nonce and timestamp.
730
+ */
731
+ get isDeviceSignalRejected(): boolean;
732
+ /**
733
+ * True when `registerPlayer` found the player already in your game with a DIFFERENT
734
+ * phone (`PHONE_MISMATCH`, 409). Nothing changed; use `updatePlayerPhone` to change it.
735
+ * (`mintPlayerToken` reports the same situation as `phoneMismatch: true` on success.)
736
+ */
737
+ get isPhoneMismatch(): boolean;
738
+ /**
739
+ * True when the phone you supplied belongs to another email
740
+ * (`PHONE_SHARE_APPROVAL_REQUIRED`, 409) on `mintPlayerToken`, `registerPlayer` or
741
+ * `updatePlayerPhone`. Nothing was created or changed. The same condition as
742
+ * {@link isPhoneShareApprovalRequired}, named for these registration calls.
743
+ */
744
+ get isPhoneShareRefused(): boolean;
623
745
  /**
624
746
  * True when `cards.createSetupSession` was asked to create a new member (`playerName`
625
747
  * sent) and INVO could not create them (`PLAYER_CREATE_FAILED`, 503). Nothing was
@@ -831,7 +953,192 @@ interface PlayerToken {
831
953
  token: string;
832
954
  expiresAt: string;
833
955
  identityId: string;
956
+ /**
957
+ * `true` when this call CREATED the player in your game (you passed `playerPhone` and
958
+ * no player with `playerEmail` existed). Absent otherwise.
959
+ */
960
+ created?: boolean;
961
+ /**
962
+ * `true` when the player already exists in your game with a DIFFERENT phone than the
963
+ * `playerPhone` you passed. The token is still minted for the existing player and their
964
+ * phone is NOT changed; use `updatePlayerPhone` to change it. Absent otherwise.
965
+ */
966
+ phoneMismatch?: boolean;
967
+ }
968
+ /** Input to `InvoServer.mintPlayerToken`. */
969
+ interface MintPlayerTokenInput {
970
+ playerEmail: string;
971
+ /**
972
+ * Optional, E.164. When the player is not in your game yet, passing it CREATES the
973
+ * player (so a first-time receiver can collect without buying first). An existing
974
+ * player's phone is never changed here. Without it, an unknown player is a 404.
975
+ */
976
+ playerPhone?: string;
977
+ /** Optional display name, used only when the player is created. */
978
+ playerName?: string;
979
+ }
980
+ /** Input to `InvoServer.registerPlayer`. */
981
+ interface RegisterPlayerInput {
982
+ playerEmail: string;
983
+ /** Required, E.164. */
984
+ playerPhone: string;
985
+ /** Optional display name for the new player. */
986
+ playerName?: string;
987
+ }
988
+ /** Result of `InvoServer.registerPlayer`. */
989
+ interface RegisterPlayerResult {
990
+ /** `"created"` (HTTP 201) or `"exists"` (HTTP 200, already in your game with that phone). */
991
+ status: "created" | "exists";
992
+ identityId: string;
993
+ /** A player token for this player, when INVO can issue one for your game. */
994
+ playerToken?: string;
995
+ playerTokenExpiresAt?: string;
996
+ raw: Record<string, unknown>;
997
+ }
998
+ /** Input to `InvoServer.updatePlayerPhone`. */
999
+ interface UpdatePlayerPhoneInput {
1000
+ playerEmail: string;
1001
+ /** The player's new phone, E.164. */
1002
+ newPhone: string;
1003
+ }
1004
+ /** Result of `InvoServer.updatePlayerPhone`. */
1005
+ interface UpdatePlayerPhoneResult {
1006
+ /** `"updated"`, or `"unchanged"` when the player already has that phone. */
1007
+ status: "updated" | "unchanged";
1008
+ /**
1009
+ * `true` when the change gave the player a new INVO identity. Any player token minted
1010
+ * before this call is then out of date: use `playerToken` below (or mint a new one).
1011
+ */
1012
+ identityRekeyed: boolean;
1013
+ identityId: string;
1014
+ /** A player token for the player's current identity, when INVO can issue one for your game. */
1015
+ playerToken?: string;
1016
+ playerTokenExpiresAt?: string;
1017
+ raw: Record<string, unknown>;
1018
+ }
1019
+ /**
1020
+ * What the player will be asked for to confirm a phone change: the emailed code alone, the
1021
+ * code plus their passkey (both on INVO's page), or the code on INVO's page plus an approval
1022
+ * on their enrolled device. Typed as `string` so a value added later is passed through.
1023
+ */
1024
+ type PhoneChangeConfirmation = "email_code" | "email_code_and_passkey" | "email_code_and_device" | (string & {});
1025
+ /** Input to `InvoServer.requestPhoneChange`. */
1026
+ interface RequestPhoneChangeInput {
1027
+ playerEmail: string;
1028
+ /** The player's new phone, E.164. */
1029
+ newPhone: string;
1030
+ }
1031
+ /**
1032
+ * Result of `InvoServer.requestPhoneChange` (HTTP 202). Nothing about the player has changed:
1033
+ * INVO emailed the player, who confirms on INVO's page. The result carries no link and no
1034
+ * code; your game never holds anything that confirms the change.
1035
+ */
1036
+ interface RequestPhoneChangeResult {
1037
+ changeRequestId: string;
1038
+ /** `"pending_confirmation"` on create. (`getPhoneChange` reads the same state as `"pending"`.) */
1039
+ status: "pending_confirmation" | (string & {});
1040
+ expiresAt: string;
1041
+ /** How INVO reached the player: `"email"`. */
1042
+ delivery: "email" | (string & {});
1043
+ confirmation: PhoneChangeConfirmation;
1044
+ /** A human-readable summary you can show the player. */
1045
+ message: string;
1046
+ raw: Record<string, unknown>;
1047
+ }
1048
+ /**
1049
+ * Status of a change request as `getPhoneChange` reads it. `pending` waits for the player;
1050
+ * `confirmed` is applied; `expired`, `cancelled`, `refused` and `denied` are closed (create a
1051
+ * new request if the player still wants the change).
1052
+ */
1053
+ type PhoneChangeRequestStatus = "pending" | "confirmed" | "expired" | "cancelled" | "refused" | "denied" | (string & {});
1054
+ /** Result of `InvoServer.getPhoneChange`. */
1055
+ interface PhoneChangeRequest {
1056
+ changeRequestId: string;
1057
+ status: PhoneChangeRequestStatus;
1058
+ confirmation: PhoneChangeConfirmation;
1059
+ delivery: string;
1060
+ /** The new number, masked. */
1061
+ newPhoneMasked: string | null;
1062
+ createdAt: string | null;
1063
+ expiresAt: string | null;
1064
+ confirmedAt: string | null;
1065
+ /**
1066
+ * How a confirmed change was confirmed: `"hosted_page"` (on INVO's page) or
1067
+ * `"hosted_page_device"` (on INVO's page, then approved on the player's device). `null`
1068
+ * until confirmed.
1069
+ */
1070
+ confirmedVia: "hosted_page" | "hosted_page_device" | (string & {}) | null;
1071
+ raw: Record<string, unknown>;
1072
+ }
1073
+ /** One phone change waiting for this player's enrolled device to approve. */
1074
+ interface PhoneChangeApproval {
1075
+ changeRequestId: string;
1076
+ /** The game that requested the change. */
1077
+ gameName: string | null;
1078
+ oldPhoneMasked: string | null;
1079
+ newPhoneMasked: string | null;
1080
+ expiresAt: string | null;
1081
+ }
1082
+ /** Result of `InvoClient.listPhoneChangeApprovals`. */
1083
+ interface PhoneChangeApprovalsResult {
1084
+ approvals: PhoneChangeApproval[];
1085
+ raw: Record<string, unknown>;
834
1086
  }
1087
+ /**
1088
+ * A signature made by the player's enrolled device key over
1089
+ * `phone-change|<changeRequestId>|<nonce>|<timestamp>` (approve) or
1090
+ * `phone-change-deny|<changeRequestId>|<nonce>|<timestamp>` (decline). Build the message with
1091
+ * `phoneChangeSignalMessage`. The SDK sends it as `device_signal`, with `transfer_id` set to
1092
+ * the change request id.
1093
+ */
1094
+ interface PhoneChangeDeviceSignal {
1095
+ /** A fresh random value, single use. */
1096
+ nonce: string;
1097
+ /** Epoch seconds (an integer), the value that was signed. */
1098
+ timestamp: number;
1099
+ /** The base64 signature over the message. */
1100
+ signature: string;
1101
+ }
1102
+ /** Input to `InvoClient.approvePhoneChange`. Pass exactly one of `deviceSignal` or `sign`. */
1103
+ interface ApprovePhoneChangeInput {
1104
+ /** The enrolled device's fingerprint, as registered with INVO. */
1105
+ deviceFingerprint: string;
1106
+ /** `"approve"` (default) or `"deny"`. Decides which message is signed. */
1107
+ decision?: "approve" | "deny";
1108
+ /** A signal you already signed (nonce, timestamp, signature). */
1109
+ deviceSignal?: PhoneChangeDeviceSignal;
1110
+ /**
1111
+ * Or let the SDK build the signal: it makes a fresh nonce and timestamp, builds the exact
1112
+ * message, and calls this with it. Return the base64 signature made with the device key.
1113
+ */
1114
+ sign?: (message: string) => Promise<string> | string;
1115
+ }
1116
+ /** Result of `InvoClient.approvePhoneChange`. */
1117
+ type ApprovePhoneChangeResult = {
1118
+ status: "confirmed";
1119
+ changeRequestId: string;
1120
+ /** The player's new identity id. Store it. */
1121
+ identityId: string;
1122
+ previousIdentityId: string;
1123
+ playersUpdated: number;
1124
+ /** The new number is not yet verified: `false`. */
1125
+ verifiedPhone: boolean;
1126
+ /** A fresh player token for the new identity; tokens minted before the change are stale. */
1127
+ playerToken?: string;
1128
+ playerTokenExpiresAt?: string;
1129
+ raw: Record<string, unknown>;
1130
+ } | {
1131
+ status: "denied";
1132
+ changeRequestId: string;
1133
+ raw: Record<string, unknown>;
1134
+ };
1135
+ /**
1136
+ * How INVO will deliver (initiate: `claimDeliveryPlanned`) or delivered (approve:
1137
+ * `claimDelivery`) the claim link or code: `"email"`, `"none"` (nothing is sent), or
1138
+ * `"sms"` (legacy, only when no email is on file). Typed as `string` so a value added
1139
+ * later is passed through rather than dropped.
1140
+ */
1141
+ type ClaimDelivery = "email" | "none" | "sms" | (string & {});
835
1142
  interface InitiateSendInput {
836
1143
  clientRequestId: string;
837
1144
  senderPlayerName: string;
@@ -869,6 +1176,20 @@ interface InitiateResult {
869
1176
  verificationMethod: VerificationMethod | undefined;
870
1177
  /** Present on the minor/guardian path (HTTP 202): the backend's guardian_approval block. */
871
1178
  guardianApproval?: unknown;
1179
+ /**
1180
+ * `true` when THIS initiate gave the sender a new INVO identity (for example their phone
1181
+ * was added to an email-only player). A player token minted before the initiate is then
1182
+ * out of date and approve refuses it (`err.isPlayerTokenStale`). Hand the browser
1183
+ * `playerToken` below before it approves. Absent when the identity did not change.
1184
+ */
1185
+ identityRekeyed?: boolean;
1186
+ /** A fresh player token for the sender's new identity; present only with `identityRekeyed`. */
1187
+ playerToken?: string;
1188
+ playerTokenExpiresAt?: string;
1189
+ /** The sender's identity id after the re-key; present only with `identityRekeyed`. */
1190
+ identityId?: string;
1191
+ /** How the claim link or code will be delivered. See {@link ClaimDelivery}. */
1192
+ claimDeliveryPlanned?: ClaimDelivery;
872
1193
  /** Full raw backend body (fees preview, order id, new balance, guardian block, …). */
873
1194
  raw: Record<string, unknown>;
874
1195
  }
@@ -934,10 +1255,10 @@ interface PurchaseInput {
934
1255
  * USD, two decimals: the listed price of the coins.
935
1256
  *
936
1257
  * **Without `acknowledgedTotalUsd` this is exactly what the card is charged, never more**,
937
- * and the player receives the listed coins for it. INVO's card fee (4.5% + $0.30 on Open,
1258
+ * and the player receives the listed coins for it. INVO's card fee (3.5% + $0.30 on Open,
938
1259
  * 5.5% + $0.50 on Merchant of Record, plus 1.5% of the listed price (before tax) on a card issued outside the
939
1260
  * US) is charged to you, the partner, never to the player: $10.00 buys 100.00 coins at the
940
- * default 10 per USD and your fee is $0.75 on Open. Card purchases only; purchases through a
1261
+ * default 10 per USD and your fee is $0.65 on Open. Card purchases only; purchases through a
941
1262
  * third-party storefront or payment rail are unaffected.
942
1263
  *
943
1264
  * Minimum card purchase: $2.99, enforced by INVO from 2026-10-27 (`400 BELOW_CARD_MINIMUM`,
@@ -1008,8 +1329,8 @@ interface PurchaseResult {
1008
1329
  */
1009
1330
  feeTakenFrom?: FeeTakenFrom;
1010
1331
  /**
1011
- * INVO's card fee charged to you, the partner, for this purchase, decimal string: 4.5% +
1012
- * $0.30 on Open, 5.5% + $0.50 on Merchant of Record ($0.75 on a $10.00 Open purchase). It
1332
+ * INVO's card fee charged to you, the partner, for this purchase, decimal string: 3.5% +
1333
+ * $0.30 on Open, 5.5% + $0.50 on Merchant of Record ($0.65 on a $10.00 Open purchase). It
1013
1334
  * nets against your earnings and is not returned on a refund. Separate from
1014
1335
  * {@link internationalCardFeeUsd}. `undefined` when the fee does not apply to the purchase
1015
1336
  * (a third-party storefront or payment rail, an order charged before the 2026-09 pricing)
@@ -1158,7 +1479,7 @@ interface CurrencyPurchaseQuote {
1158
1479
  processingFeeUsd: string;
1159
1480
  /**
1160
1481
  * INVO's card fee you will be charged for this purchase, decimal string, when the backend
1161
- * sends it: 4.5% + $0.30 on Open, 5.5% + $0.50 on Merchant of Record ($0.75 on $10.00 on
1482
+ * sends it: 3.5% + $0.30 on Open, 5.5% + $0.50 on Merchant of Record ($0.65 on $10.00 on
1162
1483
  * Open). The international card fee (1.5% of the listed price, before tax, on a card issued
1163
1484
  * outside the US) is separate and known only once the card is. Read the figure; do not
1164
1485
  * recompute it.
@@ -1230,6 +1551,70 @@ interface ItemHistoryResult {
1230
1551
  pagination: Record<string, unknown>;
1231
1552
  raw: Record<string, unknown>;
1232
1553
  }
1554
+ /** The kinds of money activity `getPlayerActivity` lists. Open-ended for forward compatibility. */
1555
+ type PlayerActivityType = "currency_purchase" | "item_purchase" | "platform_commerce" | "send" | "transfer" | (string & {});
1556
+ /** Input to `InvoServer.getPlayerActivity`. */
1557
+ interface PlayerActivityQuery {
1558
+ playerEmail: string;
1559
+ /** Page size, 1 to 100 (INVO's default 50; a larger value is capped at 100). */
1560
+ limit?: number;
1561
+ /** The previous page's `nextCursor`. Valid only for the same player and the same `types`. */
1562
+ cursor?: string;
1563
+ /** Only these kinds. Omitted or empty: all of them. An unknown kind is a `400 INVALID_INPUT`. */
1564
+ types?: PlayerActivityType[];
1565
+ }
1566
+ /** One row of a player's activity, newest first. */
1567
+ interface PlayerActivityEntry {
1568
+ /** The transaction id. */
1569
+ id: string;
1570
+ type: PlayerActivityType;
1571
+ /**
1572
+ * Relative to this player: `"in"` (currency purchases, and money sent to them), `"out"`
1573
+ * (item and Platform Commerce purchases, money they sent) or `"self"` (a send or transfer
1574
+ * where this player is both sender and recipient in your game). Note these differ from the
1575
+ * `"incoming"` / `"outgoing"` of the per-type send and transfer history reads.
1576
+ */
1577
+ direction: "in" | "out" | "self" | (string & {});
1578
+ /** Decimal string, or `null`. */
1579
+ amount: string | null;
1580
+ /** `"currency"` (your game currency), or `"usd"` (the card leg of a Platform Commerce sale). */
1581
+ amountUnit: "currency" | "usd" | (string & {});
1582
+ currency: {
1583
+ currencyId: string | number | null;
1584
+ currencyName: string | null;
1585
+ };
1586
+ /**
1587
+ * The row's status. An `"in"` send or transfer appears as soon as it names this player, in
1588
+ * ANY status (awaiting collection, completed, expired, refunded): read `status` and
1589
+ * `statusDetail` before treating it as credited.
1590
+ */
1591
+ status: string;
1592
+ statusDetail: string | null;
1593
+ /** Why it expired, on an expired send or transfer; `null` otherwise. */
1594
+ expiryReason: ExpiryReason | null;
1595
+ /** The other game on a cross-game send or transfer; `null` otherwise. */
1596
+ counterpartyGame: {
1597
+ gameId: string;
1598
+ gameName: string | null;
1599
+ } | null;
1600
+ createdAt: string | null;
1601
+ completedAt: string | null;
1602
+ orderId: string | null;
1603
+ raw: Record<string, unknown>;
1604
+ }
1605
+ /** One page of `getPlayerActivity`. */
1606
+ interface PlayerActivityResult {
1607
+ playerEmail: string;
1608
+ gameId: string;
1609
+ /** The kinds this page covers (echoed by INVO). */
1610
+ types: PlayerActivityType[];
1611
+ activity: PlayerActivityEntry[];
1612
+ limit: number;
1613
+ hasMore: boolean;
1614
+ /** Pass as `cursor` for the next page; `null` on the last page. */
1615
+ nextCursor: string | null;
1616
+ raw: Record<string, unknown>;
1617
+ }
1233
1618
  /**
1234
1619
  * How the player will authorize the Steam charge.
1235
1620
  *
@@ -1488,6 +1873,26 @@ interface PlatformOrderStatusResult {
1488
1873
  receiptUrl?: string;
1489
1874
  raw: Record<string, unknown>;
1490
1875
  }
1876
+ /** Input to `platformCommerce.getPurchaseHistory`. */
1877
+ interface PlatformPurchaseHistoryQuery {
1878
+ playerEmail: string;
1879
+ /** Page size, 1 to 100 (INVO's default 50; a larger value is capped at 100). */
1880
+ limit?: number;
1881
+ /** The previous page's `nextCursor`. Valid only for the same player. */
1882
+ cursor?: string;
1883
+ }
1884
+ /** One page of a player's Platform Commerce purchases, newest first. */
1885
+ interface PlatformPurchaseHistoryResult {
1886
+ playerEmail: string;
1887
+ gameId: string;
1888
+ /** Each entry carries exactly the fields `getStatus` returns for that order. */
1889
+ purchases: PlatformOrderStatusResult[];
1890
+ limit: number;
1891
+ hasMore: boolean;
1892
+ /** Pass as `cursor` for the next page; `null` on the last page. */
1893
+ nextCursor: string | null;
1894
+ raw: Record<string, unknown>;
1895
+ }
1491
1896
  interface PlatformRefundInput {
1492
1897
  /** Provide EXACTLY ONE of orderId or clientRequestId. */
1493
1898
  orderId?: string | number;
@@ -1642,6 +2047,8 @@ interface ApproveResult {
1642
2047
  guardianApproval?: unknown;
1643
2048
  /** Poll endpoint for guardian status (transfer holds only). */
1644
2049
  pollEndpoint?: string;
2050
+ /** How the claim link or code was delivered, on success. See {@link ClaimDelivery}. */
2051
+ claimDelivery?: ClaimDelivery;
1645
2052
  raw: Record<string, unknown>;
1646
2053
  }
1647
2054
  interface ConfirmReceiptResult {
@@ -1879,9 +2286,21 @@ interface TransactionStatusResult {
1879
2286
  orderId?: string;
1880
2287
  toPhone?: string;
1881
2288
  toIdentityId?: string | null;
2289
+ /**
2290
+ * Present once the transaction has expired: why it lapsed (`expiry_reason`).
2291
+ * `"approval_expired"` (the sender never approved), `"pin_expired"` (the legacy PIN was
2292
+ * never entered) or `"claim_expired"` (the recipient never collected). Absent otherwise,
2293
+ * and on backends that predate the field. Treat an unknown value as informational.
2294
+ */
2295
+ expiryReason?: ExpiryReason;
1882
2296
  /** Everything else (send fees, game names, claim_info, failure_reason, sender claim_code, …). */
1883
2297
  raw: Record<string, unknown>;
1884
2298
  }
2299
+ /**
2300
+ * Why a send or transfer expired (`expiry_reason`). Open-ended: a future reason arrives as
2301
+ * its own string rather than being dropped.
2302
+ */
2303
+ type ExpiryReason = "approval_expired" | "pin_expired" | "claim_expired" | (string & {});
1885
2304
  /** `state` ∈ pending | approved | rejected | expired. */
1886
2305
  interface GuardianApprovalStatusResult {
1887
2306
  state: string;
@@ -3245,4 +3664,4 @@ interface RewardsPageLink {
3245
3664
  raw: Record<string, unknown>;
3246
3665
  }
3247
3666
 
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 };
3667
+ export { type AuthHeader as $, type ApproveResult as A, type BalanceResult as B, type ConfirmReceiptResult as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type InvoRequestInfo as F, type InvoResponseInfo as G, Http as H, InvoError as I, type LoyaltyCard as J, type LoyaltyCardReward as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type LoyaltyCardStep as N, type LoyaltyRewardState as O, type PurchaseStatusResult as P, type LoyaltyStepProgress as Q, type RedeemRewardResult as R, type LoyaltyStepState as S, type LoyaltyVaultEntry as T, type PendingCollectItem as U, type PhoneChangeApproval as V, type WaitForPurchaseInput as W, type PhoneChangeDeviceSignal as X, type PurchaseRefusalReason as Y, type Rail as Z, type VerificationMethod as _, type PurchaseCredited as a, type ItemHistoryQuery as a$, type CardSetupSessionInput as a0, type CardSetupSessionResult as a1, type CardSetupInput as a2, type CardSetupResult as a3, type CardSetupConfirmInput as a4, type CardSetupConfirmResult as a5, type PlayerCardsResult as a6, type PlatformPurchaseInput as a7, type PlatformPurchaseResult as a8, type PlatformOrderStatusResult as a9, type PlayerToken as aA, type RegisterPlayerInput as aB, type RegisterPlayerResult as aC, type UpdatePlayerPhoneInput as aD, type UpdatePlayerPhoneResult as aE, type RequestPhoneChangeInput as aF, type RequestPhoneChangeResult as aG, type PhoneChangeRequest as aH, type InitiateSendInput as aI, type InitiateResult as aJ, type InitiateTransferInput as aK, type CreateCheckoutInput as aL, type CreateCheckoutResult as aM, type PurchaseInput as aN, type PurchaseResult as aO, type CurrencyPurchaseQuoteInput as aP, type CurrencyPurchaseQuote as aQ, type ConfirmPaymentResult as aR, type OrderDetailsResult as aS, type SteamPacksQuery as aT, type SteamPacksResult as aU, type SteamInitPurchaseInput as aV, type SteamInitPurchaseResult as aW, type SteamFinalizeInput as aX, type SteamFinalizeResult as aY, type PurchaseItemInput as aZ, type PurchaseItemResult as a_, type PlatformPurchaseHistoryQuery as aa, type PlatformPurchaseHistoryResult as ab, type PlatformRefundInput as ac, type PlatformRefundResult as ad, type CreateSubscriptionInput as ae, type SubscriptionResult as af, type GetSubscriptionOptions as ag, type GetSubscriptionResult as ah, type ListSubscriptionsOptions as ai, type SubscriptionListResult as aj, type CancelSubscriptionOptions as ak, type CancelResult as al, type ChangeAmountResult as am, type SetPaymentMethodInput as an, type SetPaymentMethodResult as ao, type RefundSubscriptionInput as ap, type RefundResult as aq, type SteamSubscriptionInitInput as ar, type SteamInitResult as as, type SteamFinalizeSubscriptionResult as at, type SandboxClockResult as au, type SandboxFailureOutcome as av, type SandboxForceFailureOptions as aw, type SandboxForceAuthChallengeOptions as ax, type ServerConfig as ay, type MintPlayerTokenInput as az, type PurchaseExpired as b, type SteamPack as b$, type ItemHistoryResult as b0, type ItemOrderQuery as b1, type PlayerActivityQuery as b2, type PlayerActivityResult as b3, type PlayerActivityEntry as b4, type PlayerBalanceQuery as b5, type PlayerBalanceResult as b6, type InboundPendingQuery as b7, type InboundPendingResult as b8, type LinkedIdentitiesQuery as b9, type CurrencyPurchaseQuoteBreakdown as bA, type DeviceApprovalChannel as bB, type DeviceApprovalEnrollment as bC, type DeviceApprovalFlow as bD, type DeviceApprovalPollStatus as bE, type DeviceEnrollmentDecision as bF, type DeviceEnrollmentRespond as bG, type ExpiryReason as bH, type FeeTakenFrom as bI, type FirstCharge as bJ, type FirstChargeStatus as bK, type FundingSource as bL, type InboundPendingItem as bM, type LinkedIdentityEmail as bN, type MinPurchaseWarning as bO, type PhoneChangeConfirmation as bP, type PhoneChangeRequestStatus as bQ, type PlatformPurchaseStatus as bR, type PlayerActivityType as bS, type RefundInitiation as bT, type RefundPendingApproval as bU, type RefundProcessingFeeBasis as bV, type RefundReceipt as bW, type RefundRevenueShareAttribution as bX, type RefundWarning as bY, type SandboxClockState as bZ, type SavedCard as b_, type LinkedIdentitiesResult as ba, type SmsVerifyResult as bb, type ClaimTransferInput as bc, type ClaimResult as bd, type ClaimCurrencyInput as be, type TransactionStatusResult as bf, type GuardianApprovalStatusResult as bg, type ServerDestinationsQuery as bh, type PhoneShareContact as bi, type PhoneShareInitiateResult as bj, type PhoneShareApproveInput as bk, type PhoneShareApproveResult as bl, type PhoneShareStatusResult as bm, type BeginDeviceApprovalInput as bn, type DeviceApprovalGrant as bo, type PollDeviceApprovalInput as bp, type DeviceApprovalPollResult as bq, type ConfirmDeviceEnrollmentInput as br, type ConfirmDeviceEnrollmentResult as bs, type ApproveWithDeviceCodeInput as bt, type DeviceApprovalSettleResult as bu, type CompleteDeviceApprovalInput as bv, type CompleteDeviceApprovalResult as bw, type CardSetupStatus as bx, type CheckoutWarning as by, type CurrencyBalance as bz, type PurchaseRefunded as c, type SteamUserSession as c0, type Subscription as c1, type SubscriptionBaseInput as c2, type SubscriptionConsent as c3, type SubscriptionConsentInput as c4, type SubscriptionFundingRail as c5, type SubscriptionInterval as c6, type SubscriptionRevenueShare as c7, type SubscriptionRevenueShareInput as c8, type SubscriptionStatus as c9, type UnacknowledgedPurchaseOutcome as ca, isRefundPendingApproval as cb, 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 PhoneChangeApprovalsResult as j, type ApprovePhoneChangeInput as k, type ApprovePhoneChangeResult as l, type PendingCollectResult as m, type DestinationsResult as n, type LoyaltyCardsResult as o, type LoyaltyVaultResult as p, type RewardsPageLink as q, type EnrollmentVerifyResult as r, type RecoveryBeginResult as s, type RecoveryCompleteResult as t, type BalanceRow as u, type CheckoutPurchaseStatus as v, type ClaimDelivery as w, type DestinationGame as x, type InvoErrorInfo as y, type InvoHooks 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.22.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,