@invonetwork/web-sdk 3.31.0 → 3.33.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 +1490 -1474
- package/README.md +2990 -2959
- package/dist/{chunk-UW66W2N6.js → chunk-DHVHKFQH.js} +58 -5
- package/dist/{chunk-LMN2V4YT.js → chunk-HQLPT2DY.js} +31 -2
- package/dist/{chunk-5T75PCZN.js → chunk-MJAJXYFX.js} +3 -3
- package/dist/chunk-VWUFSA6U.js +6 -0
- package/dist/game-server.cjs +84 -2
- package/dist/game-server.d.cts +4 -4
- package/dist/game-server.d.ts +4 -4
- package/dist/game-server.js +5 -5
- package/dist/game.cjs +30 -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-Dp-BigX9.d.ts → hosted-approval-CL3DfrGS.d.ts} +1 -1
- package/dist/{hosted-approval-BBQHClAP.d.cts → hosted-approval-CYqqberu.d.cts} +1 -1
- package/dist/index.cjs +29 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{server-D9bKfiY6.d.cts → server-5_g5C-no.d.cts} +15 -4
- package/dist/{server-CaALJEML.d.ts → server-Dhao5prR.d.ts} +15 -4
- package/dist/server.cjs +84 -2
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +3 -3
- package/dist/{types-CBanzneD.d.cts → types-DUfQR48n.d.cts} +53 -3
- package/dist/{types-CBanzneD.d.ts → types-DUfQR48n.d.ts} +53 -3
- package/dist/{version-B4Eincjj.d.cts → version-DKfrEYU1.d.cts} +1 -1
- package/dist/{version-B4Eincjj.d.ts → version-DKfrEYU1.d.ts} +1 -1
- package/package.json +91 -91
- package/dist/chunk-CI7PHE6L.js +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SDK_VERSION } from './chunk-
|
|
2
|
-
import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, toPurchaseStatusResult, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-
|
|
1
|
+
import { SDK_VERSION } from './chunk-VWUFSA6U.js';
|
|
2
|
+
import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, toPurchaseStatusResult, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-HQLPT2DY.js';
|
|
3
3
|
import { createHmac, timingSafeEqual } from 'crypto';
|
|
4
4
|
|
|
5
5
|
// src/payouts.ts
|
|
@@ -692,6 +692,23 @@ function toPlayerActivityEntry(raw) {
|
|
|
692
692
|
raw
|
|
693
693
|
};
|
|
694
694
|
}
|
|
695
|
+
function toPlatformApproval(raw) {
|
|
696
|
+
const s = (k) => raw[k] == null ? null : String(raw[k]);
|
|
697
|
+
const meta = raw["metadata"];
|
|
698
|
+
return {
|
|
699
|
+
approvalId: String(raw["approval_id"] ?? ""),
|
|
700
|
+
clientRequestId: String(raw["client_request_id"] ?? ""),
|
|
701
|
+
status: String(raw["status"] ?? ""),
|
|
702
|
+
reason: s("reason"),
|
|
703
|
+
totalPrice: s("total_price"),
|
|
704
|
+
orderId: raw["order_id"] ?? null,
|
|
705
|
+
transactionId: s("transaction_id"),
|
|
706
|
+
expiresAt: s("expires_at"),
|
|
707
|
+
decidedAt: s("decided_at"),
|
|
708
|
+
metadata: meta && typeof meta === "object" && !Array.isArray(meta) ? meta : {},
|
|
709
|
+
raw
|
|
710
|
+
};
|
|
711
|
+
}
|
|
695
712
|
function toPlatformOrderStatus(raw, fallbackOrderId) {
|
|
696
713
|
return {
|
|
697
714
|
orderId: raw["order_id"] ?? fallbackOrderId ?? "",
|
|
@@ -998,6 +1015,10 @@ var PlatformCommerceServer = class {
|
|
|
998
1015
|
if (input.successUrl) body["success_url"] = input.successUrl;
|
|
999
1016
|
if (input.cancelUrl) body["cancel_url"] = input.cancelUrl;
|
|
1000
1017
|
if (input.metadata) body["metadata"] = input.metadata;
|
|
1018
|
+
if (input.requirePlayerApproval === true) {
|
|
1019
|
+
body["require_player_approval"] = true;
|
|
1020
|
+
if (input.returnUrl) body["return_url"] = input.returnUrl;
|
|
1021
|
+
}
|
|
1001
1022
|
const raw = await this.http.post(
|
|
1002
1023
|
"/api/platform-commerce/purchase",
|
|
1003
1024
|
body,
|
|
@@ -1006,7 +1027,9 @@ var PlatformCommerceServer = class {
|
|
|
1006
1027
|
{ idempotent: true, signal: opts?.signal }
|
|
1007
1028
|
);
|
|
1008
1029
|
const status = String(raw["status"] ?? "");
|
|
1009
|
-
if (status === "
|
|
1030
|
+
if (status === "pending_approval") {
|
|
1031
|
+
requireField(raw["approval_id"], "approval_id", raw);
|
|
1032
|
+
} else if (status === "requires_payment") {
|
|
1010
1033
|
requireField(raw["checkout_url"], "checkout_url", raw);
|
|
1011
1034
|
} else {
|
|
1012
1035
|
requireField(raw["order_id"], "order_id", raw);
|
|
@@ -1027,9 +1050,39 @@ var PlatformCommerceServer = class {
|
|
|
1027
1050
|
amountUsd: raw["amount_usd"] ?? null,
|
|
1028
1051
|
idempotentReplay: raw["idempotent_replay"] === true,
|
|
1029
1052
|
...minPurchaseWarningField(raw),
|
|
1053
|
+
...raw["approval_id"] != null ? { approvalId: String(raw["approval_id"]) } : {},
|
|
1054
|
+
..."approval_url" in raw ? { approvalUrl: raw["approval_url"] ?? null } : {},
|
|
1030
1055
|
raw
|
|
1031
1056
|
};
|
|
1032
1057
|
}
|
|
1058
|
+
/** Read a buyer-approved purchase (3.33.0) by `approvalId` or by your `clientRequestId`
|
|
1059
|
+
* (exactly one). A fallback to the webhooks: `completed` carries `orderId`; an ending
|
|
1060
|
+
* without a sale carries `reason`. Throws `err.isApprovalNotFound` (404). */
|
|
1061
|
+
async getApproval(key, opts) {
|
|
1062
|
+
const id = key?.approvalId;
|
|
1063
|
+
const crid = key?.clientRequestId;
|
|
1064
|
+
if (Boolean(id) === Boolean(crid)) {
|
|
1065
|
+
throw invalidInput2("approvalId", id, "provide exactly one of approvalId or clientRequestId");
|
|
1066
|
+
}
|
|
1067
|
+
const path = id ? `/api/platform-commerce/approvals/${encodeURIComponent(String(id))}` : `/api/platform-commerce/approvals?${new URLSearchParams({ client_request_id: String(crid) }).toString()}`;
|
|
1068
|
+
const raw = await this.http.get(path, this.auth, { signal: opts?.signal });
|
|
1069
|
+
return toPlatformApproval(raw);
|
|
1070
|
+
}
|
|
1071
|
+
/** Withdraw a buyer-approved purchase that is still waiting (3.33.0).
|
|
1072
|
+
* `platform_commerce.declined` follows with reason `cancelled`. Throws
|
|
1073
|
+
* `err.isApprovalAlreadyEnded` (409) when it had already ended. */
|
|
1074
|
+
async cancelApproval(approvalId, opts) {
|
|
1075
|
+
if (typeof approvalId !== "string" || !approvalId.trim()) {
|
|
1076
|
+
throw invalidInput2("approvalId", approvalId, "is required");
|
|
1077
|
+
}
|
|
1078
|
+
const raw = await this.http.post(
|
|
1079
|
+
`/api/platform-commerce/approvals/${encodeURIComponent(approvalId)}/cancel`,
|
|
1080
|
+
{},
|
|
1081
|
+
this.auth,
|
|
1082
|
+
{ idempotent: true, signal: opts?.signal }
|
|
1083
|
+
);
|
|
1084
|
+
return toPlatformApproval(raw);
|
|
1085
|
+
}
|
|
1033
1086
|
/** Poll an order's status: `completed` (balance immediately; card after the webhook),
|
|
1034
1087
|
* `pending_payment` (card awaiting confirmation), or `refunded`. Once the sale has settled,
|
|
1035
1088
|
* `invoFeeUsd` / `partnerShareUsd` say what INVO kept and what you earned (additive). */
|
|
@@ -3802,5 +3855,5 @@ var InvoServer = class {
|
|
|
3802
3855
|
};
|
|
3803
3856
|
|
|
3804
3857
|
export { CardsServer, DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, PRODUCTION_BASE_URL, PayoutsServer, PlatformCommerceServer, SANDBOX_BASE_URL, SandboxServer, SandboxSubscriptionsServer, SubscriptionsServer, baseUrlForKey, createWebhookHandler, isDemoKey, isRefundPendingApproval, resolveEnvironment, verifyInvoSignature, verifyWebhook, verifyWebhookAsync };
|
|
3805
|
-
//# sourceMappingURL=chunk-
|
|
3806
|
-
//# sourceMappingURL=chunk-
|
|
3858
|
+
//# sourceMappingURL=chunk-DHVHKFQH.js.map
|
|
3859
|
+
//# sourceMappingURL=chunk-DHVHKFQH.js.map
|
|
@@ -335,6 +335,35 @@ var InvoError = class _InvoError extends Error {
|
|
|
335
335
|
get isPartnerRailSuspended() {
|
|
336
336
|
return this.code === "PARTNER_RAIL_SUSPENDED";
|
|
337
337
|
}
|
|
338
|
+
/** True when INVO has paused new payments on the developer account
|
|
339
|
+
* (`PAYMENTS_PAUSED`, 403; additive, 3.32.0). Every call that starts a payment returns it:
|
|
340
|
+
* coin purchase, checkout session, Platform Commerce card purchase, new
|
|
341
|
+
* subscription, Steam purchase or subscription start. Refunds, reads,
|
|
342
|
+
* balances, transfers and renewals of existing subscriptions keep working.
|
|
343
|
+
* Not retryable until INVO resumes payments; show a neutral "purchases are
|
|
344
|
+
* unavailable right now" message. */
|
|
345
|
+
get isPaymentsPaused() {
|
|
346
|
+
return this.code === "PAYMENTS_PAUSED";
|
|
347
|
+
}
|
|
348
|
+
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
349
|
+
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
350
|
+
* balance is never disclosed. Offer another way to pay. */
|
|
351
|
+
get isBalanceUnavailable() {
|
|
352
|
+
return this.code === "BALANCE_UNAVAILABLE";
|
|
353
|
+
}
|
|
354
|
+
/** Buyer approval is not available (`APPROVAL_NOT_AVAILABLE`, 503 or 409; 3.33.0). */
|
|
355
|
+
get isApprovalNotAvailable() {
|
|
356
|
+
return this.code === "APPROVAL_NOT_AVAILABLE";
|
|
357
|
+
}
|
|
358
|
+
/** No buyer-approved purchase with that id in your store (`APPROVAL_NOT_FOUND`, 404). */
|
|
359
|
+
get isApprovalNotFound() {
|
|
360
|
+
return this.code === "APPROVAL_NOT_FOUND";
|
|
361
|
+
}
|
|
362
|
+
/** `cancelApproval` on an approval that already ended (`APPROVAL_ALREADY_ENDED`, 409).
|
|
363
|
+
* Read it with `getApproval`: it may have completed. */
|
|
364
|
+
get isApprovalAlreadyEnded() {
|
|
365
|
+
return this.code === "APPROVAL_ALREADY_ENDED";
|
|
366
|
+
}
|
|
338
367
|
/** True when init-purchase was given a `packId` that is not in INVO's Steam
|
|
339
368
|
* catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
|
|
340
369
|
* `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
|
|
@@ -1734,5 +1763,5 @@ function toApprovePhoneChangeResult(raw, changeRequestId) {
|
|
|
1734
1763
|
}
|
|
1735
1764
|
|
|
1736
1765
|
export { Http, InvoError, assertSecureBaseUrl, buildGameEventBody, creditFields, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, newEventId, nothingWasCharged, phoneChangeSignalMessage, receiptFields, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toPhoneChangeApprovalsResult, toPhoneChangeRequest, toPurchaseStatusResult, toRedeemRewardResult, toReportGameEventResult, toRequestPhoneChangeResult, toRewardsPageLink };
|
|
1737
|
-
//# sourceMappingURL=chunk-
|
|
1738
|
-
//# sourceMappingURL=chunk-
|
|
1766
|
+
//# sourceMappingURL=chunk-HQLPT2DY.js.map
|
|
1767
|
+
//# sourceMappingURL=chunk-HQLPT2DY.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvoError, assertSecureBaseUrl, Http, toPurchaseStatusResult, toPhoneChangeApprovalsResult, phoneChangeSignalMessage, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toRedeemRewardResult, toRewardsPageLink, buildGameEventBody, toReportGameEventResult } from './chunk-
|
|
1
|
+
import { InvoError, assertSecureBaseUrl, Http, toPurchaseStatusResult, toPhoneChangeApprovalsResult, phoneChangeSignalMessage, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toRedeemRewardResult, toRewardsPageLink, buildGameEventBody, toReportGameEventResult } from './chunk-HQLPT2DY.js';
|
|
2
2
|
|
|
3
3
|
// src/shared/webauthn.ts
|
|
4
4
|
function malformedOptions(field) {
|
|
@@ -1586,5 +1586,5 @@ var InvoClient = class {
|
|
|
1586
1586
|
};
|
|
1587
1587
|
|
|
1588
1588
|
export { CheckoutClient, InvoClient, PlatformCommerceClient };
|
|
1589
|
-
//# sourceMappingURL=chunk-
|
|
1590
|
-
//# sourceMappingURL=chunk-
|
|
1589
|
+
//# sourceMappingURL=chunk-MJAJXYFX.js.map
|
|
1590
|
+
//# sourceMappingURL=chunk-MJAJXYFX.js.map
|
package/dist/game-server.cjs
CHANGED
|
@@ -431,6 +431,35 @@ var InvoError = class _InvoError extends Error {
|
|
|
431
431
|
get isPartnerRailSuspended() {
|
|
432
432
|
return this.code === "PARTNER_RAIL_SUSPENDED";
|
|
433
433
|
}
|
|
434
|
+
/** True when INVO has paused new payments on the developer account
|
|
435
|
+
* (`PAYMENTS_PAUSED`, 403; additive, 3.32.0). Every call that starts a payment returns it:
|
|
436
|
+
* coin purchase, checkout session, Platform Commerce card purchase, new
|
|
437
|
+
* subscription, Steam purchase or subscription start. Refunds, reads,
|
|
438
|
+
* balances, transfers and renewals of existing subscriptions keep working.
|
|
439
|
+
* Not retryable until INVO resumes payments; show a neutral "purchases are
|
|
440
|
+
* unavailable right now" message. */
|
|
441
|
+
get isPaymentsPaused() {
|
|
442
|
+
return this.code === "PAYMENTS_PAUSED";
|
|
443
|
+
}
|
|
444
|
+
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
445
|
+
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
446
|
+
* balance is never disclosed. Offer another way to pay. */
|
|
447
|
+
get isBalanceUnavailable() {
|
|
448
|
+
return this.code === "BALANCE_UNAVAILABLE";
|
|
449
|
+
}
|
|
450
|
+
/** Buyer approval is not available (`APPROVAL_NOT_AVAILABLE`, 503 or 409; 3.33.0). */
|
|
451
|
+
get isApprovalNotAvailable() {
|
|
452
|
+
return this.code === "APPROVAL_NOT_AVAILABLE";
|
|
453
|
+
}
|
|
454
|
+
/** No buyer-approved purchase with that id in your store (`APPROVAL_NOT_FOUND`, 404). */
|
|
455
|
+
get isApprovalNotFound() {
|
|
456
|
+
return this.code === "APPROVAL_NOT_FOUND";
|
|
457
|
+
}
|
|
458
|
+
/** `cancelApproval` on an approval that already ended (`APPROVAL_ALREADY_ENDED`, 409).
|
|
459
|
+
* Read it with `getApproval`: it may have completed. */
|
|
460
|
+
get isApprovalAlreadyEnded() {
|
|
461
|
+
return this.code === "APPROVAL_ALREADY_ENDED";
|
|
462
|
+
}
|
|
434
463
|
/** True when init-purchase was given a `packId` that is not in INVO's Steam
|
|
435
464
|
* catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
|
|
436
465
|
* `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
|
|
@@ -1732,7 +1761,7 @@ function toPhoneChangeRequest(raw) {
|
|
|
1732
1761
|
}
|
|
1733
1762
|
|
|
1734
1763
|
// src/version.ts
|
|
1735
|
-
var SDK_VERSION = "3.
|
|
1764
|
+
var SDK_VERSION = "3.33.0";
|
|
1736
1765
|
|
|
1737
1766
|
// src/payouts.ts
|
|
1738
1767
|
var AMOUNT = /^\d+(\.\d{1,2})?$/;
|
|
@@ -2277,6 +2306,23 @@ function toPlayerActivityEntry(raw) {
|
|
|
2277
2306
|
raw
|
|
2278
2307
|
};
|
|
2279
2308
|
}
|
|
2309
|
+
function toPlatformApproval(raw) {
|
|
2310
|
+
const s = (k) => raw[k] == null ? null : String(raw[k]);
|
|
2311
|
+
const meta = raw["metadata"];
|
|
2312
|
+
return {
|
|
2313
|
+
approvalId: String(raw["approval_id"] ?? ""),
|
|
2314
|
+
clientRequestId: String(raw["client_request_id"] ?? ""),
|
|
2315
|
+
status: String(raw["status"] ?? ""),
|
|
2316
|
+
reason: s("reason"),
|
|
2317
|
+
totalPrice: s("total_price"),
|
|
2318
|
+
orderId: raw["order_id"] ?? null,
|
|
2319
|
+
transactionId: s("transaction_id"),
|
|
2320
|
+
expiresAt: s("expires_at"),
|
|
2321
|
+
decidedAt: s("decided_at"),
|
|
2322
|
+
metadata: meta && typeof meta === "object" && !Array.isArray(meta) ? meta : {},
|
|
2323
|
+
raw
|
|
2324
|
+
};
|
|
2325
|
+
}
|
|
2280
2326
|
function toPlatformOrderStatus(raw, fallbackOrderId) {
|
|
2281
2327
|
return {
|
|
2282
2328
|
orderId: raw["order_id"] ?? fallbackOrderId ?? "",
|
|
@@ -2583,6 +2629,10 @@ var PlatformCommerceServer = class {
|
|
|
2583
2629
|
if (input.successUrl) body["success_url"] = input.successUrl;
|
|
2584
2630
|
if (input.cancelUrl) body["cancel_url"] = input.cancelUrl;
|
|
2585
2631
|
if (input.metadata) body["metadata"] = input.metadata;
|
|
2632
|
+
if (input.requirePlayerApproval === true) {
|
|
2633
|
+
body["require_player_approval"] = true;
|
|
2634
|
+
if (input.returnUrl) body["return_url"] = input.returnUrl;
|
|
2635
|
+
}
|
|
2586
2636
|
const raw = await this.http.post(
|
|
2587
2637
|
"/api/platform-commerce/purchase",
|
|
2588
2638
|
body,
|
|
@@ -2591,7 +2641,9 @@ var PlatformCommerceServer = class {
|
|
|
2591
2641
|
{ idempotent: true, signal: opts?.signal }
|
|
2592
2642
|
);
|
|
2593
2643
|
const status = String(raw["status"] ?? "");
|
|
2594
|
-
if (status === "
|
|
2644
|
+
if (status === "pending_approval") {
|
|
2645
|
+
requireField2(raw["approval_id"], "approval_id", raw);
|
|
2646
|
+
} else if (status === "requires_payment") {
|
|
2595
2647
|
requireField2(raw["checkout_url"], "checkout_url", raw);
|
|
2596
2648
|
} else {
|
|
2597
2649
|
requireField2(raw["order_id"], "order_id", raw);
|
|
@@ -2612,9 +2664,39 @@ var PlatformCommerceServer = class {
|
|
|
2612
2664
|
amountUsd: raw["amount_usd"] ?? null,
|
|
2613
2665
|
idempotentReplay: raw["idempotent_replay"] === true,
|
|
2614
2666
|
...minPurchaseWarningField(raw),
|
|
2667
|
+
...raw["approval_id"] != null ? { approvalId: String(raw["approval_id"]) } : {},
|
|
2668
|
+
..."approval_url" in raw ? { approvalUrl: raw["approval_url"] ?? null } : {},
|
|
2615
2669
|
raw
|
|
2616
2670
|
};
|
|
2617
2671
|
}
|
|
2672
|
+
/** Read a buyer-approved purchase (3.33.0) by `approvalId` or by your `clientRequestId`
|
|
2673
|
+
* (exactly one). A fallback to the webhooks: `completed` carries `orderId`; an ending
|
|
2674
|
+
* without a sale carries `reason`. Throws `err.isApprovalNotFound` (404). */
|
|
2675
|
+
async getApproval(key, opts) {
|
|
2676
|
+
const id = key?.approvalId;
|
|
2677
|
+
const crid = key?.clientRequestId;
|
|
2678
|
+
if (Boolean(id) === Boolean(crid)) {
|
|
2679
|
+
throw invalidInput2("approvalId", id, "provide exactly one of approvalId or clientRequestId");
|
|
2680
|
+
}
|
|
2681
|
+
const path2 = id ? `/api/platform-commerce/approvals/${encodeURIComponent(String(id))}` : `/api/platform-commerce/approvals?${new URLSearchParams({ client_request_id: String(crid) }).toString()}`;
|
|
2682
|
+
const raw = await this.http.get(path2, this.auth, { signal: opts?.signal });
|
|
2683
|
+
return toPlatformApproval(raw);
|
|
2684
|
+
}
|
|
2685
|
+
/** Withdraw a buyer-approved purchase that is still waiting (3.33.0).
|
|
2686
|
+
* `platform_commerce.declined` follows with reason `cancelled`. Throws
|
|
2687
|
+
* `err.isApprovalAlreadyEnded` (409) when it had already ended. */
|
|
2688
|
+
async cancelApproval(approvalId, opts) {
|
|
2689
|
+
if (typeof approvalId !== "string" || !approvalId.trim()) {
|
|
2690
|
+
throw invalidInput2("approvalId", approvalId, "is required");
|
|
2691
|
+
}
|
|
2692
|
+
const raw = await this.http.post(
|
|
2693
|
+
`/api/platform-commerce/approvals/${encodeURIComponent(approvalId)}/cancel`,
|
|
2694
|
+
{},
|
|
2695
|
+
this.auth,
|
|
2696
|
+
{ idempotent: true, signal: opts?.signal }
|
|
2697
|
+
);
|
|
2698
|
+
return toPlatformApproval(raw);
|
|
2699
|
+
}
|
|
2618
2700
|
/** Poll an order's status: `completed` (balance immediately; card after the webhook),
|
|
2619
2701
|
* `pending_payment` (card awaiting confirmation), or `refunded`. Once the sale has settled,
|
|
2620
2702
|
* `invoFeeUsd` / `partnerShareUsd` say what INVO kept and what you earned (additive). */
|
package/dist/game-server.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as InvoServer, a as InvoEnvironment } from './server-
|
|
2
|
-
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, b as baseUrlForKey, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-
|
|
1
|
+
import { I as InvoServer, a as InvoEnvironment } from './server-5_g5C-no.cjs';
|
|
2
|
+
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, b as baseUrlForKey, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-5_g5C-no.cjs';
|
|
3
3
|
import { G as GameCurrencyKind, a as GamePurchaseStatus, b as GameEconomyConfig } from './types-jUxfYjiD.cjs';
|
|
4
4
|
export { c as GameCatalog, d as GameCatalogItem, e as GameCheckout, f as GameCurrencyBalance, g as GameErrorBody, h as GameItemPurchase, i as GamePlayer, j as GamePremiumPack, k as GamePurchase, l as GameSession, m as GameTransferInput, n as GameTransferKind, o as GameTransferStart, p as GameTransferStatus, q as GameWallet } from './types-jUxfYjiD.cjs';
|
|
5
|
-
export { I as InvoError } from './types-
|
|
6
|
-
export { S as SDK_VERSION } from './version-
|
|
5
|
+
export { I as InvoError } from './types-DUfQR48n.cjs';
|
|
6
|
+
export { S as SDK_VERSION } from './version-DKfrEYU1.cjs';
|
|
7
7
|
import './loyalty-events-CmDw2ZoR.cjs';
|
|
8
8
|
|
|
9
9
|
interface StoredPlayer {
|
package/dist/game-server.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as InvoServer, a as InvoEnvironment } from './server-
|
|
2
|
-
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, b as baseUrlForKey, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-
|
|
1
|
+
import { I as InvoServer, a as InvoEnvironment } from './server-Dhao5prR.js';
|
|
2
|
+
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, b as baseUrlForKey, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-Dhao5prR.js';
|
|
3
3
|
import { G as GameCurrencyKind, a as GamePurchaseStatus, b as GameEconomyConfig } from './types-jUxfYjiD.js';
|
|
4
4
|
export { c as GameCatalog, d as GameCatalogItem, e as GameCheckout, f as GameCurrencyBalance, g as GameErrorBody, h as GameItemPurchase, i as GamePlayer, j as GamePremiumPack, k as GamePurchase, l as GameSession, m as GameTransferInput, n as GameTransferKind, o as GameTransferStart, p as GameTransferStatus, q as GameWallet } from './types-jUxfYjiD.js';
|
|
5
|
-
export { I as InvoError } from './types-
|
|
6
|
-
export { S as SDK_VERSION } from './version-
|
|
5
|
+
export { I as InvoError } from './types-DUfQR48n.js';
|
|
6
|
+
export { S as SDK_VERSION } from './version-DKfrEYU1.js';
|
|
7
7
|
import './loyalty-events-CmDw2ZoR.js';
|
|
8
8
|
|
|
9
9
|
interface StoredPlayer {
|
package/dist/game-server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isDemoKey, SANDBOX_BASE_URL, PRODUCTION_BASE_URL, InvoServer, resolveEnvironment, verifyWebhook } from './chunk-
|
|
2
|
-
export { DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, PRODUCTION_BASE_URL, SANDBOX_BASE_URL, baseUrlForKey, isDemoKey, resolveEnvironment, verifyInvoSignature } from './chunk-
|
|
3
|
-
export { SDK_VERSION } from './chunk-
|
|
4
|
-
import { InvoError } from './chunk-
|
|
5
|
-
export { InvoError } from './chunk-
|
|
1
|
+
import { isDemoKey, SANDBOX_BASE_URL, PRODUCTION_BASE_URL, InvoServer, resolveEnvironment, verifyWebhook } from './chunk-DHVHKFQH.js';
|
|
2
|
+
export { DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, PRODUCTION_BASE_URL, SANDBOX_BASE_URL, baseUrlForKey, isDemoKey, resolveEnvironment, verifyInvoSignature } from './chunk-DHVHKFQH.js';
|
|
3
|
+
export { SDK_VERSION } from './chunk-VWUFSA6U.js';
|
|
4
|
+
import { InvoError } from './chunk-HQLPT2DY.js';
|
|
5
|
+
export { InvoError } from './chunk-HQLPT2DY.js';
|
|
6
6
|
import { createHash, randomBytes } from 'crypto';
|
|
7
7
|
import { promises, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
8
8
|
import * as path from 'path';
|
package/dist/game.cjs
CHANGED
|
@@ -337,6 +337,35 @@ var InvoError = class _InvoError extends Error {
|
|
|
337
337
|
get isPartnerRailSuspended() {
|
|
338
338
|
return this.code === "PARTNER_RAIL_SUSPENDED";
|
|
339
339
|
}
|
|
340
|
+
/** True when INVO has paused new payments on the developer account
|
|
341
|
+
* (`PAYMENTS_PAUSED`, 403; additive, 3.32.0). Every call that starts a payment returns it:
|
|
342
|
+
* coin purchase, checkout session, Platform Commerce card purchase, new
|
|
343
|
+
* subscription, Steam purchase or subscription start. Refunds, reads,
|
|
344
|
+
* balances, transfers and renewals of existing subscriptions keep working.
|
|
345
|
+
* Not retryable until INVO resumes payments; show a neutral "purchases are
|
|
346
|
+
* unavailable right now" message. */
|
|
347
|
+
get isPaymentsPaused() {
|
|
348
|
+
return this.code === "PAYMENTS_PAUSED";
|
|
349
|
+
}
|
|
350
|
+
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
351
|
+
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
352
|
+
* balance is never disclosed. Offer another way to pay. */
|
|
353
|
+
get isBalanceUnavailable() {
|
|
354
|
+
return this.code === "BALANCE_UNAVAILABLE";
|
|
355
|
+
}
|
|
356
|
+
/** Buyer approval is not available (`APPROVAL_NOT_AVAILABLE`, 503 or 409; 3.33.0). */
|
|
357
|
+
get isApprovalNotAvailable() {
|
|
358
|
+
return this.code === "APPROVAL_NOT_AVAILABLE";
|
|
359
|
+
}
|
|
360
|
+
/** No buyer-approved purchase with that id in your store (`APPROVAL_NOT_FOUND`, 404). */
|
|
361
|
+
get isApprovalNotFound() {
|
|
362
|
+
return this.code === "APPROVAL_NOT_FOUND";
|
|
363
|
+
}
|
|
364
|
+
/** `cancelApproval` on an approval that already ended (`APPROVAL_ALREADY_ENDED`, 409).
|
|
365
|
+
* Read it with `getApproval`: it may have completed. */
|
|
366
|
+
get isApprovalAlreadyEnded() {
|
|
367
|
+
return this.code === "APPROVAL_ALREADY_ENDED";
|
|
368
|
+
}
|
|
340
369
|
/** True when init-purchase was given a `packId` that is not in INVO's Steam
|
|
341
370
|
* catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
|
|
342
371
|
* `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
|
|
@@ -4854,7 +4883,7 @@ function mountInvoUI(container, economy, options = {}) {
|
|
|
4854
4883
|
}
|
|
4855
4884
|
|
|
4856
4885
|
// src/version.ts
|
|
4857
|
-
var SDK_VERSION = "3.
|
|
4886
|
+
var SDK_VERSION = "3.33.0";
|
|
4858
4887
|
|
|
4859
4888
|
exports.InvoGameEconomy = InvoGameEconomy;
|
|
4860
4889
|
exports.InvoGameError = InvoGameError;
|
package/dist/game.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as GamePlayer, q as GameWallet, c as GameCatalog, k as GamePurchase, h as GameItemPurchase, n as GameTransferKind, d as GameCatalogItem, f as GameCurrencyBalance, p as GameTransferStatus, m as GameTransferInput, o as GameTransferStart } from './types-jUxfYjiD.cjs';
|
|
2
2
|
export { e as GameCheckout, G as GameCurrencyKind, b as GameEconomyConfig, g as GameErrorBody, j as GamePremiumPack, a as GamePurchaseStatus, l as GameSession } from './types-jUxfYjiD.cjs';
|
|
3
|
-
import { A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
import { D as DestinationGame, P as PendingCollectItem } from './types-
|
|
5
|
-
export { S as SDK_VERSION } from './version-
|
|
3
|
+
import { A as ApproveHostedResult } from './hosted-approval-CYqqberu.cjs';
|
|
4
|
+
import { D as DestinationGame, P as PendingCollectItem } from './types-DUfQR48n.cjs';
|
|
5
|
+
export { S as SDK_VERSION } from './version-DKfrEYU1.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* INVO game economy client (3.27.0), the browser half. It talks ONLY to your game server
|
package/dist/game.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as GamePlayer, q as GameWallet, c as GameCatalog, k as GamePurchase, h as GameItemPurchase, n as GameTransferKind, d as GameCatalogItem, f as GameCurrencyBalance, p as GameTransferStatus, m as GameTransferInput, o as GameTransferStart } from './types-jUxfYjiD.js';
|
|
2
2
|
export { e as GameCheckout, G as GameCurrencyKind, b as GameEconomyConfig, g as GameErrorBody, j as GamePremiumPack, a as GamePurchaseStatus, l as GameSession } from './types-jUxfYjiD.js';
|
|
3
|
-
import { A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
import { D as DestinationGame, P as PendingCollectItem } from './types-
|
|
5
|
-
export { S as SDK_VERSION } from './version-
|
|
3
|
+
import { A as ApproveHostedResult } from './hosted-approval-CL3DfrGS.js';
|
|
4
|
+
import { D as DestinationGame, P as PendingCollectItem } from './types-DUfQR48n.js';
|
|
5
|
+
export { S as SDK_VERSION } from './version-DKfrEYU1.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* INVO game economy client (3.27.0), the browser half. It talks ONLY to your game server
|
package/dist/game.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InvoClient } from './chunk-
|
|
2
|
-
export { SDK_VERSION } from './chunk-
|
|
3
|
-
import { newEventId } from './chunk-
|
|
1
|
+
import { InvoClient } from './chunk-MJAJXYFX.js';
|
|
2
|
+
export { SDK_VERSION } from './chunk-VWUFSA6U.js';
|
|
3
|
+
import { newEventId } from './chunk-HQLPT2DY.js';
|
|
4
4
|
|
|
5
5
|
// src/game/client.ts
|
|
6
6
|
var InvoGameError = class extends Error {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-
|
|
1
|
+
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-DUfQR48n.js';
|
|
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-DUfQR48n.cjs';
|
|
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
|
@@ -337,6 +337,35 @@ var InvoError = class _InvoError extends Error {
|
|
|
337
337
|
get isPartnerRailSuspended() {
|
|
338
338
|
return this.code === "PARTNER_RAIL_SUSPENDED";
|
|
339
339
|
}
|
|
340
|
+
/** True when INVO has paused new payments on the developer account
|
|
341
|
+
* (`PAYMENTS_PAUSED`, 403; additive, 3.32.0). Every call that starts a payment returns it:
|
|
342
|
+
* coin purchase, checkout session, Platform Commerce card purchase, new
|
|
343
|
+
* subscription, Steam purchase or subscription start. Refunds, reads,
|
|
344
|
+
* balances, transfers and renewals of existing subscriptions keep working.
|
|
345
|
+
* Not retryable until INVO resumes payments; show a neutral "purchases are
|
|
346
|
+
* unavailable right now" message. */
|
|
347
|
+
get isPaymentsPaused() {
|
|
348
|
+
return this.code === "PAYMENTS_PAUSED";
|
|
349
|
+
}
|
|
350
|
+
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
351
|
+
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
352
|
+
* balance is never disclosed. Offer another way to pay. */
|
|
353
|
+
get isBalanceUnavailable() {
|
|
354
|
+
return this.code === "BALANCE_UNAVAILABLE";
|
|
355
|
+
}
|
|
356
|
+
/** Buyer approval is not available (`APPROVAL_NOT_AVAILABLE`, 503 or 409; 3.33.0). */
|
|
357
|
+
get isApprovalNotAvailable() {
|
|
358
|
+
return this.code === "APPROVAL_NOT_AVAILABLE";
|
|
359
|
+
}
|
|
360
|
+
/** No buyer-approved purchase with that id in your store (`APPROVAL_NOT_FOUND`, 404). */
|
|
361
|
+
get isApprovalNotFound() {
|
|
362
|
+
return this.code === "APPROVAL_NOT_FOUND";
|
|
363
|
+
}
|
|
364
|
+
/** `cancelApproval` on an approval that already ended (`APPROVAL_ALREADY_ENDED`, 409).
|
|
365
|
+
* Read it with `getApproval`: it may have completed. */
|
|
366
|
+
get isApprovalAlreadyEnded() {
|
|
367
|
+
return this.code === "APPROVAL_ALREADY_ENDED";
|
|
368
|
+
}
|
|
340
369
|
/** True when init-purchase was given a `packId` that is not in INVO's Steam
|
|
341
370
|
* catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
|
|
342
371
|
* `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
|
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-DUfQR48n.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-DUfQR48n.cjs';
|
|
3
|
+
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-CYqqberu.cjs';
|
|
4
|
+
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-CYqqberu.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-DUfQR48n.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-DUfQR48n.js';
|
|
3
|
+
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-CL3DfrGS.js';
|
|
4
|
+
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-CL3DfrGS.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-MJAJXYFX.js';
|
|
2
|
+
export { InvoError, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, nothingWasCharged, phoneChangeSignalMessage } from './chunk-HQLPT2DY.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
|
|
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-DUfQR48n.cjs';
|
|
2
2
|
import { b as ReportServerGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.cjs';
|
|
3
|
-
import './version-
|
|
3
|
+
import './version-DKfrEYU1.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Pick the INVO environment from the game secret alone (3.28.0).
|
|
@@ -125,8 +125,8 @@ interface PurchaseEventData {
|
|
|
125
125
|
* to you. The guarantee is a Merchant of Record term; Open-tier card payments made before
|
|
126
126
|
* November 8, 2026 keep it, later ones do not (`false`, passed through at cost). `false`
|
|
127
127
|
* for any other dispute, handled as before. Never sent on a coin purchase
|
|
128
|
-
* dispute (a
|
|
129
|
-
*
|
|
128
|
+
* dispute (a coin purchase dispute reports what it charged you in `spent_coins_charged_usd`),
|
|
129
|
+
* nor on an opened or won event. Do not read absence as either value.
|
|
130
130
|
*/
|
|
131
131
|
guarantee_covered?: boolean;
|
|
132
132
|
/**
|
|
@@ -1207,6 +1207,17 @@ declare class PlatformCommerceServer {
|
|
|
1207
1207
|
* `err.isNotPlatformTenant` (403).
|
|
1208
1208
|
*/
|
|
1209
1209
|
purchase(input: PlatformPurchaseInput, opts?: CallOptions): Promise<PlatformPurchaseResult>;
|
|
1210
|
+
/** Read a buyer-approved purchase (3.33.0) by `approvalId` or by your `clientRequestId`
|
|
1211
|
+
* (exactly one). A fallback to the webhooks: `completed` carries `orderId`; an ending
|
|
1212
|
+
* without a sale carries `reason`. Throws `err.isApprovalNotFound` (404). */
|
|
1213
|
+
getApproval(key: {
|
|
1214
|
+
approvalId?: string;
|
|
1215
|
+
clientRequestId?: string;
|
|
1216
|
+
}, opts?: CallOptions): Promise<PlatformApprovalResult>;
|
|
1217
|
+
/** Withdraw a buyer-approved purchase that is still waiting (3.33.0).
|
|
1218
|
+
* `platform_commerce.declined` follows with reason `cancelled`. Throws
|
|
1219
|
+
* `err.isApprovalAlreadyEnded` (409) when it had already ended. */
|
|
1220
|
+
cancelApproval(approvalId: string, opts?: CallOptions): Promise<PlatformApprovalResult>;
|
|
1210
1221
|
/** Poll an order's status: `completed` (balance immediately; card after the webhook),
|
|
1211
1222
|
* `pending_payment` (card awaiting confirmation), or `refunded`. Once the sale has settled,
|
|
1212
1223
|
* `invoFeeUsd` / `partnerShareUsd` say what INVO kept and what you earned (additive). */
|