@invonetwork/web-sdk 3.32.0 → 3.34.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 +16 -0
- package/README.md +3006 -2963
- package/dist/chunk-73ZVDQZV.js +6 -0
- package/dist/{chunk-RPGRRZFY.js → chunk-D2AUZRYS.js} +206 -74
- package/dist/{chunk-2XOKKKFR.js → chunk-DMTNU5PM.js} +3 -3
- package/dist/{chunk-QEJB6HC7.js → chunk-R65CANFG.js} +32 -2
- package/dist/game-server.cjs +176 -5
- package/dist/game-server.d.cts +12 -8
- package/dist/game-server.d.ts +12 -8
- package/dist/game-server.js +11 -7
- package/dist/game.cjs +31 -1
- package/dist/game.d.cts +3 -3
- package/dist/game.d.ts +3 -3
- package/dist/game.js +3 -3
- package/dist/{hosted-approval-li0XZFz-.d.cts → hosted-approval-C1hQvbu6.d.cts} +1 -1
- package/dist/{hosted-approval-ICho9KsV.d.ts → hosted-approval-CFlj4UQE.d.ts} +1 -1
- package/dist/index.cjs +30 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{server-B-KKg5P0.d.ts → server-CtXpytKt.d.ts} +49 -5
- package/dist/{server-jAn9dNM3.d.cts → server-ZnCyLWA2.d.cts} +49 -5
- package/dist/server.cjs +225 -70
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +3 -3
- package/dist/{types-CaPHNjOU.d.cts → types-Ctn8N2_l.d.cts} +60 -4
- package/dist/{types-CaPHNjOU.d.ts → types-Ctn8N2_l.d.ts} +60 -4
- package/dist/{version-CqwGhQXV.d.cts → version-Ce_pLpJf.d.cts} +1 -1
- package/dist/{version-CqwGhQXV.d.ts → version-Ce_pLpJf.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-LVVPRVPU.js +0 -6
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { bu as ApproveWithDeviceCodeInput, bo as BeginDeviceApprovalInput, g as CallOptions, af as CancelResult, ae as CancelSubscriptionOptions, as as CardSetupConfirmInput, at as CardSetupConfirmResult, aq as CardSetupInput, ar as CardSetupResult, ao as CardSetupSessionInput, ap as CardSetupSessionResult, by as CardSetupStatus, ag as ChangeAmountResult, bz as CheckoutWarning, bf as ClaimCurrencyInput, y as ClaimDelivery, be as ClaimResult, bd as ClaimTransferInput, bw as CompleteDeviceApprovalInput, bx as CompleteDeviceApprovalResult, bs as ConfirmDeviceEnrollmentInput, bt as ConfirmDeviceEnrollmentResult, aS as ConfirmPaymentResult, aM as CreateCheckoutInput, aN as CreateCheckoutResult, a8 as CreateSubscriptionInput, bA as CurrencyBalance, aR as CurrencyPurchaseQuote, bB as CurrencyPurchaseQuoteBreakdown, aQ as CurrencyPurchaseQuoteInput, D as DestinationGame, p as DestinationsResult, bC as DeviceApprovalChannel, bD as DeviceApprovalEnrollment, bE as DeviceApprovalFlow, bp as DeviceApprovalGrant, br as DeviceApprovalPollResult, bF as DeviceApprovalPollStatus, bv as DeviceApprovalSettleResult, bG as DeviceEnrollmentDecision, bH as DeviceEnrollmentRespond, bI as ExpiryReason, bJ as FeeTakenFrom, bK as FirstCharge, bL as FirstChargeStatus, bM as FundingSource, aa as GetSubscriptionOptions, ab as GetSubscriptionResult, bh as GuardianApprovalStatusResult, bN as InboundPendingItem, b8 as InboundPendingQuery, b9 as InboundPendingResult, aK as InitiateResult, aJ as InitiateSendInput, aL as InitiateTransferInput, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, b0 as ItemHistoryQuery, b1 as ItemHistoryResult, b2 as ItemOrderQuery, ba as LinkedIdentitiesQuery, bb as LinkedIdentitiesResult, bO as LinkedIdentityEmail, ac as ListSubscriptionsOptions, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, q as LoyaltyCardsResult, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, bP as MinPurchaseWarning, aA as MintPlayerTokenInput, aT as OrderDetailsResult, bQ as PhoneChangeConfirmation, aI as PhoneChangeRequest, bR as PhoneChangeRequestStatus, bl as PhoneShareApproveInput, bm as PhoneShareApproveResult, bj as PhoneShareContact, bk as PhoneShareInitiateResult, bn as PhoneShareStatusResult, a2 as PlatformApprovalResult, a3 as PlatformOrderStatusResult, a4 as PlatformPurchaseHistoryQuery, a5 as PlatformPurchaseHistoryResult, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, bS as PlatformPurchaseStatus, a6 as PlatformRefundInput, a7 as PlatformRefundResult, b5 as PlayerActivityEntry, b3 as PlayerActivityQuery, b4 as PlayerActivityResult, bT as PlayerActivityType, b6 as PlayerBalanceQuery, b7 as PlayerBalanceResult, au as PlayerCardsResult, aB as PlayerToken, bq as PollDeviceApprovalInput, aO as PurchaseInput, a_ as PurchaseItemInput, a$ as PurchaseItemResult, aP as PurchaseResult, Z as Rail, bU as RefundInitiation, bV as RefundPendingApproval, bW as RefundProcessingFeeBasis, bX as RefundReceipt, ak as RefundResult, bY as RefundRevenueShareAttribution, aj as RefundSubscriptionInput, bZ as RefundWarning, aC as RegisterPlayerInput, aD as RegisterPlayerResult, aG as RequestPhoneChangeInput, aH as RequestPhoneChangeResult, av as SandboxClockResult, b_ as SandboxClockState, aw as SandboxFailureOutcome, ay as SandboxForceAuthChallengeOptions, ax as SandboxForceFailureOptions, b$ as SavedCard, az as ServerConfig, bi as ServerDestinationsQuery, ah as SetPaymentMethodInput, ai as SetPaymentMethodResult, bc as SmsVerifyResult, aY as SteamFinalizeInput, aZ as SteamFinalizeResult, an as SteamFinalizeSubscriptionResult, aW as SteamInitPurchaseInput, aX as SteamInitPurchaseResult, am as SteamInitResult, c0 as SteamPack, aU as SteamPacksQuery, aV as SteamPacksResult, al as SteamSubscriptionInitInput, c1 as SteamUserSession, c2 as Subscription, c3 as SubscriptionBaseInput, c4 as SubscriptionConsent, c5 as SubscriptionConsentInput, c6 as SubscriptionFundingRail, c7 as SubscriptionInterval, ad as SubscriptionListResult, a9 as SubscriptionResult, c8 as SubscriptionRevenueShare, c9 as SubscriptionRevenueShareInput, ca as SubscriptionStatus, bg as TransactionStatusResult, cb as UnacknowledgedPurchaseOutcome, aE as UpdatePlayerPhoneInput, aF as UpdatePlayerPhoneResult, _ as VerificationMethod, cc as isRefundPendingApproval } from './types-Ctn8N2_l.js';
|
|
2
2
|
export { G as GameEventType, R as ReportGameEventInput, a as ReportGameEventResult, b as ReportServerGameEventInput } from './loyalty-events-CmDw2ZoR.js';
|
|
3
|
-
export { C as CardsServer, D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError,
|
|
4
|
-
export { S as SDK_VERSION } from './version-
|
|
3
|
+
export { C as CardsServer, D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, d as IdentityPasskeyResetData, a as InvoEnvironment, I as InvoServer, f as InvoWebhookEvent, g as ItemPurchasedData, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, h as ListPayeesQuery, j as ListPayeesResult, k as ListPayoutsQuery, l as ListPayoutsResult, P as PRODUCTION_BASE_URL, m as PayableBlocker, n as Payee, o as PayeeInvite, p as PayeeStatus, q as PayeeStatusChangedData, s as Payout, t as PayoutStatus, u as PayoutStatusChangedData, w as PayoutsServer, x as PlatformCommercePurchasedData, y as PlatformCommerceRefundedData, z as PlatformCommerceServer, A as PlayerPhoneChangedData, B as PurchaseCompletedData, F as PurchaseEventData, R as RegisterPayeeInput, G as RegisterPayeeResult, H as RequestPayoutInput, J as RequestPayoutResult, M as ReturnReasonCode, S as SANDBOX_BASE_URL, N as SandboxServer, O as SandboxSubscriptionsServer, Q as SubscriptionAuthenticationRequiredData, U as SubscriptionCanceledData, V as SubscriptionEventCommon, W as SubscriptionExpiredData, X as SubscriptionPastDueData, Y as SubscriptionPaymentFailedData, Z as SubscriptionRefundApprovedData, _ as SubscriptionRefundDetail, $ as SubscriptionRefundRejectedData, a0 as SubscriptionRefundRequestData, a1 as SubscriptionRefundedData, a2 as SubscriptionRenewalFunding, a3 as SubscriptionRenewalSplit, a4 as SubscriptionRenewedData, a5 as SubscriptionRevenueShareAttribution, a6 as SubscriptionTrialEventFields, a7 as SubscriptionsServer, T as TEST_KEY_PREFIX, a8 as TransferEventData, a9 as VerifyWebhookOptions, aa as WebhookHandlerOptions, b as baseUrlForKey, ab as createWebhookHandler, e as environmentForBaseUrl, c as environmentFromKeyPrefix, i as isDemoKey, r as resolveEnvironment, ac as verifyWebhook, ad as verifyWebhookAsync } from './server-CtXpytKt.js';
|
|
4
|
+
export { S as SDK_VERSION } from './version-Ce_pLpJf.js';
|
package/dist/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CardsServer, DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, PRODUCTION_BASE_URL, PayoutsServer, PlatformCommerceServer, SANDBOX_BASE_URL, SandboxServer, SandboxSubscriptionsServer, SubscriptionsServer, baseUrlForKey, createWebhookHandler, isDemoKey, isRefundPendingApproval, resolveEnvironment, verifyWebhook, verifyWebhookAsync } from './chunk-
|
|
2
|
-
export { SDK_VERSION } from './chunk-
|
|
3
|
-
export { InvoError } from './chunk-
|
|
1
|
+
export { CardsServer, DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, KeyEnvironmentMismatchError, LIVE_KEY_PREFIX, PRODUCTION_BASE_URL, PayoutsServer, PlatformCommerceServer, SANDBOX_BASE_URL, SandboxServer, SandboxSubscriptionsServer, SubscriptionsServer, TEST_KEY_PREFIX, baseUrlForKey, createWebhookHandler, environmentForBaseUrl, environmentFromKeyPrefix, isDemoKey, isRefundPendingApproval, resolveEnvironment, verifyWebhook, verifyWebhookAsync } from './chunk-D2AUZRYS.js';
|
|
2
|
+
export { SDK_VERSION } from './chunk-73ZVDQZV.js';
|
|
3
|
+
export { InvoError } from './chunk-R65CANFG.js';
|
|
4
4
|
//# sourceMappingURL=server.js.map
|
|
5
5
|
//# sourceMappingURL=server.js.map
|
|
@@ -297,6 +297,24 @@ declare class InvoError extends Error {
|
|
|
297
297
|
* Not retryable until INVO resumes payments; show a neutral "purchases are
|
|
298
298
|
* unavailable right now" message. */
|
|
299
299
|
get isPaymentsPaused(): boolean;
|
|
300
|
+
/** The key belongs to the other INVO environment (`KEY_FOR_OTHER_ENVIRONMENT`, 401;
|
|
301
|
+
* additive, 3.34.0): a test key (`ivsdk_test_`) sent to production, or a live key
|
|
302
|
+
* (`ivsdk_live_`) sent to the sandbox. Never retried. Use the key for the environment
|
|
303
|
+
* you are calling, or point the SDK at the environment the key is for. The code is
|
|
304
|
+
* matched on any code field (`code`, `rawCode`, `publicCode`, or the body's
|
|
305
|
+
* `error_code` / `code`), since the 401 may carry a different `code`. */
|
|
306
|
+
get isKeyForOtherEnvironment(): boolean;
|
|
307
|
+
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
308
|
+
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
309
|
+
* balance is never disclosed. Offer another way to pay. */
|
|
310
|
+
get isBalanceUnavailable(): boolean;
|
|
311
|
+
/** Buyer approval is not available (`APPROVAL_NOT_AVAILABLE`, 503 or 409; 3.33.0). */
|
|
312
|
+
get isApprovalNotAvailable(): boolean;
|
|
313
|
+
/** No buyer-approved purchase with that id in your store (`APPROVAL_NOT_FOUND`, 404). */
|
|
314
|
+
get isApprovalNotFound(): boolean;
|
|
315
|
+
/** `cancelApproval` on an approval that already ended (`APPROVAL_ALREADY_ENDED`, 409).
|
|
316
|
+
* Read it with `getApproval`: it may have completed. */
|
|
317
|
+
get isApprovalAlreadyEnded(): boolean;
|
|
300
318
|
/** True when init-purchase was given a `packId` that is not in INVO's Steam
|
|
301
319
|
* catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
|
|
302
320
|
* `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
|
|
@@ -974,7 +992,14 @@ interface InvoConfig {
|
|
|
974
992
|
hooks?: InvoHooks;
|
|
975
993
|
}
|
|
976
994
|
interface ServerConfig extends InvoConfig {
|
|
977
|
-
/**
|
|
995
|
+
/**
|
|
996
|
+
* The game secret. Server-side ONLY: never ship this to a browser.
|
|
997
|
+
*
|
|
998
|
+
* Keys made from 3.34.0 on name their environment: `ivsdk_live_...` is production and
|
|
999
|
+
* `ivsdk_test_...` is the sandbox. Pairing one with a `baseUrl` on the other INVO host
|
|
1000
|
+
* throws `KeyEnvironmentMismatchError` here, before any request. A `baseUrl` that is not
|
|
1001
|
+
* an INVO host (your own proxy) is not checked, nor is an older unprefixed `ivsdk_...` key.
|
|
1002
|
+
*/
|
|
978
1003
|
gameSecret: string;
|
|
979
1004
|
/**
|
|
980
1005
|
* The per-game **sandbox clock key** (`ivclk_...`) from the sandbox console (Game
|
|
@@ -1876,12 +1901,19 @@ interface PlatformPurchaseInput {
|
|
|
1876
1901
|
successUrl?: string;
|
|
1877
1902
|
/** Card leg only: where the hosted checkout sends the buyer on cancel. */
|
|
1878
1903
|
cancelUrl?: string;
|
|
1879
|
-
/**
|
|
1904
|
+
/** Your correlation object, echoed back on the platform_commerce.* webhooks (both legs). */
|
|
1880
1905
|
metadata?: Record<string, unknown>;
|
|
1906
|
+
/** Balance leg (3.33.0): nothing is debited until the BUYER approves on INVO's page with
|
|
1907
|
+
* their INVO passkey. The response is `status: "pending_approval"` with `approvalId` and
|
|
1908
|
+
* `approvalUrl`. Use it whenever the buyer's email comes from a public page. The card leg
|
|
1909
|
+
* ignores it (paying by card is the buyer's approval). */
|
|
1910
|
+
requirePlayerApproval?: boolean;
|
|
1911
|
+
/** With `requirePlayerApproval`: the approval page's "Back to the store" link (https). */
|
|
1912
|
+
returnUrl?: string;
|
|
1881
1913
|
}
|
|
1882
1914
|
/** "success" → BALANCE leg settled synchronously. "requires_payment" → CARD leg: send
|
|
1883
1915
|
* the buyer to `checkoutUrl` (INVO's hosted checkout page). */
|
|
1884
|
-
type PlatformPurchaseStatus = "success" | "requires_payment";
|
|
1916
|
+
type PlatformPurchaseStatus = "success" | "requires_payment" | "pending_approval";
|
|
1885
1917
|
interface PlatformPurchaseResult {
|
|
1886
1918
|
/** "success" (balance settled) | "requires_payment" (card — send the buyer to `checkoutUrl`). */
|
|
1887
1919
|
status: string;
|
|
@@ -1913,6 +1945,30 @@ interface PlatformPurchaseResult {
|
|
|
1913
1945
|
* the purchase throws `400 BELOW_CARD_MINIMUM` (`err.isBelowCardMinimum`). Absent otherwise.
|
|
1914
1946
|
*/
|
|
1915
1947
|
minPurchaseWarning?: MinPurchaseWarning;
|
|
1948
|
+
/** Additive (3.33.0), `pending_approval` only: the buyer-approved purchase's id. */
|
|
1949
|
+
approvalId?: string;
|
|
1950
|
+
/** Additive (3.33.0), `pending_approval` only: send the buyer here. `null` on a retry of a
|
|
1951
|
+
* purchase still waiting (`idempotentReplay: true`): keep the first response's URL. */
|
|
1952
|
+
approvalUrl?: string | null;
|
|
1953
|
+
raw: Record<string, unknown>;
|
|
1954
|
+
}
|
|
1955
|
+
/** A buyer-approved balance purchase (`getApproval` / `cancelApproval`, 3.33.0). */
|
|
1956
|
+
interface PlatformApprovalResult {
|
|
1957
|
+
approvalId: string;
|
|
1958
|
+
clientRequestId: string;
|
|
1959
|
+
/** "pending_approval" | "completed" | "declined" | "expired" | "cancelled" | "failed". */
|
|
1960
|
+
status: string;
|
|
1961
|
+
/** Why it ended without a sale: declined, buyer_cannot_approve, expired, cancelled,
|
|
1962
|
+
* insufficient_balance, recovery_hold or settlement_failed. Null while pending and when
|
|
1963
|
+
* completed. */
|
|
1964
|
+
reason: string | null;
|
|
1965
|
+
totalPrice: string | null;
|
|
1966
|
+
/** The sale's order once completed; read it with `getStatus`. */
|
|
1967
|
+
orderId: string | number | null;
|
|
1968
|
+
transactionId: string | null;
|
|
1969
|
+
expiresAt: string | null;
|
|
1970
|
+
decidedAt: string | null;
|
|
1971
|
+
metadata: Record<string, unknown>;
|
|
1916
1972
|
raw: Record<string, unknown>;
|
|
1917
1973
|
}
|
|
1918
1974
|
interface PlatformOrderStatusResult {
|
|
@@ -3746,4 +3802,4 @@ interface RewardsPageLink {
|
|
|
3746
3802
|
raw: Record<string, unknown>;
|
|
3747
3803
|
}
|
|
3748
3804
|
|
|
3749
|
-
export { type AuthHeader as $, type ApproveResult as A, type BalanceResult as B, type CheckoutClientConfig as C, type DestinationGame as D, type EnrollmentBeginResult as E, type InvoHooks as F, type InvoRequestInfo as G, Http as H, InvoError as I, type InvoResponseInfo as J, type LoyaltyCard as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type LoyaltyCardReward as N, type LoyaltyCardStep as O, type PendingCollectItem as P, type LoyaltyRewardState as Q, type RedeemRewardResult as R, type LoyaltyStepProgress as S, type LoyaltyStepState as T, type LoyaltyVaultEntry 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 PurchaseStatusResult as a, type
|
|
3805
|
+
export { type AuthHeader as $, type ApproveResult as A, type BalanceResult as B, type CheckoutClientConfig as C, type DestinationGame as D, type EnrollmentBeginResult as E, type InvoHooks as F, type InvoRequestInfo as G, Http as H, InvoError as I, type InvoResponseInfo as J, type LoyaltyCard as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type LoyaltyCardReward as N, type LoyaltyCardStep as O, type PendingCollectItem as P, type LoyaltyRewardState as Q, type RedeemRewardResult as R, type LoyaltyStepProgress as S, type LoyaltyStepState as T, type LoyaltyVaultEntry 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 PurchaseStatusResult as a, type PurchaseItemResult as a$, type PlatformPurchaseInput as a0, type PlatformPurchaseResult as a1, type PlatformApprovalResult as a2, type PlatformOrderStatusResult as a3, type PlatformPurchaseHistoryQuery as a4, type PlatformPurchaseHistoryResult as a5, type PlatformRefundInput as a6, type PlatformRefundResult as a7, type CreateSubscriptionInput as a8, type SubscriptionResult as a9, type MintPlayerTokenInput as aA, type PlayerToken as aB, type RegisterPlayerInput as aC, type RegisterPlayerResult as aD, type UpdatePlayerPhoneInput as aE, type UpdatePlayerPhoneResult as aF, type RequestPhoneChangeInput as aG, type RequestPhoneChangeResult as aH, type PhoneChangeRequest as aI, type InitiateSendInput as aJ, type InitiateResult as aK, type InitiateTransferInput as aL, type CreateCheckoutInput as aM, type CreateCheckoutResult as aN, type PurchaseInput as aO, type PurchaseResult as aP, type CurrencyPurchaseQuoteInput as aQ, type CurrencyPurchaseQuote as aR, type ConfirmPaymentResult as aS, type OrderDetailsResult as aT, type SteamPacksQuery as aU, type SteamPacksResult as aV, type SteamInitPurchaseInput as aW, type SteamInitPurchaseResult as aX, type SteamFinalizeInput as aY, type SteamFinalizeResult as aZ, type PurchaseItemInput as a_, type GetSubscriptionOptions as aa, type GetSubscriptionResult as ab, type ListSubscriptionsOptions as ac, type SubscriptionListResult as ad, type CancelSubscriptionOptions as ae, type CancelResult as af, type ChangeAmountResult as ag, type SetPaymentMethodInput as ah, type SetPaymentMethodResult as ai, type RefundSubscriptionInput as aj, type RefundResult as ak, type SteamSubscriptionInitInput as al, type SteamInitResult as am, type SteamFinalizeSubscriptionResult as an, type CardSetupSessionInput as ao, type CardSetupSessionResult as ap, type CardSetupInput as aq, type CardSetupResult as ar, type CardSetupConfirmInput as as, type CardSetupConfirmResult as at, type PlayerCardsResult as au, type SandboxClockResult as av, type SandboxFailureOutcome as aw, type SandboxForceFailureOptions as ax, type SandboxForceAuthChallengeOptions as ay, type ServerConfig as az, type PurchaseCredited as b, type SavedCard as b$, type ItemHistoryQuery as b0, type ItemHistoryResult as b1, type ItemOrderQuery as b2, type PlayerActivityQuery as b3, type PlayerActivityResult as b4, type PlayerActivityEntry as b5, type PlayerBalanceQuery as b6, type PlayerBalanceResult as b7, type InboundPendingQuery as b8, type InboundPendingResult as b9, type CurrencyBalance as bA, type CurrencyPurchaseQuoteBreakdown as bB, type DeviceApprovalChannel as bC, type DeviceApprovalEnrollment as bD, type DeviceApprovalFlow as bE, type DeviceApprovalPollStatus as bF, type DeviceEnrollmentDecision as bG, type DeviceEnrollmentRespond as bH, type ExpiryReason as bI, type FeeTakenFrom as bJ, type FirstCharge as bK, type FirstChargeStatus as bL, type FundingSource as bM, type InboundPendingItem as bN, type LinkedIdentityEmail as bO, type MinPurchaseWarning as bP, type PhoneChangeConfirmation as bQ, type PhoneChangeRequestStatus as bR, type PlatformPurchaseStatus as bS, type PlayerActivityType as bT, type RefundInitiation as bU, type RefundPendingApproval as bV, type RefundProcessingFeeBasis as bW, type RefundReceipt as bX, type RefundRevenueShareAttribution as bY, type RefundWarning as bZ, type SandboxClockState as b_, type LinkedIdentitiesQuery as ba, type LinkedIdentitiesResult as bb, type SmsVerifyResult as bc, type ClaimTransferInput as bd, type ClaimResult as be, type ClaimCurrencyInput as bf, type TransactionStatusResult as bg, type GuardianApprovalStatusResult as bh, type ServerDestinationsQuery as bi, type PhoneShareContact as bj, type PhoneShareInitiateResult as bk, type PhoneShareApproveInput as bl, type PhoneShareApproveResult as bm, type PhoneShareStatusResult as bn, type BeginDeviceApprovalInput as bo, type DeviceApprovalGrant as bp, type PollDeviceApprovalInput as bq, type DeviceApprovalPollResult as br, type ConfirmDeviceEnrollmentInput as bs, type ConfirmDeviceEnrollmentResult as bt, type ApproveWithDeviceCodeInput as bu, type DeviceApprovalSettleResult as bv, type CompleteDeviceApprovalInput as bw, type CompleteDeviceApprovalResult as bx, type CardSetupStatus as by, type CheckoutWarning as bz, type PurchaseExpired as c, type SteamPack as c0, type SteamUserSession as c1, type Subscription as c2, type SubscriptionBaseInput as c3, type SubscriptionConsent as c4, type SubscriptionConsentInput as c5, type SubscriptionFundingRail as c6, type SubscriptionInterval as c7, type SubscriptionRevenueShare as c8, type SubscriptionRevenueShareInput as c9, type SubscriptionStatus as ca, type UnacknowledgedPurchaseOutcome as cb, isRefundPendingApproval as cc, type PurchaseRefunded as d, type PurchaseRefused as e, type PurchaseStatusInput as f, type CallOptions as g, type CheckoutMountHandle as h, type ClientConfig as i, type ConfirmReceiptResult as j, type PhoneChangeApprovalsResult as k, type ApprovePhoneChangeInput as l, type ApprovePhoneChangeResult as m, type PendingCollectResult as n, type DestinationsQuery as o, type DestinationsResult as p, type LoyaltyCardsResult as q, type LoyaltyVaultResult as r, type RewardsPageLink as s, type EnrollmentVerifyResult as t, type RecoveryBeginResult as u, type RecoveryCompleteResult as v, type BalanceRow as w, type CheckoutPurchaseStatus as x, type ClaimDelivery as y, type InvoErrorInfo as z };
|
|
@@ -297,6 +297,24 @@ declare class InvoError extends Error {
|
|
|
297
297
|
* Not retryable until INVO resumes payments; show a neutral "purchases are
|
|
298
298
|
* unavailable right now" message. */
|
|
299
299
|
get isPaymentsPaused(): boolean;
|
|
300
|
+
/** The key belongs to the other INVO environment (`KEY_FOR_OTHER_ENVIRONMENT`, 401;
|
|
301
|
+
* additive, 3.34.0): a test key (`ivsdk_test_`) sent to production, or a live key
|
|
302
|
+
* (`ivsdk_live_`) sent to the sandbox. Never retried. Use the key for the environment
|
|
303
|
+
* you are calling, or point the SDK at the environment the key is for. The code is
|
|
304
|
+
* matched on any code field (`code`, `rawCode`, `publicCode`, or the body's
|
|
305
|
+
* `error_code` / `code`), since the 401 may carry a different `code`. */
|
|
306
|
+
get isKeyForOtherEnvironment(): boolean;
|
|
307
|
+
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
308
|
+
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
309
|
+
* balance is never disclosed. Offer another way to pay. */
|
|
310
|
+
get isBalanceUnavailable(): boolean;
|
|
311
|
+
/** Buyer approval is not available (`APPROVAL_NOT_AVAILABLE`, 503 or 409; 3.33.0). */
|
|
312
|
+
get isApprovalNotAvailable(): boolean;
|
|
313
|
+
/** No buyer-approved purchase with that id in your store (`APPROVAL_NOT_FOUND`, 404). */
|
|
314
|
+
get isApprovalNotFound(): boolean;
|
|
315
|
+
/** `cancelApproval` on an approval that already ended (`APPROVAL_ALREADY_ENDED`, 409).
|
|
316
|
+
* Read it with `getApproval`: it may have completed. */
|
|
317
|
+
get isApprovalAlreadyEnded(): boolean;
|
|
300
318
|
/** True when init-purchase was given a `packId` that is not in INVO's Steam
|
|
301
319
|
* catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
|
|
302
320
|
* `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
|
|
@@ -974,7 +992,14 @@ interface InvoConfig {
|
|
|
974
992
|
hooks?: InvoHooks;
|
|
975
993
|
}
|
|
976
994
|
interface ServerConfig extends InvoConfig {
|
|
977
|
-
/**
|
|
995
|
+
/**
|
|
996
|
+
* The game secret. Server-side ONLY: never ship this to a browser.
|
|
997
|
+
*
|
|
998
|
+
* Keys made from 3.34.0 on name their environment: `ivsdk_live_...` is production and
|
|
999
|
+
* `ivsdk_test_...` is the sandbox. Pairing one with a `baseUrl` on the other INVO host
|
|
1000
|
+
* throws `KeyEnvironmentMismatchError` here, before any request. A `baseUrl` that is not
|
|
1001
|
+
* an INVO host (your own proxy) is not checked, nor is an older unprefixed `ivsdk_...` key.
|
|
1002
|
+
*/
|
|
978
1003
|
gameSecret: string;
|
|
979
1004
|
/**
|
|
980
1005
|
* The per-game **sandbox clock key** (`ivclk_...`) from the sandbox console (Game
|
|
@@ -1876,12 +1901,19 @@ interface PlatformPurchaseInput {
|
|
|
1876
1901
|
successUrl?: string;
|
|
1877
1902
|
/** Card leg only: where the hosted checkout sends the buyer on cancel. */
|
|
1878
1903
|
cancelUrl?: string;
|
|
1879
|
-
/**
|
|
1904
|
+
/** Your correlation object, echoed back on the platform_commerce.* webhooks (both legs). */
|
|
1880
1905
|
metadata?: Record<string, unknown>;
|
|
1906
|
+
/** Balance leg (3.33.0): nothing is debited until the BUYER approves on INVO's page with
|
|
1907
|
+
* their INVO passkey. The response is `status: "pending_approval"` with `approvalId` and
|
|
1908
|
+
* `approvalUrl`. Use it whenever the buyer's email comes from a public page. The card leg
|
|
1909
|
+
* ignores it (paying by card is the buyer's approval). */
|
|
1910
|
+
requirePlayerApproval?: boolean;
|
|
1911
|
+
/** With `requirePlayerApproval`: the approval page's "Back to the store" link (https). */
|
|
1912
|
+
returnUrl?: string;
|
|
1881
1913
|
}
|
|
1882
1914
|
/** "success" → BALANCE leg settled synchronously. "requires_payment" → CARD leg: send
|
|
1883
1915
|
* the buyer to `checkoutUrl` (INVO's hosted checkout page). */
|
|
1884
|
-
type PlatformPurchaseStatus = "success" | "requires_payment";
|
|
1916
|
+
type PlatformPurchaseStatus = "success" | "requires_payment" | "pending_approval";
|
|
1885
1917
|
interface PlatformPurchaseResult {
|
|
1886
1918
|
/** "success" (balance settled) | "requires_payment" (card — send the buyer to `checkoutUrl`). */
|
|
1887
1919
|
status: string;
|
|
@@ -1913,6 +1945,30 @@ interface PlatformPurchaseResult {
|
|
|
1913
1945
|
* the purchase throws `400 BELOW_CARD_MINIMUM` (`err.isBelowCardMinimum`). Absent otherwise.
|
|
1914
1946
|
*/
|
|
1915
1947
|
minPurchaseWarning?: MinPurchaseWarning;
|
|
1948
|
+
/** Additive (3.33.0), `pending_approval` only: the buyer-approved purchase's id. */
|
|
1949
|
+
approvalId?: string;
|
|
1950
|
+
/** Additive (3.33.0), `pending_approval` only: send the buyer here. `null` on a retry of a
|
|
1951
|
+
* purchase still waiting (`idempotentReplay: true`): keep the first response's URL. */
|
|
1952
|
+
approvalUrl?: string | null;
|
|
1953
|
+
raw: Record<string, unknown>;
|
|
1954
|
+
}
|
|
1955
|
+
/** A buyer-approved balance purchase (`getApproval` / `cancelApproval`, 3.33.0). */
|
|
1956
|
+
interface PlatformApprovalResult {
|
|
1957
|
+
approvalId: string;
|
|
1958
|
+
clientRequestId: string;
|
|
1959
|
+
/** "pending_approval" | "completed" | "declined" | "expired" | "cancelled" | "failed". */
|
|
1960
|
+
status: string;
|
|
1961
|
+
/** Why it ended without a sale: declined, buyer_cannot_approve, expired, cancelled,
|
|
1962
|
+
* insufficient_balance, recovery_hold or settlement_failed. Null while pending and when
|
|
1963
|
+
* completed. */
|
|
1964
|
+
reason: string | null;
|
|
1965
|
+
totalPrice: string | null;
|
|
1966
|
+
/** The sale's order once completed; read it with `getStatus`. */
|
|
1967
|
+
orderId: string | number | null;
|
|
1968
|
+
transactionId: string | null;
|
|
1969
|
+
expiresAt: string | null;
|
|
1970
|
+
decidedAt: string | null;
|
|
1971
|
+
metadata: Record<string, unknown>;
|
|
1916
1972
|
raw: Record<string, unknown>;
|
|
1917
1973
|
}
|
|
1918
1974
|
interface PlatformOrderStatusResult {
|
|
@@ -3746,4 +3802,4 @@ interface RewardsPageLink {
|
|
|
3746
3802
|
raw: Record<string, unknown>;
|
|
3747
3803
|
}
|
|
3748
3804
|
|
|
3749
|
-
export { type AuthHeader as $, type ApproveResult as A, type BalanceResult as B, type CheckoutClientConfig as C, type DestinationGame as D, type EnrollmentBeginResult as E, type InvoHooks as F, type InvoRequestInfo as G, Http as H, InvoError as I, type InvoResponseInfo as J, type LoyaltyCard as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type LoyaltyCardReward as N, type LoyaltyCardStep as O, type PendingCollectItem as P, type LoyaltyRewardState as Q, type RedeemRewardResult as R, type LoyaltyStepProgress as S, type LoyaltyStepState as T, type LoyaltyVaultEntry 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 PurchaseStatusResult as a, type
|
|
3805
|
+
export { type AuthHeader as $, type ApproveResult as A, type BalanceResult as B, type CheckoutClientConfig as C, type DestinationGame as D, type EnrollmentBeginResult as E, type InvoHooks as F, type InvoRequestInfo as G, Http as H, InvoError as I, type InvoResponseInfo as J, type LoyaltyCard as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type LoyaltyCardReward as N, type LoyaltyCardStep as O, type PendingCollectItem as P, type LoyaltyRewardState as Q, type RedeemRewardResult as R, type LoyaltyStepProgress as S, type LoyaltyStepState as T, type LoyaltyVaultEntry 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 PurchaseStatusResult as a, type PurchaseItemResult as a$, type PlatformPurchaseInput as a0, type PlatformPurchaseResult as a1, type PlatformApprovalResult as a2, type PlatformOrderStatusResult as a3, type PlatformPurchaseHistoryQuery as a4, type PlatformPurchaseHistoryResult as a5, type PlatformRefundInput as a6, type PlatformRefundResult as a7, type CreateSubscriptionInput as a8, type SubscriptionResult as a9, type MintPlayerTokenInput as aA, type PlayerToken as aB, type RegisterPlayerInput as aC, type RegisterPlayerResult as aD, type UpdatePlayerPhoneInput as aE, type UpdatePlayerPhoneResult as aF, type RequestPhoneChangeInput as aG, type RequestPhoneChangeResult as aH, type PhoneChangeRequest as aI, type InitiateSendInput as aJ, type InitiateResult as aK, type InitiateTransferInput as aL, type CreateCheckoutInput as aM, type CreateCheckoutResult as aN, type PurchaseInput as aO, type PurchaseResult as aP, type CurrencyPurchaseQuoteInput as aQ, type CurrencyPurchaseQuote as aR, type ConfirmPaymentResult as aS, type OrderDetailsResult as aT, type SteamPacksQuery as aU, type SteamPacksResult as aV, type SteamInitPurchaseInput as aW, type SteamInitPurchaseResult as aX, type SteamFinalizeInput as aY, type SteamFinalizeResult as aZ, type PurchaseItemInput as a_, type GetSubscriptionOptions as aa, type GetSubscriptionResult as ab, type ListSubscriptionsOptions as ac, type SubscriptionListResult as ad, type CancelSubscriptionOptions as ae, type CancelResult as af, type ChangeAmountResult as ag, type SetPaymentMethodInput as ah, type SetPaymentMethodResult as ai, type RefundSubscriptionInput as aj, type RefundResult as ak, type SteamSubscriptionInitInput as al, type SteamInitResult as am, type SteamFinalizeSubscriptionResult as an, type CardSetupSessionInput as ao, type CardSetupSessionResult as ap, type CardSetupInput as aq, type CardSetupResult as ar, type CardSetupConfirmInput as as, type CardSetupConfirmResult as at, type PlayerCardsResult as au, type SandboxClockResult as av, type SandboxFailureOutcome as aw, type SandboxForceFailureOptions as ax, type SandboxForceAuthChallengeOptions as ay, type ServerConfig as az, type PurchaseCredited as b, type SavedCard as b$, type ItemHistoryQuery as b0, type ItemHistoryResult as b1, type ItemOrderQuery as b2, type PlayerActivityQuery as b3, type PlayerActivityResult as b4, type PlayerActivityEntry as b5, type PlayerBalanceQuery as b6, type PlayerBalanceResult as b7, type InboundPendingQuery as b8, type InboundPendingResult as b9, type CurrencyBalance as bA, type CurrencyPurchaseQuoteBreakdown as bB, type DeviceApprovalChannel as bC, type DeviceApprovalEnrollment as bD, type DeviceApprovalFlow as bE, type DeviceApprovalPollStatus as bF, type DeviceEnrollmentDecision as bG, type DeviceEnrollmentRespond as bH, type ExpiryReason as bI, type FeeTakenFrom as bJ, type FirstCharge as bK, type FirstChargeStatus as bL, type FundingSource as bM, type InboundPendingItem as bN, type LinkedIdentityEmail as bO, type MinPurchaseWarning as bP, type PhoneChangeConfirmation as bQ, type PhoneChangeRequestStatus as bR, type PlatformPurchaseStatus as bS, type PlayerActivityType as bT, type RefundInitiation as bU, type RefundPendingApproval as bV, type RefundProcessingFeeBasis as bW, type RefundReceipt as bX, type RefundRevenueShareAttribution as bY, type RefundWarning as bZ, type SandboxClockState as b_, type LinkedIdentitiesQuery as ba, type LinkedIdentitiesResult as bb, type SmsVerifyResult as bc, type ClaimTransferInput as bd, type ClaimResult as be, type ClaimCurrencyInput as bf, type TransactionStatusResult as bg, type GuardianApprovalStatusResult as bh, type ServerDestinationsQuery as bi, type PhoneShareContact as bj, type PhoneShareInitiateResult as bk, type PhoneShareApproveInput as bl, type PhoneShareApproveResult as bm, type PhoneShareStatusResult as bn, type BeginDeviceApprovalInput as bo, type DeviceApprovalGrant as bp, type PollDeviceApprovalInput as bq, type DeviceApprovalPollResult as br, type ConfirmDeviceEnrollmentInput as bs, type ConfirmDeviceEnrollmentResult as bt, type ApproveWithDeviceCodeInput as bu, type DeviceApprovalSettleResult as bv, type CompleteDeviceApprovalInput as bw, type CompleteDeviceApprovalResult as bx, type CardSetupStatus as by, type CheckoutWarning as bz, type PurchaseExpired as c, type SteamPack as c0, type SteamUserSession as c1, type Subscription as c2, type SubscriptionBaseInput as c3, type SubscriptionConsent as c4, type SubscriptionConsentInput as c5, type SubscriptionFundingRail as c6, type SubscriptionInterval as c7, type SubscriptionRevenueShare as c8, type SubscriptionRevenueShareInput as c9, type SubscriptionStatus as ca, type UnacknowledgedPurchaseOutcome as cb, isRefundPendingApproval as cc, type PurchaseRefunded as d, type PurchaseRefused as e, type PurchaseStatusInput as f, type CallOptions as g, type CheckoutMountHandle as h, type ClientConfig as i, type ConfirmReceiptResult as j, type PhoneChangeApprovalsResult as k, type ApprovePhoneChangeInput as l, type ApprovePhoneChangeResult as m, type PendingCollectResult as n, type DestinationsQuery as o, type DestinationsResult as p, type LoyaltyCardsResult as q, type LoyaltyVaultResult as r, type RewardsPageLink as s, type EnrollmentVerifyResult as t, type RecoveryBeginResult as u, type RecoveryCompleteResult as v, type BalanceRow as w, type CheckoutPurchaseStatus as x, type ClaimDelivery as y, type InvoErrorInfo as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@invonetwork/web-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.34.0",
|
|
4
4
|
"description": "INVO Web SDK — currency purchase, passkey (WebAuthn) verification, loyalty, and a drop-in game economy layer (wallet, shop, hosted checkout) for partner web platforms and browser games.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"private": false,
|