@invonetwork/web-sdk 3.29.1 → 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 +1442 -1397
- package/README.md +2954 -2923
- package/dist/chunk-3ECVREIM.js +6 -0
- package/dist/chunk-7O5JT3LK.js +1590 -0
- package/dist/{chunk-VP3OK4J4.js → chunk-TCT2QSVB.js} +515 -3
- package/dist/{chunk-YONO4JE5.js → chunk-V2RQYQQD.js} +44 -5
- package/dist/game-server.cjs +387 -42
- package/dist/game-server.d.cts +42 -6
- package/dist/game-server.d.ts +42 -6
- package/dist/game-server.js +286 -8
- package/dist/game.cjs +2677 -9
- package/dist/game.d.cts +78 -4
- package/dist/game.d.ts +78 -4
- package/dist/game.js +558 -3
- package/dist/hosted-approval-DcY4U2RN.d.cts +96 -0
- package/dist/hosted-approval-DiKmtjEh.d.ts +96 -0
- package/dist/index.d.cts +7 -96
- package/dist/index.d.ts +7 -96
- package/dist/index.js +2 -1635
- package/dist/loyalty-events-CmDw2ZoR.d.cts +40 -0
- package/dist/loyalty-events-CmDw2ZoR.d.ts +40 -0
- package/dist/{server-Bxo_wgHx.d.cts → server-BAOn3KH3.d.cts} +28 -2
- package/dist/{server-BYY6tM6X.d.ts → server-DHmQU1eN.d.ts} +28 -2
- package/dist/server.cjs +106 -40
- package/dist/server.d.cts +4 -3
- package/dist/server.d.ts +4 -3
- package/dist/server.js +3 -4
- package/dist/{types-_lIm74kd.d.cts → types-BTbZicgj.d.cts} +1 -40
- package/dist/{types-_lIm74kd.d.ts → types-BTbZicgj.d.ts} +1 -40
- package/dist/{types-CLyJDuXd.d.cts → types-jUxfYjiD.d.cts} +64 -1
- package/dist/{types-CLyJDuXd.d.ts → types-jUxfYjiD.d.ts} +64 -1
- package/dist/{version-DOaYbHu7.d.cts → version-CR7XECyP.d.cts} +1 -1
- package/dist/{version-DOaYbHu7.d.ts → version-CR7XECyP.d.ts} +1 -1
- package/package.json +91 -91
- package/dist/chunk-6CN236QH.js +0 -473
- package/dist/chunk-VOGZZ6QS.js +0 -6
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-BTbZicgj.cjs';
|
|
2
|
+
|
|
3
|
+
/** The four device-approval flows (`begin.flow`). */
|
|
4
|
+
type HostedFlow = "transfer" | "send" | "send_receipt" | "transfer_receipt";
|
|
5
|
+
/** Outcome of {@link InvoClient.approveHosted}. */
|
|
6
|
+
type HostedApprovalStatus =
|
|
7
|
+
/** The poll said approved AND the approve endpoint accepted the `device_code` — see `approval`. */
|
|
8
|
+
"approved"
|
|
9
|
+
/** The player declined (poll `access_denied`, incl. a denied enrolment). The popup stays open. */
|
|
10
|
+
| "denied"
|
|
11
|
+
/** The grant expired (poll `expired_token`, or `expires_in` passed) — start a new approval. */
|
|
12
|
+
| "expired"
|
|
13
|
+
/** The player closed the popup (or `signal` aborted) before an answer. */
|
|
14
|
+
| "closed"
|
|
15
|
+
/** Popups were blocked and `popupBlocked: "redirect"` navigated this tab. */
|
|
16
|
+
| "redirected"
|
|
17
|
+
/**
|
|
18
|
+
* The popup could not be used: blocked by the browser (default `popupBlocked: "resolve"`),
|
|
19
|
+
* severed by `Cross-Origin-Opener-Policy: same-origin` on your page, or the redirect
|
|
20
|
+
* fallback failed. `message` says which. Nothing was started when the browser blocked it.
|
|
21
|
+
*/
|
|
22
|
+
| "blocked";
|
|
23
|
+
interface ApproveHostedResult<A = ApproveResult | ConfirmReceiptResult> {
|
|
24
|
+
status: HostedApprovalStatus;
|
|
25
|
+
/** true when the popup could not be used (status `redirected` or `blocked`). */
|
|
26
|
+
popupBlocked: boolean;
|
|
27
|
+
/** Human-readable reason for `blocked`; absent otherwise. */
|
|
28
|
+
message?: string;
|
|
29
|
+
/**
|
|
30
|
+
* On `approved`: the approve endpoint's response — the same shape `approveSend` /
|
|
31
|
+
* `approveTransfer` return for `transfer`/`send`, and `confirmReceipt*` for the
|
|
32
|
+
* receipt flows. A 202 hold (risk / guardian / step-up) surfaces as `holdReason`.
|
|
33
|
+
*/
|
|
34
|
+
approval?: A;
|
|
35
|
+
}
|
|
36
|
+
/** The poll's `enrollment` object (snake_case on the wire; camelCase tolerated). */
|
|
37
|
+
interface HostedEnrollmentInput {
|
|
38
|
+
state?: string;
|
|
39
|
+
device_label?: string;
|
|
40
|
+
deviceLabel?: string;
|
|
41
|
+
match_code?: string;
|
|
42
|
+
matchCode?: string;
|
|
43
|
+
requested_at?: string;
|
|
44
|
+
requestedAt?: string;
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
/** Normalised enrolment state the SDK renders and reports through `onEnrollment`. */
|
|
48
|
+
interface HostedEnrollment {
|
|
49
|
+
/** `awaiting_screen` → prompt shown; `confirmed` → "finishing" row; anything else → removed. */
|
|
50
|
+
state: string;
|
|
51
|
+
/** Fixed-list label of the device that opened the page (iPhone, Android phone, ...). */
|
|
52
|
+
deviceLabel: string;
|
|
53
|
+
/** The code the hosted page is showing; the player must see the SAME code here. */
|
|
54
|
+
matchCode: string;
|
|
55
|
+
requestedAt: string | undefined;
|
|
56
|
+
raw: Record<string, unknown>;
|
|
57
|
+
}
|
|
58
|
+
type EnrollmentDecision = "approve" | "deny";
|
|
59
|
+
/** Answer the match-code prompt (the SDK forwards it to `confirm-enrollment`). */
|
|
60
|
+
type EnrollmentRespond = (decision: EnrollmentDecision) => Promise<void>;
|
|
61
|
+
interface ApproveHostedOptions {
|
|
62
|
+
/** The transaction to approve (the id your server got when it initiated it). */
|
|
63
|
+
transactionId: string;
|
|
64
|
+
/** Which device-approval flow: `transfer` | `send` | `send_receipt` | `transfer_receipt`. */
|
|
65
|
+
flow: HostedFlow;
|
|
66
|
+
/**
|
|
67
|
+
* Pin the origin the wake-up is accepted from. `verification_uri_complete` is still
|
|
68
|
+
* parsed, must be https, and its origin must EQUAL this value — otherwise the call
|
|
69
|
+
* rejects. Default: the URL's own origin.
|
|
70
|
+
*/
|
|
71
|
+
platformOrigin?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Observe the enrolment state each time it changes (`null` when cleared). To draw
|
|
74
|
+
* your own prompt, set `renderPrompt: false` and call `respond("approve" | "deny")`.
|
|
75
|
+
*/
|
|
76
|
+
onEnrollment?: (enrollment: HostedEnrollment | null, respond: EnrollmentRespond) => void;
|
|
77
|
+
/** Render the INVO match-code prompt (default true). */
|
|
78
|
+
renderPrompt?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* When the browser blocks the popup: `"resolve"` (default) resolves `blocked` before
|
|
81
|
+
* anything is started, so you can show a button and call again from its click
|
|
82
|
+
* handler; `"redirect"` starts the grant and navigates THIS tab to the hosted page
|
|
83
|
+
* (resolving `redirected` first — your page unloads; the `device_approval.approved`
|
|
84
|
+
* webhook is then your only signal).
|
|
85
|
+
*/
|
|
86
|
+
popupBlocked?: "redirect" | "resolve";
|
|
87
|
+
/** Popup size. Defaults 480×720. */
|
|
88
|
+
popup?: {
|
|
89
|
+
width?: number;
|
|
90
|
+
height?: number;
|
|
91
|
+
};
|
|
92
|
+
/** Abort → the popup is closed and the promise resolves `closed`. */
|
|
93
|
+
signal?: AbortSignal;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type { ApproveHostedResult as A, EnrollmentDecision as E, HostedApprovalStatus as H, ApproveHostedOptions as a, EnrollmentRespond as b, HostedEnrollment as c, HostedEnrollmentInput as d, HostedFlow as e };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-BTbZicgj.js';
|
|
2
|
+
|
|
3
|
+
/** The four device-approval flows (`begin.flow`). */
|
|
4
|
+
type HostedFlow = "transfer" | "send" | "send_receipt" | "transfer_receipt";
|
|
5
|
+
/** Outcome of {@link InvoClient.approveHosted}. */
|
|
6
|
+
type HostedApprovalStatus =
|
|
7
|
+
/** The poll said approved AND the approve endpoint accepted the `device_code` — see `approval`. */
|
|
8
|
+
"approved"
|
|
9
|
+
/** The player declined (poll `access_denied`, incl. a denied enrolment). The popup stays open. */
|
|
10
|
+
| "denied"
|
|
11
|
+
/** The grant expired (poll `expired_token`, or `expires_in` passed) — start a new approval. */
|
|
12
|
+
| "expired"
|
|
13
|
+
/** The player closed the popup (or `signal` aborted) before an answer. */
|
|
14
|
+
| "closed"
|
|
15
|
+
/** Popups were blocked and `popupBlocked: "redirect"` navigated this tab. */
|
|
16
|
+
| "redirected"
|
|
17
|
+
/**
|
|
18
|
+
* The popup could not be used: blocked by the browser (default `popupBlocked: "resolve"`),
|
|
19
|
+
* severed by `Cross-Origin-Opener-Policy: same-origin` on your page, or the redirect
|
|
20
|
+
* fallback failed. `message` says which. Nothing was started when the browser blocked it.
|
|
21
|
+
*/
|
|
22
|
+
| "blocked";
|
|
23
|
+
interface ApproveHostedResult<A = ApproveResult | ConfirmReceiptResult> {
|
|
24
|
+
status: HostedApprovalStatus;
|
|
25
|
+
/** true when the popup could not be used (status `redirected` or `blocked`). */
|
|
26
|
+
popupBlocked: boolean;
|
|
27
|
+
/** Human-readable reason for `blocked`; absent otherwise. */
|
|
28
|
+
message?: string;
|
|
29
|
+
/**
|
|
30
|
+
* On `approved`: the approve endpoint's response — the same shape `approveSend` /
|
|
31
|
+
* `approveTransfer` return for `transfer`/`send`, and `confirmReceipt*` for the
|
|
32
|
+
* receipt flows. A 202 hold (risk / guardian / step-up) surfaces as `holdReason`.
|
|
33
|
+
*/
|
|
34
|
+
approval?: A;
|
|
35
|
+
}
|
|
36
|
+
/** The poll's `enrollment` object (snake_case on the wire; camelCase tolerated). */
|
|
37
|
+
interface HostedEnrollmentInput {
|
|
38
|
+
state?: string;
|
|
39
|
+
device_label?: string;
|
|
40
|
+
deviceLabel?: string;
|
|
41
|
+
match_code?: string;
|
|
42
|
+
matchCode?: string;
|
|
43
|
+
requested_at?: string;
|
|
44
|
+
requestedAt?: string;
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
/** Normalised enrolment state the SDK renders and reports through `onEnrollment`. */
|
|
48
|
+
interface HostedEnrollment {
|
|
49
|
+
/** `awaiting_screen` → prompt shown; `confirmed` → "finishing" row; anything else → removed. */
|
|
50
|
+
state: string;
|
|
51
|
+
/** Fixed-list label of the device that opened the page (iPhone, Android phone, ...). */
|
|
52
|
+
deviceLabel: string;
|
|
53
|
+
/** The code the hosted page is showing; the player must see the SAME code here. */
|
|
54
|
+
matchCode: string;
|
|
55
|
+
requestedAt: string | undefined;
|
|
56
|
+
raw: Record<string, unknown>;
|
|
57
|
+
}
|
|
58
|
+
type EnrollmentDecision = "approve" | "deny";
|
|
59
|
+
/** Answer the match-code prompt (the SDK forwards it to `confirm-enrollment`). */
|
|
60
|
+
type EnrollmentRespond = (decision: EnrollmentDecision) => Promise<void>;
|
|
61
|
+
interface ApproveHostedOptions {
|
|
62
|
+
/** The transaction to approve (the id your server got when it initiated it). */
|
|
63
|
+
transactionId: string;
|
|
64
|
+
/** Which device-approval flow: `transfer` | `send` | `send_receipt` | `transfer_receipt`. */
|
|
65
|
+
flow: HostedFlow;
|
|
66
|
+
/**
|
|
67
|
+
* Pin the origin the wake-up is accepted from. `verification_uri_complete` is still
|
|
68
|
+
* parsed, must be https, and its origin must EQUAL this value — otherwise the call
|
|
69
|
+
* rejects. Default: the URL's own origin.
|
|
70
|
+
*/
|
|
71
|
+
platformOrigin?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Observe the enrolment state each time it changes (`null` when cleared). To draw
|
|
74
|
+
* your own prompt, set `renderPrompt: false` and call `respond("approve" | "deny")`.
|
|
75
|
+
*/
|
|
76
|
+
onEnrollment?: (enrollment: HostedEnrollment | null, respond: EnrollmentRespond) => void;
|
|
77
|
+
/** Render the INVO match-code prompt (default true). */
|
|
78
|
+
renderPrompt?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* When the browser blocks the popup: `"resolve"` (default) resolves `blocked` before
|
|
81
|
+
* anything is started, so you can show a button and call again from its click
|
|
82
|
+
* handler; `"redirect"` starts the grant and navigates THIS tab to the hosted page
|
|
83
|
+
* (resolving `redirected` first — your page unloads; the `device_approval.approved`
|
|
84
|
+
* webhook is then your only signal).
|
|
85
|
+
*/
|
|
86
|
+
popupBlocked?: "redirect" | "resolve";
|
|
87
|
+
/** Popup size. Defaults 480×720. */
|
|
88
|
+
popup?: {
|
|
89
|
+
width?: number;
|
|
90
|
+
height?: number;
|
|
91
|
+
};
|
|
92
|
+
/** Abort → the popup is closed and the promise resolves `closed`. */
|
|
93
|
+
signal?: AbortSignal;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type { ApproveHostedResult as A, EnrollmentDecision as E, HostedApprovalStatus as H, ApproveHostedOptions as a, EnrollmentRespond as b, HostedEnrollment as c, HostedEnrollmentInput as d, HostedFlow as e };
|
package/dist/index.d.cts
CHANGED
|
@@ -1,98 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type HostedApprovalStatus =
|
|
8
|
-
/** The poll said approved AND the approve endpoint accepted the `device_code` — see `approval`. */
|
|
9
|
-
"approved"
|
|
10
|
-
/** The player declined (poll `access_denied`, incl. a denied enrolment). The popup stays open. */
|
|
11
|
-
| "denied"
|
|
12
|
-
/** The grant expired (poll `expired_token`, or `expires_in` passed) — start a new approval. */
|
|
13
|
-
| "expired"
|
|
14
|
-
/** The player closed the popup (or `signal` aborted) before an answer. */
|
|
15
|
-
| "closed"
|
|
16
|
-
/** Popups were blocked and `popupBlocked: "redirect"` navigated this tab. */
|
|
17
|
-
| "redirected"
|
|
18
|
-
/**
|
|
19
|
-
* The popup could not be used: blocked by the browser (default `popupBlocked: "resolve"`),
|
|
20
|
-
* severed by `Cross-Origin-Opener-Policy: same-origin` on your page, or the redirect
|
|
21
|
-
* fallback failed. `message` says which. Nothing was started when the browser blocked it.
|
|
22
|
-
*/
|
|
23
|
-
| "blocked";
|
|
24
|
-
interface ApproveHostedResult<A = ApproveResult | ConfirmReceiptResult> {
|
|
25
|
-
status: HostedApprovalStatus;
|
|
26
|
-
/** true when the popup could not be used (status `redirected` or `blocked`). */
|
|
27
|
-
popupBlocked: boolean;
|
|
28
|
-
/** Human-readable reason for `blocked`; absent otherwise. */
|
|
29
|
-
message?: string;
|
|
30
|
-
/**
|
|
31
|
-
* On `approved`: the approve endpoint's response — the same shape `approveSend` /
|
|
32
|
-
* `approveTransfer` return for `transfer`/`send`, and `confirmReceipt*` for the
|
|
33
|
-
* receipt flows. A 202 hold (risk / guardian / step-up) surfaces as `holdReason`.
|
|
34
|
-
*/
|
|
35
|
-
approval?: A;
|
|
36
|
-
}
|
|
37
|
-
/** The poll's `enrollment` object (snake_case on the wire; camelCase tolerated). */
|
|
38
|
-
interface HostedEnrollmentInput {
|
|
39
|
-
state?: string;
|
|
40
|
-
device_label?: string;
|
|
41
|
-
deviceLabel?: string;
|
|
42
|
-
match_code?: string;
|
|
43
|
-
matchCode?: string;
|
|
44
|
-
requested_at?: string;
|
|
45
|
-
requestedAt?: string;
|
|
46
|
-
[key: string]: unknown;
|
|
47
|
-
}
|
|
48
|
-
/** Normalised enrolment state the SDK renders and reports through `onEnrollment`. */
|
|
49
|
-
interface HostedEnrollment {
|
|
50
|
-
/** `awaiting_screen` → prompt shown; `confirmed` → "finishing" row; anything else → removed. */
|
|
51
|
-
state: string;
|
|
52
|
-
/** Fixed-list label of the device that opened the page (iPhone, Android phone, ...). */
|
|
53
|
-
deviceLabel: string;
|
|
54
|
-
/** The code the hosted page is showing; the player must see the SAME code here. */
|
|
55
|
-
matchCode: string;
|
|
56
|
-
requestedAt: string | undefined;
|
|
57
|
-
raw: Record<string, unknown>;
|
|
58
|
-
}
|
|
59
|
-
type EnrollmentDecision = "approve" | "deny";
|
|
60
|
-
/** Answer the match-code prompt (the SDK forwards it to `confirm-enrollment`). */
|
|
61
|
-
type EnrollmentRespond = (decision: EnrollmentDecision) => Promise<void>;
|
|
62
|
-
interface ApproveHostedOptions {
|
|
63
|
-
/** The transaction to approve (the id your server got when it initiated it). */
|
|
64
|
-
transactionId: string;
|
|
65
|
-
/** Which device-approval flow: `transfer` | `send` | `send_receipt` | `transfer_receipt`. */
|
|
66
|
-
flow: HostedFlow;
|
|
67
|
-
/**
|
|
68
|
-
* Pin the origin the wake-up is accepted from. `verification_uri_complete` is still
|
|
69
|
-
* parsed, must be https, and its origin must EQUAL this value — otherwise the call
|
|
70
|
-
* rejects. Default: the URL's own origin.
|
|
71
|
-
*/
|
|
72
|
-
platformOrigin?: string;
|
|
73
|
-
/**
|
|
74
|
-
* Observe the enrolment state each time it changes (`null` when cleared). To draw
|
|
75
|
-
* your own prompt, set `renderPrompt: false` and call `respond("approve" | "deny")`.
|
|
76
|
-
*/
|
|
77
|
-
onEnrollment?: (enrollment: HostedEnrollment | null, respond: EnrollmentRespond) => void;
|
|
78
|
-
/** Render the INVO match-code prompt (default true). */
|
|
79
|
-
renderPrompt?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* When the browser blocks the popup: `"resolve"` (default) resolves `blocked` before
|
|
82
|
-
* anything is started, so you can show a button and call again from its click
|
|
83
|
-
* handler; `"redirect"` starts the grant and navigates THIS tab to the hosted page
|
|
84
|
-
* (resolving `redirected` first — your page unloads; the `device_approval.approved`
|
|
85
|
-
* webhook is then your only signal).
|
|
86
|
-
*/
|
|
87
|
-
popupBlocked?: "redirect" | "resolve";
|
|
88
|
-
/** Popup size. Defaults 480×720. */
|
|
89
|
-
popup?: {
|
|
90
|
-
width?: number;
|
|
91
|
-
height?: number;
|
|
92
|
-
};
|
|
93
|
-
/** Abort → the popup is closed and the promise resolves `closed`. */
|
|
94
|
-
signal?: AbortSignal;
|
|
95
|
-
}
|
|
1
|
+
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-BTbZicgj.cjs';
|
|
2
|
+
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-BTbZicgj.cjs';
|
|
3
|
+
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-DcY4U2RN.cjs';
|
|
4
|
+
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-DcY4U2RN.cjs';
|
|
5
|
+
import { R as ReportGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.cjs';
|
|
6
|
+
export { G as GameEventType } from './loyalty-events-CmDw2ZoR.cjs';
|
|
96
7
|
|
|
97
8
|
/**
|
|
98
9
|
* The purchase was charged and the coins are in the balance. Show `coinsCredited`,
|
|
@@ -522,4 +433,4 @@ declare class InvoClient {
|
|
|
522
433
|
private confirmReceipt;
|
|
523
434
|
}
|
|
524
435
|
|
|
525
|
-
export {
|
|
436
|
+
export { ApproveHostedOptions, ApproveHostedResult, ApprovePhoneChangeInput, ApprovePhoneChangeResult, ApproveResult, BalanceResult, CallOptions, CheckoutClient, CheckoutClientConfig, CheckoutMountHandle, ClientConfig, ConfirmReceiptResult, DestinationsQuery, DestinationsResult, EnrollmentBeginResult, EnrollmentVerifyResult, InvoClient, LinkDeviceResult, LoyaltyCardsResult, LoyaltyVaultResult, MountCheckoutOptions, PendingCollectResult, PhoneChangeApprovalsResult, PlatformCommerceClient, PurchaseCredited, PurchaseExpired, PurchaseRefunded, PurchaseRefused, PurchaseStatusInput, PurchaseStatusResult, RecoveryBeginResult, RecoveryCompleteResult, RedeemRewardResult, ReportGameEventInput, ReportGameEventResult, RewardsPageLink, WaitForPurchaseInput, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, nothingWasCharged, phoneChangeSignalMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,98 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type HostedApprovalStatus =
|
|
8
|
-
/** The poll said approved AND the approve endpoint accepted the `device_code` — see `approval`. */
|
|
9
|
-
"approved"
|
|
10
|
-
/** The player declined (poll `access_denied`, incl. a denied enrolment). The popup stays open. */
|
|
11
|
-
| "denied"
|
|
12
|
-
/** The grant expired (poll `expired_token`, or `expires_in` passed) — start a new approval. */
|
|
13
|
-
| "expired"
|
|
14
|
-
/** The player closed the popup (or `signal` aborted) before an answer. */
|
|
15
|
-
| "closed"
|
|
16
|
-
/** Popups were blocked and `popupBlocked: "redirect"` navigated this tab. */
|
|
17
|
-
| "redirected"
|
|
18
|
-
/**
|
|
19
|
-
* The popup could not be used: blocked by the browser (default `popupBlocked: "resolve"`),
|
|
20
|
-
* severed by `Cross-Origin-Opener-Policy: same-origin` on your page, or the redirect
|
|
21
|
-
* fallback failed. `message` says which. Nothing was started when the browser blocked it.
|
|
22
|
-
*/
|
|
23
|
-
| "blocked";
|
|
24
|
-
interface ApproveHostedResult<A = ApproveResult | ConfirmReceiptResult> {
|
|
25
|
-
status: HostedApprovalStatus;
|
|
26
|
-
/** true when the popup could not be used (status `redirected` or `blocked`). */
|
|
27
|
-
popupBlocked: boolean;
|
|
28
|
-
/** Human-readable reason for `blocked`; absent otherwise. */
|
|
29
|
-
message?: string;
|
|
30
|
-
/**
|
|
31
|
-
* On `approved`: the approve endpoint's response — the same shape `approveSend` /
|
|
32
|
-
* `approveTransfer` return for `transfer`/`send`, and `confirmReceipt*` for the
|
|
33
|
-
* receipt flows. A 202 hold (risk / guardian / step-up) surfaces as `holdReason`.
|
|
34
|
-
*/
|
|
35
|
-
approval?: A;
|
|
36
|
-
}
|
|
37
|
-
/** The poll's `enrollment` object (snake_case on the wire; camelCase tolerated). */
|
|
38
|
-
interface HostedEnrollmentInput {
|
|
39
|
-
state?: string;
|
|
40
|
-
device_label?: string;
|
|
41
|
-
deviceLabel?: string;
|
|
42
|
-
match_code?: string;
|
|
43
|
-
matchCode?: string;
|
|
44
|
-
requested_at?: string;
|
|
45
|
-
requestedAt?: string;
|
|
46
|
-
[key: string]: unknown;
|
|
47
|
-
}
|
|
48
|
-
/** Normalised enrolment state the SDK renders and reports through `onEnrollment`. */
|
|
49
|
-
interface HostedEnrollment {
|
|
50
|
-
/** `awaiting_screen` → prompt shown; `confirmed` → "finishing" row; anything else → removed. */
|
|
51
|
-
state: string;
|
|
52
|
-
/** Fixed-list label of the device that opened the page (iPhone, Android phone, ...). */
|
|
53
|
-
deviceLabel: string;
|
|
54
|
-
/** The code the hosted page is showing; the player must see the SAME code here. */
|
|
55
|
-
matchCode: string;
|
|
56
|
-
requestedAt: string | undefined;
|
|
57
|
-
raw: Record<string, unknown>;
|
|
58
|
-
}
|
|
59
|
-
type EnrollmentDecision = "approve" | "deny";
|
|
60
|
-
/** Answer the match-code prompt (the SDK forwards it to `confirm-enrollment`). */
|
|
61
|
-
type EnrollmentRespond = (decision: EnrollmentDecision) => Promise<void>;
|
|
62
|
-
interface ApproveHostedOptions {
|
|
63
|
-
/** The transaction to approve (the id your server got when it initiated it). */
|
|
64
|
-
transactionId: string;
|
|
65
|
-
/** Which device-approval flow: `transfer` | `send` | `send_receipt` | `transfer_receipt`. */
|
|
66
|
-
flow: HostedFlow;
|
|
67
|
-
/**
|
|
68
|
-
* Pin the origin the wake-up is accepted from. `verification_uri_complete` is still
|
|
69
|
-
* parsed, must be https, and its origin must EQUAL this value — otherwise the call
|
|
70
|
-
* rejects. Default: the URL's own origin.
|
|
71
|
-
*/
|
|
72
|
-
platformOrigin?: string;
|
|
73
|
-
/**
|
|
74
|
-
* Observe the enrolment state each time it changes (`null` when cleared). To draw
|
|
75
|
-
* your own prompt, set `renderPrompt: false` and call `respond("approve" | "deny")`.
|
|
76
|
-
*/
|
|
77
|
-
onEnrollment?: (enrollment: HostedEnrollment | null, respond: EnrollmentRespond) => void;
|
|
78
|
-
/** Render the INVO match-code prompt (default true). */
|
|
79
|
-
renderPrompt?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* When the browser blocks the popup: `"resolve"` (default) resolves `blocked` before
|
|
82
|
-
* anything is started, so you can show a button and call again from its click
|
|
83
|
-
* handler; `"redirect"` starts the grant and navigates THIS tab to the hosted page
|
|
84
|
-
* (resolving `redirected` first — your page unloads; the `device_approval.approved`
|
|
85
|
-
* webhook is then your only signal).
|
|
86
|
-
*/
|
|
87
|
-
popupBlocked?: "redirect" | "resolve";
|
|
88
|
-
/** Popup size. Defaults 480×720. */
|
|
89
|
-
popup?: {
|
|
90
|
-
width?: number;
|
|
91
|
-
height?: number;
|
|
92
|
-
};
|
|
93
|
-
/** Abort → the popup is closed and the promise resolves `closed`. */
|
|
94
|
-
signal?: AbortSignal;
|
|
95
|
-
}
|
|
1
|
+
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-BTbZicgj.js';
|
|
2
|
+
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-BTbZicgj.js';
|
|
3
|
+
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-DiKmtjEh.js';
|
|
4
|
+
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-DiKmtjEh.js';
|
|
5
|
+
import { R as ReportGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.js';
|
|
6
|
+
export { G as GameEventType } from './loyalty-events-CmDw2ZoR.js';
|
|
96
7
|
|
|
97
8
|
/**
|
|
98
9
|
* The purchase was charged and the coins are in the balance. Show `coinsCredited`,
|
|
@@ -522,4 +433,4 @@ declare class InvoClient {
|
|
|
522
433
|
private confirmReceipt;
|
|
523
434
|
}
|
|
524
435
|
|
|
525
|
-
export {
|
|
436
|
+
export { ApproveHostedOptions, ApproveHostedResult, ApprovePhoneChangeInput, ApprovePhoneChangeResult, ApproveResult, BalanceResult, CallOptions, CheckoutClient, CheckoutClientConfig, CheckoutMountHandle, ClientConfig, ConfirmReceiptResult, DestinationsQuery, DestinationsResult, EnrollmentBeginResult, EnrollmentVerifyResult, InvoClient, LinkDeviceResult, LoyaltyCardsResult, LoyaltyVaultResult, MountCheckoutOptions, PendingCollectResult, PhoneChangeApprovalsResult, PlatformCommerceClient, PurchaseCredited, PurchaseExpired, PurchaseRefunded, PurchaseRefused, PurchaseStatusInput, PurchaseStatusResult, RecoveryBeginResult, RecoveryCompleteResult, RedeemRewardResult, ReportGameEventInput, ReportGameEventResult, RewardsPageLink, WaitForPurchaseInput, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, nothingWasCharged, phoneChangeSignalMessage };
|