@invonetwork/web-sdk 3.8.1 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/LICENSE +18 -18
- package/README.md +176 -51
- package/dist/{chunk-HYGBTUEJ.js → chunk-L4A6OV54.js} +106 -2
- package/dist/index.cjs +104 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/server.cjs +307 -61
- package/dist/server.d.cts +216 -37
- package/dist/server.d.ts +216 -37
- package/dist/server.js +204 -63
- package/dist/{types-DqRuqbqI.d.cts → types-CBxpXgAM.d.cts} +273 -15
- package/dist/{types-DqRuqbqI.d.ts → types-CBxpXgAM.d.ts} +273 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f66103c: Card-only subscriptions and subscription refund guardrails (INVO backend, 2026-09-17). Everything here is additive: no field, type or behaviour of an existing call was removed or renamed.
|
|
8
|
+
|
|
9
|
+
**Card-only subscriptions (behaviour change on INVO's side, no type changes).** A card subscription's card is now charged the full price every period; the member's coin wallet never pays for it and never moves. Steam subscriptions are unchanged (wallet first, Steam tops up the shortfall).
|
|
10
|
+
|
|
11
|
+
- `subscription.renewed` on the card rail: `funding.balance_applied_coins` is always `"0.00"`, `funding.card_charged_usd` is the price, `mint_order_id` is never `null`.
|
|
12
|
+
- Every paid card renewal also emits `purchase.completed` with `data.metadata.source === "subscription_renewal"`. Do not grant currency from it; `subscription.renewed` is the entitlement signal.
|
|
13
|
+
- A member with no saved card fails with `failure_code: "no_payment_method"` whatever their balance. New additive `failure_code`: `wallet_negative`.
|
|
14
|
+
- `walletOnly` is marked `@deprecated` (still accepted and returned): a wallet-only card subscription can never be paid (`failure_code: "wallet_only"`).
|
|
15
|
+
- `subscription.authentication_required`: `card_amount_usd` now equals `amount_due_usd` on card challenges.
|
|
16
|
+
- Doc fix: the `amountUsd` JSDoc now states the per-charge ceiling of `25000.00` (it still said `500.00`), and `SubscriptionExpiredData` no longer says `steam_containment` is sent.
|
|
17
|
+
|
|
18
|
+
**Subscription refund guardrails.**
|
|
19
|
+
|
|
20
|
+
- `subscriptions.refund` can now return a refund request. `RefundResult` stays a single interface (its `status` is typed `"refunded" | "pending_approval" | (string & {})`, so any string still assigns and compares); branch with the new `isRefundPendingApproval(r)` type guard, which narrows to `RefundPendingApproval`. `"pending_approval"` is the new HTTP 202: the refund would exceed the game's daily self-serve limit ($500 by default), nothing moved, and INVO reviews it as a refund request (`requestId`, `requestStatus`, `requestedAmountUsd`, `requestedAt`, `dailyCapUsd`, `executedTodayUsd`, `message`). Both carry every receipt field; the `request*` fields are optional on `RefundResult` and required on `RefundPendingApproval`. The status string is passed through from INVO unchanged.
|
|
21
|
+
- New optional result fields: `warnings` (`REASON_RECOMMENDED`, `REASON_TRUNCATED`), `subscriptionCanceled`, `subscriptionStatus`, `processingFeeUsd`, `processingFeeBasis`, `processingFeeBorneBy`, `processingFeeTransactionId`, `partnerTotalReversedUsd`, `initiation`, `refundRequestId`. `undefined` on receipts stored before the change.
|
|
22
|
+
- `reason` is documented as recommended now and required after a notice period. Refunds run within 30 days of the charge. A full refund cancels the subscription. Card-only periods are refunded in cash, partial included. The partner bears the card processor fee. INVO emails the member.
|
|
23
|
+
- New `InvoError` classifiers: `isRefundsNotEnabled` (403), `isRefundWindowClosed` (409), `isRefundRequestPending` (409), `isRefundRequestRejected` (409), `isConcurrentRequest` (409), `isRefundMismatch` (502), with body accessors `refundRequestId`, `decisionReason`, `periodChargedAt`, `refundWindowDays`, `refundWindowClosedAt`.
|
|
24
|
+
- New webhook types: `subscription.refund_requested`, `subscription.refund_approved`, `subscription.refund_rejected` (`SubscriptionRefundRequestData`, `SubscriptionRefundApprovedData`, `SubscriptionRefundRejectedData`). Additive fields on `subscription.refunded` (`refund.processing_fee_*`, `refund.partner_total_reversed_usd`, `initiation`, `refund_request_id`, `subscription_canceled`) and `subscription.canceled` (`cancel_cause: "full_refund"`).
|
|
25
|
+
- New exports: `isRefundPendingApproval`; types `RefundReceipt`, `RefundPendingApproval` (both extend `RefundResult`), `RefundWarning`, `RefundInitiation`, `RefundProcessingFeeBasis`.
|
|
26
|
+
|
|
27
|
+
**Compatibility.** Additive only. Code that compares `status` to any string, builds `RefundResult` mocks with a `string` status, or `extends`/`implements` `RefundResult` keeps compiling (pinned by a tsc test). `subscription.refunded`, `subscription.refund_approved` and, on a full refund, `subscription.canceled` are sent together and may arrive in any order.
|
|
28
|
+
|
|
29
|
+
README: the Subscriptions section states card-only funding, the renewal `purchase.completed` trap, the refund limits and the 202, the new events and classifiers, and "what did I earn" now subtracts `partner_total_reversed_usd`.
|
|
30
|
+
|
|
31
|
+
## 3.9.0
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- The INVO-hosted card page is the recommended way to save a card for a subscription.
|
|
36
|
+
|
|
37
|
+
New on `invo.cards`:
|
|
38
|
+
|
|
39
|
+
- **`createSetupSession({ playerEmail, successUrl?, cancelUrl?, metadata? })`** ->
|
|
40
|
+
`{ sessionId, cardSetupUrl, expiresAt, raw }` (`POST /api/checkout/card-setup-sessions`,
|
|
41
|
+
game secret header). Mint a 10-minute link server-side, send the member to `cardSetupUrl`
|
|
42
|
+
(top-level, never framed), and read the saved card's `id` back from `cards.list`; it appears
|
|
43
|
+
there immediately, carries the off-session consent a subscription needs, and no event fires
|
|
44
|
+
for it. No browser code, no client secret, no card processor named anywhere, so INVO can change
|
|
45
|
+
processor without partners changing anything. Never auto-retried: each call mints a fresh link.
|
|
46
|
+
Script-scheme `successUrl` / `cancelUrl` values are refused before the network (`INVALID_INPUT`,
|
|
47
|
+
status 0), matching INVO's own rule.
|
|
48
|
+
- `beginSetup` / `confirmSetup` are now documented as the **processor-bound alternative**: they
|
|
49
|
+
hand back a `clientSecret` only the current processor's client library can consume, so a card
|
|
50
|
+
form built on them needs rework when INVO changes processor.
|
|
51
|
+
|
|
52
|
+
New error classifiers: `isPlayerNotFound` (404 `PLAYER_NOT_FOUND`: the card page never creates
|
|
53
|
+
players), `isInvalidPlayerEmail` (400 `INVALID_PLAYER_EMAIL`), `isInvalidInput` (`INVALID_INPUT`,
|
|
54
|
+
at status 0 from the SDK's own guards or 400 from INVO for a script-scheme URL).
|
|
55
|
+
|
|
56
|
+
Fixed: `subscriptions.get(id, { includePlayer: true })` never populated `player`. INVO puts
|
|
57
|
+
`player_email` / `player_name` on the subscription object itself, not in a separate block; they
|
|
58
|
+
are now surfaced as `subscription.playerEmail` / `subscription.playerName`, and `player` is
|
|
59
|
+
derived from them.
|
|
60
|
+
|
|
61
|
+
README: a "Cards for subscriptions" section a partner can follow start to finish (mint, send,
|
|
62
|
+
read the card back, subscribe, what each error means, the 10-minute session, no browser code).
|
|
63
|
+
|
|
64
|
+
README corrections that ride along in this release: `subscription.expired` no longer carries
|
|
65
|
+
`failure_code: "steam_containment"` (a balance is spendable in any title whatever rail bought
|
|
66
|
+
it, so the "wallet value that cannot be spent in this game" deferral is gone from the deferrals
|
|
67
|
+
paragraph and the event table); the Steam transfer-policy note now says it is a rule about
|
|
68
|
+
currency moving between titles, not about spending (an item purchase never fails on origin);
|
|
69
|
+
and "game" reads "title" in a few places so a platform tenant is not misled by the word.
|
|
70
|
+
Line endings: a `.gitattributes` (`* text=auto eol=lf`) keeps the packed README, CHANGELOG and
|
|
71
|
+
package.json LF on every checkout (3.9.0's first build packed CRLF from a Windows checkout).
|
|
72
|
+
|
|
3
73
|
## 3.8.1
|
|
4
74
|
|
|
5
75
|
### Patch Changes
|
package/LICENSE
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
Copyright (c) 2026 Invo Tech Inc. All rights reserved.
|
|
2
|
-
|
|
3
|
-
This software and associated documentation files (the "Software") are the
|
|
4
|
-
proprietary property of Invo Tech Inc. ("INVO"). The Software is licensed, not
|
|
5
|
-
sold.
|
|
6
|
-
|
|
7
|
-
GRANT. INVO grants you a non-exclusive, non-transferable, royalty-free license to
|
|
8
|
-
install and use the Software, in unmodified form, solely to build and operate
|
|
9
|
-
integrations with the INVO platform, subject to INVO's developer terms at
|
|
10
|
-
https://invo.network.
|
|
11
|
-
|
|
12
|
-
RESTRICTIONS. Except as expressly permitted above, you may not copy, modify,
|
|
13
|
-
distribute, sublicense, sell, or create derivative works of the Software, or
|
|
14
|
-
remove any proprietary notices, without INVO's prior written consent.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
IMPLIED. IN NO EVENT SHALL INVO BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
18
|
-
LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE.
|
|
1
|
+
Copyright (c) 2026 Invo Tech Inc. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This software and associated documentation files (the "Software") are the
|
|
4
|
+
proprietary property of Invo Tech Inc. ("INVO"). The Software is licensed, not
|
|
5
|
+
sold.
|
|
6
|
+
|
|
7
|
+
GRANT. INVO grants you a non-exclusive, non-transferable, royalty-free license to
|
|
8
|
+
install and use the Software, in unmodified form, solely to build and operate
|
|
9
|
+
integrations with the INVO platform, subject to INVO's developer terms at
|
|
10
|
+
https://invo.network.
|
|
11
|
+
|
|
12
|
+
RESTRICTIONS. Except as expressly permitted above, you may not copy, modify,
|
|
13
|
+
distribute, sublicense, sell, or create derivative works of the Software, or
|
|
14
|
+
remove any proprietary notices, without INVO's prior written consent.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED. IN NO EVENT SHALL INVO BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
18
|
+
LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE.
|