@invonetwork/web-sdk 3.29.1 → 3.30.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 +1432 -1397
- package/README.md +2954 -2923
- package/dist/{chunk-YONO4JE5.js → chunk-664RAO2T.js} +25 -5
- package/dist/chunk-BIK6UXY7.js +6 -0
- package/dist/chunk-QDHOPJFL.js +1634 -0
- package/dist/{chunk-VP3OK4J4.js → chunk-TSTP2CWA.js} +471 -3
- package/dist/game-server.cjs +269 -2
- package/dist/game-server.d.cts +40 -6
- package/dist/game-server.d.ts +40 -6
- package/dist/game-server.js +252 -7
- 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-BYY6tM6X.d.ts → server-B0mvlGFY.d.ts} +17 -2
- package/dist/{server-Bxo_wgHx.d.cts → server-DEh9wjF2.d.cts} +17 -2
- package/dist/server.cjs +22 -1
- 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-DfVkILOj.d.cts} +1 -1
- package/dist/{version-DOaYbHu7.d.ts → version-DfVkILOj.d.ts} +1 -1
- package/package.json +91 -91
- package/dist/chunk-6CN236QH.js +0 -473
- package/dist/chunk-VOGZZ6QS.js +0 -6
|
@@ -151,5 +151,68 @@ interface GameErrorBody {
|
|
|
151
151
|
requestId?: string;
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* How currency moves to another player. Both are approved with the sender's passkey on INVO's
|
|
156
|
+
* hosted page. A **transfer** can also give the sender a claim code to pass on; a **send** can
|
|
157
|
+
* be collected from a link INVO texts to a phone-only recipient.
|
|
158
|
+
*/
|
|
159
|
+
type GameTransferKind = "transfer" | "send";
|
|
160
|
+
/** `GET /transfers/status` answer: whether players can move currency here, and how. */
|
|
161
|
+
interface GameTransferStatus {
|
|
162
|
+
enabled: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Why transfers are off: `"sandbox"` (your own sandbox key: set `INVO_TRANSFERS=on` to try
|
|
165
|
+
* them), `"off"` (switched off for this game), `"checking"` (the key's environment is still
|
|
166
|
+
* being looked up). `null` when enabled.
|
|
167
|
+
*/
|
|
168
|
+
reason: "sandbox" | "off" | "checking" | null;
|
|
169
|
+
/** True on the public demo key. */
|
|
170
|
+
demo: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Who can receive: `"project"` on the demo key (players of this copy only), `"network"`
|
|
173
|
+
* otherwise (any player of any INVO game the destination list offers).
|
|
174
|
+
*/
|
|
175
|
+
scope: "project" | "network";
|
|
176
|
+
/** Which recipient details to ask for. On the demo key only an email; otherwise a phone. */
|
|
177
|
+
recipientFields: {
|
|
178
|
+
email: "required" | "optional";
|
|
179
|
+
phone: "required" | "hidden";
|
|
180
|
+
};
|
|
181
|
+
/** INVO's API base for the player-token calls (destinations, approval, collecting). */
|
|
182
|
+
apiBaseUrl: string | null;
|
|
183
|
+
/**
|
|
184
|
+
* How the sender approves: `"passkey"` on INVO's hosted page, or `"sandbox"` on the public
|
|
185
|
+
* demo key, where the game server approves in INVO's demo sandbox without a passkey and the
|
|
186
|
+
* recipient collects through the game server.
|
|
187
|
+
*/
|
|
188
|
+
approval: "passkey" | "sandbox";
|
|
189
|
+
}
|
|
190
|
+
/** `POST /transfers` body. */
|
|
191
|
+
interface GameTransferInput {
|
|
192
|
+
kind?: GameTransferKind;
|
|
193
|
+
/** A destination's `gameId` from `getDestinations`. */
|
|
194
|
+
targetGameId: string | number;
|
|
195
|
+
/** A positive decimal string or number. */
|
|
196
|
+
amount: string | number;
|
|
197
|
+
/** Required on the demo key (the server maps it to the demo player); optional otherwise. */
|
|
198
|
+
recipientEmail?: string;
|
|
199
|
+
/** Required on a real key (E.164); not used on the demo key. */
|
|
200
|
+
recipientPhone?: string;
|
|
201
|
+
/** The sender's phone, when the game never stored one (real keys only). */
|
|
202
|
+
senderPhone?: string;
|
|
203
|
+
/** Idempotency key (8 to 64 of `A-Z a-z 0-9 _ -`). Default: a fresh UUID. */
|
|
204
|
+
clientRequestId?: string;
|
|
205
|
+
}
|
|
206
|
+
/** `POST /transfers` answer: approve it next, from a click, on INVO's hosted page. */
|
|
207
|
+
interface GameTransferStart {
|
|
208
|
+
transactionId: string;
|
|
209
|
+
kind: GameTransferKind;
|
|
210
|
+
/** A minor's transfer waits for a guardian (emailed) instead of the passkey page. */
|
|
211
|
+
guardianPending: boolean;
|
|
212
|
+
/** A fresh player token when the sender's INVO identity changed; the client swaps it in. */
|
|
213
|
+
playerToken: string | null;
|
|
214
|
+
/** How to approve it: see {@link GameTransferStatus.approval}. */
|
|
215
|
+
approval: "passkey" | "sandbox";
|
|
216
|
+
}
|
|
154
217
|
|
|
155
|
-
export type { GameCurrencyKind as G, GamePurchaseStatus as a, GameEconomyConfig as b, GameCatalog as c, GameCatalogItem as d, GameCheckout as e, GameCurrencyBalance as f, GameErrorBody as g, GameItemPurchase as h, GamePlayer as i, GamePremiumPack as j, GamePurchase as k, GameSession as l,
|
|
218
|
+
export type { GameCurrencyKind as G, GamePurchaseStatus as a, GameEconomyConfig as b, GameCatalog as c, GameCatalogItem as d, GameCheckout as e, GameCurrencyBalance as f, GameErrorBody as g, GameItemPurchase as h, GamePlayer as i, GamePremiumPack as j, GamePurchase as k, GameSession as l, GameTransferInput as m, GameTransferKind as n, GameTransferStart as o, GameTransferStatus as p, GameWallet as q };
|
package/package.json
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@invonetwork/web-sdk",
|
|
3
|
-
"version": "3.
|
|
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
|
-
"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
|
-
"./game": {
|
|
39
|
-
"types": "./dist/game.d.ts",
|
|
40
|
-
"import": "./dist/game.js",
|
|
41
|
-
"require": "./dist/game.cjs"
|
|
42
|
-
},
|
|
43
|
-
"./game-server": {
|
|
44
|
-
"types": "./dist/game-server.d.ts",
|
|
45
|
-
"import": "./dist/game-server.js",
|
|
46
|
-
"require": "./dist/game-server.cjs"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"main": "./dist/index.cjs",
|
|
50
|
-
"module": "./dist/index.js",
|
|
51
|
-
"types": "./dist/index.d.ts",
|
|
52
|
-
"scripts": {
|
|
53
|
-
"build": "tsup",
|
|
54
|
-
"dev": "tsup --watch",
|
|
55
|
-
"typecheck": "tsc --noEmit",
|
|
56
|
-
"lint": "eslint .",
|
|
57
|
-
"test": "vitest run",
|
|
58
|
-
"test:watch": "vitest",
|
|
59
|
-
"clean": "rimraf dist",
|
|
60
|
-
"changeset": "changeset",
|
|
61
|
-
"version-packages": "changeset version",
|
|
62
|
-
"release": "npm run build && changeset publish",
|
|
63
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
64
|
-
},
|
|
65
|
-
"keywords": [
|
|
66
|
-
"invo",
|
|
67
|
-
"webauthn",
|
|
68
|
-
"passkey",
|
|
69
|
-
"payments",
|
|
70
|
-
"game-currency",
|
|
71
|
-
"sdk",
|
|
72
|
-
"game",
|
|
73
|
-
"game-economy",
|
|
74
|
-
"browser-game",
|
|
75
|
-
"loyalty"
|
|
76
|
-
],
|
|
77
|
-
"publishConfig": {
|
|
78
|
-
"access": "public"
|
|
79
|
-
},
|
|
80
|
-
"devDependencies": {
|
|
81
|
-
"@changesets/cli": "^2.31.0",
|
|
82
|
-
"@eslint/js": "^10.0.1",
|
|
83
|
-
"eslint": "^10.6.0",
|
|
84
|
-
"happy-dom": "^15.11.7",
|
|
85
|
-
"rimraf": "^5.0.5",
|
|
86
|
-
"tsup": "^8.0.1",
|
|
87
|
-
"typescript": "^5.4.5",
|
|
88
|
-
"typescript-eslint": "^8.62.1",
|
|
89
|
-
"vitest": "^1.5.0"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@invonetwork/web-sdk",
|
|
3
|
+
"version": "3.30.0",
|
|
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
|
+
"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
|
+
"./game": {
|
|
39
|
+
"types": "./dist/game.d.ts",
|
|
40
|
+
"import": "./dist/game.js",
|
|
41
|
+
"require": "./dist/game.cjs"
|
|
42
|
+
},
|
|
43
|
+
"./game-server": {
|
|
44
|
+
"types": "./dist/game-server.d.ts",
|
|
45
|
+
"import": "./dist/game-server.js",
|
|
46
|
+
"require": "./dist/game-server.cjs"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"main": "./dist/index.cjs",
|
|
50
|
+
"module": "./dist/index.js",
|
|
51
|
+
"types": "./dist/index.d.ts",
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsup",
|
|
54
|
+
"dev": "tsup --watch",
|
|
55
|
+
"typecheck": "tsc --noEmit",
|
|
56
|
+
"lint": "eslint .",
|
|
57
|
+
"test": "vitest run",
|
|
58
|
+
"test:watch": "vitest",
|
|
59
|
+
"clean": "rimraf dist",
|
|
60
|
+
"changeset": "changeset",
|
|
61
|
+
"version-packages": "changeset version",
|
|
62
|
+
"release": "npm run build && changeset publish",
|
|
63
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
64
|
+
},
|
|
65
|
+
"keywords": [
|
|
66
|
+
"invo",
|
|
67
|
+
"webauthn",
|
|
68
|
+
"passkey",
|
|
69
|
+
"payments",
|
|
70
|
+
"game-currency",
|
|
71
|
+
"sdk",
|
|
72
|
+
"game",
|
|
73
|
+
"game-economy",
|
|
74
|
+
"browser-game",
|
|
75
|
+
"loyalty"
|
|
76
|
+
],
|
|
77
|
+
"publishConfig": {
|
|
78
|
+
"access": "public"
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@changesets/cli": "^2.31.0",
|
|
82
|
+
"@eslint/js": "^10.0.1",
|
|
83
|
+
"eslint": "^10.6.0",
|
|
84
|
+
"happy-dom": "^15.11.7",
|
|
85
|
+
"rimraf": "^5.0.5",
|
|
86
|
+
"tsup": "^8.0.1",
|
|
87
|
+
"typescript": "^5.4.5",
|
|
88
|
+
"typescript-eslint": "^8.62.1",
|
|
89
|
+
"vitest": "^1.5.0"
|
|
90
|
+
}
|
|
91
|
+
}
|