@invonetwork/web-sdk 3.30.0 → 3.30.1
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 +10 -0
- package/README.md +1 -1
- package/dist/chunk-3ECVREIM.js +6 -0
- package/dist/{chunk-QDHOPJFL.js → chunk-7O5JT3LK.js} +4 -48
- package/dist/{chunk-TSTP2CWA.js → chunk-TCT2QSVB.js} +82 -38
- package/dist/{chunk-664RAO2T.js → chunk-V2RQYQQD.js} +23 -4
- package/dist/game-server.cjs +121 -43
- package/dist/game-server.d.cts +5 -3
- package/dist/game-server.d.ts +5 -3
- package/dist/game-server.js +41 -8
- package/dist/game.cjs +3 -3
- package/dist/game.d.cts +1 -1
- package/dist/game.d.ts +1 -1
- package/dist/game.js +5 -5
- package/dist/index.js +2 -2
- package/dist/{server-DEh9wjF2.d.cts → server-BAOn3KH3.d.cts} +13 -2
- package/dist/{server-B0mvlGFY.d.ts → server-DHmQU1eN.d.ts} +13 -2
- package/dist/server.cjs +85 -40
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +3 -3
- package/dist/{version-DfVkILOj.d.cts → version-CR7XECyP.d.cts} +1 -1
- package/dist/{version-DfVkILOj.d.ts → version-CR7XECyP.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-BIK6UXY7.js +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.30.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Demo key: `POST /transfers/{id}/approve` no longer returns the claim code to the sender's browser (`claimCode` is always `null`). The game server keeps it and collects for the recipient, so the browser never needed it.
|
|
8
|
+
- UI kit: moves to INVO Demo Arcade on the demo key are described as delivered automatically once approved, matching the backend, instead of refunded after 24 hours.
|
|
9
|
+
- Game server: a purchase is confirmed even when the signed webhook can't reach the server (for example a private `*.replit.dev` development preview, which refuses requests that don't come from a signed-in browser). While a purchase is pending, `GET /purchases/{ref}` reads the checkout's status from INVO server-side, with the session token kept on the server, and credits from INVO's answer. The webhook and the status read credit under the same ledger ref, so whichever lands first wins and the other is a no-op. The browser's word is never used.
|
|
10
|
+
- `InvoServer.getCheckoutStatus({ sessionId, sessionToken })`: the server-side read of a hosted checkout's status.
|
|
11
|
+
- Nothing removed or renamed.
|
|
12
|
+
|
|
3
13
|
## 3.30.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -2585,7 +2585,7 @@ On the demo key, send only `recipientEmail`. The server maps it to the friend's
|
|
|
2585
2585
|
- `approveTransfer(start)` asks the game server, which approves in INVO's demo sandbox (`approval: "sandbox"`) and keeps the claim code.
|
|
2586
2586
|
- The friend's `pendingTransfers()` and `collectTransfer(item, "sandbox")` collect it through the game server.
|
|
2587
2587
|
|
|
2588
|
-
Within one game, use a **send**. The transfer rail refuses a move to your own game, and `transferDestinations()` lists this game first for that reason. On the demo, a
|
|
2588
|
+
Within one game, use a **send**. The transfer rail refuses a move to your own game, and `transferDestinations()` lists this game first for that reason. On the demo, a move to INVO Demo Arcade is collected there automatically once it's approved.
|
|
2589
2589
|
|
|
2590
2590
|
On a real key, `recipientPhone` (E.164) is required and the email is optional.
|
|
2591
2591
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvoError, assertSecureBaseUrl, Http, toPhoneChangeApprovalsResult, phoneChangeSignalMessage, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toRedeemRewardResult, toRewardsPageLink, buildGameEventBody, toReportGameEventResult
|
|
1
|
+
import { InvoError, assertSecureBaseUrl, Http, toPurchaseStatusResult, toPhoneChangeApprovalsResult, phoneChangeSignalMessage, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toRedeemRewardResult, toRewardsPageLink, buildGameEventBody, toReportGameEventResult } from './chunk-TCT2QSVB.js';
|
|
2
2
|
|
|
3
3
|
// src/shared/webauthn.ts
|
|
4
4
|
function malformedOptions(field) {
|
|
@@ -684,50 +684,6 @@ async function runHostedApproval(opts, api, deps = {}) {
|
|
|
684
684
|
});
|
|
685
685
|
}
|
|
686
686
|
|
|
687
|
-
// src/shared/purchase-status.ts
|
|
688
|
-
function str(v) {
|
|
689
|
-
return typeof v === "string" ? v : v === null || v === void 0 ? null : String(v);
|
|
690
|
-
}
|
|
691
|
-
function toPurchaseStatusResult(raw, sessionId) {
|
|
692
|
-
return {
|
|
693
|
-
status: String(raw["status"] ?? ""),
|
|
694
|
-
// INVO SAYS, AND ONLY AN EXPLICIT `true` SAYS IT. A missing or malformed field reads
|
|
695
|
-
// false, which keeps a poll running; the alternative, guessing terminality from
|
|
696
|
-
// `status`, is how an old SDK declares a future status finished.
|
|
697
|
-
terminal: raw["terminal"] === true,
|
|
698
|
-
orderId: str(raw["order_id"]),
|
|
699
|
-
sessionId: String(raw["session_id"] ?? sessionId),
|
|
700
|
-
coinsCredited: str(raw["coins_credited"]),
|
|
701
|
-
transactionId: str(raw["transaction_id"]),
|
|
702
|
-
newBalance: str(raw["new_balance"]),
|
|
703
|
-
reasonCode: str(raw["reason_code"]),
|
|
704
|
-
message: str(raw["message"]),
|
|
705
|
-
amountChargedUsd: str(raw["amount_charged_usd"]),
|
|
706
|
-
listedUsd: str(raw["listed_usd"]),
|
|
707
|
-
currencyName: str(raw["currency_name"]),
|
|
708
|
-
...receiptFields(raw),
|
|
709
|
-
raw
|
|
710
|
-
};
|
|
711
|
-
}
|
|
712
|
-
function isPurchaseCredited(r) {
|
|
713
|
-
return r.status === "credited";
|
|
714
|
-
}
|
|
715
|
-
function isPurchaseRefused(r) {
|
|
716
|
-
return r.status === "refused";
|
|
717
|
-
}
|
|
718
|
-
function isPurchaseRefunded(r) {
|
|
719
|
-
return r.status === "refunded";
|
|
720
|
-
}
|
|
721
|
-
function isPurchaseExpired(r) {
|
|
722
|
-
return r.status === "expired";
|
|
723
|
-
}
|
|
724
|
-
var NOTHING_CHARGED_REASONS = /* @__PURE__ */ new Set(["PAYMENT_DECLINED", "PAYMENT_CANCELLED"]);
|
|
725
|
-
function nothingWasCharged(r) {
|
|
726
|
-
if (r.status === "expired") return true;
|
|
727
|
-
if (r.status !== "refused") return false;
|
|
728
|
-
return r.reasonCode !== null && NOTHING_CHARGED_REASONS.has(r.reasonCode);
|
|
729
|
-
}
|
|
730
|
-
|
|
731
687
|
// src/index.ts
|
|
732
688
|
function clientInvalidInput(message) {
|
|
733
689
|
return new InvoError({ message, code: "INVALID_INPUT", status: 0 });
|
|
@@ -1629,6 +1585,6 @@ var InvoClient = class {
|
|
|
1629
1585
|
}
|
|
1630
1586
|
};
|
|
1631
1587
|
|
|
1632
|
-
export { CheckoutClient, InvoClient, PlatformCommerceClient
|
|
1633
|
-
//# sourceMappingURL=chunk-
|
|
1634
|
-
//# sourceMappingURL=chunk-
|
|
1588
|
+
export { CheckoutClient, InvoClient, PlatformCommerceClient };
|
|
1589
|
+
//# sourceMappingURL=chunk-7O5JT3LK.js.map
|
|
1590
|
+
//# sourceMappingURL=chunk-7O5JT3LK.js.map
|
|
@@ -1399,10 +1399,54 @@ function receiptFields(raw) {
|
|
|
1399
1399
|
return typeof u === "string" && u !== "" ? { receiptNumber: n, receiptUrl: u } : { receiptNumber: n };
|
|
1400
1400
|
}
|
|
1401
1401
|
|
|
1402
|
+
// src/shared/purchase-status.ts
|
|
1403
|
+
function str(v) {
|
|
1404
|
+
return typeof v === "string" ? v : v === null || v === void 0 ? null : String(v);
|
|
1405
|
+
}
|
|
1406
|
+
function toPurchaseStatusResult(raw, sessionId) {
|
|
1407
|
+
return {
|
|
1408
|
+
status: String(raw["status"] ?? ""),
|
|
1409
|
+
// INVO SAYS, AND ONLY AN EXPLICIT `true` SAYS IT. A missing or malformed field reads
|
|
1410
|
+
// false, which keeps a poll running; the alternative, guessing terminality from
|
|
1411
|
+
// `status`, is how an old SDK declares a future status finished.
|
|
1412
|
+
terminal: raw["terminal"] === true,
|
|
1413
|
+
orderId: str(raw["order_id"]),
|
|
1414
|
+
sessionId: String(raw["session_id"] ?? sessionId),
|
|
1415
|
+
coinsCredited: str(raw["coins_credited"]),
|
|
1416
|
+
transactionId: str(raw["transaction_id"]),
|
|
1417
|
+
newBalance: str(raw["new_balance"]),
|
|
1418
|
+
reasonCode: str(raw["reason_code"]),
|
|
1419
|
+
message: str(raw["message"]),
|
|
1420
|
+
amountChargedUsd: str(raw["amount_charged_usd"]),
|
|
1421
|
+
listedUsd: str(raw["listed_usd"]),
|
|
1422
|
+
currencyName: str(raw["currency_name"]),
|
|
1423
|
+
...receiptFields(raw),
|
|
1424
|
+
raw
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
function isPurchaseCredited(r) {
|
|
1428
|
+
return r.status === "credited";
|
|
1429
|
+
}
|
|
1430
|
+
function isPurchaseRefused(r) {
|
|
1431
|
+
return r.status === "refused";
|
|
1432
|
+
}
|
|
1433
|
+
function isPurchaseRefunded(r) {
|
|
1434
|
+
return r.status === "refunded";
|
|
1435
|
+
}
|
|
1436
|
+
function isPurchaseExpired(r) {
|
|
1437
|
+
return r.status === "expired";
|
|
1438
|
+
}
|
|
1439
|
+
var NOTHING_CHARGED_REASONS = /* @__PURE__ */ new Set(["PAYMENT_DECLINED", "PAYMENT_CANCELLED"]);
|
|
1440
|
+
function nothingWasCharged(r) {
|
|
1441
|
+
if (r.status === "expired") return true;
|
|
1442
|
+
if (r.status !== "refused") return false;
|
|
1443
|
+
return r.reasonCode !== null && NOTHING_CHARGED_REASONS.has(r.reasonCode);
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1402
1446
|
// src/shared/loyalty.ts
|
|
1403
1447
|
var obj = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
1404
1448
|
var rows = (v) => Array.isArray(v) ? v.filter((r) => r && typeof r === "object" && !Array.isArray(r)) : [];
|
|
1405
|
-
var
|
|
1449
|
+
var str2 = (v) => v === void 0 || v === null ? "" : String(v);
|
|
1406
1450
|
var strOrNull = (v) => v === void 0 || v === null ? null : String(v);
|
|
1407
1451
|
var numOrNull = (v) => typeof v === "number" && Number.isFinite(v) ? v : null;
|
|
1408
1452
|
var int = (v, fallback = 0) => typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
@@ -1419,22 +1463,22 @@ function toStep(row) {
|
|
|
1419
1463
|
return {
|
|
1420
1464
|
stepId: strOrNull(row["step_id"]),
|
|
1421
1465
|
index: int(row["index"]),
|
|
1422
|
-
action:
|
|
1423
|
-
label:
|
|
1424
|
-
summary:
|
|
1466
|
+
action: str2(row["action"]),
|
|
1467
|
+
label: str2(row["label"]),
|
|
1468
|
+
summary: str2(row["summary"]),
|
|
1425
1469
|
windowHours: numOrNull(row["window_hours"]),
|
|
1426
|
-
state:
|
|
1470
|
+
state: str2(row["state"]),
|
|
1427
1471
|
progress: toLoyaltyStepProgress(row["progress"]),
|
|
1428
1472
|
raw: row
|
|
1429
1473
|
};
|
|
1430
1474
|
}
|
|
1431
1475
|
function toCardReward(row) {
|
|
1432
1476
|
return {
|
|
1433
|
-
vaultEntryId:
|
|
1434
|
-
rewardId:
|
|
1435
|
-
state:
|
|
1436
|
-
unlockedAt:
|
|
1437
|
-
expiresAt:
|
|
1477
|
+
vaultEntryId: str2(row["vault_entry_id"]),
|
|
1478
|
+
rewardId: str2(row["reward_id"]),
|
|
1479
|
+
state: str2(row["state"]),
|
|
1480
|
+
unlockedAt: str2(row["unlocked_at"]),
|
|
1481
|
+
expiresAt: str2(row["expires_at"]),
|
|
1438
1482
|
redeemedAt: strOrNull(row["redeemed_at"]),
|
|
1439
1483
|
codeMasked: strOrNull(row["code_masked"]),
|
|
1440
1484
|
canRedeem: row["can_redeem"] === true,
|
|
@@ -1449,18 +1493,18 @@ function toLoyaltyCard(row) {
|
|
|
1449
1493
|
const steps = rows(row["steps"]).map(toStep);
|
|
1450
1494
|
return {
|
|
1451
1495
|
cardVersion: passThrough(row["card_version"]),
|
|
1452
|
-
mode:
|
|
1496
|
+
mode: str2(row["mode"]),
|
|
1453
1497
|
programId: strOrNull(row["program_id"]),
|
|
1454
1498
|
questId: strOrNull(row["quest_id"]),
|
|
1455
1499
|
questVersion: numOrNull(row["quest_version"]),
|
|
1456
1500
|
campaignId: strOrNull(row["campaign_id"]),
|
|
1457
|
-
title:
|
|
1458
|
-
description:
|
|
1501
|
+
title: str2(row["title"]),
|
|
1502
|
+
description: str2(row["description"]),
|
|
1459
1503
|
brand: { name: strOrNull(brand["name"]), logoUrl: strOrNull(brand["logo_url"]) },
|
|
1460
1504
|
artUrl: strOrNull(row["art_url"]),
|
|
1461
1505
|
reward: { rewardId: strOrNull(reward["reward_id"]), name: strOrNull(reward["name"]) },
|
|
1462
|
-
orderMode:
|
|
1463
|
-
status:
|
|
1506
|
+
orderMode: str2(row["order_mode"]),
|
|
1507
|
+
status: str2(row["status"]),
|
|
1464
1508
|
startsAt: strOrNull(row["starts_at"]),
|
|
1465
1509
|
endsAt: strOrNull(row["ends_at"]),
|
|
1466
1510
|
completionHours: numOrNull(row["completion_hours"]),
|
|
@@ -1483,12 +1527,12 @@ function toLoyaltyCardsResult(raw) {
|
|
|
1483
1527
|
}
|
|
1484
1528
|
function toVaultEntry(row) {
|
|
1485
1529
|
return {
|
|
1486
|
-
vaultEntryId:
|
|
1487
|
-
rewardRef:
|
|
1488
|
-
programId:
|
|
1530
|
+
vaultEntryId: str2(row["vault_entry_id"]),
|
|
1531
|
+
rewardRef: str2(row["reward_ref"]),
|
|
1532
|
+
programId: str2(row["program_id"]),
|
|
1489
1533
|
questId: strOrNull(row["quest_id"]),
|
|
1490
|
-
units:
|
|
1491
|
-
state:
|
|
1534
|
+
units: str2(row["units"]),
|
|
1535
|
+
state: str2(row["state"]),
|
|
1492
1536
|
unlockedAt: strOrNull(row["unlocked_at"]),
|
|
1493
1537
|
expiresAt: strOrNull(row["expires_at"]),
|
|
1494
1538
|
redeemedAt: strOrNull(row["redeemed_at"]),
|
|
@@ -1501,9 +1545,9 @@ function toLoyaltyVaultResult(raw) {
|
|
|
1501
1545
|
}
|
|
1502
1546
|
function toRedeemRewardResult(raw, vaultEntryId) {
|
|
1503
1547
|
return {
|
|
1504
|
-
vaultEntryId:
|
|
1505
|
-
rewardRef:
|
|
1506
|
-
state:
|
|
1548
|
+
vaultEntryId: str2(raw["vault_entry_id"] ?? vaultEntryId),
|
|
1549
|
+
rewardRef: str2(raw["reward_ref"]),
|
|
1550
|
+
state: str2(raw["state"]),
|
|
1507
1551
|
redeemedAt: strOrNull(raw["redeemed_at"]),
|
|
1508
1552
|
code: strOrNull(raw["code"]),
|
|
1509
1553
|
codeMasked: strOrNull(raw["code_masked"]),
|
|
@@ -1513,7 +1557,7 @@ function toRedeemRewardResult(raw, vaultEntryId) {
|
|
|
1513
1557
|
};
|
|
1514
1558
|
}
|
|
1515
1559
|
function toRewardsPageLink(raw) {
|
|
1516
|
-
return { url:
|
|
1560
|
+
return { url: str2(raw["url"]), expiresAt: str2(raw["expires_at"]), raw };
|
|
1517
1561
|
}
|
|
1518
1562
|
|
|
1519
1563
|
// src/shared/loyalty-events.ts
|
|
@@ -1598,16 +1642,16 @@ function requireField(value, field, raw) {
|
|
|
1598
1642
|
}
|
|
1599
1643
|
return s;
|
|
1600
1644
|
}
|
|
1601
|
-
var
|
|
1645
|
+
var str3 = (v) => v == null ? "" : String(v);
|
|
1602
1646
|
var strOrNull2 = (v) => typeof v === "string" ? v : v == null ? null : String(v);
|
|
1603
1647
|
function toRequestPhoneChangeResult(raw) {
|
|
1604
1648
|
return {
|
|
1605
1649
|
changeRequestId: requireField(raw["change_request_id"], "change_request_id", raw),
|
|
1606
1650
|
status: requireField(raw["status"], "status", raw),
|
|
1607
|
-
expiresAt:
|
|
1608
|
-
delivery:
|
|
1609
|
-
confirmation:
|
|
1610
|
-
message:
|
|
1651
|
+
expiresAt: str3(raw["expires_at"]),
|
|
1652
|
+
delivery: str3(raw["delivery"]),
|
|
1653
|
+
confirmation: str3(raw["confirmation"]),
|
|
1654
|
+
message: str3(raw["message"]),
|
|
1611
1655
|
raw
|
|
1612
1656
|
};
|
|
1613
1657
|
}
|
|
@@ -1615,8 +1659,8 @@ function toPhoneChangeRequest(raw) {
|
|
|
1615
1659
|
return {
|
|
1616
1660
|
changeRequestId: requireField(raw["change_request_id"], "change_request_id", raw),
|
|
1617
1661
|
status: requireField(raw["status"], "status", raw),
|
|
1618
|
-
confirmation:
|
|
1619
|
-
delivery:
|
|
1662
|
+
confirmation: str3(raw["confirmation"]),
|
|
1663
|
+
delivery: str3(raw["delivery"]),
|
|
1620
1664
|
newPhoneMasked: strOrNull2(raw["new_phone_masked"]),
|
|
1621
1665
|
createdAt: strOrNull2(raw["created_at"]),
|
|
1622
1666
|
expiresAt: strOrNull2(raw["expires_at"]),
|
|
@@ -1628,7 +1672,7 @@ function toPhoneChangeRequest(raw) {
|
|
|
1628
1672
|
function toPhoneChangeApprovalsResult(raw) {
|
|
1629
1673
|
const rows2 = Array.isArray(raw["approvals"]) ? raw["approvals"] : [];
|
|
1630
1674
|
const approvals = rows2.filter((r) => r && typeof r === "object").map((r) => ({
|
|
1631
|
-
changeRequestId:
|
|
1675
|
+
changeRequestId: str3(r["change_request_id"]),
|
|
1632
1676
|
gameName: strOrNull2(r["game_name"]),
|
|
1633
1677
|
oldPhoneMasked: strOrNull2(r["old_phone_masked"]),
|
|
1634
1678
|
newPhoneMasked: strOrNull2(r["new_phone_masked"]),
|
|
@@ -1637,7 +1681,7 @@ function toPhoneChangeApprovalsResult(raw) {
|
|
|
1637
1681
|
return { approvals, raw };
|
|
1638
1682
|
}
|
|
1639
1683
|
function toApprovePhoneChangeResult(raw, changeRequestId) {
|
|
1640
|
-
const id =
|
|
1684
|
+
const id = str3(raw["change_request_id"] ?? changeRequestId);
|
|
1641
1685
|
const status = requireField(raw["status"], "status", raw);
|
|
1642
1686
|
if (status === "denied") {
|
|
1643
1687
|
return { status: "denied", changeRequestId: id, raw };
|
|
@@ -1653,8 +1697,8 @@ function toApprovePhoneChangeResult(raw, changeRequestId) {
|
|
|
1653
1697
|
const out = {
|
|
1654
1698
|
status: "confirmed",
|
|
1655
1699
|
changeRequestId: id,
|
|
1656
|
-
identityId:
|
|
1657
|
-
previousIdentityId:
|
|
1700
|
+
identityId: str3(raw["identity_id"]),
|
|
1701
|
+
previousIdentityId: str3(raw["previous_identity_id"]),
|
|
1658
1702
|
playersUpdated: Number(raw["players_updated"] ?? 0) || 0,
|
|
1659
1703
|
verifiedPhone: raw["verified_phone"] === true,
|
|
1660
1704
|
raw
|
|
@@ -1668,6 +1712,6 @@ function toApprovePhoneChangeResult(raw, changeRequestId) {
|
|
|
1668
1712
|
return out;
|
|
1669
1713
|
}
|
|
1670
1714
|
|
|
1671
|
-
export { Http, InvoError, assertSecureBaseUrl, buildGameEventBody, creditFields, newEventId, phoneChangeSignalMessage, receiptFields, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toPhoneChangeApprovalsResult, toPhoneChangeRequest, toRedeemRewardResult, toReportGameEventResult, toRequestPhoneChangeResult, toRewardsPageLink };
|
|
1672
|
-
//# sourceMappingURL=chunk-
|
|
1673
|
-
//# sourceMappingURL=chunk-
|
|
1715
|
+
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 };
|
|
1716
|
+
//# sourceMappingURL=chunk-TCT2QSVB.js.map
|
|
1717
|
+
//# sourceMappingURL=chunk-TCT2QSVB.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SDK_VERSION } from './chunk-
|
|
2
|
-
import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-
|
|
1
|
+
import { SDK_VERSION } from './chunk-3ECVREIM.js';
|
|
2
|
+
import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, toPurchaseStatusResult, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-TCT2QSVB.js';
|
|
3
3
|
import { createHmac, timingSafeEqual } from 'crypto';
|
|
4
4
|
|
|
5
5
|
// src/payouts.ts
|
|
@@ -2529,6 +2529,25 @@ var InvoServer = class {
|
|
|
2529
2529
|
raw
|
|
2530
2530
|
};
|
|
2531
2531
|
}
|
|
2532
|
+
/**
|
|
2533
|
+
* Read a hosted checkout's status from INVO, server-side, with the session token that
|
|
2534
|
+
* {@link createCheckout} returned. Same answer as the browser's
|
|
2535
|
+
* `invo.checkout.getPurchaseStatus`. A game server uses it to confirm a purchase when
|
|
2536
|
+
* the signed webhook cannot reach it (for example a private development preview).
|
|
2537
|
+
* It is INVO's own record, read over TLS with the session credential, never the buyer's word.
|
|
2538
|
+
*/
|
|
2539
|
+
async getCheckoutStatus(input, opts) {
|
|
2540
|
+
const sessionId = String(input?.sessionId ?? "").trim();
|
|
2541
|
+
const sessionToken = String(input?.sessionToken ?? "").trim();
|
|
2542
|
+
if (!sessionId) throw invalidInput2("sessionId", input?.sessionId, "is required");
|
|
2543
|
+
if (!sessionToken) throw invalidInput2("sessionToken", "(hidden)", "is required");
|
|
2544
|
+
const raw = await this.http.get(
|
|
2545
|
+
`/api/checkout/sessions/${encodeURIComponent(sessionId)}`,
|
|
2546
|
+
{ kind: "bearer", token: sessionToken },
|
|
2547
|
+
{ signal: opts?.signal }
|
|
2548
|
+
);
|
|
2549
|
+
return toPurchaseStatusResult(raw, sessionId);
|
|
2550
|
+
}
|
|
2532
2551
|
/**
|
|
2533
2552
|
* Direct purchase via the rail selector. Use when you need a specific rail.
|
|
2534
2553
|
* - rail "platform" (default): standard card. May return status "requires_action"
|
|
@@ -3768,5 +3787,5 @@ var InvoServer = class {
|
|
|
3768
3787
|
};
|
|
3769
3788
|
|
|
3770
3789
|
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 };
|
|
3771
|
-
//# sourceMappingURL=chunk-
|
|
3772
|
-
//# sourceMappingURL=chunk-
|
|
3790
|
+
//# sourceMappingURL=chunk-V2RQYQQD.js.map
|
|
3791
|
+
//# sourceMappingURL=chunk-V2RQYQQD.js.map
|
package/dist/game-server.cjs
CHANGED
|
@@ -1478,10 +1478,53 @@ function toDestinationsResult(raw, direction) {
|
|
|
1478
1478
|
};
|
|
1479
1479
|
}
|
|
1480
1480
|
|
|
1481
|
+
// src/shared/receipt-fields.ts
|
|
1482
|
+
function creditFields(raw) {
|
|
1483
|
+
const c = raw["credited"];
|
|
1484
|
+
if (c === true) return { credited: true };
|
|
1485
|
+
if (c === false) {
|
|
1486
|
+
const r = raw["reason_code"];
|
|
1487
|
+
return { credited: false, reasonCode: r == null ? null : String(r) };
|
|
1488
|
+
}
|
|
1489
|
+
return {};
|
|
1490
|
+
}
|
|
1491
|
+
function receiptFields(raw) {
|
|
1492
|
+
const n = raw["receipt_number"];
|
|
1493
|
+
if (typeof n !== "string" || n === "") return {};
|
|
1494
|
+
const u = raw["receipt_url"];
|
|
1495
|
+
return typeof u === "string" && u !== "" ? { receiptNumber: n, receiptUrl: u } : { receiptNumber: n };
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
// src/shared/purchase-status.ts
|
|
1499
|
+
function str(v) {
|
|
1500
|
+
return typeof v === "string" ? v : v === null || v === void 0 ? null : String(v);
|
|
1501
|
+
}
|
|
1502
|
+
function toPurchaseStatusResult(raw, sessionId) {
|
|
1503
|
+
return {
|
|
1504
|
+
status: String(raw["status"] ?? ""),
|
|
1505
|
+
// INVO SAYS, AND ONLY AN EXPLICIT `true` SAYS IT. A missing or malformed field reads
|
|
1506
|
+
// false, which keeps a poll running; the alternative, guessing terminality from
|
|
1507
|
+
// `status`, is how an old SDK declares a future status finished.
|
|
1508
|
+
terminal: raw["terminal"] === true,
|
|
1509
|
+
orderId: str(raw["order_id"]),
|
|
1510
|
+
sessionId: String(raw["session_id"] ?? sessionId),
|
|
1511
|
+
coinsCredited: str(raw["coins_credited"]),
|
|
1512
|
+
transactionId: str(raw["transaction_id"]),
|
|
1513
|
+
newBalance: str(raw["new_balance"]),
|
|
1514
|
+
reasonCode: str(raw["reason_code"]),
|
|
1515
|
+
message: str(raw["message"]),
|
|
1516
|
+
amountChargedUsd: str(raw["amount_charged_usd"]),
|
|
1517
|
+
listedUsd: str(raw["listed_usd"]),
|
|
1518
|
+
currencyName: str(raw["currency_name"]),
|
|
1519
|
+
...receiptFields(raw),
|
|
1520
|
+
raw
|
|
1521
|
+
};
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1481
1524
|
// src/shared/loyalty.ts
|
|
1482
1525
|
var obj = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
1483
1526
|
var rows = (v) => Array.isArray(v) ? v.filter((r) => r && typeof r === "object" && !Array.isArray(r)) : [];
|
|
1484
|
-
var
|
|
1527
|
+
var str2 = (v) => v === void 0 || v === null ? "" : String(v);
|
|
1485
1528
|
var strOrNull = (v) => v === void 0 || v === null ? null : String(v);
|
|
1486
1529
|
var numOrNull = (v) => typeof v === "number" && Number.isFinite(v) ? v : null;
|
|
1487
1530
|
var int = (v, fallback = 0) => typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
@@ -1498,22 +1541,22 @@ function toStep(row) {
|
|
|
1498
1541
|
return {
|
|
1499
1542
|
stepId: strOrNull(row["step_id"]),
|
|
1500
1543
|
index: int(row["index"]),
|
|
1501
|
-
action:
|
|
1502
|
-
label:
|
|
1503
|
-
summary:
|
|
1544
|
+
action: str2(row["action"]),
|
|
1545
|
+
label: str2(row["label"]),
|
|
1546
|
+
summary: str2(row["summary"]),
|
|
1504
1547
|
windowHours: numOrNull(row["window_hours"]),
|
|
1505
|
-
state:
|
|
1548
|
+
state: str2(row["state"]),
|
|
1506
1549
|
progress: toLoyaltyStepProgress(row["progress"]),
|
|
1507
1550
|
raw: row
|
|
1508
1551
|
};
|
|
1509
1552
|
}
|
|
1510
1553
|
function toCardReward(row) {
|
|
1511
1554
|
return {
|
|
1512
|
-
vaultEntryId:
|
|
1513
|
-
rewardId:
|
|
1514
|
-
state:
|
|
1515
|
-
unlockedAt:
|
|
1516
|
-
expiresAt:
|
|
1555
|
+
vaultEntryId: str2(row["vault_entry_id"]),
|
|
1556
|
+
rewardId: str2(row["reward_id"]),
|
|
1557
|
+
state: str2(row["state"]),
|
|
1558
|
+
unlockedAt: str2(row["unlocked_at"]),
|
|
1559
|
+
expiresAt: str2(row["expires_at"]),
|
|
1517
1560
|
redeemedAt: strOrNull(row["redeemed_at"]),
|
|
1518
1561
|
codeMasked: strOrNull(row["code_masked"]),
|
|
1519
1562
|
canRedeem: row["can_redeem"] === true,
|
|
@@ -1528,18 +1571,18 @@ function toLoyaltyCard(row) {
|
|
|
1528
1571
|
const steps = rows(row["steps"]).map(toStep);
|
|
1529
1572
|
return {
|
|
1530
1573
|
cardVersion: passThrough(row["card_version"]),
|
|
1531
|
-
mode:
|
|
1574
|
+
mode: str2(row["mode"]),
|
|
1532
1575
|
programId: strOrNull(row["program_id"]),
|
|
1533
1576
|
questId: strOrNull(row["quest_id"]),
|
|
1534
1577
|
questVersion: numOrNull(row["quest_version"]),
|
|
1535
1578
|
campaignId: strOrNull(row["campaign_id"]),
|
|
1536
|
-
title:
|
|
1537
|
-
description:
|
|
1579
|
+
title: str2(row["title"]),
|
|
1580
|
+
description: str2(row["description"]),
|
|
1538
1581
|
brand: { name: strOrNull(brand["name"]), logoUrl: strOrNull(brand["logo_url"]) },
|
|
1539
1582
|
artUrl: strOrNull(row["art_url"]),
|
|
1540
1583
|
reward: { rewardId: strOrNull(reward["reward_id"]), name: strOrNull(reward["name"]) },
|
|
1541
|
-
orderMode:
|
|
1542
|
-
status:
|
|
1584
|
+
orderMode: str2(row["order_mode"]),
|
|
1585
|
+
status: str2(row["status"]),
|
|
1543
1586
|
startsAt: strOrNull(row["starts_at"]),
|
|
1544
1587
|
endsAt: strOrNull(row["ends_at"]),
|
|
1545
1588
|
completionHours: numOrNull(row["completion_hours"]),
|
|
@@ -1626,23 +1669,6 @@ function toReportGameEventResult(raw, eventId) {
|
|
|
1626
1669
|
};
|
|
1627
1670
|
}
|
|
1628
1671
|
|
|
1629
|
-
// src/shared/receipt-fields.ts
|
|
1630
|
-
function creditFields(raw) {
|
|
1631
|
-
const c = raw["credited"];
|
|
1632
|
-
if (c === true) return { credited: true };
|
|
1633
|
-
if (c === false) {
|
|
1634
|
-
const r = raw["reason_code"];
|
|
1635
|
-
return { credited: false, reasonCode: r == null ? null : String(r) };
|
|
1636
|
-
}
|
|
1637
|
-
return {};
|
|
1638
|
-
}
|
|
1639
|
-
function receiptFields(raw) {
|
|
1640
|
-
const n = raw["receipt_number"];
|
|
1641
|
-
if (typeof n !== "string" || n === "") return {};
|
|
1642
|
-
const u = raw["receipt_url"];
|
|
1643
|
-
return typeof u === "string" && u !== "" ? { receiptNumber: n, receiptUrl: u } : { receiptNumber: n };
|
|
1644
|
-
}
|
|
1645
|
-
|
|
1646
1672
|
// src/shared/phone-change.ts
|
|
1647
1673
|
function requireField(value, field, raw) {
|
|
1648
1674
|
const s = value == null ? "" : String(value);
|
|
@@ -1656,16 +1682,16 @@ function requireField(value, field, raw) {
|
|
|
1656
1682
|
}
|
|
1657
1683
|
return s;
|
|
1658
1684
|
}
|
|
1659
|
-
var
|
|
1685
|
+
var str3 = (v) => v == null ? "" : String(v);
|
|
1660
1686
|
var strOrNull2 = (v) => typeof v === "string" ? v : v == null ? null : String(v);
|
|
1661
1687
|
function toRequestPhoneChangeResult(raw) {
|
|
1662
1688
|
return {
|
|
1663
1689
|
changeRequestId: requireField(raw["change_request_id"], "change_request_id", raw),
|
|
1664
1690
|
status: requireField(raw["status"], "status", raw),
|
|
1665
|
-
expiresAt:
|
|
1666
|
-
delivery:
|
|
1667
|
-
confirmation:
|
|
1668
|
-
message:
|
|
1691
|
+
expiresAt: str3(raw["expires_at"]),
|
|
1692
|
+
delivery: str3(raw["delivery"]),
|
|
1693
|
+
confirmation: str3(raw["confirmation"]),
|
|
1694
|
+
message: str3(raw["message"]),
|
|
1669
1695
|
raw
|
|
1670
1696
|
};
|
|
1671
1697
|
}
|
|
@@ -1673,8 +1699,8 @@ function toPhoneChangeRequest(raw) {
|
|
|
1673
1699
|
return {
|
|
1674
1700
|
changeRequestId: requireField(raw["change_request_id"], "change_request_id", raw),
|
|
1675
1701
|
status: requireField(raw["status"], "status", raw),
|
|
1676
|
-
confirmation:
|
|
1677
|
-
delivery:
|
|
1702
|
+
confirmation: str3(raw["confirmation"]),
|
|
1703
|
+
delivery: str3(raw["delivery"]),
|
|
1678
1704
|
newPhoneMasked: strOrNull2(raw["new_phone_masked"]),
|
|
1679
1705
|
createdAt: strOrNull2(raw["created_at"]),
|
|
1680
1706
|
expiresAt: strOrNull2(raw["expires_at"]),
|
|
@@ -1685,7 +1711,7 @@ function toPhoneChangeRequest(raw) {
|
|
|
1685
1711
|
}
|
|
1686
1712
|
|
|
1687
1713
|
// src/version.ts
|
|
1688
|
-
var SDK_VERSION = "3.30.
|
|
1714
|
+
var SDK_VERSION = "3.30.1";
|
|
1689
1715
|
|
|
1690
1716
|
// src/payouts.ts
|
|
1691
1717
|
var AMOUNT = /^\d+(\.\d{1,2})?$/;
|
|
@@ -4067,6 +4093,25 @@ var InvoServer = class {
|
|
|
4067
4093
|
raw
|
|
4068
4094
|
};
|
|
4069
4095
|
}
|
|
4096
|
+
/**
|
|
4097
|
+
* Read a hosted checkout's status from INVO, server-side, with the session token that
|
|
4098
|
+
* {@link createCheckout} returned. Same answer as the browser's
|
|
4099
|
+
* `invo.checkout.getPurchaseStatus`. A game server uses it to confirm a purchase when
|
|
4100
|
+
* the signed webhook cannot reach it (for example a private development preview).
|
|
4101
|
+
* It is INVO's own record, read over TLS with the session credential, never the buyer's word.
|
|
4102
|
+
*/
|
|
4103
|
+
async getCheckoutStatus(input, opts) {
|
|
4104
|
+
const sessionId = String(input?.sessionId ?? "").trim();
|
|
4105
|
+
const sessionToken = String(input?.sessionToken ?? "").trim();
|
|
4106
|
+
if (!sessionId) throw invalidInput2("sessionId", input?.sessionId, "is required");
|
|
4107
|
+
if (!sessionToken) throw invalidInput2("sessionToken", "(hidden)", "is required");
|
|
4108
|
+
const raw = await this.http.get(
|
|
4109
|
+
`/api/checkout/sessions/${encodeURIComponent(sessionId)}`,
|
|
4110
|
+
{ kind: "bearer", token: sessionToken },
|
|
4111
|
+
{ signal: opts?.signal }
|
|
4112
|
+
);
|
|
4113
|
+
return toPurchaseStatusResult(raw, sessionId);
|
|
4114
|
+
}
|
|
4070
4115
|
/**
|
|
4071
4116
|
* Direct purchase via the rail selector. Use when you need a specific rail.
|
|
4072
4117
|
* - rail "platform" (default): standard card. May return status "requires_action"
|
|
@@ -5702,6 +5747,7 @@ function createInvoGameServer(options) {
|
|
|
5702
5747
|
playerId: player.id,
|
|
5703
5748
|
packId: pack.id,
|
|
5704
5749
|
sessionId: session.sessionId,
|
|
5750
|
+
invoSessionToken: session.sessionToken || void 0,
|
|
5705
5751
|
status: "pending",
|
|
5706
5752
|
credited: null,
|
|
5707
5753
|
orderId: null,
|
|
@@ -5715,8 +5761,9 @@ function createInvoGameServer(options) {
|
|
|
5715
5761
|
}
|
|
5716
5762
|
async function purchaseStatus(request, ref) {
|
|
5717
5763
|
const { player } = await sessionPlayer(request);
|
|
5718
|
-
|
|
5764
|
+
let p = await store.read((s) => s.purchases[ref] ?? null);
|
|
5719
5765
|
if (!p || p.playerId !== player.id) throw new GameServerError(404, "PURCHASE_NOT_FOUND", "No such purchase.");
|
|
5766
|
+
if (p.status === "pending") p = await confirmFromInvo(p) ?? p;
|
|
5720
5767
|
const out = {
|
|
5721
5768
|
purchaseRef: p.purchaseRef,
|
|
5722
5769
|
packId: p.packId,
|
|
@@ -5727,6 +5774,37 @@ function createInvoGameServer(options) {
|
|
|
5727
5774
|
};
|
|
5728
5775
|
return json(200, out);
|
|
5729
5776
|
}
|
|
5777
|
+
async function confirmFromInvo(p) {
|
|
5778
|
+
if (!p.sessionId || !p.invoSessionToken) return null;
|
|
5779
|
+
let result;
|
|
5780
|
+
try {
|
|
5781
|
+
result = await invo.getCheckoutStatus({ sessionId: p.sessionId, sessionToken: p.invoSessionToken });
|
|
5782
|
+
} catch (err) {
|
|
5783
|
+
log("warn", "checkout status read failed", { code: err instanceof InvoError ? err.code : "ERROR" });
|
|
5784
|
+
return null;
|
|
5785
|
+
}
|
|
5786
|
+
if (!result.terminal) return null;
|
|
5787
|
+
const at = iso();
|
|
5788
|
+
return store.transact((s) => {
|
|
5789
|
+
const purchase = s.purchases[p.purchaseRef];
|
|
5790
|
+
if (!purchase || purchase.status !== "pending") return purchase ?? null;
|
|
5791
|
+
if (result.status === "credited") {
|
|
5792
|
+
const amount = toNumber(result.coinsCredited) ?? 0;
|
|
5793
|
+
const orderId = result.orderId ?? "";
|
|
5794
|
+
const ref = `order:${orderId}`;
|
|
5795
|
+
if (orderId && !s.ledgerRefs[ref]) {
|
|
5796
|
+
addLedger(s, { playerId: purchase.playerId, currency: "premium", amount, reason: "premium purchase (INVO, confirmed by status)", ref, at });
|
|
5797
|
+
}
|
|
5798
|
+
purchase.status = "credited";
|
|
5799
|
+
purchase.credited = amount;
|
|
5800
|
+
purchase.orderId = orderId || null;
|
|
5801
|
+
} else {
|
|
5802
|
+
purchase.status = "failed";
|
|
5803
|
+
}
|
|
5804
|
+
purchase.updatedAt = at;
|
|
5805
|
+
return purchase;
|
|
5806
|
+
});
|
|
5807
|
+
}
|
|
5730
5808
|
async function webhook(request) {
|
|
5731
5809
|
const raw = await readText(request);
|
|
5732
5810
|
let event;
|
|
@@ -6100,7 +6178,7 @@ function createInvoGameServer(options) {
|
|
|
6100
6178
|
const { player } = await sessionPlayer(request);
|
|
6101
6179
|
const move = await store.read((s) => s.demoMoves?.[id] ?? null);
|
|
6102
6180
|
if (!move || move.fromPlayerId !== player.id) throw new GameServerError(404, "TRANSFER_NOT_FOUND", "That transfer isn't yours to approve.");
|
|
6103
|
-
if (move.status !== "started") return json(200, { status: "approved", claimCode:
|
|
6181
|
+
if (move.status !== "started") return json(200, { status: "approved", claimCode: null, replayed: true });
|
|
6104
6182
|
try {
|
|
6105
6183
|
const approved = await invo.sandbox.approveDemoMove(id, move.kind);
|
|
6106
6184
|
await store.transact((s) => {
|
|
@@ -6112,7 +6190,7 @@ function createInvoGameServer(options) {
|
|
|
6112
6190
|
}
|
|
6113
6191
|
});
|
|
6114
6192
|
log("info", "demo transfer approved", { kind: move.kind, playerId: player.id, transactionId: id });
|
|
6115
|
-
return json(200, { status: "approved", claimCode:
|
|
6193
|
+
return json(200, { status: "approved", claimCode: null, replayed: false });
|
|
6116
6194
|
} catch (err) {
|
|
6117
6195
|
if (err instanceof InvoError) throw fromInvoError(err);
|
|
6118
6196
|
throw err;
|
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-BAOn3KH3.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-BAOn3KH3.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
5
|
export { I as InvoError } from './types-BTbZicgj.cjs';
|
|
6
|
-
export { S as SDK_VERSION } from './version-
|
|
6
|
+
export { S as SDK_VERSION } from './version-CR7XECyP.cjs';
|
|
7
7
|
import './loyalty-events-CmDw2ZoR.cjs';
|
|
8
8
|
|
|
9
9
|
interface StoredPlayer {
|
|
@@ -38,6 +38,8 @@ interface StoredPurchase {
|
|
|
38
38
|
playerId: string;
|
|
39
39
|
packId: string;
|
|
40
40
|
sessionId: string;
|
|
41
|
+
/** INVO's checkout session token, kept on the server to confirm the purchase if the webhook can't arrive. */
|
|
42
|
+
invoSessionToken?: string;
|
|
41
43
|
status: GamePurchaseStatus;
|
|
42
44
|
credited: number | null;
|
|
43
45
|
orderId: string | null;
|
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-DHmQU1eN.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-DHmQU1eN.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
5
|
export { I as InvoError } from './types-BTbZicgj.js';
|
|
6
|
-
export { S as SDK_VERSION } from './version-
|
|
6
|
+
export { S as SDK_VERSION } from './version-CR7XECyP.js';
|
|
7
7
|
import './loyalty-events-CmDw2ZoR.js';
|
|
8
8
|
|
|
9
9
|
interface StoredPlayer {
|
|
@@ -38,6 +38,8 @@ interface StoredPurchase {
|
|
|
38
38
|
playerId: string;
|
|
39
39
|
packId: string;
|
|
40
40
|
sessionId: string;
|
|
41
|
+
/** INVO's checkout session token, kept on the server to confirm the purchase if the webhook can't arrive. */
|
|
42
|
+
invoSessionToken?: string;
|
|
41
43
|
status: GamePurchaseStatus;
|
|
42
44
|
credited: number | null;
|
|
43
45
|
orderId: string | null;
|
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-V2RQYQQD.js';
|
|
2
|
+
export { DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, PRODUCTION_BASE_URL, SANDBOX_BASE_URL, baseUrlForKey, isDemoKey, resolveEnvironment, verifyInvoSignature } from './chunk-V2RQYQQD.js';
|
|
3
|
+
export { SDK_VERSION } from './chunk-3ECVREIM.js';
|
|
4
|
+
import { InvoError } from './chunk-TCT2QSVB.js';
|
|
5
|
+
export { InvoError } from './chunk-TCT2QSVB.js';
|
|
6
6
|
import { createHash, randomBytes } from 'crypto';
|
|
7
7
|
import { promises, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
8
8
|
import * as path from 'path';
|
|
@@ -406,6 +406,7 @@ function createInvoGameServer(options) {
|
|
|
406
406
|
playerId: player.id,
|
|
407
407
|
packId: pack.id,
|
|
408
408
|
sessionId: session.sessionId,
|
|
409
|
+
invoSessionToken: session.sessionToken || void 0,
|
|
409
410
|
status: "pending",
|
|
410
411
|
credited: null,
|
|
411
412
|
orderId: null,
|
|
@@ -419,8 +420,9 @@ function createInvoGameServer(options) {
|
|
|
419
420
|
}
|
|
420
421
|
async function purchaseStatus(request, ref) {
|
|
421
422
|
const { player } = await sessionPlayer(request);
|
|
422
|
-
|
|
423
|
+
let p = await store.read((s) => s.purchases[ref] ?? null);
|
|
423
424
|
if (!p || p.playerId !== player.id) throw new GameServerError(404, "PURCHASE_NOT_FOUND", "No such purchase.");
|
|
425
|
+
if (p.status === "pending") p = await confirmFromInvo(p) ?? p;
|
|
424
426
|
const out = {
|
|
425
427
|
purchaseRef: p.purchaseRef,
|
|
426
428
|
packId: p.packId,
|
|
@@ -431,6 +433,37 @@ function createInvoGameServer(options) {
|
|
|
431
433
|
};
|
|
432
434
|
return json(200, out);
|
|
433
435
|
}
|
|
436
|
+
async function confirmFromInvo(p) {
|
|
437
|
+
if (!p.sessionId || !p.invoSessionToken) return null;
|
|
438
|
+
let result;
|
|
439
|
+
try {
|
|
440
|
+
result = await invo.getCheckoutStatus({ sessionId: p.sessionId, sessionToken: p.invoSessionToken });
|
|
441
|
+
} catch (err) {
|
|
442
|
+
log("warn", "checkout status read failed", { code: err instanceof InvoError ? err.code : "ERROR" });
|
|
443
|
+
return null;
|
|
444
|
+
}
|
|
445
|
+
if (!result.terminal) return null;
|
|
446
|
+
const at = iso();
|
|
447
|
+
return store.transact((s) => {
|
|
448
|
+
const purchase = s.purchases[p.purchaseRef];
|
|
449
|
+
if (!purchase || purchase.status !== "pending") return purchase ?? null;
|
|
450
|
+
if (result.status === "credited") {
|
|
451
|
+
const amount = toNumber(result.coinsCredited) ?? 0;
|
|
452
|
+
const orderId = result.orderId ?? "";
|
|
453
|
+
const ref = `order:${orderId}`;
|
|
454
|
+
if (orderId && !s.ledgerRefs[ref]) {
|
|
455
|
+
addLedger(s, { playerId: purchase.playerId, currency: "premium", amount, reason: "premium purchase (INVO, confirmed by status)", ref, at });
|
|
456
|
+
}
|
|
457
|
+
purchase.status = "credited";
|
|
458
|
+
purchase.credited = amount;
|
|
459
|
+
purchase.orderId = orderId || null;
|
|
460
|
+
} else {
|
|
461
|
+
purchase.status = "failed";
|
|
462
|
+
}
|
|
463
|
+
purchase.updatedAt = at;
|
|
464
|
+
return purchase;
|
|
465
|
+
});
|
|
466
|
+
}
|
|
434
467
|
async function webhook(request) {
|
|
435
468
|
const raw = await readText(request);
|
|
436
469
|
let event;
|
|
@@ -804,7 +837,7 @@ function createInvoGameServer(options) {
|
|
|
804
837
|
const { player } = await sessionPlayer(request);
|
|
805
838
|
const move = await store.read((s) => s.demoMoves?.[id] ?? null);
|
|
806
839
|
if (!move || move.fromPlayerId !== player.id) throw new GameServerError(404, "TRANSFER_NOT_FOUND", "That transfer isn't yours to approve.");
|
|
807
|
-
if (move.status !== "started") return json(200, { status: "approved", claimCode:
|
|
840
|
+
if (move.status !== "started") return json(200, { status: "approved", claimCode: null, replayed: true });
|
|
808
841
|
try {
|
|
809
842
|
const approved = await invo.sandbox.approveDemoMove(id, move.kind);
|
|
810
843
|
await store.transact((s) => {
|
|
@@ -816,7 +849,7 @@ function createInvoGameServer(options) {
|
|
|
816
849
|
}
|
|
817
850
|
});
|
|
818
851
|
log("info", "demo transfer approved", { kind: move.kind, playerId: player.id, transactionId: id });
|
|
819
|
-
return json(200, { status: "approved", claimCode:
|
|
852
|
+
return json(200, { status: "approved", claimCode: null, replayed: false });
|
|
820
853
|
} catch (err) {
|
|
821
854
|
if (err instanceof InvoError) throw fromInvoError(err);
|
|
822
855
|
throw err;
|
package/dist/game.cjs
CHANGED
|
@@ -4582,7 +4582,7 @@ function mountInvoUI(container, economy, options = {}) {
|
|
|
4582
4582
|
seg.hidden = g.thisGame;
|
|
4583
4583
|
if (g.thisGame) draft.kind = "send";
|
|
4584
4584
|
const range = g.minimumTransfer && g.maximumTransfer ? `${g.minimumTransfer} to ${g.maximumTransfer} per transfer. ` : "";
|
|
4585
|
-
limits.textContent = g.thisGame ? `To another player of this game. INVO's network fee is 10%.` : `${g.gameName} accepts ${range}INVO's network fee is 10%.` + (status.demo ? ` In this demo
|
|
4585
|
+
limits.textContent = g.thisGame ? `To another player of this game. INVO's network fee is 10%.` : `${g.gameName} accepts ${range}INVO's network fee is 10%.` + (status.demo ? ` In this demo it's delivered to ${g.gameName} automatically once you approve.` : "");
|
|
4586
4586
|
};
|
|
4587
4587
|
game.onchange = () => {
|
|
4588
4588
|
const was = draft.kind;
|
|
@@ -4668,7 +4668,7 @@ function mountInvoUI(container, economy, options = {}) {
|
|
|
4668
4668
|
donePane(
|
|
4669
4669
|
pane,
|
|
4670
4670
|
draft.kind === "send" ? "Sent" : "Transferred",
|
|
4671
|
-
game.thisGame ? `${what} is on its way. Your friend collects it from Transfer \u2192 Collect.` : `${what} is on its way. Your friend collects it in ${game.gameName}.`,
|
|
4671
|
+
game.thisGame ? `${what} is on its way. Your friend collects it from Transfer \u2192 Collect.` : status.demo ? `${what} has been delivered to ${game.gameName}.` : `${what} is on its way. Your friend collects it in ${game.gameName}.`,
|
|
4672
4672
|
// The demo collects with the claim code on the server; only a real transfer needs it shown.
|
|
4673
4673
|
status.approval === "sandbox" ? null : claim
|
|
4674
4674
|
);
|
|
@@ -4833,7 +4833,7 @@ function mountInvoUI(container, economy, options = {}) {
|
|
|
4833
4833
|
}
|
|
4834
4834
|
|
|
4835
4835
|
// src/version.ts
|
|
4836
|
-
var SDK_VERSION = "3.30.
|
|
4836
|
+
var SDK_VERSION = "3.30.1";
|
|
4837
4837
|
|
|
4838
4838
|
exports.InvoGameEconomy = InvoGameEconomy;
|
|
4839
4839
|
exports.InvoGameError = InvoGameError;
|
package/dist/game.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { i as GamePlayer, q as GameWallet, c as GameCatalog, k as GamePurchase,
|
|
|
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
3
|
import { A as ApproveHostedResult } from './hosted-approval-DcY4U2RN.cjs';
|
|
4
4
|
import { D as DestinationGame, P as PendingCollectItem } from './types-BTbZicgj.cjs';
|
|
5
|
-
export { S as SDK_VERSION } from './version-
|
|
5
|
+
export { S as SDK_VERSION } from './version-CR7XECyP.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
|
@@ -2,7 +2,7 @@ import { i as GamePlayer, q as GameWallet, c as GameCatalog, k as GamePurchase,
|
|
|
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
3
|
import { A as ApproveHostedResult } from './hosted-approval-DiKmtjEh.js';
|
|
4
4
|
import { D as DestinationGame, P as PendingCollectItem } from './types-BTbZicgj.js';
|
|
5
|
-
export { S as SDK_VERSION } from './version-
|
|
5
|
+
export { S as SDK_VERSION } from './version-CR7XECyP.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-7O5JT3LK.js';
|
|
2
|
+
export { SDK_VERSION } from './chunk-3ECVREIM.js';
|
|
3
|
+
import { newEventId } from './chunk-TCT2QSVB.js';
|
|
4
4
|
|
|
5
5
|
// src/game/client.ts
|
|
6
6
|
var InvoGameError = class extends Error {
|
|
@@ -1337,7 +1337,7 @@ function mountInvoUI(container, economy, options = {}) {
|
|
|
1337
1337
|
seg.hidden = g.thisGame;
|
|
1338
1338
|
if (g.thisGame) draft.kind = "send";
|
|
1339
1339
|
const range = g.minimumTransfer && g.maximumTransfer ? `${g.minimumTransfer} to ${g.maximumTransfer} per transfer. ` : "";
|
|
1340
|
-
limits.textContent = g.thisGame ? `To another player of this game. INVO's network fee is 10%.` : `${g.gameName} accepts ${range}INVO's network fee is 10%.` + (status.demo ? ` In this demo
|
|
1340
|
+
limits.textContent = g.thisGame ? `To another player of this game. INVO's network fee is 10%.` : `${g.gameName} accepts ${range}INVO's network fee is 10%.` + (status.demo ? ` In this demo it's delivered to ${g.gameName} automatically once you approve.` : "");
|
|
1341
1341
|
};
|
|
1342
1342
|
game.onchange = () => {
|
|
1343
1343
|
const was = draft.kind;
|
|
@@ -1423,7 +1423,7 @@ function mountInvoUI(container, economy, options = {}) {
|
|
|
1423
1423
|
donePane(
|
|
1424
1424
|
pane,
|
|
1425
1425
|
draft.kind === "send" ? "Sent" : "Transferred",
|
|
1426
|
-
game.thisGame ? `${what} is on its way. Your friend collects it from Transfer \u2192 Collect.` : `${what} is on its way. Your friend collects it in ${game.gameName}.`,
|
|
1426
|
+
game.thisGame ? `${what} is on its way. Your friend collects it from Transfer \u2192 Collect.` : status.demo ? `${what} has been delivered to ${game.gameName}.` : `${what} is on its way. Your friend collects it in ${game.gameName}.`,
|
|
1427
1427
|
// The demo collects with the claim code on the server; only a real transfer needs it shown.
|
|
1428
1428
|
status.approval === "sandbox" ? null : claim
|
|
1429
1429
|
);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CheckoutClient, InvoClient, PlatformCommerceClient
|
|
2
|
-
export { InvoError, phoneChangeSignalMessage } from './chunk-
|
|
1
|
+
export { CheckoutClient, InvoClient, PlatformCommerceClient } from './chunk-7O5JT3LK.js';
|
|
2
|
+
export { InvoError, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, nothingWasCharged, phoneChangeSignalMessage } from './chunk-TCT2QSVB.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 PlatformOrderStatusResult, a3 as PlatformPurchaseHistoryQuery, a4 as PlatformPurchaseHistoryResult, a5 as PlatformRefundInput, a6 as PlatformRefundResult, a7 as CreateSubscriptionInput, a8 as SubscriptionResult, a9 as GetSubscriptionOptions, aa as GetSubscriptionResult, ab as ListSubscriptionsOptions, ac as SubscriptionListResult, ad as CancelSubscriptionOptions, ae as CancelResult, af as ChangeAmountResult, ag as SetPaymentMethodInput, ah as SetPaymentMethodResult, ai as RefundSubscriptionInput, aj as RefundResult, ak as SteamSubscriptionInitInput, al as SteamInitResult, am as SteamFinalizeSubscriptionResult, an as CardSetupSessionInput, ao as CardSetupSessionResult, ap as CardSetupInput, aq as CardSetupResult, ar as CardSetupConfirmInput, as as CardSetupConfirmResult, at as PlayerCardsResult, au as SandboxClockResult, av as SandboxFailureOutcome, aw as SandboxForceFailureOptions, ax as SandboxForceAuthChallengeOptions, ay as ServerConfig, az as MintPlayerTokenInput, aA as PlayerToken, aB as RegisterPlayerInput, aC as RegisterPlayerResult, aD as UpdatePlayerPhoneInput, aE as UpdatePlayerPhoneResult, aF as RequestPhoneChangeInput, aG as RequestPhoneChangeResult, aH as PhoneChangeRequest, aI as InitiateSendInput, aJ as InitiateResult, aK as InitiateTransferInput, aL as CreateCheckoutInput, aM as CreateCheckoutResult, aN as PurchaseInput, aO as PurchaseResult, aP as CurrencyPurchaseQuoteInput, aQ as CurrencyPurchaseQuote, aR as ConfirmPaymentResult, aS as OrderDetailsResult, aT as SteamPacksQuery, aU as SteamPacksResult, aV as SteamInitPurchaseInput, aW as SteamInitPurchaseResult, aX as SteamFinalizeInput, aY as SteamFinalizeResult, aZ as PurchaseItemInput, a_ as PurchaseItemResult, a$ as ItemHistoryQuery, b0 as ItemHistoryResult, b1 as ItemOrderQuery, b2 as PlayerActivityQuery, b3 as PlayerActivityResult, b4 as PlayerActivityEntry, b5 as PlayerBalanceQuery, b6 as PlayerBalanceResult, q as LoyaltyCardsResult, b7 as InboundPendingQuery, b8 as InboundPendingResult, b9 as LinkedIdentitiesQuery, ba as LinkedIdentitiesResult, bb as SmsVerifyResult, bc as ClaimTransferInput, bd as ClaimResult, be as ClaimCurrencyInput, bf as TransactionStatusResult, bg as GuardianApprovalStatusResult, bh as ServerDestinationsQuery, p as DestinationsResult, bi as PhoneShareContact, bj as PhoneShareInitiateResult, bk as PhoneShareApproveInput, bl as PhoneShareApproveResult, bm as PhoneShareStatusResult, bn as BeginDeviceApprovalInput, bo as DeviceApprovalGrant, bp as PollDeviceApprovalInput, bq as DeviceApprovalPollResult, br as ConfirmDeviceEnrollmentInput, bs as ConfirmDeviceEnrollmentResult, bt as ApproveWithDeviceCodeInput, bu as DeviceApprovalSettleResult, bv as CompleteDeviceApprovalInput, bw as CompleteDeviceApprovalResult } from './types-BTbZicgj.cjs';
|
|
1
|
+
import { I as InvoError, H as Http, $ as AuthHeader, g as CallOptions, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, a2 as PlatformOrderStatusResult, a3 as PlatformPurchaseHistoryQuery, a4 as PlatformPurchaseHistoryResult, a5 as PlatformRefundInput, a6 as PlatformRefundResult, a7 as CreateSubscriptionInput, a8 as SubscriptionResult, a9 as GetSubscriptionOptions, aa as GetSubscriptionResult, ab as ListSubscriptionsOptions, ac as SubscriptionListResult, ad as CancelSubscriptionOptions, ae as CancelResult, af as ChangeAmountResult, ag as SetPaymentMethodInput, ah as SetPaymentMethodResult, ai as RefundSubscriptionInput, aj as RefundResult, ak as SteamSubscriptionInitInput, al as SteamInitResult, am as SteamFinalizeSubscriptionResult, an as CardSetupSessionInput, ao as CardSetupSessionResult, ap as CardSetupInput, aq as CardSetupResult, ar as CardSetupConfirmInput, as as CardSetupConfirmResult, at as PlayerCardsResult, au as SandboxClockResult, av as SandboxFailureOutcome, aw as SandboxForceFailureOptions, ax as SandboxForceAuthChallengeOptions, ay as ServerConfig, az as MintPlayerTokenInput, aA as PlayerToken, aB as RegisterPlayerInput, aC as RegisterPlayerResult, aD as UpdatePlayerPhoneInput, aE as UpdatePlayerPhoneResult, aF as RequestPhoneChangeInput, aG as RequestPhoneChangeResult, aH as PhoneChangeRequest, aI as InitiateSendInput, aJ as InitiateResult, aK as InitiateTransferInput, aL as CreateCheckoutInput, aM as CreateCheckoutResult, a as PurchaseStatusResult, aN as PurchaseInput, aO as PurchaseResult, aP as CurrencyPurchaseQuoteInput, aQ as CurrencyPurchaseQuote, aR as ConfirmPaymentResult, aS as OrderDetailsResult, aT as SteamPacksQuery, aU as SteamPacksResult, aV as SteamInitPurchaseInput, aW as SteamInitPurchaseResult, aX as SteamFinalizeInput, aY as SteamFinalizeResult, aZ as PurchaseItemInput, a_ as PurchaseItemResult, a$ as ItemHistoryQuery, b0 as ItemHistoryResult, b1 as ItemOrderQuery, b2 as PlayerActivityQuery, b3 as PlayerActivityResult, b4 as PlayerActivityEntry, b5 as PlayerBalanceQuery, b6 as PlayerBalanceResult, q as LoyaltyCardsResult, b7 as InboundPendingQuery, b8 as InboundPendingResult, b9 as LinkedIdentitiesQuery, ba as LinkedIdentitiesResult, bb as SmsVerifyResult, bc as ClaimTransferInput, bd as ClaimResult, be as ClaimCurrencyInput, bf as TransactionStatusResult, bg as GuardianApprovalStatusResult, bh as ServerDestinationsQuery, p as DestinationsResult, bi as PhoneShareContact, bj as PhoneShareInitiateResult, bk as PhoneShareApproveInput, bl as PhoneShareApproveResult, bm as PhoneShareStatusResult, bn as BeginDeviceApprovalInput, bo as DeviceApprovalGrant, bp as PollDeviceApprovalInput, bq as DeviceApprovalPollResult, br as ConfirmDeviceEnrollmentInput, bs as ConfirmDeviceEnrollmentResult, bt as ApproveWithDeviceCodeInput, bu as DeviceApprovalSettleResult, bv as CompleteDeviceApprovalInput, bw as CompleteDeviceApprovalResult } from './types-BTbZicgj.cjs';
|
|
2
2
|
import { b as ReportServerGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.cjs';
|
|
3
|
-
import './version-
|
|
3
|
+
import './version-CR7XECyP.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Pick the INVO environment from the game secret alone (3.28.0).
|
|
@@ -1736,6 +1736,17 @@ declare class InvoServer {
|
|
|
1736
1736
|
* handles cards, saved cards, and 3-D Secure. Crediting is server-side via the
|
|
1737
1737
|
* purchase.completed webhook. */
|
|
1738
1738
|
createCheckout(input: CreateCheckoutInput, opts?: CallOptions): Promise<CreateCheckoutResult>;
|
|
1739
|
+
/**
|
|
1740
|
+
* Read a hosted checkout's status from INVO, server-side, with the session token that
|
|
1741
|
+
* {@link createCheckout} returned. Same answer as the browser's
|
|
1742
|
+
* `invo.checkout.getPurchaseStatus`. A game server uses it to confirm a purchase when
|
|
1743
|
+
* the signed webhook cannot reach it (for example a private development preview).
|
|
1744
|
+
* It is INVO's own record, read over TLS with the session credential, never the buyer's word.
|
|
1745
|
+
*/
|
|
1746
|
+
getCheckoutStatus(input: {
|
|
1747
|
+
sessionId: string;
|
|
1748
|
+
sessionToken: string;
|
|
1749
|
+
}, opts?: CallOptions): Promise<PurchaseStatusResult>;
|
|
1739
1750
|
/**
|
|
1740
1751
|
* Direct purchase via the rail selector. Use when you need a specific rail.
|
|
1741
1752
|
* - rail "platform" (default): standard card. May return status "requires_action"
|
|
@@ -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 PlatformOrderStatusResult, a3 as PlatformPurchaseHistoryQuery, a4 as PlatformPurchaseHistoryResult, a5 as PlatformRefundInput, a6 as PlatformRefundResult, a7 as CreateSubscriptionInput, a8 as SubscriptionResult, a9 as GetSubscriptionOptions, aa as GetSubscriptionResult, ab as ListSubscriptionsOptions, ac as SubscriptionListResult, ad as CancelSubscriptionOptions, ae as CancelResult, af as ChangeAmountResult, ag as SetPaymentMethodInput, ah as SetPaymentMethodResult, ai as RefundSubscriptionInput, aj as RefundResult, ak as SteamSubscriptionInitInput, al as SteamInitResult, am as SteamFinalizeSubscriptionResult, an as CardSetupSessionInput, ao as CardSetupSessionResult, ap as CardSetupInput, aq as CardSetupResult, ar as CardSetupConfirmInput, as as CardSetupConfirmResult, at as PlayerCardsResult, au as SandboxClockResult, av as SandboxFailureOutcome, aw as SandboxForceFailureOptions, ax as SandboxForceAuthChallengeOptions, ay as ServerConfig, az as MintPlayerTokenInput, aA as PlayerToken, aB as RegisterPlayerInput, aC as RegisterPlayerResult, aD as UpdatePlayerPhoneInput, aE as UpdatePlayerPhoneResult, aF as RequestPhoneChangeInput, aG as RequestPhoneChangeResult, aH as PhoneChangeRequest, aI as InitiateSendInput, aJ as InitiateResult, aK as InitiateTransferInput, aL as CreateCheckoutInput, aM as CreateCheckoutResult, aN as PurchaseInput, aO as PurchaseResult, aP as CurrencyPurchaseQuoteInput, aQ as CurrencyPurchaseQuote, aR as ConfirmPaymentResult, aS as OrderDetailsResult, aT as SteamPacksQuery, aU as SteamPacksResult, aV as SteamInitPurchaseInput, aW as SteamInitPurchaseResult, aX as SteamFinalizeInput, aY as SteamFinalizeResult, aZ as PurchaseItemInput, a_ as PurchaseItemResult, a$ as ItemHistoryQuery, b0 as ItemHistoryResult, b1 as ItemOrderQuery, b2 as PlayerActivityQuery, b3 as PlayerActivityResult, b4 as PlayerActivityEntry, b5 as PlayerBalanceQuery, b6 as PlayerBalanceResult, q as LoyaltyCardsResult, b7 as InboundPendingQuery, b8 as InboundPendingResult, b9 as LinkedIdentitiesQuery, ba as LinkedIdentitiesResult, bb as SmsVerifyResult, bc as ClaimTransferInput, bd as ClaimResult, be as ClaimCurrencyInput, bf as TransactionStatusResult, bg as GuardianApprovalStatusResult, bh as ServerDestinationsQuery, p as DestinationsResult, bi as PhoneShareContact, bj as PhoneShareInitiateResult, bk as PhoneShareApproveInput, bl as PhoneShareApproveResult, bm as PhoneShareStatusResult, bn as BeginDeviceApprovalInput, bo as DeviceApprovalGrant, bp as PollDeviceApprovalInput, bq as DeviceApprovalPollResult, br as ConfirmDeviceEnrollmentInput, bs as ConfirmDeviceEnrollmentResult, bt as ApproveWithDeviceCodeInput, bu as DeviceApprovalSettleResult, bv as CompleteDeviceApprovalInput, bw as CompleteDeviceApprovalResult } from './types-BTbZicgj.js';
|
|
1
|
+
import { I as InvoError, H as Http, $ as AuthHeader, g as CallOptions, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, a2 as PlatformOrderStatusResult, a3 as PlatformPurchaseHistoryQuery, a4 as PlatformPurchaseHistoryResult, a5 as PlatformRefundInput, a6 as PlatformRefundResult, a7 as CreateSubscriptionInput, a8 as SubscriptionResult, a9 as GetSubscriptionOptions, aa as GetSubscriptionResult, ab as ListSubscriptionsOptions, ac as SubscriptionListResult, ad as CancelSubscriptionOptions, ae as CancelResult, af as ChangeAmountResult, ag as SetPaymentMethodInput, ah as SetPaymentMethodResult, ai as RefundSubscriptionInput, aj as RefundResult, ak as SteamSubscriptionInitInput, al as SteamInitResult, am as SteamFinalizeSubscriptionResult, an as CardSetupSessionInput, ao as CardSetupSessionResult, ap as CardSetupInput, aq as CardSetupResult, ar as CardSetupConfirmInput, as as CardSetupConfirmResult, at as PlayerCardsResult, au as SandboxClockResult, av as SandboxFailureOutcome, aw as SandboxForceFailureOptions, ax as SandboxForceAuthChallengeOptions, ay as ServerConfig, az as MintPlayerTokenInput, aA as PlayerToken, aB as RegisterPlayerInput, aC as RegisterPlayerResult, aD as UpdatePlayerPhoneInput, aE as UpdatePlayerPhoneResult, aF as RequestPhoneChangeInput, aG as RequestPhoneChangeResult, aH as PhoneChangeRequest, aI as InitiateSendInput, aJ as InitiateResult, aK as InitiateTransferInput, aL as CreateCheckoutInput, aM as CreateCheckoutResult, a as PurchaseStatusResult, aN as PurchaseInput, aO as PurchaseResult, aP as CurrencyPurchaseQuoteInput, aQ as CurrencyPurchaseQuote, aR as ConfirmPaymentResult, aS as OrderDetailsResult, aT as SteamPacksQuery, aU as SteamPacksResult, aV as SteamInitPurchaseInput, aW as SteamInitPurchaseResult, aX as SteamFinalizeInput, aY as SteamFinalizeResult, aZ as PurchaseItemInput, a_ as PurchaseItemResult, a$ as ItemHistoryQuery, b0 as ItemHistoryResult, b1 as ItemOrderQuery, b2 as PlayerActivityQuery, b3 as PlayerActivityResult, b4 as PlayerActivityEntry, b5 as PlayerBalanceQuery, b6 as PlayerBalanceResult, q as LoyaltyCardsResult, b7 as InboundPendingQuery, b8 as InboundPendingResult, b9 as LinkedIdentitiesQuery, ba as LinkedIdentitiesResult, bb as SmsVerifyResult, bc as ClaimTransferInput, bd as ClaimResult, be as ClaimCurrencyInput, bf as TransactionStatusResult, bg as GuardianApprovalStatusResult, bh as ServerDestinationsQuery, p as DestinationsResult, bi as PhoneShareContact, bj as PhoneShareInitiateResult, bk as PhoneShareApproveInput, bl as PhoneShareApproveResult, bm as PhoneShareStatusResult, bn as BeginDeviceApprovalInput, bo as DeviceApprovalGrant, bp as PollDeviceApprovalInput, bq as DeviceApprovalPollResult, br as ConfirmDeviceEnrollmentInput, bs as ConfirmDeviceEnrollmentResult, bt as ApproveWithDeviceCodeInput, bu as DeviceApprovalSettleResult, bv as CompleteDeviceApprovalInput, bw as CompleteDeviceApprovalResult } from './types-BTbZicgj.js';
|
|
2
2
|
import { b as ReportServerGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.js';
|
|
3
|
-
import './version-
|
|
3
|
+
import './version-CR7XECyP.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Pick the INVO environment from the game secret alone (3.28.0).
|
|
@@ -1736,6 +1736,17 @@ declare class InvoServer {
|
|
|
1736
1736
|
* handles cards, saved cards, and 3-D Secure. Crediting is server-side via the
|
|
1737
1737
|
* purchase.completed webhook. */
|
|
1738
1738
|
createCheckout(input: CreateCheckoutInput, opts?: CallOptions): Promise<CreateCheckoutResult>;
|
|
1739
|
+
/**
|
|
1740
|
+
* Read a hosted checkout's status from INVO, server-side, with the session token that
|
|
1741
|
+
* {@link createCheckout} returned. Same answer as the browser's
|
|
1742
|
+
* `invo.checkout.getPurchaseStatus`. A game server uses it to confirm a purchase when
|
|
1743
|
+
* the signed webhook cannot reach it (for example a private development preview).
|
|
1744
|
+
* It is INVO's own record, read over TLS with the session credential, never the buyer's word.
|
|
1745
|
+
*/
|
|
1746
|
+
getCheckoutStatus(input: {
|
|
1747
|
+
sessionId: string;
|
|
1748
|
+
sessionToken: string;
|
|
1749
|
+
}, opts?: CallOptions): Promise<PurchaseStatusResult>;
|
|
1739
1750
|
/**
|
|
1740
1751
|
* Direct purchase via the rail selector. Use when you need a specific rail.
|
|
1741
1752
|
* - rail "platform" (default): standard card. May return status "requires_action"
|
package/dist/server.cjs
CHANGED
|
@@ -1386,10 +1386,53 @@ function toDestinationsResult(raw, direction) {
|
|
|
1386
1386
|
};
|
|
1387
1387
|
}
|
|
1388
1388
|
|
|
1389
|
+
// src/shared/receipt-fields.ts
|
|
1390
|
+
function creditFields(raw) {
|
|
1391
|
+
const c = raw["credited"];
|
|
1392
|
+
if (c === true) return { credited: true };
|
|
1393
|
+
if (c === false) {
|
|
1394
|
+
const r = raw["reason_code"];
|
|
1395
|
+
return { credited: false, reasonCode: r == null ? null : String(r) };
|
|
1396
|
+
}
|
|
1397
|
+
return {};
|
|
1398
|
+
}
|
|
1399
|
+
function receiptFields(raw) {
|
|
1400
|
+
const n = raw["receipt_number"];
|
|
1401
|
+
if (typeof n !== "string" || n === "") return {};
|
|
1402
|
+
const u = raw["receipt_url"];
|
|
1403
|
+
return typeof u === "string" && u !== "" ? { receiptNumber: n, receiptUrl: u } : { receiptNumber: n };
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
// src/shared/purchase-status.ts
|
|
1407
|
+
function str(v) {
|
|
1408
|
+
return typeof v === "string" ? v : v === null || v === void 0 ? null : String(v);
|
|
1409
|
+
}
|
|
1410
|
+
function toPurchaseStatusResult(raw, sessionId) {
|
|
1411
|
+
return {
|
|
1412
|
+
status: String(raw["status"] ?? ""),
|
|
1413
|
+
// INVO SAYS, AND ONLY AN EXPLICIT `true` SAYS IT. A missing or malformed field reads
|
|
1414
|
+
// false, which keeps a poll running; the alternative, guessing terminality from
|
|
1415
|
+
// `status`, is how an old SDK declares a future status finished.
|
|
1416
|
+
terminal: raw["terminal"] === true,
|
|
1417
|
+
orderId: str(raw["order_id"]),
|
|
1418
|
+
sessionId: String(raw["session_id"] ?? sessionId),
|
|
1419
|
+
coinsCredited: str(raw["coins_credited"]),
|
|
1420
|
+
transactionId: str(raw["transaction_id"]),
|
|
1421
|
+
newBalance: str(raw["new_balance"]),
|
|
1422
|
+
reasonCode: str(raw["reason_code"]),
|
|
1423
|
+
message: str(raw["message"]),
|
|
1424
|
+
amountChargedUsd: str(raw["amount_charged_usd"]),
|
|
1425
|
+
listedUsd: str(raw["listed_usd"]),
|
|
1426
|
+
currencyName: str(raw["currency_name"]),
|
|
1427
|
+
...receiptFields(raw),
|
|
1428
|
+
raw
|
|
1429
|
+
};
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1389
1432
|
// src/shared/loyalty.ts
|
|
1390
1433
|
var obj = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
1391
1434
|
var rows = (v) => Array.isArray(v) ? v.filter((r) => r && typeof r === "object" && !Array.isArray(r)) : [];
|
|
1392
|
-
var
|
|
1435
|
+
var str2 = (v) => v === void 0 || v === null ? "" : String(v);
|
|
1393
1436
|
var strOrNull = (v) => v === void 0 || v === null ? null : String(v);
|
|
1394
1437
|
var numOrNull = (v) => typeof v === "number" && Number.isFinite(v) ? v : null;
|
|
1395
1438
|
var int = (v, fallback = 0) => typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
@@ -1406,22 +1449,22 @@ function toStep(row) {
|
|
|
1406
1449
|
return {
|
|
1407
1450
|
stepId: strOrNull(row["step_id"]),
|
|
1408
1451
|
index: int(row["index"]),
|
|
1409
|
-
action:
|
|
1410
|
-
label:
|
|
1411
|
-
summary:
|
|
1452
|
+
action: str2(row["action"]),
|
|
1453
|
+
label: str2(row["label"]),
|
|
1454
|
+
summary: str2(row["summary"]),
|
|
1412
1455
|
windowHours: numOrNull(row["window_hours"]),
|
|
1413
|
-
state:
|
|
1456
|
+
state: str2(row["state"]),
|
|
1414
1457
|
progress: toLoyaltyStepProgress(row["progress"]),
|
|
1415
1458
|
raw: row
|
|
1416
1459
|
};
|
|
1417
1460
|
}
|
|
1418
1461
|
function toCardReward(row) {
|
|
1419
1462
|
return {
|
|
1420
|
-
vaultEntryId:
|
|
1421
|
-
rewardId:
|
|
1422
|
-
state:
|
|
1423
|
-
unlockedAt:
|
|
1424
|
-
expiresAt:
|
|
1463
|
+
vaultEntryId: str2(row["vault_entry_id"]),
|
|
1464
|
+
rewardId: str2(row["reward_id"]),
|
|
1465
|
+
state: str2(row["state"]),
|
|
1466
|
+
unlockedAt: str2(row["unlocked_at"]),
|
|
1467
|
+
expiresAt: str2(row["expires_at"]),
|
|
1425
1468
|
redeemedAt: strOrNull(row["redeemed_at"]),
|
|
1426
1469
|
codeMasked: strOrNull(row["code_masked"]),
|
|
1427
1470
|
canRedeem: row["can_redeem"] === true,
|
|
@@ -1436,18 +1479,18 @@ function toLoyaltyCard(row) {
|
|
|
1436
1479
|
const steps = rows(row["steps"]).map(toStep);
|
|
1437
1480
|
return {
|
|
1438
1481
|
cardVersion: passThrough(row["card_version"]),
|
|
1439
|
-
mode:
|
|
1482
|
+
mode: str2(row["mode"]),
|
|
1440
1483
|
programId: strOrNull(row["program_id"]),
|
|
1441
1484
|
questId: strOrNull(row["quest_id"]),
|
|
1442
1485
|
questVersion: numOrNull(row["quest_version"]),
|
|
1443
1486
|
campaignId: strOrNull(row["campaign_id"]),
|
|
1444
|
-
title:
|
|
1445
|
-
description:
|
|
1487
|
+
title: str2(row["title"]),
|
|
1488
|
+
description: str2(row["description"]),
|
|
1446
1489
|
brand: { name: strOrNull(brand["name"]), logoUrl: strOrNull(brand["logo_url"]) },
|
|
1447
1490
|
artUrl: strOrNull(row["art_url"]),
|
|
1448
1491
|
reward: { rewardId: strOrNull(reward["reward_id"]), name: strOrNull(reward["name"]) },
|
|
1449
|
-
orderMode:
|
|
1450
|
-
status:
|
|
1492
|
+
orderMode: str2(row["order_mode"]),
|
|
1493
|
+
status: str2(row["status"]),
|
|
1451
1494
|
startsAt: strOrNull(row["starts_at"]),
|
|
1452
1495
|
endsAt: strOrNull(row["ends_at"]),
|
|
1453
1496
|
completionHours: numOrNull(row["completion_hours"]),
|
|
@@ -1534,23 +1577,6 @@ function toReportGameEventResult(raw, eventId) {
|
|
|
1534
1577
|
};
|
|
1535
1578
|
}
|
|
1536
1579
|
|
|
1537
|
-
// src/shared/receipt-fields.ts
|
|
1538
|
-
function creditFields(raw) {
|
|
1539
|
-
const c = raw["credited"];
|
|
1540
|
-
if (c === true) return { credited: true };
|
|
1541
|
-
if (c === false) {
|
|
1542
|
-
const r = raw["reason_code"];
|
|
1543
|
-
return { credited: false, reasonCode: r == null ? null : String(r) };
|
|
1544
|
-
}
|
|
1545
|
-
return {};
|
|
1546
|
-
}
|
|
1547
|
-
function receiptFields(raw) {
|
|
1548
|
-
const n = raw["receipt_number"];
|
|
1549
|
-
if (typeof n !== "string" || n === "") return {};
|
|
1550
|
-
const u = raw["receipt_url"];
|
|
1551
|
-
return typeof u === "string" && u !== "" ? { receiptNumber: n, receiptUrl: u } : { receiptNumber: n };
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
1580
|
// src/shared/phone-change.ts
|
|
1555
1581
|
function requireField(value, field, raw) {
|
|
1556
1582
|
const s = value == null ? "" : String(value);
|
|
@@ -1564,16 +1590,16 @@ function requireField(value, field, raw) {
|
|
|
1564
1590
|
}
|
|
1565
1591
|
return s;
|
|
1566
1592
|
}
|
|
1567
|
-
var
|
|
1593
|
+
var str3 = (v) => v == null ? "" : String(v);
|
|
1568
1594
|
var strOrNull2 = (v) => typeof v === "string" ? v : v == null ? null : String(v);
|
|
1569
1595
|
function toRequestPhoneChangeResult(raw) {
|
|
1570
1596
|
return {
|
|
1571
1597
|
changeRequestId: requireField(raw["change_request_id"], "change_request_id", raw),
|
|
1572
1598
|
status: requireField(raw["status"], "status", raw),
|
|
1573
|
-
expiresAt:
|
|
1574
|
-
delivery:
|
|
1575
|
-
confirmation:
|
|
1576
|
-
message:
|
|
1599
|
+
expiresAt: str3(raw["expires_at"]),
|
|
1600
|
+
delivery: str3(raw["delivery"]),
|
|
1601
|
+
confirmation: str3(raw["confirmation"]),
|
|
1602
|
+
message: str3(raw["message"]),
|
|
1577
1603
|
raw
|
|
1578
1604
|
};
|
|
1579
1605
|
}
|
|
@@ -1581,8 +1607,8 @@ function toPhoneChangeRequest(raw) {
|
|
|
1581
1607
|
return {
|
|
1582
1608
|
changeRequestId: requireField(raw["change_request_id"], "change_request_id", raw),
|
|
1583
1609
|
status: requireField(raw["status"], "status", raw),
|
|
1584
|
-
confirmation:
|
|
1585
|
-
delivery:
|
|
1610
|
+
confirmation: str3(raw["confirmation"]),
|
|
1611
|
+
delivery: str3(raw["delivery"]),
|
|
1586
1612
|
newPhoneMasked: strOrNull2(raw["new_phone_masked"]),
|
|
1587
1613
|
createdAt: strOrNull2(raw["created_at"]),
|
|
1588
1614
|
expiresAt: strOrNull2(raw["expires_at"]),
|
|
@@ -1593,7 +1619,7 @@ function toPhoneChangeRequest(raw) {
|
|
|
1593
1619
|
}
|
|
1594
1620
|
|
|
1595
1621
|
// src/version.ts
|
|
1596
|
-
var SDK_VERSION = "3.30.
|
|
1622
|
+
var SDK_VERSION = "3.30.1";
|
|
1597
1623
|
|
|
1598
1624
|
// src/payouts.ts
|
|
1599
1625
|
var AMOUNT = /^\d+(\.\d{1,2})?$/;
|
|
@@ -4119,6 +4145,25 @@ var InvoServer = class {
|
|
|
4119
4145
|
raw
|
|
4120
4146
|
};
|
|
4121
4147
|
}
|
|
4148
|
+
/**
|
|
4149
|
+
* Read a hosted checkout's status from INVO, server-side, with the session token that
|
|
4150
|
+
* {@link createCheckout} returned. Same answer as the browser's
|
|
4151
|
+
* `invo.checkout.getPurchaseStatus`. A game server uses it to confirm a purchase when
|
|
4152
|
+
* the signed webhook cannot reach it (for example a private development preview).
|
|
4153
|
+
* It is INVO's own record, read over TLS with the session credential, never the buyer's word.
|
|
4154
|
+
*/
|
|
4155
|
+
async getCheckoutStatus(input, opts) {
|
|
4156
|
+
const sessionId = String(input?.sessionId ?? "").trim();
|
|
4157
|
+
const sessionToken = String(input?.sessionToken ?? "").trim();
|
|
4158
|
+
if (!sessionId) throw invalidInput2("sessionId", input?.sessionId, "is required");
|
|
4159
|
+
if (!sessionToken) throw invalidInput2("sessionToken", "(hidden)", "is required");
|
|
4160
|
+
const raw = await this.http.get(
|
|
4161
|
+
`/api/checkout/sessions/${encodeURIComponent(sessionId)}`,
|
|
4162
|
+
{ kind: "bearer", token: sessionToken },
|
|
4163
|
+
{ signal: opts?.signal }
|
|
4164
|
+
);
|
|
4165
|
+
return toPurchaseStatusResult(raw, sessionId);
|
|
4166
|
+
}
|
|
4122
4167
|
/**
|
|
4123
4168
|
* Direct purchase via the rail selector. Use when you need a specific rail.
|
|
4124
4169
|
* - rail "platform" (default): standard card. May return status "requires_action"
|
package/dist/server.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { bt as ApproveWithDeviceCodeInput, bn as BeginDeviceApprovalInput, g as CallOptions, ae as CancelResult, ad as CancelSubscriptionOptions, ar as CardSetupConfirmInput, as as CardSetupConfirmResult, ap as CardSetupInput, aq as CardSetupResult, an as CardSetupSessionInput, ao as CardSetupSessionResult, bx as CardSetupStatus, af as ChangeAmountResult, by as CheckoutWarning, be as ClaimCurrencyInput, y as ClaimDelivery, bd as ClaimResult, bc as ClaimTransferInput, bv as CompleteDeviceApprovalInput, bw as CompleteDeviceApprovalResult, br as ConfirmDeviceEnrollmentInput, bs as ConfirmDeviceEnrollmentResult, aR as ConfirmPaymentResult, aL as CreateCheckoutInput, aM as CreateCheckoutResult, a7 as CreateSubscriptionInput, bz as CurrencyBalance, aQ as CurrencyPurchaseQuote, bA as CurrencyPurchaseQuoteBreakdown, aP as CurrencyPurchaseQuoteInput, D as DestinationGame, p as DestinationsResult, bB as DeviceApprovalChannel, bC as DeviceApprovalEnrollment, bD as DeviceApprovalFlow, bo as DeviceApprovalGrant, bq as DeviceApprovalPollResult, bE as DeviceApprovalPollStatus, bu as DeviceApprovalSettleResult, bF as DeviceEnrollmentDecision, bG as DeviceEnrollmentRespond, bH as ExpiryReason, bI as FeeTakenFrom, bJ as FirstCharge, bK as FirstChargeStatus, bL as FundingSource, a9 as GetSubscriptionOptions, aa as GetSubscriptionResult, bg as GuardianApprovalStatusResult, bM as InboundPendingItem, b7 as InboundPendingQuery, b8 as InboundPendingResult, aJ as InitiateResult, aI as InitiateSendInput, aK as InitiateTransferInput, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, a$ as ItemHistoryQuery, b0 as ItemHistoryResult, b1 as ItemOrderQuery, b9 as LinkedIdentitiesQuery, ba as LinkedIdentitiesResult, bN as LinkedIdentityEmail, ab as ListSubscriptionsOptions, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, q as LoyaltyCardsResult, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, bO as MinPurchaseWarning, az as MintPlayerTokenInput, aS as OrderDetailsResult, bP as PhoneChangeConfirmation, aH as PhoneChangeRequest, bQ as PhoneChangeRequestStatus, bk as PhoneShareApproveInput, bl as PhoneShareApproveResult, bi as PhoneShareContact, bj as PhoneShareInitiateResult, bm as PhoneShareStatusResult, a2 as PlatformOrderStatusResult, a3 as PlatformPurchaseHistoryQuery, a4 as PlatformPurchaseHistoryResult, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, bR as PlatformPurchaseStatus, a5 as PlatformRefundInput, a6 as PlatformRefundResult, b4 as PlayerActivityEntry, b2 as PlayerActivityQuery, b3 as PlayerActivityResult, bS as PlayerActivityType, b5 as PlayerBalanceQuery, b6 as PlayerBalanceResult, at as PlayerCardsResult, aA as PlayerToken, bp as PollDeviceApprovalInput, aN as PurchaseInput, aZ as PurchaseItemInput, a_ as PurchaseItemResult, aO as PurchaseResult, Z as Rail, bT as RefundInitiation, bU as RefundPendingApproval, bV as RefundProcessingFeeBasis, bW as RefundReceipt, aj as RefundResult, bX as RefundRevenueShareAttribution, ai as RefundSubscriptionInput, bY as RefundWarning, aB as RegisterPlayerInput, aC as RegisterPlayerResult, aF as RequestPhoneChangeInput, aG as RequestPhoneChangeResult, au as SandboxClockResult, bZ as SandboxClockState, av as SandboxFailureOutcome, ax as SandboxForceAuthChallengeOptions, aw as SandboxForceFailureOptions, b_ as SavedCard, ay as ServerConfig, bh as ServerDestinationsQuery, ag as SetPaymentMethodInput, ah as SetPaymentMethodResult, bb as SmsVerifyResult, aX as SteamFinalizeInput, aY as SteamFinalizeResult, am as SteamFinalizeSubscriptionResult, aV as SteamInitPurchaseInput, aW as SteamInitPurchaseResult, al as SteamInitResult, b$ as SteamPack, aT as SteamPacksQuery, aU as SteamPacksResult, ak as SteamSubscriptionInitInput, c0 as SteamUserSession, c1 as Subscription, c2 as SubscriptionBaseInput, c3 as SubscriptionConsent, c4 as SubscriptionConsentInput, c5 as SubscriptionFundingRail, c6 as SubscriptionInterval, ac as SubscriptionListResult, a8 as SubscriptionResult, c7 as SubscriptionRevenueShare, c8 as SubscriptionRevenueShareInput, c9 as SubscriptionStatus, bf as TransactionStatusResult, ca as UnacknowledgedPurchaseOutcome, aD as UpdatePlayerPhoneInput, aE as UpdatePlayerPhoneResult, _ as VerificationMethod, cb as isRefundPendingApproval } from './types-BTbZicgj.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, c as IdentityPasskeyResetData, a as InvoEnvironment, I as InvoServer, d as InvoWebhookEvent, e as ItemPurchasedData, L as ListPayeesQuery, f as ListPayeesResult, g as ListPayoutsQuery, h as ListPayoutsResult, P as PRODUCTION_BASE_URL, j as PayableBlocker, k as Payee, l as PayeeInvite, m as PayeeStatus, n as PayeeStatusChangedData, o as Payout, p as PayoutStatus, q as PayoutStatusChangedData, s as PayoutsServer, t as PlatformCommercePurchasedData, u as PlatformCommerceRefundedData, w as PlatformCommerceServer, x as PlayerPhoneChangedData, y as PurchaseCompletedData, z as PurchaseEventData, R as RegisterPayeeInput, A as RegisterPayeeResult, B as RequestPayoutInput, F as RequestPayoutResult, G as ReturnReasonCode, S as SANDBOX_BASE_URL, H as SandboxServer, J as SandboxSubscriptionsServer, K as SubscriptionAuthenticationRequiredData, M as SubscriptionCanceledData, N as SubscriptionEventCommon, O as SubscriptionExpiredData, Q as SubscriptionPastDueData, T as SubscriptionPaymentFailedData, U as SubscriptionRefundApprovedData, V as SubscriptionRefundDetail, W as SubscriptionRefundRejectedData, X as SubscriptionRefundRequestData, Y as SubscriptionRefundedData, Z as SubscriptionRenewalFunding, _ as SubscriptionRenewalSplit, $ as SubscriptionRenewedData, a0 as SubscriptionRevenueShareAttribution, a1 as SubscriptionTrialEventFields, a2 as SubscriptionsServer, a3 as TransferEventData, a4 as VerifyWebhookOptions, a5 as WebhookHandlerOptions, b as baseUrlForKey, a6 as createWebhookHandler, i as isDemoKey, r as resolveEnvironment, a7 as verifyWebhook, a8 as verifyWebhookAsync } from './server-
|
|
4
|
-
export { S as SDK_VERSION } from './version-
|
|
3
|
+
export { C as CardsServer, D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, c as IdentityPasskeyResetData, a as InvoEnvironment, I as InvoServer, d as InvoWebhookEvent, e as ItemPurchasedData, L as ListPayeesQuery, f as ListPayeesResult, g as ListPayoutsQuery, h as ListPayoutsResult, P as PRODUCTION_BASE_URL, j as PayableBlocker, k as Payee, l as PayeeInvite, m as PayeeStatus, n as PayeeStatusChangedData, o as Payout, p as PayoutStatus, q as PayoutStatusChangedData, s as PayoutsServer, t as PlatformCommercePurchasedData, u as PlatformCommerceRefundedData, w as PlatformCommerceServer, x as PlayerPhoneChangedData, y as PurchaseCompletedData, z as PurchaseEventData, R as RegisterPayeeInput, A as RegisterPayeeResult, B as RequestPayoutInput, F as RequestPayoutResult, G as ReturnReasonCode, S as SANDBOX_BASE_URL, H as SandboxServer, J as SandboxSubscriptionsServer, K as SubscriptionAuthenticationRequiredData, M as SubscriptionCanceledData, N as SubscriptionEventCommon, O as SubscriptionExpiredData, Q as SubscriptionPastDueData, T as SubscriptionPaymentFailedData, U as SubscriptionRefundApprovedData, V as SubscriptionRefundDetail, W as SubscriptionRefundRejectedData, X as SubscriptionRefundRequestData, Y as SubscriptionRefundedData, Z as SubscriptionRenewalFunding, _ as SubscriptionRenewalSplit, $ as SubscriptionRenewedData, a0 as SubscriptionRevenueShareAttribution, a1 as SubscriptionTrialEventFields, a2 as SubscriptionsServer, a3 as TransferEventData, a4 as VerifyWebhookOptions, a5 as WebhookHandlerOptions, b as baseUrlForKey, a6 as createWebhookHandler, i as isDemoKey, r as resolveEnvironment, a7 as verifyWebhook, a8 as verifyWebhookAsync } from './server-BAOn3KH3.cjs';
|
|
4
|
+
export { S as SDK_VERSION } from './version-CR7XECyP.cjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { bt as ApproveWithDeviceCodeInput, bn as BeginDeviceApprovalInput, g as CallOptions, ae as CancelResult, ad as CancelSubscriptionOptions, ar as CardSetupConfirmInput, as as CardSetupConfirmResult, ap as CardSetupInput, aq as CardSetupResult, an as CardSetupSessionInput, ao as CardSetupSessionResult, bx as CardSetupStatus, af as ChangeAmountResult, by as CheckoutWarning, be as ClaimCurrencyInput, y as ClaimDelivery, bd as ClaimResult, bc as ClaimTransferInput, bv as CompleteDeviceApprovalInput, bw as CompleteDeviceApprovalResult, br as ConfirmDeviceEnrollmentInput, bs as ConfirmDeviceEnrollmentResult, aR as ConfirmPaymentResult, aL as CreateCheckoutInput, aM as CreateCheckoutResult, a7 as CreateSubscriptionInput, bz as CurrencyBalance, aQ as CurrencyPurchaseQuote, bA as CurrencyPurchaseQuoteBreakdown, aP as CurrencyPurchaseQuoteInput, D as DestinationGame, p as DestinationsResult, bB as DeviceApprovalChannel, bC as DeviceApprovalEnrollment, bD as DeviceApprovalFlow, bo as DeviceApprovalGrant, bq as DeviceApprovalPollResult, bE as DeviceApprovalPollStatus, bu as DeviceApprovalSettleResult, bF as DeviceEnrollmentDecision, bG as DeviceEnrollmentRespond, bH as ExpiryReason, bI as FeeTakenFrom, bJ as FirstCharge, bK as FirstChargeStatus, bL as FundingSource, a9 as GetSubscriptionOptions, aa as GetSubscriptionResult, bg as GuardianApprovalStatusResult, bM as InboundPendingItem, b7 as InboundPendingQuery, b8 as InboundPendingResult, aJ as InitiateResult, aI as InitiateSendInput, aK as InitiateTransferInput, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, a$ as ItemHistoryQuery, b0 as ItemHistoryResult, b1 as ItemOrderQuery, b9 as LinkedIdentitiesQuery, ba as LinkedIdentitiesResult, bN as LinkedIdentityEmail, ab as ListSubscriptionsOptions, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, q as LoyaltyCardsResult, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, bO as MinPurchaseWarning, az as MintPlayerTokenInput, aS as OrderDetailsResult, bP as PhoneChangeConfirmation, aH as PhoneChangeRequest, bQ as PhoneChangeRequestStatus, bk as PhoneShareApproveInput, bl as PhoneShareApproveResult, bi as PhoneShareContact, bj as PhoneShareInitiateResult, bm as PhoneShareStatusResult, a2 as PlatformOrderStatusResult, a3 as PlatformPurchaseHistoryQuery, a4 as PlatformPurchaseHistoryResult, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, bR as PlatformPurchaseStatus, a5 as PlatformRefundInput, a6 as PlatformRefundResult, b4 as PlayerActivityEntry, b2 as PlayerActivityQuery, b3 as PlayerActivityResult, bS as PlayerActivityType, b5 as PlayerBalanceQuery, b6 as PlayerBalanceResult, at as PlayerCardsResult, aA as PlayerToken, bp as PollDeviceApprovalInput, aN as PurchaseInput, aZ as PurchaseItemInput, a_ as PurchaseItemResult, aO as PurchaseResult, Z as Rail, bT as RefundInitiation, bU as RefundPendingApproval, bV as RefundProcessingFeeBasis, bW as RefundReceipt, aj as RefundResult, bX as RefundRevenueShareAttribution, ai as RefundSubscriptionInput, bY as RefundWarning, aB as RegisterPlayerInput, aC as RegisterPlayerResult, aF as RequestPhoneChangeInput, aG as RequestPhoneChangeResult, au as SandboxClockResult, bZ as SandboxClockState, av as SandboxFailureOutcome, ax as SandboxForceAuthChallengeOptions, aw as SandboxForceFailureOptions, b_ as SavedCard, ay as ServerConfig, bh as ServerDestinationsQuery, ag as SetPaymentMethodInput, ah as SetPaymentMethodResult, bb as SmsVerifyResult, aX as SteamFinalizeInput, aY as SteamFinalizeResult, am as SteamFinalizeSubscriptionResult, aV as SteamInitPurchaseInput, aW as SteamInitPurchaseResult, al as SteamInitResult, b$ as SteamPack, aT as SteamPacksQuery, aU as SteamPacksResult, ak as SteamSubscriptionInitInput, c0 as SteamUserSession, c1 as Subscription, c2 as SubscriptionBaseInput, c3 as SubscriptionConsent, c4 as SubscriptionConsentInput, c5 as SubscriptionFundingRail, c6 as SubscriptionInterval, ac as SubscriptionListResult, a8 as SubscriptionResult, c7 as SubscriptionRevenueShare, c8 as SubscriptionRevenueShareInput, c9 as SubscriptionStatus, bf as TransactionStatusResult, ca as UnacknowledgedPurchaseOutcome, aD as UpdatePlayerPhoneInput, aE as UpdatePlayerPhoneResult, _ as VerificationMethod, cb as isRefundPendingApproval } from './types-BTbZicgj.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, c as IdentityPasskeyResetData, a as InvoEnvironment, I as InvoServer, d as InvoWebhookEvent, e as ItemPurchasedData, L as ListPayeesQuery, f as ListPayeesResult, g as ListPayoutsQuery, h as ListPayoutsResult, P as PRODUCTION_BASE_URL, j as PayableBlocker, k as Payee, l as PayeeInvite, m as PayeeStatus, n as PayeeStatusChangedData, o as Payout, p as PayoutStatus, q as PayoutStatusChangedData, s as PayoutsServer, t as PlatformCommercePurchasedData, u as PlatformCommerceRefundedData, w as PlatformCommerceServer, x as PlayerPhoneChangedData, y as PurchaseCompletedData, z as PurchaseEventData, R as RegisterPayeeInput, A as RegisterPayeeResult, B as RequestPayoutInput, F as RequestPayoutResult, G as ReturnReasonCode, S as SANDBOX_BASE_URL, H as SandboxServer, J as SandboxSubscriptionsServer, K as SubscriptionAuthenticationRequiredData, M as SubscriptionCanceledData, N as SubscriptionEventCommon, O as SubscriptionExpiredData, Q as SubscriptionPastDueData, T as SubscriptionPaymentFailedData, U as SubscriptionRefundApprovedData, V as SubscriptionRefundDetail, W as SubscriptionRefundRejectedData, X as SubscriptionRefundRequestData, Y as SubscriptionRefundedData, Z as SubscriptionRenewalFunding, _ as SubscriptionRenewalSplit, $ as SubscriptionRenewedData, a0 as SubscriptionRevenueShareAttribution, a1 as SubscriptionTrialEventFields, a2 as SubscriptionsServer, a3 as TransferEventData, a4 as VerifyWebhookOptions, a5 as WebhookHandlerOptions, b as baseUrlForKey, a6 as createWebhookHandler, i as isDemoKey, r as resolveEnvironment, a7 as verifyWebhook, a8 as verifyWebhookAsync } from './server-
|
|
4
|
-
export { S as SDK_VERSION } from './version-
|
|
3
|
+
export { C as CardsServer, D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, c as IdentityPasskeyResetData, a as InvoEnvironment, I as InvoServer, d as InvoWebhookEvent, e as ItemPurchasedData, L as ListPayeesQuery, f as ListPayeesResult, g as ListPayoutsQuery, h as ListPayoutsResult, P as PRODUCTION_BASE_URL, j as PayableBlocker, k as Payee, l as PayeeInvite, m as PayeeStatus, n as PayeeStatusChangedData, o as Payout, p as PayoutStatus, q as PayoutStatusChangedData, s as PayoutsServer, t as PlatformCommercePurchasedData, u as PlatformCommerceRefundedData, w as PlatformCommerceServer, x as PlayerPhoneChangedData, y as PurchaseCompletedData, z as PurchaseEventData, R as RegisterPayeeInput, A as RegisterPayeeResult, B as RequestPayoutInput, F as RequestPayoutResult, G as ReturnReasonCode, S as SANDBOX_BASE_URL, H as SandboxServer, J as SandboxSubscriptionsServer, K as SubscriptionAuthenticationRequiredData, M as SubscriptionCanceledData, N as SubscriptionEventCommon, O as SubscriptionExpiredData, Q as SubscriptionPastDueData, T as SubscriptionPaymentFailedData, U as SubscriptionRefundApprovedData, V as SubscriptionRefundDetail, W as SubscriptionRefundRejectedData, X as SubscriptionRefundRequestData, Y as SubscriptionRefundedData, Z as SubscriptionRenewalFunding, _ as SubscriptionRenewalSplit, $ as SubscriptionRenewedData, a0 as SubscriptionRevenueShareAttribution, a1 as SubscriptionTrialEventFields, a2 as SubscriptionsServer, a3 as TransferEventData, a4 as VerifyWebhookOptions, a5 as WebhookHandlerOptions, b as baseUrlForKey, a6 as createWebhookHandler, i as isDemoKey, r as resolveEnvironment, a7 as verifyWebhook, a8 as verifyWebhookAsync } from './server-DHmQU1eN.js';
|
|
4
|
+
export { S as SDK_VERSION } from './version-CR7XECyP.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, PRODUCTION_BASE_URL, PayoutsServer, PlatformCommerceServer, SANDBOX_BASE_URL, SandboxServer, SandboxSubscriptionsServer, SubscriptionsServer, baseUrlForKey, createWebhookHandler, isDemoKey, isRefundPendingApproval, resolveEnvironment, verifyWebhook, verifyWebhookAsync } from './chunk-V2RQYQQD.js';
|
|
2
|
+
export { SDK_VERSION } from './chunk-3ECVREIM.js';
|
|
3
|
+
export { InvoError } from './chunk-TCT2QSVB.js';
|
|
4
4
|
//# sourceMappingURL=server.js.map
|
|
5
5
|
//# sourceMappingURL=server.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@invonetwork/web-sdk",
|
|
3
|
-
"version": "3.30.
|
|
3
|
+
"version": "3.30.1",
|
|
4
4
|
"description": "INVO Web SDK — currency purchase, passkey (WebAuthn) verification, loyalty, and a drop-in game economy layer (wallet, shop, hosted checkout) for partner web platforms and browser games.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"private": false,
|