@invonetwork/web-sdk 0.8.0 → 1.1.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 +221 -194
- package/README.md +56 -6
- package/dist/{chunk-D3XBTH4C.js → chunk-ZVKWDXSL.js} +6 -2
- package/dist/index.cjs +4 -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 +182 -1
- package/dist/server.d.cts +36 -3
- package/dist/server.d.ts +36 -3
- package/dist/server.js +180 -3
- package/dist/{types-DLSCxpoT.d.cts → types-CPt_5_Aw.d.cts} +77 -1
- package/dist/{types-DLSCxpoT.d.ts → types-CPt_5_Aw.d.ts} +77 -1
- package/package.json +76 -76
|
@@ -37,6 +37,8 @@ declare class InvoError extends Error {
|
|
|
37
37
|
* is a rate-limit, not a top-up condition) is NOT misclassified as this.
|
|
38
38
|
*/
|
|
39
39
|
get isInsufficientBalance(): boolean;
|
|
40
|
+
/** True if a claim needs phone-share approval before it can complete (claim → 409). */
|
|
41
|
+
get isPhoneShareApprovalRequired(): boolean;
|
|
40
42
|
/** True if an idempotency-keyed request was a duplicate (item purchase → 409). */
|
|
41
43
|
get isDuplicateRequest(): boolean;
|
|
42
44
|
/** Seconds to wait before retrying, when the backend throttled the call (429 `retry_after`). */
|
|
@@ -459,5 +461,79 @@ interface LinkDeviceResult {
|
|
|
459
461
|
status: string;
|
|
460
462
|
raw: Record<string, unknown>;
|
|
461
463
|
}
|
|
464
|
+
interface SmsVerifyResult {
|
|
465
|
+
/** "success" on a completed verification. */
|
|
466
|
+
status: string;
|
|
467
|
+
transactionId: string;
|
|
468
|
+
/** The recipient claim code, when the completion issued one. */
|
|
469
|
+
claimCode?: string;
|
|
470
|
+
/** Canonical balance AFTER completion, when the backend returned it. */
|
|
471
|
+
newBalance?: string | number | null;
|
|
472
|
+
orderId?: string;
|
|
473
|
+
raw: Record<string, unknown>;
|
|
474
|
+
}
|
|
475
|
+
interface ClaimTransferInput {
|
|
476
|
+
claimCode: string;
|
|
477
|
+
targetPlayerName: string;
|
|
478
|
+
targetPlayerEmail: string;
|
|
479
|
+
targetPlayerPhone: string;
|
|
480
|
+
/** Which of this game's currencies to credit. */
|
|
481
|
+
targetCurrencyId: string | number;
|
|
482
|
+
/** Re-submit with this after a `needsAccountSelection` result to disambiguate a
|
|
483
|
+
* phone that maps to more than one of your players. */
|
|
484
|
+
targetPlayerId?: string | number;
|
|
485
|
+
}
|
|
486
|
+
interface ClaimCurrencyInput {
|
|
487
|
+
claimCode: string;
|
|
488
|
+
receiverPlayerName: string;
|
|
489
|
+
receiverPlayerEmail: string;
|
|
490
|
+
receiverPlayerPhone: string;
|
|
491
|
+
/** Re-submit with this after a `needsAccountSelection` result (multi-account phone). */
|
|
492
|
+
receiverPlayerId?: string | number;
|
|
493
|
+
}
|
|
494
|
+
interface ClaimResult {
|
|
495
|
+
/** "success" on completion, or "needs_account_selection" (see `needsAccountSelection`). */
|
|
496
|
+
status: string;
|
|
497
|
+
transactionId?: string;
|
|
498
|
+
newBalance?: string | number | null;
|
|
499
|
+
currencyName?: string;
|
|
500
|
+
orderId?: string;
|
|
501
|
+
/**
|
|
502
|
+
* true when a 200 came back as `status:"needs_account_selection"` (the recipient
|
|
503
|
+
* phone maps to more than one of your players). NOT an error — re-submit the claim
|
|
504
|
+
* with `targetPlayerId` (transfer) / `receiverPlayerId` (send) from `candidates`.
|
|
505
|
+
*/
|
|
506
|
+
needsAccountSelection: boolean;
|
|
507
|
+
/** Candidate accounts to disambiguate, present on a `needsAccountSelection` result. */
|
|
508
|
+
candidates?: Record<string, unknown>[];
|
|
509
|
+
raw: Record<string, unknown>;
|
|
510
|
+
}
|
|
511
|
+
/** `verification_state` ∈ awaiting | approved | completed | expired | failed | unknown. */
|
|
512
|
+
interface TransactionStatusResult {
|
|
513
|
+
transactionId: string;
|
|
514
|
+
/** "transfer" | "send". */
|
|
515
|
+
transactionType: string;
|
|
516
|
+
transactionStatus: string;
|
|
517
|
+
verificationState: string;
|
|
518
|
+
amount: string | number | null;
|
|
519
|
+
netAmount: string | number | null;
|
|
520
|
+
currencyId: string | number;
|
|
521
|
+
orderId?: string;
|
|
522
|
+
toPhone?: string;
|
|
523
|
+
toIdentityId?: string | null;
|
|
524
|
+
/** Everything else (send fees, game names, claim_info, failure_reason, sender claim_code, …). */
|
|
525
|
+
raw: Record<string, unknown>;
|
|
526
|
+
}
|
|
527
|
+
/** `state` ∈ pending | approved | rejected | expired. */
|
|
528
|
+
interface GuardianApprovalStatusResult {
|
|
529
|
+
state: string;
|
|
530
|
+
approvalId?: string;
|
|
531
|
+
transactionId?: string;
|
|
532
|
+
expiresAt?: string;
|
|
533
|
+
decidedAt?: string;
|
|
534
|
+
decisionSource?: string;
|
|
535
|
+
actionDescription?: string;
|
|
536
|
+
raw: Record<string, unknown>;
|
|
537
|
+
}
|
|
462
538
|
|
|
463
|
-
export { type ApproveResult as A, type BalanceResult as B, type ClientConfig as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type PlayerBalanceResult as F, type InboundPendingQuery as G, type InboundPendingResult as H, InvoError as I, type LinkedIdentitiesQuery as J, type LinkedIdentitiesResult as K, type LinkDeviceResult as L, type
|
|
539
|
+
export { type ApproveResult as A, type BalanceResult as B, type ClientConfig as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type PlayerBalanceResult as F, type InboundPendingQuery as G, type InboundPendingResult as H, InvoError as I, type LinkedIdentitiesQuery as J, type LinkedIdentitiesResult as K, type LinkDeviceResult as L, type SmsVerifyResult as M, type ClaimTransferInput as N, type OrderDetailsResult as O, type PendingCollectResult as P, type ClaimResult as Q, type Rail as R, type ServerConfig as S, type ClaimCurrencyInput as T, type TransactionStatusResult as U, type VerificationMethod as V, type GuardianApprovalStatusResult as W, type CurrencyBalance as X, type InboundPendingItem as Y, type LinkedIdentityEmail as Z, type CallOptions as a, type ConfirmReceiptResult as b, type DestinationsResult as c, type EnrollmentVerifyResult as d, type BalanceRow as e, type DestinationGame as f, type InvoErrorInfo as g, type InvoHooks as h, type InvoRequestInfo as i, type InvoResponseInfo as j, type PendingCollectItem as k, type PlayerToken as l, type InitiateSendInput as m, type InitiateResult as n, type InitiateTransferInput as o, type CreateCheckoutInput as p, type CreateCheckoutResult as q, type PurchaseInput as r, type PurchaseResult as s, type ConfirmPaymentResult as t, type PurchaseItemInput as u, type PurchaseItemResult as v, type ItemHistoryQuery as w, type ItemHistoryResult as x, type ItemOrderQuery as y, type PlayerBalanceQuery as z };
|
package/package.json
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@invonetwork/web-sdk",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "INVO Web SDK — currency purchase + passkey (WebAuthn) verification for partner web platforms.",
|
|
5
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
-
"private": false,
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/Invo-Technologies/invo-web-sdk.git"
|
|
10
|
-
},
|
|
11
|
-
"homepage": "https://docs.invo.network",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/Invo-Technologies/invo-web-sdk/issues"
|
|
14
|
-
},
|
|
15
|
-
"type": "module",
|
|
16
|
-
"engines": {
|
|
17
|
-
"node": ">=18"
|
|
18
|
-
},
|
|
19
|
-
"sideEffects": false,
|
|
20
|
-
"files": [
|
|
21
|
-
"dist",
|
|
22
|
-
"!dist/**/*.map",
|
|
23
|
-
"README.md",
|
|
24
|
-
"LICENSE",
|
|
25
|
-
"CHANGELOG.md"
|
|
26
|
-
],
|
|
27
|
-
"exports": {
|
|
28
|
-
".": {
|
|
29
|
-
"types": "./dist/index.d.ts",
|
|
30
|
-
"import": "./dist/index.js",
|
|
31
|
-
"require": "./dist/index.cjs"
|
|
32
|
-
},
|
|
33
|
-
"./server": {
|
|
34
|
-
"types": "./dist/server.d.ts",
|
|
35
|
-
"import": "./dist/server.js",
|
|
36
|
-
"require": "./dist/server.cjs"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"main": "./dist/index.cjs",
|
|
40
|
-
"module": "./dist/index.js",
|
|
41
|
-
"types": "./dist/index.d.ts",
|
|
42
|
-
"scripts": {
|
|
43
|
-
"build": "tsup",
|
|
44
|
-
"dev": "tsup --watch",
|
|
45
|
-
"typecheck": "tsc --noEmit",
|
|
46
|
-
"lint": "eslint .",
|
|
47
|
-
"test": "vitest run",
|
|
48
|
-
"test:watch": "vitest",
|
|
49
|
-
"clean": "rimraf dist",
|
|
50
|
-
"changeset": "changeset",
|
|
51
|
-
"version-packages": "changeset version",
|
|
52
|
-
"release": "npm run build && changeset publish",
|
|
53
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
54
|
-
},
|
|
55
|
-
"keywords": [
|
|
56
|
-
"invo",
|
|
57
|
-
"webauthn",
|
|
58
|
-
"passkey",
|
|
59
|
-
"payments",
|
|
60
|
-
"game-currency",
|
|
61
|
-
"sdk"
|
|
62
|
-
],
|
|
63
|
-
"publishConfig": {
|
|
64
|
-
"access": "public"
|
|
65
|
-
},
|
|
66
|
-
"devDependencies": {
|
|
67
|
-
"@changesets/cli": "^2.31.0",
|
|
68
|
-
"@eslint/js": "^10.0.1",
|
|
69
|
-
"eslint": "^10.6.0",
|
|
70
|
-
"rimraf": "^5.0.5",
|
|
71
|
-
"tsup": "^8.0.1",
|
|
72
|
-
"typescript": "^5.4.5",
|
|
73
|
-
"typescript-eslint": "^8.62.1",
|
|
74
|
-
"vitest": "^1.5.0"
|
|
75
|
-
}
|
|
76
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@invonetwork/web-sdk",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "INVO Web SDK — currency purchase + passkey (WebAuthn) verification for partner web platforms.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"private": false,
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Invo-Technologies/invo-web-sdk.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://docs.invo.network",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Invo-Technologies/invo-web-sdk/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
18
|
+
},
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"!dist/**/*.map",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"CHANGELOG.md"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"require": "./dist/index.cjs"
|
|
32
|
+
},
|
|
33
|
+
"./server": {
|
|
34
|
+
"types": "./dist/server.d.ts",
|
|
35
|
+
"import": "./dist/server.js",
|
|
36
|
+
"require": "./dist/server.cjs"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"main": "./dist/index.cjs",
|
|
40
|
+
"module": "./dist/index.js",
|
|
41
|
+
"types": "./dist/index.d.ts",
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsup",
|
|
44
|
+
"dev": "tsup --watch",
|
|
45
|
+
"typecheck": "tsc --noEmit",
|
|
46
|
+
"lint": "eslint .",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:watch": "vitest",
|
|
49
|
+
"clean": "rimraf dist",
|
|
50
|
+
"changeset": "changeset",
|
|
51
|
+
"version-packages": "changeset version",
|
|
52
|
+
"release": "npm run build && changeset publish",
|
|
53
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
54
|
+
},
|
|
55
|
+
"keywords": [
|
|
56
|
+
"invo",
|
|
57
|
+
"webauthn",
|
|
58
|
+
"passkey",
|
|
59
|
+
"payments",
|
|
60
|
+
"game-currency",
|
|
61
|
+
"sdk"
|
|
62
|
+
],
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@changesets/cli": "^2.31.0",
|
|
68
|
+
"@eslint/js": "^10.0.1",
|
|
69
|
+
"eslint": "^10.6.0",
|
|
70
|
+
"rimraf": "^5.0.5",
|
|
71
|
+
"tsup": "^8.0.1",
|
|
72
|
+
"typescript": "^5.4.5",
|
|
73
|
+
"typescript-eslint": "^8.62.1",
|
|
74
|
+
"vitest": "^1.5.0"
|
|
75
|
+
}
|
|
76
|
+
}
|