@invonetwork/web-sdk 3.14.2 → 3.16.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.
@@ -164,8 +164,16 @@ declare class InvoError extends Error {
164
164
  get isWebauthnNotEnabledForTenant(): boolean;
165
165
  /** True if the phone-share (phone, requesting_email) pair was already approved. */
166
166
  get isPhoneShareAlreadyApproved(): boolean;
167
- /** True if an idempotency-keyed request was a duplicate (item / platform purchase → 409). */
167
+ /** True if an idempotency-keyed request was a duplicate (item / platform purchase → 409).
168
+ * Also true for {@link isDuplicateClientRequestId}. */
168
169
  get isDuplicateRequest(): boolean;
170
+ /**
171
+ * True when a Platform Commerce CARD purchase reused a `clientRequestId` that already has a
172
+ * payment in progress or done (`DUPLICATE_CLIENT_REQUEST_ID`, 409). The body carries
173
+ * `order_id` and `order_status` for that order. Read it with `platformCommerce.getStatus`
174
+ * rather than starting a second payment.
175
+ */
176
+ get isDuplicateClientRequestId(): boolean;
169
177
  /**
170
178
  * True if a Platform Commerce call was rejected because the tenant isn't a platform
171
179
  * tenant (`NOT_A_PLATFORM_TENANT`, 403). Platform Commerce (`invo.platformCommerce.*`)
@@ -173,8 +181,9 @@ declare class InvoError extends Error {
173
181
  * (spend game currency) or `createCheckout`/`purchaseCurrency` (buy currency) instead.
174
182
  */
175
183
  get isNotPlatformTenant(): boolean;
176
- /** True if a Platform Commerce purchase was too small for the fee to round above zero
177
- * (`AMOUNT_BELOW_MINIMUM`, 400) — raise the amount. */
184
+ /** True if a Platform Commerce purchase, or a `purchaseItem` spend, was too small for the
185
+ * fee to round above zero (`AMOUNT_BELOW_MINIMUM`, 400) — raise the amount. `purchaseItem`
186
+ * rounds `totalPrice` to cents before this check. */
178
187
  get isAmountBelowMinimum(): boolean;
179
188
  /**
180
189
  * True if the `rail` you sent disagrees with the storefront key you
@@ -449,6 +458,13 @@ declare class InvoError extends Error {
449
458
  * message names the rule.
450
459
  */
451
460
  get isTrialAmountInvalid(): boolean;
461
+ /**
462
+ * True when a paid trial's `trialAmountUsd` would leave you nothing after INVO's card fee
463
+ * (`TRIAL_AMOUNT_BELOW_FEE_FLOOR`, 400). Nothing was created. The message names the smallest
464
+ * trial price accepted for your account. A subscription already created is not affected: a
465
+ * replay of its `clientRequestId` answers as before.
466
+ */
467
+ get isTrialAmountBelowFeeFloor(): boolean;
452
468
  /** True when `trialAmountUsd` was sent without `trialDays` or `trialEnd` (`TRIAL_AMOUNT_REQUIRES_TRIAL`, 400). */
453
469
  get isTrialAmountRequiresTrial(): boolean;
454
470
  /**
@@ -560,12 +576,19 @@ declare class InvoError extends Error {
560
576
  get isGameNotLive(): boolean;
561
577
  /**
562
578
  * True when `cards.createSetupSession` was refused because the member does not exist
563
- * in this game yet (`PLAYER_NOT_FOUND`, 404). The card page never creates players;
564
- * create the member first (any endpoint that creates players, for example a currency
565
- * purchase), then mint the session again. The same code comes back from
566
- * `cards.beginSetup` and from `mintPlayerToken` for the same reason.
579
+ * in this game yet (`PLAYER_NOT_FOUND`, 404) and no `playerName` was sent. Send
580
+ * `playerName` (and optionally `playerPhone`) to create the member with their card.
581
+ * The same code comes back from `cards.beginSetup` and from `mintPlayerToken` for the
582
+ * same reason; those two never create players, so create the member first (for
583
+ * example with `createSetupSession` and a `playerName`, or a currency purchase).
567
584
  */
568
585
  get isPlayerNotFound(): boolean;
586
+ /**
587
+ * True when `cards.createSetupSession` was asked to create a new member (`playerName`
588
+ * sent) and INVO could not create them (`PLAYER_CREATE_FAILED`, 503). Nothing was
589
+ * created and no link was minted; call again.
590
+ */
591
+ get isPlayerCreateFailed(): boolean;
569
592
  /**
570
593
  * True when `cards.createSetupSession` was refused because `playerEmail` was missing or
571
594
  * is not an email address (`INVALID_PLAYER_EMAIL`, 400).
@@ -576,7 +599,8 @@ declare class InvoError extends Error {
576
599
  * `status === 0` is this SDK refusing a value before the network (every client-side
577
600
  * guard uses this code); `status === 400` is INVO refusing one, on
578
601
  * `cards.createSetupSession` a `successUrl` / `cancelUrl` that uses a script scheme
579
- * (`javascript:`, `data:`, `vbscript:`). http(s) and app deep-link schemes are fine.
602
+ * (`javascript:`, `data:`, `vbscript:`; http(s) and app deep-link schemes are fine), or,
603
+ * when the member is new, a `playerName` over 255 characters or a `playerPhone` over 30.
580
604
  */
581
605
  get isInvalidInput(): boolean;
582
606
  /**
@@ -599,6 +623,12 @@ declare class InvoError extends Error {
599
623
  * order id you already hold and a Contact support link rather than a blank screen.
600
624
  */
601
625
  get isCheckoutSessionExpired(): boolean;
626
+ /**
627
+ * True when a claim or a confirm-receipt could not be checked just now
628
+ * (`IDENTITY_CHECK_UNAVAILABLE`, 503). Nothing was moved. Retry after a few seconds. Distinct
629
+ * from `CONFIRMATION_SEND_FAILED`, which means a confirmation text could not be sent.
630
+ */
631
+ get isIdentityCheckUnavailable(): boolean;
602
632
  /** Seconds to wait before retrying, when the backend throttled the call (429 `retry_after`). */
603
633
  get retryAfter(): number | undefined;
604
634
  /** `body` as a plain object, or `{}` if it's a string/number/null (non-JSON responses).
@@ -824,8 +854,23 @@ interface CreateCheckoutResult {
824
854
  * only to the buyer whose purchase it is.
825
855
  */
826
856
  sessionToken?: string;
857
+ /**
858
+ * Non-fatal notes on the mint, when INVO has any. Absent otherwise. Today the one code is
859
+ * `ITEM_METADATA_ON_CURRENCY_SESSION`: `metadata` carried `item_id` / `item_name`, but a
860
+ * checkout session sells game currency, so the buyer receives coins and the metadata is only
861
+ * echoed back. To sell an item, use `platformCommerce.purchase`
862
+ * (`POST /api/platform-commerce/purchase`). Treat unknown codes as informational.
863
+ */
864
+ warnings?: CheckoutWarning[];
827
865
  raw: Record<string, unknown>;
828
866
  }
867
+ /** A non-fatal note on a checkout session mint (see {@link CreateCheckoutResult.warnings}). */
868
+ interface CheckoutWarning {
869
+ code: string;
870
+ message: string;
871
+ /** The request fields the note is about, e.g. `["item_id"]`. */
872
+ fields?: string[];
873
+ }
829
874
  interface PurchaseInput {
830
875
  playerEmail: string;
831
876
  /**
@@ -2576,8 +2621,26 @@ interface PlayerCardsResult {
2576
2621
  }
2577
2622
  /** Input for `cards.createSetupSession`. */
2578
2623
  interface CardSetupSessionInput {
2579
- /** Must already exist in this game. The card page never creates players (`404 PLAYER_NOT_FOUND`). */
2624
+ /**
2625
+ * The member's email. A member this game already knows needs nothing else. An unknown
2626
+ * member is `404 PLAYER_NOT_FOUND` unless `playerName` is sent, in which case INVO
2627
+ * creates them.
2628
+ */
2580
2629
  playerEmail: string;
2630
+ /**
2631
+ * Creates the member when they are new to this game (as `subscriptions.create` does),
2632
+ * so a first-time signup can save a card before a paid trial. Max 255 characters. Used
2633
+ * only when the member is new: a known member is never renamed by this call. Omit it to
2634
+ * keep the old behaviour (an unknown member is refused with `404 PLAYER_NOT_FOUND`).
2635
+ */
2636
+ playerName?: string;
2637
+ /**
2638
+ * E.164 (for example `"+15555550100"`); the SDK refuses any other form before the
2639
+ * network. Used only when `playerName` creates a new member; ignored for a known member.
2640
+ * A phone already on another member can answer `409 PHONE_SHARE_APPROVAL_REQUIRED`
2641
+ * (`err.isPhoneShareApprovalRequired`).
2642
+ */
2643
+ playerPhone?: string;
2581
2644
  /**
2582
2645
  * Where the page sends the member after the card is saved. Absent: the page shows
2583
2646
  * "Card saved, you can close this window". http(s) and app deep-link schemes only; a
@@ -2841,4 +2904,4 @@ interface CheckoutClientConfig {
2841
2904
  hooks?: InvoHooks;
2842
2905
  }
2843
2906
 
2844
- export { type ListSubscriptionsOptions as $, type ApproveResult as A, type BalanceResult as B, type ConfirmReceiptResult as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type CardSetupInput as F, type CardSetupResult as G, Http as H, InvoError as I, type CardSetupConfirmInput as J, type CardSetupConfirmResult as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type PlayerCardsResult as N, type PlatformPurchaseInput as O, type PurchaseStatusResult as P, type PlatformPurchaseResult as Q, type RecoveryBeginResult as R, type PlatformOrderStatusResult as S, type PlatformRefundInput as T, type PlatformRefundResult as U, type VerificationMethod as V, type WaitForPurchaseInput as W, type CreateSubscriptionInput as X, type SubscriptionResult as Y, type GetSubscriptionOptions as Z, type GetSubscriptionResult as _, type PurchaseCredited as a, type ApproveWithDeviceCodeInput as a$, type SubscriptionListResult as a0, type CancelSubscriptionOptions as a1, type CancelResult as a2, type ChangeAmountResult as a3, type SetPaymentMethodInput as a4, type SetPaymentMethodResult as a5, type RefundSubscriptionInput as a6, type RefundResult as a7, type SteamSubscriptionInitInput as a8, type SteamInitResult as a9, type ItemHistoryQuery as aA, type ItemHistoryResult as aB, type ItemOrderQuery as aC, type PlayerBalanceQuery as aD, type PlayerBalanceResult as aE, type InboundPendingQuery as aF, type InboundPendingResult as aG, type LinkedIdentitiesQuery as aH, type LinkedIdentitiesResult as aI, type SmsVerifyResult as aJ, type ClaimTransferInput as aK, type ClaimResult as aL, type ClaimCurrencyInput as aM, type TransactionStatusResult as aN, type GuardianApprovalStatusResult as aO, type ServerDestinationsQuery as aP, type PhoneShareContact as aQ, type PhoneShareInitiateResult as aR, type PhoneShareApproveInput as aS, type PhoneShareApproveResult as aT, type PhoneShareStatusResult as aU, type BeginDeviceApprovalInput as aV, type DeviceApprovalGrant as aW, type PollDeviceApprovalInput as aX, type DeviceApprovalPollResult as aY, type ConfirmDeviceEnrollmentInput as aZ, type ConfirmDeviceEnrollmentResult as a_, type SteamFinalizeSubscriptionResult as aa, type SandboxClockResult as ab, type SandboxFailureOutcome as ac, type SandboxForceFailureOptions as ad, type SandboxForceAuthChallengeOptions as ae, type ServerConfig as af, type PlayerToken as ag, type InitiateSendInput as ah, type InitiateResult as ai, type InitiateTransferInput as aj, type CreateCheckoutInput as ak, type CreateCheckoutResult as al, type PurchaseInput as am, type PurchaseResult as an, type CurrencyPurchaseQuoteInput as ao, type CurrencyPurchaseQuote as ap, type ConfirmPaymentResult as aq, type OrderDetailsResult as ar, type SteamPacksQuery as as, type SteamPacksResult as at, type SteamInitPurchaseInput as au, type SteamInitPurchaseResult as av, type SteamFinalizeInput as aw, type SteamFinalizeResult as ax, type PurchaseItemInput as ay, type PurchaseItemResult as az, type PurchaseExpired as b, type DeviceApprovalSettleResult as b0, type CompleteDeviceApprovalInput as b1, type CompleteDeviceApprovalResult as b2, type CardSetupStatus as b3, type CurrencyBalance as b4, type CurrencyPurchaseQuoteBreakdown as b5, type DeviceApprovalChannel as b6, type DeviceApprovalEnrollment as b7, type DeviceApprovalFlow as b8, type DeviceApprovalPollStatus as b9, type SubscriptionRevenueShareInput as bA, type SubscriptionStatus as bB, type UnacknowledgedPurchaseOutcome as bC, isRefundPendingApproval as bD, type DeviceEnrollmentDecision as ba, type DeviceEnrollmentRespond as bb, type FeeTakenFrom as bc, type FirstCharge as bd, type FirstChargeStatus as be, type FundingSource as bf, type InboundPendingItem as bg, type LinkedIdentityEmail as bh, type PlatformPurchaseStatus as bi, type RefundInitiation as bj, type RefundPendingApproval as bk, type RefundProcessingFeeBasis as bl, type RefundReceipt as bm, type RefundRevenueShareAttribution as bn, type RefundWarning as bo, type SandboxClockState as bp, type SavedCard as bq, type SteamPack as br, type SteamUserSession as bs, type Subscription as bt, type SubscriptionBaseInput as bu, type SubscriptionConsent as bv, type SubscriptionConsentInput as bw, type SubscriptionFundingRail as bx, type SubscriptionInterval as by, type SubscriptionRevenueShare 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 EnrollmentVerifyResult as l, type RecoveryCompleteResult as m, type BalanceRow as n, type CheckoutPurchaseStatus as o, type DestinationGame as p, type InvoErrorInfo as q, type InvoHooks as r, type InvoRequestInfo as s, type InvoResponseInfo as t, type PendingCollectItem as u, type PurchaseRefusalReason as v, type Rail as w, type AuthHeader as x, type CardSetupSessionInput as y, type CardSetupSessionResult as z };
2907
+ export { type ListSubscriptionsOptions as $, type ApproveResult as A, type BalanceResult as B, type ConfirmReceiptResult as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type CardSetupInput as F, type CardSetupResult as G, Http as H, InvoError as I, type CardSetupConfirmInput as J, type CardSetupConfirmResult as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type PlayerCardsResult as N, type PlatformPurchaseInput as O, type PurchaseStatusResult as P, type PlatformPurchaseResult as Q, type RecoveryBeginResult as R, type PlatformOrderStatusResult as S, type PlatformRefundInput as T, type PlatformRefundResult as U, type VerificationMethod as V, type WaitForPurchaseInput as W, type CreateSubscriptionInput as X, type SubscriptionResult as Y, type GetSubscriptionOptions as Z, type GetSubscriptionResult as _, type PurchaseCredited as a, type ApproveWithDeviceCodeInput as a$, type SubscriptionListResult as a0, type CancelSubscriptionOptions as a1, type CancelResult as a2, type ChangeAmountResult as a3, type SetPaymentMethodInput as a4, type SetPaymentMethodResult as a5, type RefundSubscriptionInput as a6, type RefundResult as a7, type SteamSubscriptionInitInput as a8, type SteamInitResult as a9, type ItemHistoryQuery as aA, type ItemHistoryResult as aB, type ItemOrderQuery as aC, type PlayerBalanceQuery as aD, type PlayerBalanceResult as aE, type InboundPendingQuery as aF, type InboundPendingResult as aG, type LinkedIdentitiesQuery as aH, type LinkedIdentitiesResult as aI, type SmsVerifyResult as aJ, type ClaimTransferInput as aK, type ClaimResult as aL, type ClaimCurrencyInput as aM, type TransactionStatusResult as aN, type GuardianApprovalStatusResult as aO, type ServerDestinationsQuery as aP, type PhoneShareContact as aQ, type PhoneShareInitiateResult as aR, type PhoneShareApproveInput as aS, type PhoneShareApproveResult as aT, type PhoneShareStatusResult as aU, type BeginDeviceApprovalInput as aV, type DeviceApprovalGrant as aW, type PollDeviceApprovalInput as aX, type DeviceApprovalPollResult as aY, type ConfirmDeviceEnrollmentInput as aZ, type ConfirmDeviceEnrollmentResult as a_, type SteamFinalizeSubscriptionResult as aa, type SandboxClockResult as ab, type SandboxFailureOutcome as ac, type SandboxForceFailureOptions as ad, type SandboxForceAuthChallengeOptions as ae, type ServerConfig as af, type PlayerToken as ag, type InitiateSendInput as ah, type InitiateResult as ai, type InitiateTransferInput as aj, type CreateCheckoutInput as ak, type CreateCheckoutResult as al, type PurchaseInput as am, type PurchaseResult as an, type CurrencyPurchaseQuoteInput as ao, type CurrencyPurchaseQuote as ap, type ConfirmPaymentResult as aq, type OrderDetailsResult as ar, type SteamPacksQuery as as, type SteamPacksResult as at, type SteamInitPurchaseInput as au, type SteamInitPurchaseResult as av, type SteamFinalizeInput as aw, type SteamFinalizeResult as ax, type PurchaseItemInput as ay, type PurchaseItemResult as az, type PurchaseExpired as b, type DeviceApprovalSettleResult as b0, type CompleteDeviceApprovalInput as b1, type CompleteDeviceApprovalResult as b2, type CardSetupStatus as b3, type CheckoutWarning as b4, type CurrencyBalance as b5, type CurrencyPurchaseQuoteBreakdown as b6, type DeviceApprovalChannel as b7, type DeviceApprovalEnrollment as b8, type DeviceApprovalFlow as b9, type SubscriptionRevenueShare as bA, type SubscriptionRevenueShareInput as bB, type SubscriptionStatus as bC, type UnacknowledgedPurchaseOutcome as bD, isRefundPendingApproval as bE, type DeviceApprovalPollStatus as ba, type DeviceEnrollmentDecision as bb, type DeviceEnrollmentRespond as bc, type FeeTakenFrom as bd, type FirstCharge as be, type FirstChargeStatus as bf, type FundingSource as bg, type InboundPendingItem as bh, type LinkedIdentityEmail as bi, type PlatformPurchaseStatus as bj, type RefundInitiation as bk, type RefundPendingApproval as bl, type RefundProcessingFeeBasis as bm, type RefundReceipt as bn, type RefundRevenueShareAttribution as bo, type RefundWarning as bp, type SandboxClockState as bq, type SavedCard as br, type SteamPack as bs, type SteamUserSession as bt, type Subscription as bu, type SubscriptionBaseInput as bv, type SubscriptionConsent as bw, type SubscriptionConsentInput as bx, type SubscriptionFundingRail as by, type SubscriptionInterval 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 EnrollmentVerifyResult as l, type RecoveryCompleteResult as m, type BalanceRow as n, type CheckoutPurchaseStatus as o, type DestinationGame as p, type InvoErrorInfo as q, type InvoHooks as r, type InvoRequestInfo as s, type InvoResponseInfo as t, type PendingCollectItem as u, type PurchaseRefusalReason as v, type Rail as w, type AuthHeader as x, type CardSetupSessionInput as y, type CardSetupSessionResult as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invonetwork/web-sdk",
3
- "version": "3.14.2",
3
+ "version": "3.16.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,