@invonetwork/web-sdk 3.30.3 → 3.31.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 +17 -0
- package/README.md +13 -8
- package/dist/{chunk-7O5JT3LK.js → chunk-5T75PCZN.js} +3 -3
- package/dist/chunk-CI7PHE6L.js +6 -0
- package/dist/{chunk-TCT2QSVB.js → chunk-LMN2V4YT.js} +28 -7
- package/dist/{chunk-JJPAUW2S.js → chunk-UW66W2N6.js} +23 -8
- package/dist/game-server.cjs +46 -10
- 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 +27 -6
- package/dist/game.d.cts +3 -3
- package/dist/game.d.ts +3 -3
- package/dist/game.js +3 -3
- package/dist/{hosted-approval-awgyhXHa.d.cts → hosted-approval-BBQHClAP.d.cts} +1 -1
- package/dist/{hosted-approval-B2W9FSaW.d.ts → hosted-approval-Dp-BigX9.d.ts} +1 -1
- package/dist/index.cjs +26 -5
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{server-C9gIZ2Wx.d.ts → server-CaALJEML.d.ts} +22 -6
- package/dist/{server-B5BTXYXy.d.cts → server-D9bKfiY6.d.cts} +22 -6
- package/dist/server.cjs +46 -10
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +3 -3
- package/dist/{types-a9zeN1UE.d.ts → types-CBanzneD.d.cts} +41 -4
- package/dist/{types-a9zeN1UE.d.cts → types-CBanzneD.d.ts} +41 -4
- package/dist/{version-lfflokBD.d.cts → version-B4Eincjj.d.cts} +1 -1
- package/dist/{version-lfflokBD.d.ts → version-B4Eincjj.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-CSIEPFCV.js +0 -6
|
@@ -31,6 +31,11 @@ declare class InvoError extends Error {
|
|
|
31
31
|
readonly body: unknown;
|
|
32
32
|
/** Backend request id (from the response headers), when present — quote it in support tickets. */
|
|
33
33
|
readonly requestId: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The response's `Retry-After` header, as sent (additive, 3.31.0). Read {@link retryAfter}
|
|
36
|
+
* rather than this: it prefers the body's `retry_after` and falls back to this header.
|
|
37
|
+
*/
|
|
38
|
+
readonly retryAfterHeader: string | undefined;
|
|
34
39
|
constructor(args: {
|
|
35
40
|
message: string;
|
|
36
41
|
code?: string;
|
|
@@ -39,6 +44,7 @@ declare class InvoError extends Error {
|
|
|
39
44
|
status: number;
|
|
40
45
|
body?: unknown;
|
|
41
46
|
requestId?: string;
|
|
47
|
+
retryAfterHeader?: string;
|
|
42
48
|
});
|
|
43
49
|
/** True if this is the "recipient isn't passkey-enrolled, fall back to claim code" signal. */
|
|
44
50
|
get isReceiverNotEnrolled(): boolean;
|
|
@@ -822,8 +828,19 @@ declare class InvoError extends Error {
|
|
|
822
828
|
get isRewardUnavailable(): boolean;
|
|
823
829
|
/** True when the reward expired before it was redeemed (`vault_entry_expired`, 410). */
|
|
824
830
|
get isRewardExpired(): boolean;
|
|
825
|
-
/**
|
|
831
|
+
/**
|
|
832
|
+
* Seconds to wait before retrying, when the backend throttled the call: the body's
|
|
833
|
+
* `retry_after`, else the `Retry-After` header (seconds). Every INVO rate-limit 429 carries
|
|
834
|
+
* both (since 2026-10-20). `undefined` when neither is a usable number of seconds.
|
|
835
|
+
*/
|
|
826
836
|
get retryAfter(): number | undefined;
|
|
837
|
+
/**
|
|
838
|
+
* True when INVO refused the call for going over a rate limit (additive, 3.31.0): `error_code`
|
|
839
|
+
* `"RATE_LIMITED"` (every rate-limit 429 carries it since 2026-10-20), or any other 429 (an
|
|
840
|
+
* older release, or an endpoint with its own throttle body). Wait {@link retryAfter} seconds
|
|
841
|
+
* and send the same request again. Branch on this, not on the message.
|
|
842
|
+
*/
|
|
843
|
+
get isRateLimited(): boolean;
|
|
827
844
|
/** `body` as a plain object, or `{}` if it's a string/number/null (non-JSON responses).
|
|
828
845
|
* The `in` operator throws on primitives, so callers must go through this. */
|
|
829
846
|
private bodyObject;
|
|
@@ -1223,7 +1240,10 @@ interface CreateCheckoutInput {
|
|
|
1223
1240
|
* pinned here: expect a 400 carrying the live figure. */
|
|
1224
1241
|
usdAmount: string | number;
|
|
1225
1242
|
/** Which rail the hosted page presents. Default "platform" (card). The page
|
|
1226
|
-
* renders the right experience per rail
|
|
1243
|
+
* renders the right experience per rail. On every rail it shows the INVO logo by
|
|
1244
|
+
* default, or the game's own logo when one is set in the INVO console (Game
|
|
1245
|
+
* settings, Checkout branding), with a "Secured by INVO" line at the bottom.
|
|
1246
|
+
* There is no SDK call to set the logo. */
|
|
1227
1247
|
rail?: Rail;
|
|
1228
1248
|
successUrl?: string;
|
|
1229
1249
|
cancelUrl?: string;
|
|
@@ -1908,6 +1928,19 @@ interface PlatformOrderStatusResult {
|
|
|
1908
1928
|
* `receiptNumber` is.
|
|
1909
1929
|
*/
|
|
1910
1930
|
receiptUrl?: string;
|
|
1931
|
+
/**
|
|
1932
|
+
* Additive (2026-10-20): everything INVO kept on this sale, in USD, as a decimal string such
|
|
1933
|
+
* as `"0.50"`: the price less tax less {@link partnerShareUsd} (the card fee, and the
|
|
1934
|
+
* international card fee where it applies, on a card sale; the platform fee on a balance sale).
|
|
1935
|
+
* `null` until the sale has settled, or when the split cannot be read; `undefined` from an
|
|
1936
|
+
* INVO release that does not send it. A later refund or lost dispute does not change it.
|
|
1937
|
+
*/
|
|
1938
|
+
invoFeeUsd?: string | null;
|
|
1939
|
+
/**
|
|
1940
|
+
* Additive (2026-10-20): what you earned on this sale, in USD, as a decimal string. `null` and
|
|
1941
|
+
* `undefined` on the same terms as {@link invoFeeUsd}.
|
|
1942
|
+
*/
|
|
1943
|
+
partnerShareUsd?: string | null;
|
|
1911
1944
|
raw: Record<string, unknown>;
|
|
1912
1945
|
}
|
|
1913
1946
|
/** Input to `platformCommerce.getPurchaseHistory`. */
|
|
@@ -2781,7 +2814,9 @@ interface FirstCharge {
|
|
|
2781
2814
|
*/
|
|
2782
2815
|
failureCode: string | null;
|
|
2783
2816
|
nextRetryAt: string | null;
|
|
2784
|
-
/** On `requires_action`: a single-use bearer link. Do not log it beside identifiers you publish.
|
|
2817
|
+
/** On `requires_action`: a single-use bearer link. Do not log it beside identifiers you publish.
|
|
2818
|
+
* The page it opens shows the INVO logo by default, or the game's own logo when one is
|
|
2819
|
+
* set in the INVO console (Game settings, Checkout branding). */
|
|
2785
2820
|
confirmationUrl: string | null;
|
|
2786
2821
|
expiresAt: string | null;
|
|
2787
2822
|
message: string | null;
|
|
@@ -3314,7 +3349,9 @@ interface CardSetupSessionInput {
|
|
|
3314
3349
|
*/
|
|
3315
3350
|
interface CardSetupSessionResult {
|
|
3316
3351
|
sessionId: string;
|
|
3317
|
-
/** The INVO-hosted card page for this member. Never build this URL yourself.
|
|
3352
|
+
/** The INVO-hosted card page for this member. Never build this URL yourself. It
|
|
3353
|
+
* shows the INVO logo by default, or the game's own logo when one is set in the INVO
|
|
3354
|
+
* console (Game settings, Checkout branding). */
|
|
3318
3355
|
cardSetupUrl: string;
|
|
3319
3356
|
/** ISO 8601 with offset: 10 minutes after the mint. */
|
|
3320
3357
|
expiresAt: string;
|
|
@@ -31,6 +31,11 @@ declare class InvoError extends Error {
|
|
|
31
31
|
readonly body: unknown;
|
|
32
32
|
/** Backend request id (from the response headers), when present — quote it in support tickets. */
|
|
33
33
|
readonly requestId: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The response's `Retry-After` header, as sent (additive, 3.31.0). Read {@link retryAfter}
|
|
36
|
+
* rather than this: it prefers the body's `retry_after` and falls back to this header.
|
|
37
|
+
*/
|
|
38
|
+
readonly retryAfterHeader: string | undefined;
|
|
34
39
|
constructor(args: {
|
|
35
40
|
message: string;
|
|
36
41
|
code?: string;
|
|
@@ -39,6 +44,7 @@ declare class InvoError extends Error {
|
|
|
39
44
|
status: number;
|
|
40
45
|
body?: unknown;
|
|
41
46
|
requestId?: string;
|
|
47
|
+
retryAfterHeader?: string;
|
|
42
48
|
});
|
|
43
49
|
/** True if this is the "recipient isn't passkey-enrolled, fall back to claim code" signal. */
|
|
44
50
|
get isReceiverNotEnrolled(): boolean;
|
|
@@ -822,8 +828,19 @@ declare class InvoError extends Error {
|
|
|
822
828
|
get isRewardUnavailable(): boolean;
|
|
823
829
|
/** True when the reward expired before it was redeemed (`vault_entry_expired`, 410). */
|
|
824
830
|
get isRewardExpired(): boolean;
|
|
825
|
-
/**
|
|
831
|
+
/**
|
|
832
|
+
* Seconds to wait before retrying, when the backend throttled the call: the body's
|
|
833
|
+
* `retry_after`, else the `Retry-After` header (seconds). Every INVO rate-limit 429 carries
|
|
834
|
+
* both (since 2026-10-20). `undefined` when neither is a usable number of seconds.
|
|
835
|
+
*/
|
|
826
836
|
get retryAfter(): number | undefined;
|
|
837
|
+
/**
|
|
838
|
+
* True when INVO refused the call for going over a rate limit (additive, 3.31.0): `error_code`
|
|
839
|
+
* `"RATE_LIMITED"` (every rate-limit 429 carries it since 2026-10-20), or any other 429 (an
|
|
840
|
+
* older release, or an endpoint with its own throttle body). Wait {@link retryAfter} seconds
|
|
841
|
+
* and send the same request again. Branch on this, not on the message.
|
|
842
|
+
*/
|
|
843
|
+
get isRateLimited(): boolean;
|
|
827
844
|
/** `body` as a plain object, or `{}` if it's a string/number/null (non-JSON responses).
|
|
828
845
|
* The `in` operator throws on primitives, so callers must go through this. */
|
|
829
846
|
private bodyObject;
|
|
@@ -1223,7 +1240,10 @@ interface CreateCheckoutInput {
|
|
|
1223
1240
|
* pinned here: expect a 400 carrying the live figure. */
|
|
1224
1241
|
usdAmount: string | number;
|
|
1225
1242
|
/** Which rail the hosted page presents. Default "platform" (card). The page
|
|
1226
|
-
* renders the right experience per rail
|
|
1243
|
+
* renders the right experience per rail. On every rail it shows the INVO logo by
|
|
1244
|
+
* default, or the game's own logo when one is set in the INVO console (Game
|
|
1245
|
+
* settings, Checkout branding), with a "Secured by INVO" line at the bottom.
|
|
1246
|
+
* There is no SDK call to set the logo. */
|
|
1227
1247
|
rail?: Rail;
|
|
1228
1248
|
successUrl?: string;
|
|
1229
1249
|
cancelUrl?: string;
|
|
@@ -1908,6 +1928,19 @@ interface PlatformOrderStatusResult {
|
|
|
1908
1928
|
* `receiptNumber` is.
|
|
1909
1929
|
*/
|
|
1910
1930
|
receiptUrl?: string;
|
|
1931
|
+
/**
|
|
1932
|
+
* Additive (2026-10-20): everything INVO kept on this sale, in USD, as a decimal string such
|
|
1933
|
+
* as `"0.50"`: the price less tax less {@link partnerShareUsd} (the card fee, and the
|
|
1934
|
+
* international card fee where it applies, on a card sale; the platform fee on a balance sale).
|
|
1935
|
+
* `null` until the sale has settled, or when the split cannot be read; `undefined` from an
|
|
1936
|
+
* INVO release that does not send it. A later refund or lost dispute does not change it.
|
|
1937
|
+
*/
|
|
1938
|
+
invoFeeUsd?: string | null;
|
|
1939
|
+
/**
|
|
1940
|
+
* Additive (2026-10-20): what you earned on this sale, in USD, as a decimal string. `null` and
|
|
1941
|
+
* `undefined` on the same terms as {@link invoFeeUsd}.
|
|
1942
|
+
*/
|
|
1943
|
+
partnerShareUsd?: string | null;
|
|
1911
1944
|
raw: Record<string, unknown>;
|
|
1912
1945
|
}
|
|
1913
1946
|
/** Input to `platformCommerce.getPurchaseHistory`. */
|
|
@@ -2781,7 +2814,9 @@ interface FirstCharge {
|
|
|
2781
2814
|
*/
|
|
2782
2815
|
failureCode: string | null;
|
|
2783
2816
|
nextRetryAt: string | null;
|
|
2784
|
-
/** On `requires_action`: a single-use bearer link. Do not log it beside identifiers you publish.
|
|
2817
|
+
/** On `requires_action`: a single-use bearer link. Do not log it beside identifiers you publish.
|
|
2818
|
+
* The page it opens shows the INVO logo by default, or the game's own logo when one is
|
|
2819
|
+
* set in the INVO console (Game settings, Checkout branding). */
|
|
2785
2820
|
confirmationUrl: string | null;
|
|
2786
2821
|
expiresAt: string | null;
|
|
2787
2822
|
message: string | null;
|
|
@@ -3314,7 +3349,9 @@ interface CardSetupSessionInput {
|
|
|
3314
3349
|
*/
|
|
3315
3350
|
interface CardSetupSessionResult {
|
|
3316
3351
|
sessionId: string;
|
|
3317
|
-
/** The INVO-hosted card page for this member. Never build this URL yourself.
|
|
3352
|
+
/** The INVO-hosted card page for this member. Never build this URL yourself. It
|
|
3353
|
+
* shows the INVO logo by default, or the game's own logo when one is set in the INVO
|
|
3354
|
+
* console (Game settings, Checkout branding). */
|
|
3318
3355
|
cardSetupUrl: string;
|
|
3319
3356
|
/** ISO 8601 with offset: 10 minutes after the mint. */
|
|
3320
3357
|
expiresAt: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@invonetwork/web-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.31.0",
|
|
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,
|