@invonetwork/web-sdk 3.33.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 +1500 -1490
- package/README.md +3006 -2990
- package/dist/chunk-73ZVDQZV.js +6 -0
- package/dist/{chunk-DHVHKFQH.js → chunk-D2AUZRYS.js} +152 -73
- package/dist/{chunk-MJAJXYFX.js → chunk-DMTNU5PM.js} +3 -3
- package/dist/{chunk-HQLPT2DY.js → chunk-R65CANFG.js} +13 -2
- package/dist/game-server.cjs +103 -4
- 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 +12 -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-CYqqberu.d.cts → hosted-approval-C1hQvbu6.d.cts} +1 -1
- package/dist/{hosted-approval-CL3DfrGS.d.ts → hosted-approval-CFlj4UQE.d.ts} +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{server-Dhao5prR.d.ts → server-CtXpytKt.d.ts} +38 -5
- package/dist/{server-5_g5C-no.d.cts → server-ZnCyLWA2.d.cts} +38 -5
- package/dist/server.cjs +152 -69
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +3 -3
- package/dist/{types-DUfQR48n.d.ts → types-Ctn8N2_l.d.cts} +15 -1
- package/dist/{types-DUfQR48n.d.cts → types-Ctn8N2_l.d.ts} +15 -1
- package/dist/{version-DKfrEYU1.d.cts → version-Ce_pLpJf.d.cts} +1 -1
- package/dist/{version-DKfrEYU1.d.ts → version-Ce_pLpJf.d.ts} +1 -1
- package/package.json +91 -91
- package/dist/chunk-VWUFSA6U.js +0 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-
|
|
1
|
+
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-Ctn8N2_l.cjs';
|
|
2
2
|
|
|
3
3
|
/** The four device-approval flows (`begin.flow`). */
|
|
4
4
|
type HostedFlow = "transfer" | "send" | "send_receipt" | "transfer_receipt";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-
|
|
1
|
+
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-Ctn8N2_l.js';
|
|
2
2
|
|
|
3
3
|
/** The four device-approval flows (`begin.flow`). */
|
|
4
4
|
type HostedFlow = "transfer" | "send" | "send_receipt" | "transfer_receipt";
|
package/dist/index.cjs
CHANGED
|
@@ -347,6 +347,17 @@ var InvoError = class _InvoError extends Error {
|
|
|
347
347
|
get isPaymentsPaused() {
|
|
348
348
|
return this.code === "PAYMENTS_PAUSED";
|
|
349
349
|
}
|
|
350
|
+
/** The key belongs to the other INVO environment (`KEY_FOR_OTHER_ENVIRONMENT`, 401;
|
|
351
|
+
* additive, 3.34.0): a test key (`ivsdk_test_`) sent to production, or a live key
|
|
352
|
+
* (`ivsdk_live_`) sent to the sandbox. Never retried. Use the key for the environment
|
|
353
|
+
* you are calling, or point the SDK at the environment the key is for. The code is
|
|
354
|
+
* matched on any code field (`code`, `rawCode`, `publicCode`, or the body's
|
|
355
|
+
* `error_code` / `code`), since the 401 may carry a different `code`. */
|
|
356
|
+
get isKeyForOtherEnvironment() {
|
|
357
|
+
const C = "KEY_FOR_OTHER_ENVIRONMENT";
|
|
358
|
+
const b = this.bodyObject();
|
|
359
|
+
return this.code === C || this.rawCode === C || this.publicCode === C || b["error_code"] === C || b["code"] === C;
|
|
360
|
+
}
|
|
350
361
|
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
351
362
|
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
352
363
|
* balance is never disclosed. Offer another way to pay. */
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-
|
|
2
|
-
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-
|
|
3
|
-
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-
|
|
1
|
+
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-Ctn8N2_l.cjs';
|
|
2
|
+
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-Ctn8N2_l.cjs';
|
|
3
|
+
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-C1hQvbu6.cjs';
|
|
4
|
+
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-C1hQvbu6.cjs';
|
|
5
5
|
import { R as ReportGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.cjs';
|
|
6
6
|
export { G as GameEventType } from './loyalty-events-CmDw2ZoR.cjs';
|
|
7
7
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-
|
|
2
|
-
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-
|
|
3
|
-
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-
|
|
1
|
+
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-Ctn8N2_l.js';
|
|
2
|
+
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-Ctn8N2_l.js';
|
|
3
|
+
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-CFlj4UQE.js';
|
|
4
|
+
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-CFlj4UQE.js';
|
|
5
5
|
import { R as ReportGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.js';
|
|
6
6
|
export { G as GameEventType } from './loyalty-events-CmDw2ZoR.js';
|
|
7
7
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CheckoutClient, InvoClient, PlatformCommerceClient } from './chunk-
|
|
2
|
-
export { InvoError, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, nothingWasCharged, phoneChangeSignalMessage } from './chunk-
|
|
1
|
+
export { CheckoutClient, InvoClient, PlatformCommerceClient } from './chunk-DMTNU5PM.js';
|
|
2
|
+
export { InvoError, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, nothingWasCharged, phoneChangeSignalMessage } from './chunk-R65CANFG.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { I as InvoError, H as Http, $ as AuthHeader, g as CallOptions, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, a2 as PlatformApprovalResult, a3 as PlatformOrderStatusResult, a4 as PlatformPurchaseHistoryQuery, a5 as PlatformPurchaseHistoryResult, a6 as PlatformRefundInput, a7 as PlatformRefundResult, a8 as CreateSubscriptionInput, a9 as SubscriptionResult, aa as GetSubscriptionOptions, ab as GetSubscriptionResult, ac as ListSubscriptionsOptions, ad as SubscriptionListResult, ae as CancelSubscriptionOptions, af as CancelResult, ag as ChangeAmountResult, ah as SetPaymentMethodInput, ai as SetPaymentMethodResult, aj as RefundSubscriptionInput, ak as RefundResult, al as SteamSubscriptionInitInput, am as SteamInitResult, an as SteamFinalizeSubscriptionResult, ao as CardSetupSessionInput, ap as CardSetupSessionResult, aq as CardSetupInput, ar as CardSetupResult, as as CardSetupConfirmInput, at as CardSetupConfirmResult, au as PlayerCardsResult, av as SandboxClockResult, aw as SandboxFailureOutcome, ax as SandboxForceFailureOptions, ay as SandboxForceAuthChallengeOptions, az as ServerConfig, aA as MintPlayerTokenInput, aB as PlayerToken, aC as RegisterPlayerInput, aD as RegisterPlayerResult, aE as UpdatePlayerPhoneInput, aF as UpdatePlayerPhoneResult, aG as RequestPhoneChangeInput, aH as RequestPhoneChangeResult, aI as PhoneChangeRequest, aJ as InitiateSendInput, aK as InitiateResult, aL as InitiateTransferInput, aM as CreateCheckoutInput, aN as CreateCheckoutResult, a as PurchaseStatusResult, aO as PurchaseInput, aP as PurchaseResult, aQ as CurrencyPurchaseQuoteInput, aR as CurrencyPurchaseQuote, aS as ConfirmPaymentResult, aT as OrderDetailsResult, aU as SteamPacksQuery, aV as SteamPacksResult, aW as SteamInitPurchaseInput, aX as SteamInitPurchaseResult, aY as SteamFinalizeInput, aZ as SteamFinalizeResult, a_ as PurchaseItemInput, a$ as PurchaseItemResult, b0 as ItemHistoryQuery, b1 as ItemHistoryResult, b2 as ItemOrderQuery, b3 as PlayerActivityQuery, b4 as PlayerActivityResult, b5 as PlayerActivityEntry, b6 as PlayerBalanceQuery, b7 as PlayerBalanceResult, q as LoyaltyCardsResult, b8 as InboundPendingQuery, b9 as InboundPendingResult, ba as LinkedIdentitiesQuery, bb as LinkedIdentitiesResult, bc as SmsVerifyResult, bd as ClaimTransferInput, be as ClaimResult, bf as ClaimCurrencyInput, bg as TransactionStatusResult, bh as GuardianApprovalStatusResult, bi as ServerDestinationsQuery, p as DestinationsResult, bj as PhoneShareContact, bk as PhoneShareInitiateResult, bl as PhoneShareApproveInput, bm as PhoneShareApproveResult, bn as PhoneShareStatusResult, bo as BeginDeviceApprovalInput, bp as DeviceApprovalGrant, bq as PollDeviceApprovalInput, br as DeviceApprovalPollResult, bs as ConfirmDeviceEnrollmentInput, bt as ConfirmDeviceEnrollmentResult, bu as ApproveWithDeviceCodeInput, bv as DeviceApprovalSettleResult, bw as CompleteDeviceApprovalInput, bx as CompleteDeviceApprovalResult } from './types-
|
|
1
|
+
import { I as InvoError, H as Http, $ as AuthHeader, g as CallOptions, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, a2 as PlatformApprovalResult, a3 as PlatformOrderStatusResult, a4 as PlatformPurchaseHistoryQuery, a5 as PlatformPurchaseHistoryResult, a6 as PlatformRefundInput, a7 as PlatformRefundResult, a8 as CreateSubscriptionInput, a9 as SubscriptionResult, aa as GetSubscriptionOptions, ab as GetSubscriptionResult, ac as ListSubscriptionsOptions, ad as SubscriptionListResult, ae as CancelSubscriptionOptions, af as CancelResult, ag as ChangeAmountResult, ah as SetPaymentMethodInput, ai as SetPaymentMethodResult, aj as RefundSubscriptionInput, ak as RefundResult, al as SteamSubscriptionInitInput, am as SteamInitResult, an as SteamFinalizeSubscriptionResult, ao as CardSetupSessionInput, ap as CardSetupSessionResult, aq as CardSetupInput, ar as CardSetupResult, as as CardSetupConfirmInput, at as CardSetupConfirmResult, au as PlayerCardsResult, av as SandboxClockResult, aw as SandboxFailureOutcome, ax as SandboxForceFailureOptions, ay as SandboxForceAuthChallengeOptions, az as ServerConfig, aA as MintPlayerTokenInput, aB as PlayerToken, aC as RegisterPlayerInput, aD as RegisterPlayerResult, aE as UpdatePlayerPhoneInput, aF as UpdatePlayerPhoneResult, aG as RequestPhoneChangeInput, aH as RequestPhoneChangeResult, aI as PhoneChangeRequest, aJ as InitiateSendInput, aK as InitiateResult, aL as InitiateTransferInput, aM as CreateCheckoutInput, aN as CreateCheckoutResult, a as PurchaseStatusResult, aO as PurchaseInput, aP as PurchaseResult, aQ as CurrencyPurchaseQuoteInput, aR as CurrencyPurchaseQuote, aS as ConfirmPaymentResult, aT as OrderDetailsResult, aU as SteamPacksQuery, aV as SteamPacksResult, aW as SteamInitPurchaseInput, aX as SteamInitPurchaseResult, aY as SteamFinalizeInput, aZ as SteamFinalizeResult, a_ as PurchaseItemInput, a$ as PurchaseItemResult, b0 as ItemHistoryQuery, b1 as ItemHistoryResult, b2 as ItemOrderQuery, b3 as PlayerActivityQuery, b4 as PlayerActivityResult, b5 as PlayerActivityEntry, b6 as PlayerBalanceQuery, b7 as PlayerBalanceResult, q as LoyaltyCardsResult, b8 as InboundPendingQuery, b9 as InboundPendingResult, ba as LinkedIdentitiesQuery, bb as LinkedIdentitiesResult, bc as SmsVerifyResult, bd as ClaimTransferInput, be as ClaimResult, bf as ClaimCurrencyInput, bg as TransactionStatusResult, bh as GuardianApprovalStatusResult, bi as ServerDestinationsQuery, p as DestinationsResult, bj as PhoneShareContact, bk as PhoneShareInitiateResult, bl as PhoneShareApproveInput, bm as PhoneShareApproveResult, bn as PhoneShareStatusResult, bo as BeginDeviceApprovalInput, bp as DeviceApprovalGrant, bq as PollDeviceApprovalInput, br as DeviceApprovalPollResult, bs as ConfirmDeviceEnrollmentInput, bt as ConfirmDeviceEnrollmentResult, bu as ApproveWithDeviceCodeInput, bv as DeviceApprovalSettleResult, bw as CompleteDeviceApprovalInput, bx as CompleteDeviceApprovalResult } from './types-Ctn8N2_l.js';
|
|
2
2
|
import { b as ReportServerGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.js';
|
|
3
|
-
import './version-
|
|
3
|
+
import './version-Ce_pLpJf.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Pick the INVO environment from the game secret alone (3.28.0).
|
|
@@ -10,13 +10,46 @@ import './version-DKfrEYU1.js';
|
|
|
10
10
|
* your code changes.
|
|
11
11
|
*
|
|
12
12
|
* - The public demo key starts with `ivsdk_demo_`: always the sandbox, no network call.
|
|
13
|
-
* -
|
|
14
|
-
*
|
|
13
|
+
* - A test key starts with `ivsdk_test_`: always the sandbox, no network call (3.34.0).
|
|
14
|
+
* - A live key starts with `ivsdk_live_`: always production, no network call (3.34.0).
|
|
15
|
+
* - Any other key (the original `ivsdk_...` keys, which keep working): INVO is asked once
|
|
16
|
+
* (`GET /api/sdk/key-environment`), production first, then the sandbox. The answer is
|
|
17
|
+
* cached per key for the life of the process.
|
|
15
18
|
*/
|
|
16
19
|
declare const PRODUCTION_BASE_URL = "https://invo.network";
|
|
17
20
|
declare const SANDBOX_BASE_URL = "https://sandbox.invo.network/sandbox";
|
|
18
21
|
declare const DEMO_KEY_PREFIX = "ivsdk_demo_";
|
|
22
|
+
/** Keys for the sandbox (3.34.0). */
|
|
23
|
+
declare const TEST_KEY_PREFIX = "ivsdk_test_";
|
|
24
|
+
/** Keys for production (3.34.0). */
|
|
25
|
+
declare const LIVE_KEY_PREFIX = "ivsdk_live_";
|
|
19
26
|
type InvoEnvironment = "production" | "sandbox";
|
|
27
|
+
/**
|
|
28
|
+
* The environment a key's prefix names, with no network call (3.34.0): `"production"` for
|
|
29
|
+
* `ivsdk_live_`, `"sandbox"` for `ivsdk_test_` and the public demo key `ivsdk_demo_`, and
|
|
30
|
+
* `null` for any other key (an unprefixed `ivsdk_...` key is looked up with
|
|
31
|
+
* {@link resolveEnvironment}).
|
|
32
|
+
*/
|
|
33
|
+
declare function environmentFromKeyPrefix(gameSecret: string | undefined | null): InvoEnvironment | null;
|
|
34
|
+
/**
|
|
35
|
+
* The INVO environment a base URL points at, or `null` when it is not one of INVO's hosts
|
|
36
|
+
* (your own proxy, `localhost`, anything else) (3.34.0). `sandbox.invo.network` is the
|
|
37
|
+
* sandbox; `invo.network` (and `www.`) is production, unless its path starts with
|
|
38
|
+
* `/sandbox`. A trailing slash or an `/api` suffix makes no difference.
|
|
39
|
+
*/
|
|
40
|
+
declare function environmentForBaseUrl(baseUrl: string | undefined | null): InvoEnvironment | null;
|
|
41
|
+
/**
|
|
42
|
+
* A prefixed key (`ivsdk_live_` / `ivsdk_test_`) was configured against the other INVO
|
|
43
|
+
* environment (3.34.0). Thrown at construction, before any request. The message says what
|
|
44
|
+
* to change.
|
|
45
|
+
*/
|
|
46
|
+
declare class KeyEnvironmentMismatchError extends Error {
|
|
47
|
+
/** The environment the key's prefix names. */
|
|
48
|
+
readonly keyEnvironment: InvoEnvironment;
|
|
49
|
+
/** The environment the configuration points at. */
|
|
50
|
+
readonly configuredEnvironment: InvoEnvironment;
|
|
51
|
+
constructor(message: string, keyEnvironment: InvoEnvironment, configuredEnvironment: InvoEnvironment);
|
|
52
|
+
}
|
|
20
53
|
/** Neither environment recognised the key, or INVO could not be reached. */
|
|
21
54
|
declare class EnvironmentUnknownError extends Error {
|
|
22
55
|
constructor(message: string);
|
|
@@ -2215,4 +2248,4 @@ declare class InvoServer {
|
|
|
2215
2248
|
private toInitiateResult;
|
|
2216
2249
|
}
|
|
2217
2250
|
|
|
2218
|
-
export { type
|
|
2251
|
+
export { type SubscriptionRefundRejectedData as $, type PlayerPhoneChangedData as A, type PurchaseCompletedData as B, CardsServer as C, DEMO_KEY_PREFIX as D, EnvironmentUnknownError as E, type PurchaseEventData as F, type RegisterPayeeResult as G, type RequestPayoutInput as H, InvoServer as I, type RequestPayoutResult as J, KeyEnvironmentMismatchError as K, LIVE_KEY_PREFIX as L, type ReturnReasonCode as M, SandboxServer as N, SandboxSubscriptionsServer as O, PRODUCTION_BASE_URL as P, type SubscriptionAuthenticationRequiredData as Q, type RegisterPayeeInput as R, SANDBOX_BASE_URL as S, TEST_KEY_PREFIX as T, type SubscriptionCanceledData as U, type SubscriptionEventCommon as V, type SubscriptionExpiredData as W, type SubscriptionPastDueData as X, type SubscriptionPaymentFailedData as Y, type SubscriptionRefundApprovedData as Z, type SubscriptionRefundDetail as _, type InvoEnvironment as a, type SubscriptionRefundRequestData as a0, type SubscriptionRefundedData as a1, type SubscriptionRenewalFunding as a2, type SubscriptionRenewalSplit as a3, type SubscriptionRenewedData as a4, type SubscriptionRevenueShareAttribution as a5, type SubscriptionTrialEventFields as a6, SubscriptionsServer as a7, type TransferEventData as a8, type VerifyWebhookOptions as a9, type WebhookHandlerOptions as aa, createWebhookHandler as ab, verifyWebhook as ac, verifyWebhookAsync as ad, baseUrlForKey as b, environmentFromKeyPrefix as c, type IdentityPasskeyResetData as d, environmentForBaseUrl as e, type InvoWebhookEvent as f, type ItemPurchasedData as g, type ListPayeesQuery as h, isDemoKey as i, type ListPayeesResult as j, type ListPayoutsQuery as k, type ListPayoutsResult as l, type PayableBlocker as m, type Payee as n, type PayeeInvite as o, type PayeeStatus as p, type PayeeStatusChangedData as q, resolveEnvironment as r, type Payout as s, type PayoutStatus as t, type PayoutStatusChangedData as u, verifyInvoSignature as v, PayoutsServer as w, type PlatformCommercePurchasedData as x, type PlatformCommerceRefundedData as y, PlatformCommerceServer as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { I as InvoError, H as Http, $ as AuthHeader, g as CallOptions, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, a2 as PlatformApprovalResult, a3 as PlatformOrderStatusResult, a4 as PlatformPurchaseHistoryQuery, a5 as PlatformPurchaseHistoryResult, a6 as PlatformRefundInput, a7 as PlatformRefundResult, a8 as CreateSubscriptionInput, a9 as SubscriptionResult, aa as GetSubscriptionOptions, ab as GetSubscriptionResult, ac as ListSubscriptionsOptions, ad as SubscriptionListResult, ae as CancelSubscriptionOptions, af as CancelResult, ag as ChangeAmountResult, ah as SetPaymentMethodInput, ai as SetPaymentMethodResult, aj as RefundSubscriptionInput, ak as RefundResult, al as SteamSubscriptionInitInput, am as SteamInitResult, an as SteamFinalizeSubscriptionResult, ao as CardSetupSessionInput, ap as CardSetupSessionResult, aq as CardSetupInput, ar as CardSetupResult, as as CardSetupConfirmInput, at as CardSetupConfirmResult, au as PlayerCardsResult, av as SandboxClockResult, aw as SandboxFailureOutcome, ax as SandboxForceFailureOptions, ay as SandboxForceAuthChallengeOptions, az as ServerConfig, aA as MintPlayerTokenInput, aB as PlayerToken, aC as RegisterPlayerInput, aD as RegisterPlayerResult, aE as UpdatePlayerPhoneInput, aF as UpdatePlayerPhoneResult, aG as RequestPhoneChangeInput, aH as RequestPhoneChangeResult, aI as PhoneChangeRequest, aJ as InitiateSendInput, aK as InitiateResult, aL as InitiateTransferInput, aM as CreateCheckoutInput, aN as CreateCheckoutResult, a as PurchaseStatusResult, aO as PurchaseInput, aP as PurchaseResult, aQ as CurrencyPurchaseQuoteInput, aR as CurrencyPurchaseQuote, aS as ConfirmPaymentResult, aT as OrderDetailsResult, aU as SteamPacksQuery, aV as SteamPacksResult, aW as SteamInitPurchaseInput, aX as SteamInitPurchaseResult, aY as SteamFinalizeInput, aZ as SteamFinalizeResult, a_ as PurchaseItemInput, a$ as PurchaseItemResult, b0 as ItemHistoryQuery, b1 as ItemHistoryResult, b2 as ItemOrderQuery, b3 as PlayerActivityQuery, b4 as PlayerActivityResult, b5 as PlayerActivityEntry, b6 as PlayerBalanceQuery, b7 as PlayerBalanceResult, q as LoyaltyCardsResult, b8 as InboundPendingQuery, b9 as InboundPendingResult, ba as LinkedIdentitiesQuery, bb as LinkedIdentitiesResult, bc as SmsVerifyResult, bd as ClaimTransferInput, be as ClaimResult, bf as ClaimCurrencyInput, bg as TransactionStatusResult, bh as GuardianApprovalStatusResult, bi as ServerDestinationsQuery, p as DestinationsResult, bj as PhoneShareContact, bk as PhoneShareInitiateResult, bl as PhoneShareApproveInput, bm as PhoneShareApproveResult, bn as PhoneShareStatusResult, bo as BeginDeviceApprovalInput, bp as DeviceApprovalGrant, bq as PollDeviceApprovalInput, br as DeviceApprovalPollResult, bs as ConfirmDeviceEnrollmentInput, bt as ConfirmDeviceEnrollmentResult, bu as ApproveWithDeviceCodeInput, bv as DeviceApprovalSettleResult, bw as CompleteDeviceApprovalInput, bx as CompleteDeviceApprovalResult } from './types-
|
|
1
|
+
import { I as InvoError, H as Http, $ as AuthHeader, g as CallOptions, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, a2 as PlatformApprovalResult, a3 as PlatformOrderStatusResult, a4 as PlatformPurchaseHistoryQuery, a5 as PlatformPurchaseHistoryResult, a6 as PlatformRefundInput, a7 as PlatformRefundResult, a8 as CreateSubscriptionInput, a9 as SubscriptionResult, aa as GetSubscriptionOptions, ab as GetSubscriptionResult, ac as ListSubscriptionsOptions, ad as SubscriptionListResult, ae as CancelSubscriptionOptions, af as CancelResult, ag as ChangeAmountResult, ah as SetPaymentMethodInput, ai as SetPaymentMethodResult, aj as RefundSubscriptionInput, ak as RefundResult, al as SteamSubscriptionInitInput, am as SteamInitResult, an as SteamFinalizeSubscriptionResult, ao as CardSetupSessionInput, ap as CardSetupSessionResult, aq as CardSetupInput, ar as CardSetupResult, as as CardSetupConfirmInput, at as CardSetupConfirmResult, au as PlayerCardsResult, av as SandboxClockResult, aw as SandboxFailureOutcome, ax as SandboxForceFailureOptions, ay as SandboxForceAuthChallengeOptions, az as ServerConfig, aA as MintPlayerTokenInput, aB as PlayerToken, aC as RegisterPlayerInput, aD as RegisterPlayerResult, aE as UpdatePlayerPhoneInput, aF as UpdatePlayerPhoneResult, aG as RequestPhoneChangeInput, aH as RequestPhoneChangeResult, aI as PhoneChangeRequest, aJ as InitiateSendInput, aK as InitiateResult, aL as InitiateTransferInput, aM as CreateCheckoutInput, aN as CreateCheckoutResult, a as PurchaseStatusResult, aO as PurchaseInput, aP as PurchaseResult, aQ as CurrencyPurchaseQuoteInput, aR as CurrencyPurchaseQuote, aS as ConfirmPaymentResult, aT as OrderDetailsResult, aU as SteamPacksQuery, aV as SteamPacksResult, aW as SteamInitPurchaseInput, aX as SteamInitPurchaseResult, aY as SteamFinalizeInput, aZ as SteamFinalizeResult, a_ as PurchaseItemInput, a$ as PurchaseItemResult, b0 as ItemHistoryQuery, b1 as ItemHistoryResult, b2 as ItemOrderQuery, b3 as PlayerActivityQuery, b4 as PlayerActivityResult, b5 as PlayerActivityEntry, b6 as PlayerBalanceQuery, b7 as PlayerBalanceResult, q as LoyaltyCardsResult, b8 as InboundPendingQuery, b9 as InboundPendingResult, ba as LinkedIdentitiesQuery, bb as LinkedIdentitiesResult, bc as SmsVerifyResult, bd as ClaimTransferInput, be as ClaimResult, bf as ClaimCurrencyInput, bg as TransactionStatusResult, bh as GuardianApprovalStatusResult, bi as ServerDestinationsQuery, p as DestinationsResult, bj as PhoneShareContact, bk as PhoneShareInitiateResult, bl as PhoneShareApproveInput, bm as PhoneShareApproveResult, bn as PhoneShareStatusResult, bo as BeginDeviceApprovalInput, bp as DeviceApprovalGrant, bq as PollDeviceApprovalInput, br as DeviceApprovalPollResult, bs as ConfirmDeviceEnrollmentInput, bt as ConfirmDeviceEnrollmentResult, bu as ApproveWithDeviceCodeInput, bv as DeviceApprovalSettleResult, bw as CompleteDeviceApprovalInput, bx as CompleteDeviceApprovalResult } from './types-Ctn8N2_l.cjs';
|
|
2
2
|
import { b as ReportServerGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.cjs';
|
|
3
|
-
import './version-
|
|
3
|
+
import './version-Ce_pLpJf.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Pick the INVO environment from the game secret alone (3.28.0).
|
|
@@ -10,13 +10,46 @@ import './version-DKfrEYU1.cjs';
|
|
|
10
10
|
* your code changes.
|
|
11
11
|
*
|
|
12
12
|
* - The public demo key starts with `ivsdk_demo_`: always the sandbox, no network call.
|
|
13
|
-
* -
|
|
14
|
-
*
|
|
13
|
+
* - A test key starts with `ivsdk_test_`: always the sandbox, no network call (3.34.0).
|
|
14
|
+
* - A live key starts with `ivsdk_live_`: always production, no network call (3.34.0).
|
|
15
|
+
* - Any other key (the original `ivsdk_...` keys, which keep working): INVO is asked once
|
|
16
|
+
* (`GET /api/sdk/key-environment`), production first, then the sandbox. The answer is
|
|
17
|
+
* cached per key for the life of the process.
|
|
15
18
|
*/
|
|
16
19
|
declare const PRODUCTION_BASE_URL = "https://invo.network";
|
|
17
20
|
declare const SANDBOX_BASE_URL = "https://sandbox.invo.network/sandbox";
|
|
18
21
|
declare const DEMO_KEY_PREFIX = "ivsdk_demo_";
|
|
22
|
+
/** Keys for the sandbox (3.34.0). */
|
|
23
|
+
declare const TEST_KEY_PREFIX = "ivsdk_test_";
|
|
24
|
+
/** Keys for production (3.34.0). */
|
|
25
|
+
declare const LIVE_KEY_PREFIX = "ivsdk_live_";
|
|
19
26
|
type InvoEnvironment = "production" | "sandbox";
|
|
27
|
+
/**
|
|
28
|
+
* The environment a key's prefix names, with no network call (3.34.0): `"production"` for
|
|
29
|
+
* `ivsdk_live_`, `"sandbox"` for `ivsdk_test_` and the public demo key `ivsdk_demo_`, and
|
|
30
|
+
* `null` for any other key (an unprefixed `ivsdk_...` key is looked up with
|
|
31
|
+
* {@link resolveEnvironment}).
|
|
32
|
+
*/
|
|
33
|
+
declare function environmentFromKeyPrefix(gameSecret: string | undefined | null): InvoEnvironment | null;
|
|
34
|
+
/**
|
|
35
|
+
* The INVO environment a base URL points at, or `null` when it is not one of INVO's hosts
|
|
36
|
+
* (your own proxy, `localhost`, anything else) (3.34.0). `sandbox.invo.network` is the
|
|
37
|
+
* sandbox; `invo.network` (and `www.`) is production, unless its path starts with
|
|
38
|
+
* `/sandbox`. A trailing slash or an `/api` suffix makes no difference.
|
|
39
|
+
*/
|
|
40
|
+
declare function environmentForBaseUrl(baseUrl: string | undefined | null): InvoEnvironment | null;
|
|
41
|
+
/**
|
|
42
|
+
* A prefixed key (`ivsdk_live_` / `ivsdk_test_`) was configured against the other INVO
|
|
43
|
+
* environment (3.34.0). Thrown at construction, before any request. The message says what
|
|
44
|
+
* to change.
|
|
45
|
+
*/
|
|
46
|
+
declare class KeyEnvironmentMismatchError extends Error {
|
|
47
|
+
/** The environment the key's prefix names. */
|
|
48
|
+
readonly keyEnvironment: InvoEnvironment;
|
|
49
|
+
/** The environment the configuration points at. */
|
|
50
|
+
readonly configuredEnvironment: InvoEnvironment;
|
|
51
|
+
constructor(message: string, keyEnvironment: InvoEnvironment, configuredEnvironment: InvoEnvironment);
|
|
52
|
+
}
|
|
20
53
|
/** Neither environment recognised the key, or INVO could not be reached. */
|
|
21
54
|
declare class EnvironmentUnknownError extends Error {
|
|
22
55
|
constructor(message: string);
|
|
@@ -2215,4 +2248,4 @@ declare class InvoServer {
|
|
|
2215
2248
|
private toInitiateResult;
|
|
2216
2249
|
}
|
|
2217
2250
|
|
|
2218
|
-
export { type
|
|
2251
|
+
export { type SubscriptionRefundRejectedData as $, type PlayerPhoneChangedData as A, type PurchaseCompletedData as B, CardsServer as C, DEMO_KEY_PREFIX as D, EnvironmentUnknownError as E, type PurchaseEventData as F, type RegisterPayeeResult as G, type RequestPayoutInput as H, InvoServer as I, type RequestPayoutResult as J, KeyEnvironmentMismatchError as K, LIVE_KEY_PREFIX as L, type ReturnReasonCode as M, SandboxServer as N, SandboxSubscriptionsServer as O, PRODUCTION_BASE_URL as P, type SubscriptionAuthenticationRequiredData as Q, type RegisterPayeeInput as R, SANDBOX_BASE_URL as S, TEST_KEY_PREFIX as T, type SubscriptionCanceledData as U, type SubscriptionEventCommon as V, type SubscriptionExpiredData as W, type SubscriptionPastDueData as X, type SubscriptionPaymentFailedData as Y, type SubscriptionRefundApprovedData as Z, type SubscriptionRefundDetail as _, type InvoEnvironment as a, type SubscriptionRefundRequestData as a0, type SubscriptionRefundedData as a1, type SubscriptionRenewalFunding as a2, type SubscriptionRenewalSplit as a3, type SubscriptionRenewedData as a4, type SubscriptionRevenueShareAttribution as a5, type SubscriptionTrialEventFields as a6, SubscriptionsServer as a7, type TransferEventData as a8, type VerifyWebhookOptions as a9, type WebhookHandlerOptions as aa, createWebhookHandler as ab, verifyWebhook as ac, verifyWebhookAsync as ad, baseUrlForKey as b, environmentFromKeyPrefix as c, type IdentityPasskeyResetData as d, environmentForBaseUrl as e, type InvoWebhookEvent as f, type ItemPurchasedData as g, type ListPayeesQuery as h, isDemoKey as i, type ListPayeesResult as j, type ListPayoutsQuery as k, type ListPayoutsResult as l, type PayableBlocker as m, type Payee as n, type PayeeInvite as o, type PayeeStatus as p, type PayeeStatusChangedData as q, resolveEnvironment as r, type Payout as s, type PayoutStatus as t, type PayoutStatusChangedData as u, verifyInvoSignature as v, PayoutsServer as w, type PlatformCommercePurchasedData as x, type PlatformCommerceRefundedData as y, PlatformCommerceServer as z };
|
package/dist/server.cjs
CHANGED
|
@@ -349,6 +349,17 @@ var InvoError = class _InvoError extends Error {
|
|
|
349
349
|
get isPaymentsPaused() {
|
|
350
350
|
return this.code === "PAYMENTS_PAUSED";
|
|
351
351
|
}
|
|
352
|
+
/** The key belongs to the other INVO environment (`KEY_FOR_OTHER_ENVIRONMENT`, 401;
|
|
353
|
+
* additive, 3.34.0): a test key (`ivsdk_test_`) sent to production, or a live key
|
|
354
|
+
* (`ivsdk_live_`) sent to the sandbox. Never retried. Use the key for the environment
|
|
355
|
+
* you are calling, or point the SDK at the environment the key is for. The code is
|
|
356
|
+
* matched on any code field (`code`, `rawCode`, `publicCode`, or the body's
|
|
357
|
+
* `error_code` / `code`), since the 401 may carry a different `code`. */
|
|
358
|
+
get isKeyForOtherEnvironment() {
|
|
359
|
+
const C = "KEY_FOR_OTHER_ENVIRONMENT";
|
|
360
|
+
const b = this.bodyObject();
|
|
361
|
+
return this.code === C || this.rawCode === C || this.publicCode === C || b["error_code"] === C || b["code"] === C;
|
|
362
|
+
}
|
|
352
363
|
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
353
364
|
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
354
365
|
* balance is never disclosed. Offer another way to pay. */
|
|
@@ -1669,7 +1680,7 @@ function toPhoneChangeRequest(raw) {
|
|
|
1669
1680
|
}
|
|
1670
1681
|
|
|
1671
1682
|
// src/version.ts
|
|
1672
|
-
var SDK_VERSION = "3.
|
|
1683
|
+
var SDK_VERSION = "3.34.0";
|
|
1673
1684
|
|
|
1674
1685
|
// src/payouts.ts
|
|
1675
1686
|
var AMOUNT = /^\d+(\.\d{1,2})?$/;
|
|
@@ -1863,6 +1874,140 @@ var PayoutsServer = class {
|
|
|
1863
1874
|
}
|
|
1864
1875
|
};
|
|
1865
1876
|
|
|
1877
|
+
// src/environment.ts
|
|
1878
|
+
var PRODUCTION_BASE_URL = "https://invo.network";
|
|
1879
|
+
var SANDBOX_BASE_URL = "https://sandbox.invo.network/sandbox";
|
|
1880
|
+
var DEMO_KEY_PREFIX = "ivsdk_demo_";
|
|
1881
|
+
var TEST_KEY_PREFIX = "ivsdk_test_";
|
|
1882
|
+
var LIVE_KEY_PREFIX = "ivsdk_live_";
|
|
1883
|
+
var KEY_ENVIRONMENT_PATH = "/api/sdk/key-environment";
|
|
1884
|
+
function environmentFromKeyPrefix(gameSecret) {
|
|
1885
|
+
if (typeof gameSecret !== "string") return null;
|
|
1886
|
+
if (gameSecret.startsWith(LIVE_KEY_PREFIX)) return "production";
|
|
1887
|
+
if (gameSecret.startsWith(TEST_KEY_PREFIX) || gameSecret.startsWith(DEMO_KEY_PREFIX)) return "sandbox";
|
|
1888
|
+
return null;
|
|
1889
|
+
}
|
|
1890
|
+
function environmentForBaseUrl(baseUrl) {
|
|
1891
|
+
if (typeof baseUrl !== "string" || !baseUrl.trim()) return null;
|
|
1892
|
+
let url;
|
|
1893
|
+
try {
|
|
1894
|
+
url = new URL(baseUrl.trim());
|
|
1895
|
+
} catch {
|
|
1896
|
+
return null;
|
|
1897
|
+
}
|
|
1898
|
+
const host = url.hostname.toLowerCase().replace(/\.$/, "");
|
|
1899
|
+
if (host === "sandbox.invo.network") return "sandbox";
|
|
1900
|
+
if (host === "invo.network" || host === "www.invo.network") {
|
|
1901
|
+
const first = url.pathname.split("/").filter(Boolean)[0]?.toLowerCase();
|
|
1902
|
+
return first === "sandbox" ? "sandbox" : "production";
|
|
1903
|
+
}
|
|
1904
|
+
return null;
|
|
1905
|
+
}
|
|
1906
|
+
var KeyEnvironmentMismatchError = class extends Error {
|
|
1907
|
+
constructor(message, keyEnvironment, configuredEnvironment) {
|
|
1908
|
+
super(message);
|
|
1909
|
+
this.name = "KeyEnvironmentMismatchError";
|
|
1910
|
+
this.keyEnvironment = keyEnvironment;
|
|
1911
|
+
this.configuredEnvironment = configuredEnvironment;
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
function strictKeyEnvironment(gameSecret) {
|
|
1915
|
+
if (typeof gameSecret !== "string") return null;
|
|
1916
|
+
if (gameSecret.startsWith(LIVE_KEY_PREFIX)) return "production";
|
|
1917
|
+
if (gameSecret.startsWith(TEST_KEY_PREFIX)) return "sandbox";
|
|
1918
|
+
return null;
|
|
1919
|
+
}
|
|
1920
|
+
function describeKey(env) {
|
|
1921
|
+
return env === "production" ? `a live key (${LIVE_KEY_PREFIX})` : `a test key (${TEST_KEY_PREFIX})`;
|
|
1922
|
+
}
|
|
1923
|
+
function fixFor(keyEnv) {
|
|
1924
|
+
return keyEnv === "production" ? `Use ${PRODUCTION_BASE_URL}, or a test key.` : `Use ${SANDBOX_BASE_URL}, or a live key.`;
|
|
1925
|
+
}
|
|
1926
|
+
function displayUrl(baseUrl) {
|
|
1927
|
+
try {
|
|
1928
|
+
const u = new URL(baseUrl.trim());
|
|
1929
|
+
return `${u.protocol}//${u.host}${u.pathname}`.replace(/\/+$/, "");
|
|
1930
|
+
} catch {
|
|
1931
|
+
return "(the configured URL)";
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
function assertKeyMatchesBaseUrl(gameSecret, baseUrl, setting = "baseUrl") {
|
|
1935
|
+
const keyEnv = strictKeyEnvironment(gameSecret);
|
|
1936
|
+
if (!keyEnv) return;
|
|
1937
|
+
const urlEnv = environmentForBaseUrl(baseUrl);
|
|
1938
|
+
if (!urlEnv || urlEnv === keyEnv) return;
|
|
1939
|
+
const where = urlEnv === "production" ? "production" : "the sandbox";
|
|
1940
|
+
const shown = displayUrl(String(baseUrl));
|
|
1941
|
+
throw new KeyEnvironmentMismatchError(
|
|
1942
|
+
`This is ${describeKey(keyEnv)} but ${setting} points at ${where} ${shown}. ${fixFor(keyEnv)}`,
|
|
1943
|
+
keyEnv,
|
|
1944
|
+
urlEnv
|
|
1945
|
+
);
|
|
1946
|
+
}
|
|
1947
|
+
var EnvironmentUnknownError = class extends Error {
|
|
1948
|
+
constructor(message) {
|
|
1949
|
+
super(message);
|
|
1950
|
+
this.name = "EnvironmentUnknownError";
|
|
1951
|
+
}
|
|
1952
|
+
};
|
|
1953
|
+
function isDemoKey(gameSecret) {
|
|
1954
|
+
return typeof gameSecret === "string" && gameSecret.startsWith(DEMO_KEY_PREFIX);
|
|
1955
|
+
}
|
|
1956
|
+
var cache = /* @__PURE__ */ new Map();
|
|
1957
|
+
async function ask(baseUrl, gameSecret, fetchImpl) {
|
|
1958
|
+
let res;
|
|
1959
|
+
try {
|
|
1960
|
+
res = await fetchImpl(baseUrl + KEY_ENVIRONMENT_PATH, {
|
|
1961
|
+
method: "GET",
|
|
1962
|
+
headers: { "X-Game-Secret-Key": gameSecret, Accept: "application/json" },
|
|
1963
|
+
redirect: "error"
|
|
1964
|
+
});
|
|
1965
|
+
} catch {
|
|
1966
|
+
throw new EnvironmentUnknownError("Could not reach INVO to check the key.");
|
|
1967
|
+
}
|
|
1968
|
+
if (res.status === 401 || res.status === 403 || res.status === 404) return null;
|
|
1969
|
+
if (!res.ok) throw new EnvironmentUnknownError(`INVO answered ${res.status} while checking the key.`);
|
|
1970
|
+
const body = await res.json().catch(() => ({}));
|
|
1971
|
+
return body.environment === "production" || body.environment === "sandbox" ? body.environment : null;
|
|
1972
|
+
}
|
|
1973
|
+
function resolveEnvironment(gameSecret, opts = {}) {
|
|
1974
|
+
if (!gameSecret) return Promise.reject(new Error("A game secret is required."));
|
|
1975
|
+
const byPrefix = environmentFromKeyPrefix(gameSecret);
|
|
1976
|
+
if (byPrefix) return Promise.resolve(byPrefix);
|
|
1977
|
+
const hit = cache.get(gameSecret);
|
|
1978
|
+
if (hit) return hit;
|
|
1979
|
+
const fetchImpl = opts.fetch ?? ((input, init) => fetch(input, init));
|
|
1980
|
+
const p = (async () => {
|
|
1981
|
+
let prodError = null;
|
|
1982
|
+
let env = null;
|
|
1983
|
+
try {
|
|
1984
|
+
env = await ask(PRODUCTION_BASE_URL, gameSecret, fetchImpl);
|
|
1985
|
+
} catch (err) {
|
|
1986
|
+
prodError = err;
|
|
1987
|
+
}
|
|
1988
|
+
if (!env) {
|
|
1989
|
+
try {
|
|
1990
|
+
env = await ask(SANDBOX_BASE_URL, gameSecret, fetchImpl);
|
|
1991
|
+
} catch (err) {
|
|
1992
|
+
throw prodError ?? err;
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
if (!env && prodError) throw prodError;
|
|
1996
|
+
if (!env) {
|
|
1997
|
+
throw new EnvironmentUnknownError(
|
|
1998
|
+
"Neither INVO production nor the INVO sandbox recognises this key. Check INVO_GAME_SECRET in your secrets."
|
|
1999
|
+
);
|
|
2000
|
+
}
|
|
2001
|
+
return env;
|
|
2002
|
+
})();
|
|
2003
|
+
cache.set(gameSecret, p);
|
|
2004
|
+
p.catch(() => cache.delete(gameSecret));
|
|
2005
|
+
return p;
|
|
2006
|
+
}
|
|
2007
|
+
async function baseUrlForKey(gameSecret, opts = {}) {
|
|
2008
|
+
return await resolveEnvironment(gameSecret, opts) === "production" ? PRODUCTION_BASE_URL : SANDBOX_BASE_URL;
|
|
2009
|
+
}
|
|
2010
|
+
|
|
1866
2011
|
// src/shared/types.ts
|
|
1867
2012
|
function isRefundPendingApproval(r) {
|
|
1868
2013
|
return r.status === "pending_approval";
|
|
@@ -2031,74 +2176,6 @@ async function hmacHexSubtle(secret, message) {
|
|
|
2031
2176
|
return hex;
|
|
2032
2177
|
}
|
|
2033
2178
|
|
|
2034
|
-
// src/environment.ts
|
|
2035
|
-
var PRODUCTION_BASE_URL = "https://invo.network";
|
|
2036
|
-
var SANDBOX_BASE_URL = "https://sandbox.invo.network/sandbox";
|
|
2037
|
-
var DEMO_KEY_PREFIX = "ivsdk_demo_";
|
|
2038
|
-
var KEY_ENVIRONMENT_PATH = "/api/sdk/key-environment";
|
|
2039
|
-
var EnvironmentUnknownError = class extends Error {
|
|
2040
|
-
constructor(message) {
|
|
2041
|
-
super(message);
|
|
2042
|
-
this.name = "EnvironmentUnknownError";
|
|
2043
|
-
}
|
|
2044
|
-
};
|
|
2045
|
-
function isDemoKey(gameSecret) {
|
|
2046
|
-
return typeof gameSecret === "string" && gameSecret.startsWith(DEMO_KEY_PREFIX);
|
|
2047
|
-
}
|
|
2048
|
-
var cache = /* @__PURE__ */ new Map();
|
|
2049
|
-
async function ask(baseUrl, gameSecret, fetchImpl) {
|
|
2050
|
-
let res;
|
|
2051
|
-
try {
|
|
2052
|
-
res = await fetchImpl(baseUrl + KEY_ENVIRONMENT_PATH, {
|
|
2053
|
-
method: "GET",
|
|
2054
|
-
headers: { "X-Game-Secret-Key": gameSecret, Accept: "application/json" },
|
|
2055
|
-
redirect: "error"
|
|
2056
|
-
});
|
|
2057
|
-
} catch {
|
|
2058
|
-
throw new EnvironmentUnknownError("Could not reach INVO to check the key.");
|
|
2059
|
-
}
|
|
2060
|
-
if (res.status === 401 || res.status === 403 || res.status === 404) return null;
|
|
2061
|
-
if (!res.ok) throw new EnvironmentUnknownError(`INVO answered ${res.status} while checking the key.`);
|
|
2062
|
-
const body = await res.json().catch(() => ({}));
|
|
2063
|
-
return body.environment === "production" || body.environment === "sandbox" ? body.environment : null;
|
|
2064
|
-
}
|
|
2065
|
-
function resolveEnvironment(gameSecret, opts = {}) {
|
|
2066
|
-
if (!gameSecret) return Promise.reject(new Error("A game secret is required."));
|
|
2067
|
-
if (isDemoKey(gameSecret)) return Promise.resolve("sandbox");
|
|
2068
|
-
const hit = cache.get(gameSecret);
|
|
2069
|
-
if (hit) return hit;
|
|
2070
|
-
const fetchImpl = opts.fetch ?? ((input, init) => fetch(input, init));
|
|
2071
|
-
const p = (async () => {
|
|
2072
|
-
let prodError = null;
|
|
2073
|
-
let env = null;
|
|
2074
|
-
try {
|
|
2075
|
-
env = await ask(PRODUCTION_BASE_URL, gameSecret, fetchImpl);
|
|
2076
|
-
} catch (err) {
|
|
2077
|
-
prodError = err;
|
|
2078
|
-
}
|
|
2079
|
-
if (!env) {
|
|
2080
|
-
try {
|
|
2081
|
-
env = await ask(SANDBOX_BASE_URL, gameSecret, fetchImpl);
|
|
2082
|
-
} catch (err) {
|
|
2083
|
-
throw prodError ?? err;
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
if (!env && prodError) throw prodError;
|
|
2087
|
-
if (!env) {
|
|
2088
|
-
throw new EnvironmentUnknownError(
|
|
2089
|
-
"Neither INVO production nor the INVO sandbox recognises this key. Check INVO_GAME_SECRET in your secrets."
|
|
2090
|
-
);
|
|
2091
|
-
}
|
|
2092
|
-
return env;
|
|
2093
|
-
})();
|
|
2094
|
-
cache.set(gameSecret, p);
|
|
2095
|
-
p.catch(() => cache.delete(gameSecret));
|
|
2096
|
-
return p;
|
|
2097
|
-
}
|
|
2098
|
-
async function baseUrlForKey(gameSecret, opts = {}) {
|
|
2099
|
-
return await resolveEnvironment(gameSecret, opts) === "production" ? PRODUCTION_BASE_URL : SANDBOX_BASE_URL;
|
|
2100
|
-
}
|
|
2101
|
-
|
|
2102
2179
|
// src/server.ts
|
|
2103
2180
|
var DEFAULT_UA = `invonetwork-web-sdk/${SDK_VERSION} (+https://invo.network)`;
|
|
2104
2181
|
var MAX_USD_AMOUNT = 999999.99;
|
|
@@ -3975,6 +4052,7 @@ var InvoServer = class {
|
|
|
3975
4052
|
if (!config.gameSecret) throw new Error("InvoServer requires a `gameSecret`.");
|
|
3976
4053
|
if (!config.baseUrl) throw new Error("InvoServer requires a `baseUrl`.");
|
|
3977
4054
|
assertSecureBaseUrl(config.baseUrl);
|
|
4055
|
+
assertKeyMatchesBaseUrl(config.gameSecret.trim(), config.baseUrl);
|
|
3978
4056
|
this.http = new Http({
|
|
3979
4057
|
baseUrl: config.baseUrl,
|
|
3980
4058
|
timeoutMs: config.timeoutMs,
|
|
@@ -5525,6 +5603,8 @@ exports.DEMO_KEY_PREFIX = DEMO_KEY_PREFIX;
|
|
|
5525
5603
|
exports.EnvironmentUnknownError = EnvironmentUnknownError;
|
|
5526
5604
|
exports.InvoError = InvoError;
|
|
5527
5605
|
exports.InvoServer = InvoServer;
|
|
5606
|
+
exports.KeyEnvironmentMismatchError = KeyEnvironmentMismatchError;
|
|
5607
|
+
exports.LIVE_KEY_PREFIX = LIVE_KEY_PREFIX;
|
|
5528
5608
|
exports.PRODUCTION_BASE_URL = PRODUCTION_BASE_URL;
|
|
5529
5609
|
exports.PayoutsServer = PayoutsServer;
|
|
5530
5610
|
exports.PlatformCommerceServer = PlatformCommerceServer;
|
|
@@ -5533,8 +5613,11 @@ exports.SDK_VERSION = SDK_VERSION;
|
|
|
5533
5613
|
exports.SandboxServer = SandboxServer;
|
|
5534
5614
|
exports.SandboxSubscriptionsServer = SandboxSubscriptionsServer;
|
|
5535
5615
|
exports.SubscriptionsServer = SubscriptionsServer;
|
|
5616
|
+
exports.TEST_KEY_PREFIX = TEST_KEY_PREFIX;
|
|
5536
5617
|
exports.baseUrlForKey = baseUrlForKey;
|
|
5537
5618
|
exports.createWebhookHandler = createWebhookHandler;
|
|
5619
|
+
exports.environmentForBaseUrl = environmentForBaseUrl;
|
|
5620
|
+
exports.environmentFromKeyPrefix = environmentFromKeyPrefix;
|
|
5538
5621
|
exports.isDemoKey = isDemoKey;
|
|
5539
5622
|
exports.isRefundPendingApproval = isRefundPendingApproval;
|
|
5540
5623
|
exports.resolveEnvironment = resolveEnvironment;
|
package/dist/server.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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.cjs';
|
|
2
2
|
export { G as GameEventType, R as ReportGameEventInput, a as ReportGameEventResult, b as ReportServerGameEventInput } from './loyalty-events-CmDw2ZoR.cjs';
|
|
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-ZnCyLWA2.cjs';
|
|
4
|
+
export { S as SDK_VERSION } from './version-Ce_pLpJf.cjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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
|