@invonetwork/web-sdk 3.36.0 → 3.37.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 +22 -0
- package/README.md +64 -6
- package/dist/{chunk-BGCSSWVL.js → chunk-I4GDKZFL.js} +34 -5
- package/dist/chunk-OYJUX2TH.js +6 -0
- package/dist/{chunk-SCFK6IVH.js → chunk-QD5G355J.js} +3 -3
- package/dist/{chunk-J4IQ3ANY.js → chunk-YFNQKYUI.js} +40 -18
- package/dist/game-server.cjs +69 -18
- package/dist/game-server.d.cts +4 -4
- package/dist/game-server.d.ts +4 -4
- package/dist/game-server.js +5 -5
- package/dist/game.cjs +33 -4
- package/dist/game.d.cts +3 -3
- package/dist/game.d.ts +3 -3
- package/dist/game.js +3 -3
- package/dist/{hosted-approval-BKI9oHwf.d.cts → hosted-approval-CxWyQOfU.d.cts} +1 -1
- package/dist/{hosted-approval-fgVkugRU.d.ts → hosted-approval-D-CGX-LO.d.ts} +1 -1
- package/dist/index.cjs +32 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{server-BMY3q2Bn.d.cts → server-BuByP1JU.d.cts} +41 -12
- package/dist/{server-CSRCWgrK.d.ts → server-DzczMA-z.d.ts} +41 -12
- package/dist/server.cjs +69 -18
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +3 -3
- package/dist/{types-BcdXf2S5.d.ts → types-IRNjMV47.d.cts} +37 -8
- package/dist/{types-BcdXf2S5.d.cts → types-IRNjMV47.d.ts} +37 -8
- package/dist/{version-QIFHOifq.d.cts → version-BIHJFKuj.d.cts} +1 -1
- package/dist/{version-QIFHOifq.d.ts → version-BIHJFKuj.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-B75DBT53.js +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.37.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Documentation only; no code or behavior change. Phone-share, player registration and guardian approval now match the server:
|
|
8
|
+
|
|
9
|
+
- `registerPlayer`: `"created"` means new to your title and can mean joining the person's existing INVO wallet (same email and phone), so `identityId` is the same one other games see; the token fields are omitted when INVO cannot issue a token; `503 sdk_verification_disabled` is listed.
|
|
10
|
+
- `err.isPhoneShareRefused` / `err.isPhoneShareApprovalRequired`: the refusal is not a dead end. INVO creates an approval request and asks the phone's existing owner (by email when INVO has verified their address, otherwise by a text code); retry the same call once they approve. An INVO wallet created in the INVO app counts as an owner of its phone. `err.phoneShareLast4` is the last 4 digits as a string, absent on older servers.
|
|
11
|
+
- `PhoneShareApproveResult`: describes what the approve endpoint returns (`status`, `approved`, `approval_id`, `phone`, `approved_email`, `approved_at`); `alreadyApproved` and `expiresAt` are not sent by it. Approval is permanent; there is no revoke.
|
|
12
|
+
- README: who is a minor (INVO sets no minimum age; INVO support marks a wallet as a minor on request; `isMinor` reads it), what the guardian gates (cross-game transfers, sends, wallet-app moves; not coin or item purchases, not receiving) and the 15-minute window.
|
|
13
|
+
|
|
14
|
+
## 3.37.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- Payouts when your billing account owes INVO. On the Steam and Apple rails Steam or Apple pays you directly and INVO bills you for the coins through your billing account, charging the card on file first. If the billing account still owes INVO when a payout is created, INVO now settles that amount from the payout and pays you the rest. All additive.
|
|
19
|
+
|
|
20
|
+
- `Payout` gains `offset_float_usd` and `amount_before_offset_usd` (as the server sends them) and the mapped `offsetFloatUsd` and `amountBeforeOffsetUsd` on `requestPayout`, `getPayout`, `listPayouts` and `cancelPayout`. They are present only when something was settled; `requested_amount_usd` is then the cash part. A payout with nothing settled is returned exactly as before.
|
|
21
|
+
- `payout.status_changed` webhook data types the same two snake_case fields.
|
|
22
|
+
- `InvoError` predicates: `isFloatDebtOutstanding` (`FLOAT_DEBT_OUTSTANDING`, 409: the amount owed is more than the payout less the minimum; nothing was created) with `floatDebtUsd`, and `isFloatCheckUnavailable` (`FLOAT_CHECK_UNAVAILABLE`, 503, retryable).
|
|
23
|
+
- README: a new "Payouts when your billing account owes INVO" section.
|
|
24
|
+
|
|
3
25
|
## 3.36.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -211,7 +211,9 @@ An existing player's phone is **never changed** by this call. When it differs fr
|
|
|
211
211
|
`phoneMismatch: true`. When the new phone is genuine, call
|
|
212
212
|
`updatePlayerPhone({ playerEmail, newPhone })` to change it (see
|
|
213
213
|
[Registering players and changing their phone](#registering-players-and-changing-their-phone)).
|
|
214
|
-
A phone that already belongs to another email is a `409` (`err.isPhoneShareRefused`)
|
|
214
|
+
A phone that already belongs to another email is a `409` (`err.isPhoneShareRefused`): INVO asks the
|
|
215
|
+
phone's owner to approve, and the same call succeeds once they have (see
|
|
216
|
+
[Registering players and changing their phone](#registering-players-and-changing-their-phone)).
|
|
215
217
|
|
|
216
218
|
If the player changed their number with INVO (a `player.phone_changed` webhook, or a
|
|
217
219
|
`phoneMismatch` you did not cause), INVO's number is the current one: **never push the number
|
|
@@ -230,12 +232,29 @@ money routing keys off it:
|
|
|
230
232
|
### Registering players and changing their phone
|
|
231
233
|
|
|
232
234
|
Two server calls, both authenticated with your game secret, neither moves money nor sends the
|
|
233
|
-
player a message.
|
|
235
|
+
player a message. The one exception is a phone-share refusal (below): it contacts the phone's
|
|
236
|
+
**existing owner**, never the player you are registering.
|
|
234
237
|
|
|
235
238
|
**`registerPlayer({ playerEmail, playerPhone, playerName? })`** creates the player in your
|
|
236
239
|
title. It returns `status: "created"` (new) or `status: "exists"` (already in your title with
|
|
237
240
|
that phone), the `identityId`, and a `playerToken` / `playerTokenExpiresAt` when INVO can issue
|
|
238
|
-
one for your title, so you can hand the browser a token straight away.
|
|
241
|
+
one for your title, so you can hand the browser a token straight away. Both token fields are
|
|
242
|
+
omitted when INVO cannot issue a token, so check for them.
|
|
243
|
+
|
|
244
|
+
`"created"` means new to **your** title, not new to INVO. When the email and phone match an
|
|
245
|
+
existing INVO wallet (the person already uses INVO in another game, or in the INVO app), the
|
|
246
|
+
player joins that wallet: the `identityId` is derived from the email and phone, so it is the
|
|
247
|
+
same `identityId` other games see for that person. `registerPlayer` answers `503` with
|
|
248
|
+
`error: "sdk_verification_disabled"` while the SDK player routes are switched off.
|
|
249
|
+
|
|
250
|
+
**When the phone is held under a different email** (by a player in any game, or by an INVO
|
|
251
|
+
wallet, including one created in the INVO app that has no player in any game), the call is
|
|
252
|
+
refused with `409` `err.isPhoneShareRefused`. The refusal is not a dead end: INVO creates an
|
|
253
|
+
approval request and asks the phone's owner to approve (by email when INVO has verified their
|
|
254
|
+
address, otherwise by a text code; in the INVO app too when app notifications are on). Show
|
|
255
|
+
`err.message` (`err.phoneShareLast4` is the last 4 digits of the phone, when the server sends
|
|
256
|
+
it), then retry the same call once the owner approves: it succeeds. `phoneShareStatus` tells
|
|
257
|
+
you when. The approval is permanent and applies across the network.
|
|
239
258
|
|
|
240
259
|
```ts
|
|
241
260
|
const reg = await invo.registerPlayer({
|
|
@@ -260,7 +279,7 @@ if (upd.identityRekeyed && upd.playerToken) handTokenToBrowser(upd.playerToken);
|
|
|
260
279
|
| Refusal | HTTP | Means | Do |
|
|
261
280
|
|---|---|---|---|
|
|
262
281
|
| `err.isPhoneMismatch` (`PHONE_MISMATCH`) | 409 | `registerPlayer`: the player is already in your title with a **different** phone. Nothing changed. | Call `updatePlayerPhone` if the change is genuine. |
|
|
263
|
-
| `err.isPhoneShareRefused` (`PHONE_SHARE_APPROVAL_REQUIRED`) | 409 | The phone
|
|
282
|
+
| `err.isPhoneShareRefused` (`PHONE_SHARE_APPROVAL_REQUIRED`) | 409 | The phone is held under another email (a player or an INVO wallet). No player was created or changed, but INVO created an approval request and asked the phone's owner to approve. Same code as `err.isPhoneShareApprovalRequired`. | Show `err.message` (`err.phoneShareLast4` names the number); retry the same call once the owner approves (poll `phoneShareStatus`). |
|
|
264
283
|
| `err.isPhoneChangeRequiresVerification` (`PHONE_CHANGE_REQUIRES_VERIFICATION`) | 409 | `updatePlayerPhone`: the player has secured this account, so the change needs the player's own confirmation. Nothing changed. `err.changeRequestEndpoint` names the route to use instead. | Call `requestPhoneChange` (see [Player-confirmed phone change](#player-confirmed-phone-change)). |
|
|
265
284
|
| `err.isPlayerNotFound` | 404 | `updatePlayerPhone` (or `mintPlayerToken` without `playerPhone`): no player with that email in your title. | Create the player first (`registerPlayer`). |
|
|
266
285
|
| `INVALID_INPUT` / `INVALID_PHONE` | 400 | A missing email or phone, or a phone INVO does not accept. | Fix the input. The SDK also refuses a non-E.164 phone before the network (`status === 0`). |
|
|
@@ -268,6 +287,7 @@ if (upd.identityRekeyed && upd.playerToken) handTokenToBrowser(upd.playerToken);
|
|
|
268
287
|
| `err.isPendingTransfersToOldPhone` (`PENDING_TRANSFERS_TO_OLD_PHONE`) | 409 | `updatePlayerPhone`: sends or transfers to the player's current number are still waiting to be collected; changing the number now would strand them. Nothing changed. | Ask the player to collect them first (or wait until they expire), then retry. |
|
|
269
288
|
| `err.isPendingTransfersToNewPhone` (`PENDING_TRANSFERS_TO_NEW_PHONE`) | 409 | `updatePlayerPhone`: sends or transfers to the new number are still waiting to be collected. Nothing changed. | Retry after they are collected or expire. |
|
|
270
289
|
| `PHONE_UPDATE_UNAVAILABLE` | 503 | `updatePlayerPhone` could not be checked right now. Nothing changed. | Try again shortly. |
|
|
290
|
+
| `sdk_verification_disabled` (in `error`) | 503 | The SDK player routes are switched off in this environment. Nothing changed. | Retry later. |
|
|
271
291
|
|
|
272
292
|
### Player-confirmed phone change
|
|
273
293
|
|
|
@@ -1868,12 +1888,19 @@ try {
|
|
|
1868
1888
|
sender is as before; what's new is that the sender gets an email and the recipient a single
|
|
1869
1889
|
text saying the currency was returned, instead of silence. `transfer.claim_expired` +
|
|
1870
1890
|
`transfer.refunded` remain the source of truth — reconcile off those, not the messages.
|
|
1871
|
-
- **`err.isPhoneShareApprovalRequired` on `confirmReceipt*` / `claimTransfer` / `claimCurrency`** (409): the receiver phone is contested, so INVO **holds the money** and
|
|
1891
|
+
- **`err.isPhoneShareApprovalRequired` on `confirmReceipt*` / `claimTransfer` / `claimCurrency`** (409): the receiver phone is contested, so INVO **holds the money** and asks the phone owner to approve (by email when INVO has verified their address, otherwise by text). Not a failure — show `err.message` verbatim (`err.phoneShareLast4` names the phone), then **retry the same call** once approved (it succeeds idempotently); on denial/expiry the sender is refunded. Same handling as the initiate-time phone-share 409.
|
|
1872
1892
|
- **`err.isIdentityCheckUnavailable` on `confirmReceipt*` / `claimTransfer` / `claimCurrency`** (503, retryable): INVO could not check the claim just now. Nothing was moved; retry the same call after a few seconds.
|
|
1873
1893
|
- **Both games must be Live.** `initiateSend`/`initiateTransfer` throw `403` if either side is still in testing, and the two cases are **deliberately separate** because the fix differs: `err.isSourceGameNotLive` is **your** game (self-serve — switch it to Live in the console under Game Settings → Status), `err.isTargetGameNotLive` is the **destination** game, usually owned by another developer, so you can't flip it — show `err.message` and steer the player elsewhere via `getDestinations`. `err.gameStatus` carries the current state. Don't merge these into one "not live" branch; it produces a "go fix it" button that leads nowhere half the time.
|
|
1874
1894
|
- **Steam titles** (dark until a title is Steam-distributed): `initiateSend`/`initiateTransfer` can throw `err.isSteamValueNonTransferable` (moving more than the non-Steam balance to a non-Steam destination — show `err.message`, cap the amount at `err.steamTransferableMax`; `err.steamOriginAmount` is the Steam-locked portion) or `err.isNonSteamValueIntoSteamBlocked` (non-Steam value into a Steam title). Prevent both up front: `getDestinations` rows carry **`acceptsSteamOriginValue`** — disable non-Steam destinations for a player holding Steam-purchased currency. **This is a rule about currency moving between titles, not about spending.** A player can spend any balance on items in any title, Steam-distributed or not, including currency bought through Steam, so an item purchase never fails on origin and there is nothing to branch on there.
|
|
1875
1895
|
- Transfer self-claim may be disabled for your tenant; if it is, surface the claim-code path instead.
|
|
1876
1896
|
- **Holds:** an approve/claim can return an HTTP 202 hold instead of success — inspect `result.holdReason` (`"RISK_HOLD"`, `"GUARDIAN_APPROVAL_PENDING"`, and on confirm-receipt `"RECIPIENT_IDENTITY_PENDING"`); success has no `holdReason` (and `next: "pending_claim"`). Terminal guardian outcomes throw (`GUARDIAN_APPROVAL_REJECTED`/`_EXPIRED`).
|
|
1897
|
+
- **Who is a minor.** INVO sets no minimum age for a wallet; your game's own age policy applies. A wallet
|
|
1898
|
+
is marked as a minor, and linked to a guardian's wallet, only by INVO support on request; it is not
|
|
1899
|
+
inferred from other signals. `getLinkedIdentities().isMinor` reads the flag (server-only), but it can
|
|
1900
|
+
change at any time, so handle the 202 everywhere. A minor's cross-game transfers, sends and INVO
|
|
1901
|
+
wallet-app moves need the guardian; buying coins, buying items and receiving money do not. The
|
|
1902
|
+
guardian has 15 minutes: with no answer the request expires and the money does not move. A minor with
|
|
1903
|
+
no usable guardian is refused with `403` `GUARDIAN_REQUIRED`.
|
|
1877
1904
|
- **Guardian approval goes by email first.** When a minor's initiate returns the 202, the guardian gets a
|
|
1878
1905
|
signed, single-use link to a hosted INVO page with Approve / Decline — not a text. A reply-YES text goes
|
|
1879
1906
|
out only when the guardian has no verified email or the email could not be delivered. The raw 202
|
|
@@ -1890,7 +1917,9 @@ try {
|
|
|
1890
1917
|
- **Phone-share and recipient-identity consents use the same hosted page.** On `err.isPhoneShareApprovalRequired`
|
|
1891
1918
|
the phone's existing owner gets an emailed link (Allow / Decline) when INVO has itself proven an address for
|
|
1892
1919
|
them — at most three holders, one email per request — and the 409 body carries `consent_channel: "email"`;
|
|
1893
|
-
the OTP text goes out instead only when no proven holder exists (`consent_channel: "sms"`).
|
|
1920
|
+
the OTP text goes out instead only when no proven holder exists (`consent_channel: "sms"`). An INVO wallet
|
|
1921
|
+
created in the INVO app counts as a holder of its phone, so registering a different email with that phone
|
|
1922
|
+
needs the wallet owner's approval. The
|
|
1894
1923
|
`RECIPIENT_IDENTITY_PENDING` hold emails the phone owner's oldest verified address the same way. **Nothing
|
|
1895
1924
|
changes for you:** same 409 / 202 codes, same poll-and-retry, and the typed-code and in-app approves still work.
|
|
1896
1925
|
|
|
@@ -2815,6 +2844,35 @@ The first payout to a creator registered with the game key carries `owner_confir
|
|
|
2815
2844
|
|
|
2816
2845
|
Refusals carry `err.code`: `PAYEE_NOT_FOUND`, `PAYEE_NOT_VERIFIED` (not `verified` right now: check the status), `PAYEE_VERIFICATION_EXPIRED`, `PAYEE_BANK_NOT_VERIFIED`, `PAYEE_CLOSED`, `PAYEE_TERMS_NOT_ACCEPTED` (the creator hasn't accepted INVO's current Payee Terms yet), `PAYEE_NOT_PAYABLE` (the creator can't be paid right now; no action is needed from you or the creator; try again later), `INSUFFICIENT_OWED_BALANCE`, `IDEMPOTENCY_KEY_REUSED`, `PAYOUT_NOT_CANCELLABLE`. Registering: `PARTNER_REFERENCE_CONFLICT`, `COUNTRY_NOT_SUPPORTED`, `GAME_HAS_NO_OWNER`. Resending an invite: `INVITE_NOT_NEEDED`, `PAYEE_ERASED`, `INVITE_RATE_LIMITED` (wait `retry_after_seconds`). A completed payout the bank sends back reads `returned` with `return_reason_code` (always `"returned"` on a creator payout). `partner_message` is a note INVO wrote for you. Each creator carries `payable` and `payable_blockers` (`erased`, `closed`, `not_verified`, `verification_expired`, `terms_not_accepted`, `bank_not_verified`, `not_payable_now`): check `payable` before offering a payout. Removing a creator with a payout still being processed is refused with `PAYEE_HAS_PAYOUTS_IN_FLIGHT` (`payouts_in_flight_by_status` counts them; a `requested` one can be cancelled).
|
|
2817
2846
|
|
|
2847
|
+
### Payouts when your billing account owes INVO
|
|
2848
|
+
|
|
2849
|
+
On the Steam and Apple rails, Steam or Apple pays you directly and INVO bills you for the coins it issued through your billing account in the INVO console, charging the card on file first. If the billing account still owes INVO when a payout is created, INVO settles that amount from the payout and pays you the rest. Accounts that settle by invoice under an agreement are never netted. See [payouts when your account owes INVO](https://docs.invo.network/docs/partners#payouts-account-owes).
|
|
2850
|
+
|
|
2851
|
+
```ts
|
|
2852
|
+
try {
|
|
2853
|
+
const { payout } = await invo.payouts.requestPayout({
|
|
2854
|
+
amountUsd: "100.00",
|
|
2855
|
+
contactEmail: "ops@example.com",
|
|
2856
|
+
bankAccountId: 12,
|
|
2857
|
+
clientRequestId: crypto.randomUUID(),
|
|
2858
|
+
});
|
|
2859
|
+
if (payout.offsetFloatUsd) {
|
|
2860
|
+
// Billing account owed $40.00: payout.offsetFloatUsd "40.00",
|
|
2861
|
+
// payout.amountBeforeOffsetUsd "100.00", payout.requested_amount_usd "60.00" (the cash part).
|
|
2862
|
+
// The payout fee is on the cash part only.
|
|
2863
|
+
}
|
|
2864
|
+
} catch (err) {
|
|
2865
|
+
if (err instanceof InvoError && err.isFloatDebtOutstanding) {
|
|
2866
|
+
// 409: the amount owed (err.floatDebtUsd, e.g. "95.00") is more than this payout less the
|
|
2867
|
+
// $10 minimum. Nothing was created. Ask for more, or retry after the card is charged.
|
|
2868
|
+
} else if (err instanceof InvoError && err.isFloatCheckUnavailable) {
|
|
2869
|
+
// 503, retryable: nothing was changed. Retry with the same clientRequestId.
|
|
2870
|
+
} else throw err;
|
|
2871
|
+
}
|
|
2872
|
+
```
|
|
2873
|
+
|
|
2874
|
+
`offsetFloatUsd` and `amountBeforeOffsetUsd` (and the server's `offset_float_usd` / `amount_before_offset_usd`, also on `payout.status_changed`) are present only when something was settled: absent, never `"0.00"`, otherwise. What was settled stays settled if the payout is later rejected, fails or is returned; only the cash part is owed to you again. If a card charge fails, INVO also applies your earnings to the amount owed once an hour and emails the account owner each time.
|
|
2875
|
+
|
|
2818
2876
|
## Webhooks
|
|
2819
2877
|
|
|
2820
2878
|
The synchronous responses are for UX; **reconcile and grant value off webhooks.** They're HMAC-signed; **dedupe on the `X-Invo-Idempotency-Key` header** (stable across retries/replays — *not* `X-Invo-Event-Id`, which changes per delivery).
|
|
@@ -82,7 +82,11 @@ var InvoError = class _InvoError extends Error {
|
|
|
82
82
|
* - registration/token-mint (phone already on another INVO account), and
|
|
83
83
|
* - **claim + confirm-receipt** (`claimTransfer`/`claimCurrency`,
|
|
84
84
|
* `confirmReceiptSend`/`confirmReceiptTransfer`) — the receiver phone is contested,
|
|
85
|
-
* so INVO holds the money and
|
|
85
|
+
* so INVO holds the money and asks the phone owner to approve.
|
|
86
|
+
*
|
|
87
|
+
* Either way the 409 has already created an approval request and contacted the phone's
|
|
88
|
+
* existing owner: by email when INVO has verified their address, otherwise by a text code
|
|
89
|
+
* (the body's `consent_channel` says which).
|
|
86
90
|
*
|
|
87
91
|
* NOT a failure. Show `err.message` verbatim (the backend supplies the user-facing text;
|
|
88
92
|
* `phoneShareLast4` tells the UI which phone), keep the funds pending, and **retry the same
|
|
@@ -99,7 +103,8 @@ var InvoError = class _InvoError extends Error {
|
|
|
99
103
|
const v = this.bodyObject()["approval_id"];
|
|
100
104
|
return typeof v === "string" && v ? v : void 0;
|
|
101
105
|
}
|
|
102
|
-
/** Last 4 digits of the phone that must approve (`phone_last4
|
|
106
|
+
/** Last 4 digits of the phone that must approve (`phone_last4`, a string such as `"4567"`),
|
|
107
|
+
* for the UI message. `undefined` when the body has none (an older server). */
|
|
103
108
|
get phoneShareLast4() {
|
|
104
109
|
const v = this.bodyObject()["phone_last4"];
|
|
105
110
|
return typeof v === "string" && v ? v : void 0;
|
|
@@ -335,6 +340,27 @@ var InvoError = class _InvoError extends Error {
|
|
|
335
340
|
get isPartnerRailSuspended() {
|
|
336
341
|
return this.code === "PARTNER_RAIL_SUSPENDED";
|
|
337
342
|
}
|
|
343
|
+
/** A payout or withdrawal was refused because the billing account owes INVO more for
|
|
344
|
+
* Steam or Apple coins than this payout can settle (`FLOAT_DEBT_OUTSTANDING`, 409;
|
|
345
|
+
* additive, 3.37.0). Nothing was created. {@link floatDebtUsd} is what is owed; the
|
|
346
|
+
* message is safe to show the account owner. Ask for a larger amount, or retry once the
|
|
347
|
+
* card on file has been charged. */
|
|
348
|
+
get isFloatDebtOutstanding() {
|
|
349
|
+
return this.code === "FLOAT_DEBT_OUTSTANDING";
|
|
350
|
+
}
|
|
351
|
+
/** On `FLOAT_DEBT_OUTSTANDING`: what the billing account owes (`float_debt_usd`), USD
|
|
352
|
+
* decimal string, for example `"95.00"`. `undefined` when the body does not carry it. */
|
|
353
|
+
get floatDebtUsd() {
|
|
354
|
+
const v = this.bodyObject()["float_debt_usd"];
|
|
355
|
+
if (typeof v === "number" && Number.isFinite(v)) return v.toFixed(2);
|
|
356
|
+
return typeof v === "string" && v ? v : void 0;
|
|
357
|
+
}
|
|
358
|
+
/** The billing account could not be checked, so the payout or withdrawal was not created
|
|
359
|
+
* (`FLOAT_CHECK_UNAVAILABLE`, 503, `retryable: true`; additive, 3.37.0). Nothing was
|
|
360
|
+
* changed. Retry with the same idempotency key. */
|
|
361
|
+
get isFloatCheckUnavailable() {
|
|
362
|
+
return this.code === "FLOAT_CHECK_UNAVAILABLE";
|
|
363
|
+
}
|
|
338
364
|
/** True when INVO has paused new payments on the developer account
|
|
339
365
|
* (`PAYMENTS_PAUSED`, 403; additive, 3.32.0). Every call that starts a payment returns it:
|
|
340
366
|
* coin purchase, checkout session, Platform Commerce card purchase, new
|
|
@@ -1051,7 +1077,10 @@ var InvoError = class _InvoError extends Error {
|
|
|
1051
1077
|
/**
|
|
1052
1078
|
* True when the phone you supplied belongs to another email
|
|
1053
1079
|
* (`PHONE_SHARE_APPROVAL_REQUIRED`, 409) on `mintPlayerToken`, `registerPlayer` or
|
|
1054
|
-
* `updatePlayerPhone`.
|
|
1080
|
+
* `updatePlayerPhone`. The phone may be held by a player in any game or by an INVO wallet
|
|
1081
|
+
* (including one created in the INVO app). No player was created or changed, but INVO has
|
|
1082
|
+
* created an approval request and asked the phone's owner to approve; retry the same call
|
|
1083
|
+
* once they have and it succeeds. The same condition as
|
|
1055
1084
|
* {@link isPhoneShareApprovalRequired}, named for these registration calls.
|
|
1056
1085
|
*/
|
|
1057
1086
|
get isPhoneShareRefused() {
|
|
@@ -1876,5 +1905,5 @@ function toApprovePhoneChangeResult(raw, changeRequestId) {
|
|
|
1876
1905
|
}
|
|
1877
1906
|
|
|
1878
1907
|
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 };
|
|
1879
|
-
//# sourceMappingURL=chunk-
|
|
1880
|
-
//# sourceMappingURL=chunk-
|
|
1908
|
+
//# sourceMappingURL=chunk-I4GDKZFL.js.map
|
|
1909
|
+
//# sourceMappingURL=chunk-I4GDKZFL.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvoError, assertSecureBaseUrl, Http, toPurchaseStatusResult, toPhoneChangeApprovalsResult, phoneChangeSignalMessage, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toRedeemRewardResult, toRewardsPageLink, buildGameEventBody, toReportGameEventResult } from './chunk-
|
|
1
|
+
import { InvoError, assertSecureBaseUrl, Http, toPurchaseStatusResult, toPhoneChangeApprovalsResult, phoneChangeSignalMessage, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toRedeemRewardResult, toRewardsPageLink, buildGameEventBody, toReportGameEventResult } from './chunk-I4GDKZFL.js';
|
|
2
2
|
|
|
3
3
|
// src/shared/webauthn.ts
|
|
4
4
|
function malformedOptions(field) {
|
|
@@ -1586,5 +1586,5 @@ var InvoClient = class {
|
|
|
1586
1586
|
};
|
|
1587
1587
|
|
|
1588
1588
|
export { CheckoutClient, InvoClient, PlatformCommerceClient };
|
|
1589
|
-
//# sourceMappingURL=chunk-
|
|
1590
|
-
//# sourceMappingURL=chunk-
|
|
1589
|
+
//# sourceMappingURL=chunk-QD5G355J.js.map
|
|
1590
|
+
//# sourceMappingURL=chunk-QD5G355J.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SDK_VERSION } from './chunk-
|
|
2
|
-
import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, toPurchaseStatusResult, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-
|
|
1
|
+
import { SDK_VERSION } from './chunk-OYJUX2TH.js';
|
|
2
|
+
import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, toPurchaseStatusResult, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-I4GDKZFL.js';
|
|
3
3
|
import { createHmac, timingSafeEqual } from 'crypto';
|
|
4
4
|
|
|
5
5
|
// src/shared/apple.ts
|
|
@@ -116,6 +116,20 @@ function query(params) {
|
|
|
116
116
|
}
|
|
117
117
|
return parts.length ? `?${parts.join("&")}` : "";
|
|
118
118
|
}
|
|
119
|
+
function moneyString(v) {
|
|
120
|
+
if (typeof v === "number" && Number.isFinite(v)) return v.toFixed(2);
|
|
121
|
+
return typeof v === "string" && v ? v : void 0;
|
|
122
|
+
}
|
|
123
|
+
function withOffsetFields(p) {
|
|
124
|
+
if (!p || typeof p !== "object") return p;
|
|
125
|
+
const offset = moneyString(p["offset_float_usd"]);
|
|
126
|
+
const before = moneyString(p["amount_before_offset_usd"]);
|
|
127
|
+
if (offset === void 0 && before === void 0) return p;
|
|
128
|
+
const out = { ...p };
|
|
129
|
+
if (offset !== void 0) out.offsetFloatUsd = offset;
|
|
130
|
+
if (before !== void 0) out.amountBeforeOffsetUsd = before;
|
|
131
|
+
return out;
|
|
132
|
+
}
|
|
119
133
|
function payeePath(payeeId) {
|
|
120
134
|
return `/api/partner-payees/${encodeURIComponent(requireText("payeeId", payeeId))}`;
|
|
121
135
|
}
|
|
@@ -241,7 +255,7 @@ var PayoutsServer = class {
|
|
|
241
255
|
signal: opts?.signal
|
|
242
256
|
});
|
|
243
257
|
return {
|
|
244
|
-
payout: raw["payout_request"],
|
|
258
|
+
payout: withOffsetFields(raw["payout_request"]),
|
|
245
259
|
duplicate: raw["duplicate"] === true,
|
|
246
260
|
raw
|
|
247
261
|
};
|
|
@@ -253,7 +267,7 @@ var PayoutsServer = class {
|
|
|
253
267
|
this.auth,
|
|
254
268
|
{ signal: opts?.signal }
|
|
255
269
|
);
|
|
256
|
-
return raw["payout_request"];
|
|
270
|
+
return withOffsetFields(raw["payout_request"]);
|
|
257
271
|
}
|
|
258
272
|
/** Your payouts (`GET /api/partner-payouts`), optionally one creator's (`payeeId`). */
|
|
259
273
|
async listPayouts(q = {}, opts) {
|
|
@@ -262,7 +276,7 @@ var PayoutsServer = class {
|
|
|
262
276
|
this.auth,
|
|
263
277
|
{ signal: opts?.signal }
|
|
264
278
|
);
|
|
265
|
-
return { total: Number(raw["total"] ?? 0), items: raw["items"] ?? [], raw };
|
|
279
|
+
return { total: Number(raw["total"] ?? 0), items: (raw["items"] ?? []).map((p) => withOffsetFields(p)), raw };
|
|
266
280
|
}
|
|
267
281
|
/**
|
|
268
282
|
* Cancel a creator payout that is still `requested`
|
|
@@ -276,7 +290,7 @@ var PayoutsServer = class {
|
|
|
276
290
|
this.auth,
|
|
277
291
|
{ signal: opts?.signal }
|
|
278
292
|
);
|
|
279
|
-
return raw["payout_request"] ?? raw["payout"];
|
|
293
|
+
return withOffsetFields(raw["payout_request"] ?? raw["payout"]);
|
|
280
294
|
}
|
|
281
295
|
};
|
|
282
296
|
|
|
@@ -2544,11 +2558,16 @@ var InvoServer = class {
|
|
|
2544
2558
|
* Create a player in your game without moving money (`POST /api/sdk/players`), so a
|
|
2545
2559
|
* first-time receiver can collect in-game. Sends no message to the player.
|
|
2546
2560
|
*
|
|
2547
|
-
* Returns `status: "created"` (new) or `"exists"` (already in
|
|
2548
|
-
* phone), with a player token when INVO can issue one
|
|
2549
|
-
*
|
|
2550
|
-
*
|
|
2551
|
-
*
|
|
2561
|
+
* Returns `status: "created"` (201, new to your game) or `"exists"` (200, already in
|
|
2562
|
+
* your game with that phone), with a player token when INVO can issue one (the token
|
|
2563
|
+
* fields are omitted otherwise). "created" can mean joining an existing INVO wallet:
|
|
2564
|
+
* the same email and phone as a wallet the person already has, so `identityId` is the
|
|
2565
|
+
* same one other games see. Refusals: 409 `err.isPhoneMismatch` (already in your game
|
|
2566
|
+
* with a different phone; use `updatePlayerPhone`), 409 `err.isPhoneShareRefused` (the
|
|
2567
|
+
* phone is held under another email, by a player or an INVO wallet: INVO asks the
|
|
2568
|
+
* phone's owner to approve, and the same call succeeds once they have), 400
|
|
2569
|
+
* `INVALID_INPUT` / `INVALID_PHONE`, 429 (`err.retryAfter`), 503
|
|
2570
|
+
* `sdk_verification_disabled` (the SDK player routes are switched off).
|
|
2552
2571
|
*/
|
|
2553
2572
|
async registerPlayer(input, opts) {
|
|
2554
2573
|
if (typeof input.playerEmail !== "string" || !input.playerEmail.trim()) {
|
|
@@ -3724,7 +3743,9 @@ var InvoServer = class {
|
|
|
3724
3743
|
*
|
|
3725
3744
|
* These three endpoints are UNAUTHENTICATED (phone-owner-driven: no game secret,
|
|
3726
3745
|
* no player token) — a partner backend relays the handshake. The triggering 409
|
|
3727
|
-
* carries `approval_id, expires_at, code_sent, existing_account_hints[], next_endpoint
|
|
3746
|
+
* carries `approval_id, expires_at, code_sent, existing_account_hints[], next_endpoint`,
|
|
3747
|
+
* `phone_last4` and `consent_channel` (`"email"` when the owner was emailed a link,
|
|
3748
|
+
* so there is no code to collect; `"sms"` when a text code went out).
|
|
3728
3749
|
*
|
|
3729
3750
|
* `phoneShareInitiate` is the fallback OTP send (use when the 409 didn't already
|
|
3730
3751
|
* dispatch a code). NOT idempotent — never auto-retried. OTP TTL ~10 min.
|
|
@@ -3747,10 +3768,11 @@ var InvoServer = class {
|
|
|
3747
3768
|
return toPhoneShareInitiateResult(raw);
|
|
3748
3769
|
}
|
|
3749
3770
|
/**
|
|
3750
|
-
* Approve a phone-share with the OTP the phone owner received. On success the
|
|
3751
|
-
* is stored server-side, keyed by (phone, requesting_email) and
|
|
3752
|
-
* caller simply RE-ISSUES the identical
|
|
3753
|
-
* idempotent (attempts are counted) — never
|
|
3771
|
+
* Approve a phone-share with the OTP the phone owner received. On success the approval
|
|
3772
|
+
* is stored server-side, keyed by (phone, requesting_email), permanently and
|
|
3773
|
+
* network-wide (there is no revoke) — the caller simply RE-ISSUES the identical
|
|
3774
|
+
* original request. UNAUTHENTICATED. NOT idempotent (attempts are counted) — never
|
|
3775
|
+
* auto-retried.
|
|
3754
3776
|
*/
|
|
3755
3777
|
async phoneShareApprove(input, opts) {
|
|
3756
3778
|
if (typeof input.approvalId !== "string" || !input.approvalId.trim()) {
|
|
@@ -4104,5 +4126,5 @@ var InvoServer = class {
|
|
|
4104
4126
|
};
|
|
4105
4127
|
|
|
4106
4128
|
export { APPLE_FINISH_ERROR_CODES, CardsServer, DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, KeyEnvironmentMismatchError, LIVE_KEY_PREFIX, PRODUCTION_BASE_URL, PayoutsServer, PlatformCommerceServer, SANDBOX_BASE_URL, SandboxServer, SandboxSubscriptionsServer, SubscriptionsServer, TEST_KEY_PREFIX, assertKeyMatchesBaseUrl, assertKeyMatchesEnvironment, baseUrlForKey, createWebhookHandler, environmentForBaseUrl, environmentFromKeyPrefix, isAppleCreditPending, isDemoKey, isRefundPendingApproval, resolveEnvironment, shouldFinishAppleTransaction, verifyInvoSignature, verifyWebhook, verifyWebhookAsync };
|
|
4107
|
-
//# sourceMappingURL=chunk-
|
|
4108
|
-
//# sourceMappingURL=chunk-
|
|
4129
|
+
//# sourceMappingURL=chunk-YFNQKYUI.js.map
|
|
4130
|
+
//# sourceMappingURL=chunk-YFNQKYUI.js.map
|
package/dist/game-server.cjs
CHANGED
|
@@ -256,7 +256,11 @@ var InvoError = class _InvoError extends Error {
|
|
|
256
256
|
* - registration/token-mint (phone already on another INVO account), and
|
|
257
257
|
* - **claim + confirm-receipt** (`claimTransfer`/`claimCurrency`,
|
|
258
258
|
* `confirmReceiptSend`/`confirmReceiptTransfer`) — the receiver phone is contested,
|
|
259
|
-
* so INVO holds the money and
|
|
259
|
+
* so INVO holds the money and asks the phone owner to approve.
|
|
260
|
+
*
|
|
261
|
+
* Either way the 409 has already created an approval request and contacted the phone's
|
|
262
|
+
* existing owner: by email when INVO has verified their address, otherwise by a text code
|
|
263
|
+
* (the body's `consent_channel` says which).
|
|
260
264
|
*
|
|
261
265
|
* NOT a failure. Show `err.message` verbatim (the backend supplies the user-facing text;
|
|
262
266
|
* `phoneShareLast4` tells the UI which phone), keep the funds pending, and **retry the same
|
|
@@ -273,7 +277,8 @@ var InvoError = class _InvoError extends Error {
|
|
|
273
277
|
const v = this.bodyObject()["approval_id"];
|
|
274
278
|
return typeof v === "string" && v ? v : void 0;
|
|
275
279
|
}
|
|
276
|
-
/** Last 4 digits of the phone that must approve (`phone_last4
|
|
280
|
+
/** Last 4 digits of the phone that must approve (`phone_last4`, a string such as `"4567"`),
|
|
281
|
+
* for the UI message. `undefined` when the body has none (an older server). */
|
|
277
282
|
get phoneShareLast4() {
|
|
278
283
|
const v = this.bodyObject()["phone_last4"];
|
|
279
284
|
return typeof v === "string" && v ? v : void 0;
|
|
@@ -509,6 +514,27 @@ var InvoError = class _InvoError extends Error {
|
|
|
509
514
|
get isPartnerRailSuspended() {
|
|
510
515
|
return this.code === "PARTNER_RAIL_SUSPENDED";
|
|
511
516
|
}
|
|
517
|
+
/** A payout or withdrawal was refused because the billing account owes INVO more for
|
|
518
|
+
* Steam or Apple coins than this payout can settle (`FLOAT_DEBT_OUTSTANDING`, 409;
|
|
519
|
+
* additive, 3.37.0). Nothing was created. {@link floatDebtUsd} is what is owed; the
|
|
520
|
+
* message is safe to show the account owner. Ask for a larger amount, or retry once the
|
|
521
|
+
* card on file has been charged. */
|
|
522
|
+
get isFloatDebtOutstanding() {
|
|
523
|
+
return this.code === "FLOAT_DEBT_OUTSTANDING";
|
|
524
|
+
}
|
|
525
|
+
/** On `FLOAT_DEBT_OUTSTANDING`: what the billing account owes (`float_debt_usd`), USD
|
|
526
|
+
* decimal string, for example `"95.00"`. `undefined` when the body does not carry it. */
|
|
527
|
+
get floatDebtUsd() {
|
|
528
|
+
const v = this.bodyObject()["float_debt_usd"];
|
|
529
|
+
if (typeof v === "number" && Number.isFinite(v)) return v.toFixed(2);
|
|
530
|
+
return typeof v === "string" && v ? v : void 0;
|
|
531
|
+
}
|
|
532
|
+
/** The billing account could not be checked, so the payout or withdrawal was not created
|
|
533
|
+
* (`FLOAT_CHECK_UNAVAILABLE`, 503, `retryable: true`; additive, 3.37.0). Nothing was
|
|
534
|
+
* changed. Retry with the same idempotency key. */
|
|
535
|
+
get isFloatCheckUnavailable() {
|
|
536
|
+
return this.code === "FLOAT_CHECK_UNAVAILABLE";
|
|
537
|
+
}
|
|
512
538
|
/** True when INVO has paused new payments on the developer account
|
|
513
539
|
* (`PAYMENTS_PAUSED`, 403; additive, 3.32.0). Every call that starts a payment returns it:
|
|
514
540
|
* coin purchase, checkout session, Platform Commerce card purchase, new
|
|
@@ -1225,7 +1251,10 @@ var InvoError = class _InvoError extends Error {
|
|
|
1225
1251
|
/**
|
|
1226
1252
|
* True when the phone you supplied belongs to another email
|
|
1227
1253
|
* (`PHONE_SHARE_APPROVAL_REQUIRED`, 409) on `mintPlayerToken`, `registerPlayer` or
|
|
1228
|
-
* `updatePlayerPhone`.
|
|
1254
|
+
* `updatePlayerPhone`. The phone may be held by a player in any game or by an INVO wallet
|
|
1255
|
+
* (including one created in the INVO app). No player was created or changed, but INVO has
|
|
1256
|
+
* created an approval request and asked the phone's owner to approve; retry the same call
|
|
1257
|
+
* once they have and it succeeds. The same condition as
|
|
1229
1258
|
* {@link isPhoneShareApprovalRequired}, named for these registration calls.
|
|
1230
1259
|
*/
|
|
1231
1260
|
get isPhoneShareRefused() {
|
|
@@ -1995,7 +2024,7 @@ function toPhoneChangeRequest(raw) {
|
|
|
1995
2024
|
}
|
|
1996
2025
|
|
|
1997
2026
|
// src/version.ts
|
|
1998
|
-
var SDK_VERSION = "3.
|
|
2027
|
+
var SDK_VERSION = "3.37.1";
|
|
1999
2028
|
|
|
2000
2029
|
// src/payouts.ts
|
|
2001
2030
|
var AMOUNT = /^\d+(\.\d{1,2})?$/;
|
|
@@ -2025,6 +2054,20 @@ function query(params) {
|
|
|
2025
2054
|
}
|
|
2026
2055
|
return parts.length ? `?${parts.join("&")}` : "";
|
|
2027
2056
|
}
|
|
2057
|
+
function moneyString(v) {
|
|
2058
|
+
if (typeof v === "number" && Number.isFinite(v)) return v.toFixed(2);
|
|
2059
|
+
return typeof v === "string" && v ? v : void 0;
|
|
2060
|
+
}
|
|
2061
|
+
function withOffsetFields(p) {
|
|
2062
|
+
if (!p || typeof p !== "object") return p;
|
|
2063
|
+
const offset = moneyString(p["offset_float_usd"]);
|
|
2064
|
+
const before = moneyString(p["amount_before_offset_usd"]);
|
|
2065
|
+
if (offset === void 0 && before === void 0) return p;
|
|
2066
|
+
const out = { ...p };
|
|
2067
|
+
if (offset !== void 0) out.offsetFloatUsd = offset;
|
|
2068
|
+
if (before !== void 0) out.amountBeforeOffsetUsd = before;
|
|
2069
|
+
return out;
|
|
2070
|
+
}
|
|
2028
2071
|
function payeePath(payeeId) {
|
|
2029
2072
|
return `/api/partner-payees/${encodeURIComponent(requireText("payeeId", payeeId))}`;
|
|
2030
2073
|
}
|
|
@@ -2150,7 +2193,7 @@ var PayoutsServer = class {
|
|
|
2150
2193
|
signal: opts?.signal
|
|
2151
2194
|
});
|
|
2152
2195
|
return {
|
|
2153
|
-
payout: raw["payout_request"],
|
|
2196
|
+
payout: withOffsetFields(raw["payout_request"]),
|
|
2154
2197
|
duplicate: raw["duplicate"] === true,
|
|
2155
2198
|
raw
|
|
2156
2199
|
};
|
|
@@ -2162,7 +2205,7 @@ var PayoutsServer = class {
|
|
|
2162
2205
|
this.auth,
|
|
2163
2206
|
{ signal: opts?.signal }
|
|
2164
2207
|
);
|
|
2165
|
-
return raw["payout_request"];
|
|
2208
|
+
return withOffsetFields(raw["payout_request"]);
|
|
2166
2209
|
}
|
|
2167
2210
|
/** Your payouts (`GET /api/partner-payouts`), optionally one creator's (`payeeId`). */
|
|
2168
2211
|
async listPayouts(q = {}, opts) {
|
|
@@ -2171,7 +2214,7 @@ var PayoutsServer = class {
|
|
|
2171
2214
|
this.auth,
|
|
2172
2215
|
{ signal: opts?.signal }
|
|
2173
2216
|
);
|
|
2174
|
-
return { total: Number(raw["total"] ?? 0), items: raw["items"] ?? [], raw };
|
|
2217
|
+
return { total: Number(raw["total"] ?? 0), items: (raw["items"] ?? []).map((p) => withOffsetFields(p)), raw };
|
|
2175
2218
|
}
|
|
2176
2219
|
/**
|
|
2177
2220
|
* Cancel a creator payout that is still `requested`
|
|
@@ -2185,7 +2228,7 @@ var PayoutsServer = class {
|
|
|
2185
2228
|
this.auth,
|
|
2186
2229
|
{ signal: opts?.signal }
|
|
2187
2230
|
);
|
|
2188
|
-
return raw["payout_request"] ?? raw["payout"];
|
|
2231
|
+
return withOffsetFields(raw["payout_request"] ?? raw["payout"]);
|
|
2189
2232
|
}
|
|
2190
2233
|
};
|
|
2191
2234
|
var DEFAULT_TOLERANCE_SEC = 300;
|
|
@@ -4228,11 +4271,16 @@ var InvoServer = class {
|
|
|
4228
4271
|
* Create a player in your game without moving money (`POST /api/sdk/players`), so a
|
|
4229
4272
|
* first-time receiver can collect in-game. Sends no message to the player.
|
|
4230
4273
|
*
|
|
4231
|
-
* Returns `status: "created"` (new) or `"exists"` (already in
|
|
4232
|
-
* phone), with a player token when INVO can issue one
|
|
4233
|
-
*
|
|
4234
|
-
*
|
|
4235
|
-
*
|
|
4274
|
+
* Returns `status: "created"` (201, new to your game) or `"exists"` (200, already in
|
|
4275
|
+
* your game with that phone), with a player token when INVO can issue one (the token
|
|
4276
|
+
* fields are omitted otherwise). "created" can mean joining an existing INVO wallet:
|
|
4277
|
+
* the same email and phone as a wallet the person already has, so `identityId` is the
|
|
4278
|
+
* same one other games see. Refusals: 409 `err.isPhoneMismatch` (already in your game
|
|
4279
|
+
* with a different phone; use `updatePlayerPhone`), 409 `err.isPhoneShareRefused` (the
|
|
4280
|
+
* phone is held under another email, by a player or an INVO wallet: INVO asks the
|
|
4281
|
+
* phone's owner to approve, and the same call succeeds once they have), 400
|
|
4282
|
+
* `INVALID_INPUT` / `INVALID_PHONE`, 429 (`err.retryAfter`), 503
|
|
4283
|
+
* `sdk_verification_disabled` (the SDK player routes are switched off).
|
|
4236
4284
|
*/
|
|
4237
4285
|
async registerPlayer(input, opts) {
|
|
4238
4286
|
if (typeof input.playerEmail !== "string" || !input.playerEmail.trim()) {
|
|
@@ -5408,7 +5456,9 @@ var InvoServer = class {
|
|
|
5408
5456
|
*
|
|
5409
5457
|
* These three endpoints are UNAUTHENTICATED (phone-owner-driven: no game secret,
|
|
5410
5458
|
* no player token) — a partner backend relays the handshake. The triggering 409
|
|
5411
|
-
* carries `approval_id, expires_at, code_sent, existing_account_hints[], next_endpoint
|
|
5459
|
+
* carries `approval_id, expires_at, code_sent, existing_account_hints[], next_endpoint`,
|
|
5460
|
+
* `phone_last4` and `consent_channel` (`"email"` when the owner was emailed a link,
|
|
5461
|
+
* so there is no code to collect; `"sms"` when a text code went out).
|
|
5412
5462
|
*
|
|
5413
5463
|
* `phoneShareInitiate` is the fallback OTP send (use when the 409 didn't already
|
|
5414
5464
|
* dispatch a code). NOT idempotent — never auto-retried. OTP TTL ~10 min.
|
|
@@ -5431,10 +5481,11 @@ var InvoServer = class {
|
|
|
5431
5481
|
return toPhoneShareInitiateResult(raw);
|
|
5432
5482
|
}
|
|
5433
5483
|
/**
|
|
5434
|
-
* Approve a phone-share with the OTP the phone owner received. On success the
|
|
5435
|
-
* is stored server-side, keyed by (phone, requesting_email) and
|
|
5436
|
-
* caller simply RE-ISSUES the identical
|
|
5437
|
-
* idempotent (attempts are counted) — never
|
|
5484
|
+
* Approve a phone-share with the OTP the phone owner received. On success the approval
|
|
5485
|
+
* is stored server-side, keyed by (phone, requesting_email), permanently and
|
|
5486
|
+
* network-wide (there is no revoke) — the caller simply RE-ISSUES the identical
|
|
5487
|
+
* original request. UNAUTHENTICATED. NOT idempotent (attempts are counted) — never
|
|
5488
|
+
* auto-retried.
|
|
5438
5489
|
*/
|
|
5439
5490
|
async phoneShareApprove(input, opts) {
|
|
5440
5491
|
if (typeof input.approvalId !== "string" || !input.approvalId.trim()) {
|
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, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, T as TEST_KEY_PREFIX, b as baseUrlForKey, e as environmentForBaseUrl, c as environmentFromKeyPrefix, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-
|
|
1
|
+
import { I as InvoServer, a as InvoEnvironment } from './server-BuByP1JU.cjs';
|
|
2
|
+
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, T as TEST_KEY_PREFIX, b as baseUrlForKey, e as environmentForBaseUrl, c as environmentFromKeyPrefix, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-BuByP1JU.cjs';
|
|
3
3
|
import { G as GameCurrencyKind, a as GamePurchaseStatus, b as GameEconomyConfig } from './types-jUxfYjiD.cjs';
|
|
4
4
|
export { c as GameCatalog, d as GameCatalogItem, e as GameCheckout, f as GameCurrencyBalance, g as GameErrorBody, h as GameItemPurchase, i as GamePlayer, j as GamePremiumPack, k as GamePurchase, l as GameSession, m as GameTransferInput, n as GameTransferKind, o as GameTransferStart, p as GameTransferStatus, q as GameWallet } from './types-jUxfYjiD.cjs';
|
|
5
|
-
export { I as InvoError } from './types-
|
|
6
|
-
export { S as SDK_VERSION } from './version-
|
|
5
|
+
export { I as InvoError } from './types-IRNjMV47.cjs';
|
|
6
|
+
export { S as SDK_VERSION } from './version-BIHJFKuj.cjs';
|
|
7
7
|
import './loyalty-events-CmDw2ZoR.cjs';
|
|
8
8
|
|
|
9
9
|
interface StoredPlayer {
|
package/dist/game-server.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as InvoServer, a as InvoEnvironment } from './server-
|
|
2
|
-
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, T as TEST_KEY_PREFIX, b as baseUrlForKey, e as environmentForBaseUrl, c as environmentFromKeyPrefix, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-
|
|
1
|
+
import { I as InvoServer, a as InvoEnvironment } from './server-DzczMA-z.js';
|
|
2
|
+
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, T as TEST_KEY_PREFIX, b as baseUrlForKey, e as environmentForBaseUrl, c as environmentFromKeyPrefix, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-DzczMA-z.js';
|
|
3
3
|
import { G as GameCurrencyKind, a as GamePurchaseStatus, b as GameEconomyConfig } from './types-jUxfYjiD.js';
|
|
4
4
|
export { c as GameCatalog, d as GameCatalogItem, e as GameCheckout, f as GameCurrencyBalance, g as GameErrorBody, h as GameItemPurchase, i as GamePlayer, j as GamePremiumPack, k as GamePurchase, l as GameSession, m as GameTransferInput, n as GameTransferKind, o as GameTransferStart, p as GameTransferStatus, q as GameWallet } from './types-jUxfYjiD.js';
|
|
5
|
-
export { I as InvoError } from './types-
|
|
6
|
-
export { S as SDK_VERSION } from './version-
|
|
5
|
+
export { I as InvoError } from './types-IRNjMV47.js';
|
|
6
|
+
export { S as SDK_VERSION } from './version-BIHJFKuj.js';
|
|
7
7
|
import './loyalty-events-CmDw2ZoR.js';
|
|
8
8
|
|
|
9
9
|
interface StoredPlayer {
|
package/dist/game-server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isDemoKey, SANDBOX_BASE_URL, environmentFromKeyPrefix, assertKeyMatchesEnvironment, assertKeyMatchesBaseUrl, PRODUCTION_BASE_URL, InvoServer, resolveEnvironment, verifyWebhook } from './chunk-
|
|
2
|
-
export { DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, KeyEnvironmentMismatchError, LIVE_KEY_PREFIX, PRODUCTION_BASE_URL, SANDBOX_BASE_URL, TEST_KEY_PREFIX, baseUrlForKey, environmentForBaseUrl, environmentFromKeyPrefix, 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, environmentFromKeyPrefix, assertKeyMatchesEnvironment, assertKeyMatchesBaseUrl, PRODUCTION_BASE_URL, InvoServer, resolveEnvironment, verifyWebhook } from './chunk-YFNQKYUI.js';
|
|
2
|
+
export { DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, KeyEnvironmentMismatchError, LIVE_KEY_PREFIX, PRODUCTION_BASE_URL, SANDBOX_BASE_URL, TEST_KEY_PREFIX, baseUrlForKey, environmentForBaseUrl, environmentFromKeyPrefix, isDemoKey, resolveEnvironment, verifyInvoSignature } from './chunk-YFNQKYUI.js';
|
|
3
|
+
export { SDK_VERSION } from './chunk-OYJUX2TH.js';
|
|
4
|
+
import { InvoError } from './chunk-I4GDKZFL.js';
|
|
5
|
+
export { InvoError } from './chunk-I4GDKZFL.js';
|
|
6
6
|
import { createHash, randomBytes } from 'crypto';
|
|
7
7
|
import { promises, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
8
8
|
import * as path from 'path';
|