@invonetwork/web-sdk 3.26.1 → 3.28.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 +20 -0
- package/README.md +118 -0
- package/dist/chunk-3DRWLDDF.js +6 -0
- package/dist/chunk-4YKTKXC5.js +3735 -0
- package/dist/chunk-6CN236QH.js +473 -0
- package/dist/{chunk-7BYAUHTA.js → chunk-VP3OK4J4.js} +56 -459
- package/dist/game-server.cjs +6025 -0
- package/dist/game-server.d.cts +193 -0
- package/dist/game-server.d.ts +193 -0
- package/dist/game-server.js +746 -0
- package/dist/game.cjs +2172 -0
- package/dist/game.d.cts +197 -0
- package/dist/game.d.ts +197 -0
- package/dist/game.js +1034 -0
- package/dist/index.cjs +87 -0
- package/dist/index.d.cts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +26 -2
- package/dist/server.cjs +158 -1
- package/dist/server.d.cts +50 -7
- package/dist/server.d.ts +50 -7
- package/dist/server.js +4 -3650
- package/dist/types-CoW9LopI.d.cts +143 -0
- package/dist/types-CoW9LopI.d.ts +143 -0
- package/dist/{types-Cjd4SAR8.d.cts → types-_lIm74kd.d.cts} +40 -1
- package/dist/{types-Cjd4SAR8.d.ts → types-_lIm74kd.d.ts} +40 -1
- package/dist/version-iWmcxjYu.d.cts +8 -0
- package/dist/version-iWmcxjYu.d.ts +8 -0
- package/package.json +91 -77
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { I as InvoError, H as Http,
|
|
2
|
-
export {
|
|
1
|
+
import { I as InvoError, H as Http, a2 as AuthHeader, g as CallOptions, a3 as PlatformPurchaseInput, a4 as PlatformPurchaseResult, a5 as PlatformOrderStatusResult, a6 as PlatformPurchaseHistoryQuery, a7 as PlatformPurchaseHistoryResult, a8 as PlatformRefundInput, a9 as PlatformRefundResult, aa as CreateSubscriptionInput, ab as SubscriptionResult, ac as GetSubscriptionOptions, ad as GetSubscriptionResult, ae as ListSubscriptionsOptions, af as SubscriptionListResult, ag as CancelSubscriptionOptions, ah as CancelResult, ai as ChangeAmountResult, aj as SetPaymentMethodInput, ak as SetPaymentMethodResult, al as RefundSubscriptionInput, am as RefundResult, an as SteamSubscriptionInitInput, ao as SteamInitResult, ap as SteamFinalizeSubscriptionResult, aq as CardSetupSessionInput, ar as CardSetupSessionResult, as as CardSetupInput, at as CardSetupResult, au as CardSetupConfirmInput, av as CardSetupConfirmResult, aw as PlayerCardsResult, ax as SandboxClockResult, ay as SandboxFailureOutcome, az as SandboxForceFailureOptions, aA as SandboxForceAuthChallengeOptions, aB as ServerConfig, aC as MintPlayerTokenInput, aD as PlayerToken, aE as RegisterPlayerInput, aF as RegisterPlayerResult, aG as UpdatePlayerPhoneInput, aH as UpdatePlayerPhoneResult, aI as RequestPhoneChangeInput, aJ as RequestPhoneChangeResult, aK as PhoneChangeRequest, aL as InitiateSendInput, aM as InitiateResult, aN as InitiateTransferInput, aO as CreateCheckoutInput, aP as CreateCheckoutResult, aQ as PurchaseInput, aR as PurchaseResult, aS as CurrencyPurchaseQuoteInput, aT as CurrencyPurchaseQuote, aU as ConfirmPaymentResult, aV as OrderDetailsResult, aW as SteamPacksQuery, aX as SteamPacksResult, aY as SteamInitPurchaseInput, aZ as SteamInitPurchaseResult, a_ as SteamFinalizeInput, a$ as SteamFinalizeResult, b0 as PurchaseItemInput, b1 as PurchaseItemResult, b2 as ItemHistoryQuery, b3 as ItemHistoryResult, b4 as ItemOrderQuery, b5 as PlayerActivityQuery, b6 as PlayerActivityResult, b7 as PlayerActivityEntry, b8 as PlayerBalanceQuery, b9 as PlayerBalanceResult, o as LoyaltyCardsResult, ba as ReportServerGameEventInput, s as ReportGameEventResult, bb as InboundPendingQuery, bc as InboundPendingResult, bd as LinkedIdentitiesQuery, be as LinkedIdentitiesResult, bf as SmsVerifyResult, bg as ClaimTransferInput, bh as ClaimResult, bi as ClaimCurrencyInput, bj as TransactionStatusResult, bk as GuardianApprovalStatusResult, bl as ServerDestinationsQuery, n as DestinationsResult, bm as PhoneShareContact, bn as PhoneShareInitiateResult, bo as PhoneShareApproveInput, bp as PhoneShareApproveResult, bq as PhoneShareStatusResult, br as BeginDeviceApprovalInput, bs as DeviceApprovalGrant, bt as PollDeviceApprovalInput, bu as DeviceApprovalPollResult, bv as ConfirmDeviceEnrollmentInput, bw as ConfirmDeviceEnrollmentResult, bx as ApproveWithDeviceCodeInput, by as DeviceApprovalSettleResult, bz as CompleteDeviceApprovalInput, bA as CompleteDeviceApprovalResult } from './types-_lIm74kd.js';
|
|
2
|
+
export { bB as CardSetupStatus, bC as CheckoutWarning, y as ClaimDelivery, bD as CurrencyBalance, bE as CurrencyPurchaseQuoteBreakdown, z as DestinationGame, bF as DeviceApprovalChannel, bG as DeviceApprovalEnrollment, bH as DeviceApprovalFlow, bI as DeviceApprovalPollStatus, bJ as DeviceEnrollmentDecision, bK as DeviceEnrollmentRespond, bL as ExpiryReason, bM as FeeTakenFrom, bN as FirstCharge, bO as FirstChargeStatus, bP as FundingSource, G as GameEventType, bQ as InboundPendingItem, F as InvoErrorInfo, J as InvoHooks, K as InvoRequestInfo, N as InvoResponseInfo, bR as LinkedIdentityEmail, O as LoyaltyCard, Q as LoyaltyCardReward, S as LoyaltyCardStep, T as LoyaltyRewardState, U as LoyaltyStepProgress, V as LoyaltyStepState, bS as MinPurchaseWarning, bT as PhoneChangeConfirmation, bU as PhoneChangeRequestStatus, bV as PlatformPurchaseStatus, bW as PlayerActivityType, a0 as Rail, bX as RefundInitiation, bY as RefundPendingApproval, bZ as RefundProcessingFeeBasis, b_ as RefundReceipt, b$ as RefundRevenueShareAttribution, c0 as RefundWarning, r as ReportGameEventInput, c1 as SandboxClockState, c2 as SavedCard, c3 as SteamPack, c4 as SteamUserSession, c5 as Subscription, c6 as SubscriptionBaseInput, c7 as SubscriptionConsent, c8 as SubscriptionConsentInput, c9 as SubscriptionFundingRail, ca as SubscriptionInterval, cb as SubscriptionRevenueShare, cc as SubscriptionRevenueShareInput, cd as SubscriptionStatus, ce as UnacknowledgedPurchaseOutcome, a1 as VerificationMethod, cf as isRefundPendingApproval } from './types-_lIm74kd.js';
|
|
3
|
+
export { S as SDK_VERSION } from './version-iWmcxjYu.js';
|
|
3
4
|
|
|
4
5
|
interface VerifyWebhookOptions {
|
|
5
6
|
/** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
|
|
@@ -1109,11 +1110,36 @@ declare class PayoutsServer {
|
|
|
1109
1110
|
}
|
|
1110
1111
|
|
|
1111
1112
|
/**
|
|
1112
|
-
*
|
|
1113
|
-
*
|
|
1114
|
-
*
|
|
1113
|
+
* Pick the INVO environment from the game secret alone (3.28.0).
|
|
1114
|
+
*
|
|
1115
|
+
* Going live is swapping the key: a sandbox key (including the public demo key baked into
|
|
1116
|
+
* INVO's game templates) talks to the sandbox, a live key to production, and nothing else in
|
|
1117
|
+
* your code changes.
|
|
1118
|
+
*
|
|
1119
|
+
* - The public demo key starts with `ivsdk_demo_`: always the sandbox, no network call.
|
|
1120
|
+
* - Any other key: INVO is asked once (`GET /api/sdk/key-environment`), production first,
|
|
1121
|
+
* then the sandbox. The answer is cached per key for the life of the process.
|
|
1122
|
+
*/
|
|
1123
|
+
declare const PRODUCTION_BASE_URL = "https://invo.network";
|
|
1124
|
+
declare const SANDBOX_BASE_URL = "https://sandbox.invo.network/sandbox";
|
|
1125
|
+
declare const DEMO_KEY_PREFIX = "ivsdk_demo_";
|
|
1126
|
+
type InvoEnvironment = "production" | "sandbox";
|
|
1127
|
+
/** Neither environment recognised the key, or INVO could not be reached. */
|
|
1128
|
+
declare class EnvironmentUnknownError extends Error {
|
|
1129
|
+
constructor(message: string);
|
|
1130
|
+
}
|
|
1131
|
+
declare function isDemoKey(gameSecret: string | undefined | null): boolean;
|
|
1132
|
+
/**
|
|
1133
|
+
* `"production"` or `"sandbox"` for this key. Rejects with {@link EnvironmentUnknownError}
|
|
1134
|
+
* when neither environment knows the key (a failed lookup is not cached, so it is retried).
|
|
1115
1135
|
*/
|
|
1116
|
-
declare
|
|
1136
|
+
declare function resolveEnvironment(gameSecret: string, opts?: {
|
|
1137
|
+
fetch?: typeof fetch;
|
|
1138
|
+
}): Promise<InvoEnvironment>;
|
|
1139
|
+
/** The API base URL for this key (see {@link resolveEnvironment}). */
|
|
1140
|
+
declare function baseUrlForKey(gameSecret: string, opts?: {
|
|
1141
|
+
fetch?: typeof fetch;
|
|
1142
|
+
}): Promise<string>;
|
|
1117
1143
|
|
|
1118
1144
|
/**
|
|
1119
1145
|
* @invonetwork/web-sdk/server — NODE entry.
|
|
@@ -1900,6 +1926,23 @@ declare class InvoServer {
|
|
|
1900
1926
|
* timed out): retry later. A GET, so transient failures are retried automatically.
|
|
1901
1927
|
*/
|
|
1902
1928
|
getPlayerRewards(playerEmail: string, opts?: CallOptions): Promise<LoyaltyCardsResult>;
|
|
1929
|
+
/**
|
|
1930
|
+
* Report a gameplay event for one player to INVO's loyalty engine from your SERVER
|
|
1931
|
+
* (`POST /api/sdk/loyalty/server-events`, game secret). Server-reported events are the
|
|
1932
|
+
* ones trusted for rewards. Use it for sessions, level milestones and custom events
|
|
1933
|
+
* registered in the console (see {@link GameEventType}); currency steps are tracked by
|
|
1934
|
+
* INVO itself and are never reported.
|
|
1935
|
+
*
|
|
1936
|
+
* Idempotent on `eventId`: pass your own UUID, or let the SDK generate one, and reuse the
|
|
1937
|
+
* returned `eventId` if you retry. Transient failures (429, 5xx) are retried with it.
|
|
1938
|
+
*
|
|
1939
|
+
* Refusals (all `InvoError`): `INVALID_INPUT` before the network for a non-`game.*` type,
|
|
1940
|
+
* a malformed `eventId`, an `occurredAt` without a timezone or a non-object payload;
|
|
1941
|
+
* `400 RESERVED_EVENT_TYPE` / `EVENT_TYPE_NOT_ALLOWED`; `401 INVALID_GAME_SECRET`;
|
|
1942
|
+
* `404 PLAYER_NOT_FOUND` (`err.isPlayerNotFound`); `422 validation_failed` (for example an
|
|
1943
|
+
* unregistered `event_name`).
|
|
1944
|
+
*/
|
|
1945
|
+
reportGameEvent(input: ReportServerGameEventInput, opts?: CallOptions): Promise<ReportGameEventResult>;
|
|
1903
1946
|
/**
|
|
1904
1947
|
* List LIVE, unclaimed inbound sends/transfers addressed to a player at YOUR game —
|
|
1905
1948
|
* the source of truth for a "you have X to collect" badge. Pass the player's email
|
|
@@ -2113,4 +2156,4 @@ declare class InvoServer {
|
|
|
2113
2156
|
private toInitiateResult;
|
|
2114
2157
|
}
|
|
2115
2158
|
|
|
2116
|
-
export { ApproveWithDeviceCodeInput, BeginDeviceApprovalInput, CallOptions, CancelResult, CancelSubscriptionOptions, CardSetupConfirmInput, CardSetupConfirmResult, CardSetupInput, CardSetupResult, CardSetupSessionInput, CardSetupSessionResult, CardsServer, ChangeAmountResult, ClaimCurrencyInput, ClaimResult, ClaimTransferInput, CompleteDeviceApprovalInput, CompleteDeviceApprovalResult, ConfirmDeviceEnrollmentInput, ConfirmDeviceEnrollmentResult, ConfirmPaymentResult, CreateCheckoutInput, CreateCheckoutResult, CreateSubscriptionInput, CurrencyPurchaseQuote, CurrencyPurchaseQuoteInput, DestinationsResult, DeviceApprovalGrant, DeviceApprovalPollResult, DeviceApprovalSettleResult, GetSubscriptionOptions, GetSubscriptionResult, GuardianApprovalStatusResult, type IdentityPasskeyResetData, InboundPendingQuery, InboundPendingResult, InitiateResult, InitiateSendInput, InitiateTransferInput, InvoError, InvoServer, type InvoWebhookEvent, ItemHistoryQuery, ItemHistoryResult, ItemOrderQuery, type ItemPurchasedData, LinkedIdentitiesQuery, LinkedIdentitiesResult, type ListPayeesQuery, type ListPayeesResult, type ListPayoutsQuery, type ListPayoutsResult, ListSubscriptionsOptions, LoyaltyCardsResult, MintPlayerTokenInput, OrderDetailsResult, type PayableBlocker, type Payee, type PayeeInvite, type PayeeStatus, type PayeeStatusChangedData, type Payout, type PayoutStatus, type PayoutStatusChangedData, PayoutsServer, PhoneChangeRequest, PhoneShareApproveInput, PhoneShareApproveResult, PhoneShareContact, PhoneShareInitiateResult, PhoneShareStatusResult, type PlatformCommercePurchasedData, type PlatformCommerceRefundedData, PlatformCommerceServer, PlatformOrderStatusResult, PlatformPurchaseHistoryQuery, PlatformPurchaseHistoryResult, PlatformPurchaseInput, PlatformPurchaseResult, PlatformRefundInput, PlatformRefundResult, PlayerActivityEntry, PlayerActivityQuery, PlayerActivityResult, PlayerBalanceQuery, PlayerBalanceResult, PlayerCardsResult, type PlayerPhoneChangedData, PlayerToken, PollDeviceApprovalInput, type PurchaseCompletedData, type PurchaseEventData, PurchaseInput, PurchaseItemInput, PurchaseItemResult, PurchaseResult, RefundResult, RefundSubscriptionInput, type RegisterPayeeInput, type RegisterPayeeResult, RegisterPlayerInput, RegisterPlayerResult, type RequestPayoutInput, type RequestPayoutResult, RequestPhoneChangeInput, RequestPhoneChangeResult, type ReturnReasonCode,
|
|
2159
|
+
export { ApproveWithDeviceCodeInput, BeginDeviceApprovalInput, CallOptions, CancelResult, CancelSubscriptionOptions, CardSetupConfirmInput, CardSetupConfirmResult, CardSetupInput, CardSetupResult, CardSetupSessionInput, CardSetupSessionResult, CardsServer, ChangeAmountResult, ClaimCurrencyInput, ClaimResult, ClaimTransferInput, CompleteDeviceApprovalInput, CompleteDeviceApprovalResult, ConfirmDeviceEnrollmentInput, ConfirmDeviceEnrollmentResult, ConfirmPaymentResult, CreateCheckoutInput, CreateCheckoutResult, CreateSubscriptionInput, CurrencyPurchaseQuote, CurrencyPurchaseQuoteInput, DEMO_KEY_PREFIX, DestinationsResult, DeviceApprovalGrant, DeviceApprovalPollResult, DeviceApprovalSettleResult, EnvironmentUnknownError, GetSubscriptionOptions, GetSubscriptionResult, GuardianApprovalStatusResult, type IdentityPasskeyResetData, InboundPendingQuery, InboundPendingResult, InitiateResult, InitiateSendInput, InitiateTransferInput, type InvoEnvironment, InvoError, InvoServer, type InvoWebhookEvent, ItemHistoryQuery, ItemHistoryResult, ItemOrderQuery, type ItemPurchasedData, LinkedIdentitiesQuery, LinkedIdentitiesResult, type ListPayeesQuery, type ListPayeesResult, type ListPayoutsQuery, type ListPayoutsResult, ListSubscriptionsOptions, LoyaltyCardsResult, MintPlayerTokenInput, OrderDetailsResult, PRODUCTION_BASE_URL, type PayableBlocker, type Payee, type PayeeInvite, type PayeeStatus, type PayeeStatusChangedData, type Payout, type PayoutStatus, type PayoutStatusChangedData, PayoutsServer, PhoneChangeRequest, PhoneShareApproveInput, PhoneShareApproveResult, PhoneShareContact, PhoneShareInitiateResult, PhoneShareStatusResult, type PlatformCommercePurchasedData, type PlatformCommerceRefundedData, PlatformCommerceServer, PlatformOrderStatusResult, PlatformPurchaseHistoryQuery, PlatformPurchaseHistoryResult, PlatformPurchaseInput, PlatformPurchaseResult, PlatformRefundInput, PlatformRefundResult, PlayerActivityEntry, PlayerActivityQuery, PlayerActivityResult, PlayerBalanceQuery, PlayerBalanceResult, PlayerCardsResult, type PlayerPhoneChangedData, PlayerToken, PollDeviceApprovalInput, type PurchaseCompletedData, type PurchaseEventData, PurchaseInput, PurchaseItemInput, PurchaseItemResult, PurchaseResult, RefundResult, RefundSubscriptionInput, type RegisterPayeeInput, type RegisterPayeeResult, RegisterPlayerInput, RegisterPlayerResult, ReportGameEventResult, ReportServerGameEventInput, type RequestPayoutInput, type RequestPayoutResult, RequestPhoneChangeInput, RequestPhoneChangeResult, type ReturnReasonCode, SANDBOX_BASE_URL, SandboxClockResult, SandboxFailureOutcome, SandboxForceAuthChallengeOptions, SandboxForceFailureOptions, SandboxServer, SandboxSubscriptionsServer, ServerConfig, ServerDestinationsQuery, SetPaymentMethodInput, SetPaymentMethodResult, SmsVerifyResult, SteamFinalizeInput, SteamFinalizeResult, SteamFinalizeSubscriptionResult, SteamInitPurchaseInput, SteamInitPurchaseResult, SteamInitResult, SteamPacksQuery, SteamPacksResult, SteamSubscriptionInitInput, type SubscriptionAuthenticationRequiredData, type SubscriptionCanceledData, type SubscriptionEventCommon, type SubscriptionExpiredData, SubscriptionListResult, type SubscriptionPastDueData, type SubscriptionPaymentFailedData, type SubscriptionRefundApprovedData, type SubscriptionRefundDetail, type SubscriptionRefundRejectedData, type SubscriptionRefundRequestData, type SubscriptionRefundedData, type SubscriptionRenewalFunding, type SubscriptionRenewalSplit, type SubscriptionRenewedData, SubscriptionResult, type SubscriptionRevenueShareAttribution, type SubscriptionTrialEventFields, SubscriptionsServer, TransactionStatusResult, type TransferEventData, UpdatePlayerPhoneInput, UpdatePlayerPhoneResult, type VerifyWebhookOptions, type WebhookHandlerOptions, baseUrlForKey, createWebhookHandler, isDemoKey, resolveEnvironment, verifyWebhook, verifyWebhookAsync };
|