@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.
Files changed (36) hide show
  1. package/CHANGELOG.md +1432 -1397
  2. package/README.md +2954 -2923
  3. package/dist/{chunk-YONO4JE5.js → chunk-664RAO2T.js} +25 -5
  4. package/dist/chunk-BIK6UXY7.js +6 -0
  5. package/dist/chunk-QDHOPJFL.js +1634 -0
  6. package/dist/{chunk-VP3OK4J4.js → chunk-TSTP2CWA.js} +471 -3
  7. package/dist/game-server.cjs +269 -2
  8. package/dist/game-server.d.cts +40 -6
  9. package/dist/game-server.d.ts +40 -6
  10. package/dist/game-server.js +252 -7
  11. package/dist/game.cjs +2677 -9
  12. package/dist/game.d.cts +78 -4
  13. package/dist/game.d.ts +78 -4
  14. package/dist/game.js +558 -3
  15. package/dist/hosted-approval-DcY4U2RN.d.cts +96 -0
  16. package/dist/hosted-approval-DiKmtjEh.d.ts +96 -0
  17. package/dist/index.d.cts +7 -96
  18. package/dist/index.d.ts +7 -96
  19. package/dist/index.js +2 -1635
  20. package/dist/loyalty-events-CmDw2ZoR.d.cts +40 -0
  21. package/dist/loyalty-events-CmDw2ZoR.d.ts +40 -0
  22. package/dist/{server-BYY6tM6X.d.ts → server-B0mvlGFY.d.ts} +17 -2
  23. package/dist/{server-Bxo_wgHx.d.cts → server-DEh9wjF2.d.cts} +17 -2
  24. package/dist/server.cjs +22 -1
  25. package/dist/server.d.cts +4 -3
  26. package/dist/server.d.ts +4 -3
  27. package/dist/server.js +3 -4
  28. package/dist/{types-_lIm74kd.d.cts → types-BTbZicgj.d.cts} +1 -40
  29. package/dist/{types-_lIm74kd.d.ts → types-BTbZicgj.d.ts} +1 -40
  30. package/dist/{types-CLyJDuXd.d.cts → types-jUxfYjiD.d.cts} +64 -1
  31. package/dist/{types-CLyJDuXd.d.ts → types-jUxfYjiD.d.ts} +64 -1
  32. package/dist/{version-DOaYbHu7.d.cts → version-DfVkILOj.d.cts} +1 -1
  33. package/dist/{version-DOaYbHu7.d.ts → version-DfVkILOj.d.ts} +1 -1
  34. package/package.json +91 -91
  35. package/dist/chunk-6CN236QH.js +0 -473
  36. package/dist/chunk-VOGZZ6QS.js +0 -6
@@ -1,6 +1,5 @@
1
- import { assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, receiptFields, creditFields, toLoyaltyCardsResult, toDestinationsResult } from './chunk-6CN236QH.js';
2
- import { SDK_VERSION } from './chunk-VOGZZ6QS.js';
3
- import { InvoError, buildGameEventBody, toReportGameEventResult } from './chunk-VP3OK4J4.js';
1
+ import { SDK_VERSION } from './chunk-BIK6UXY7.js';
2
+ import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-TSTP2CWA.js';
4
3
  import { createHmac, timingSafeEqual } from 'crypto';
5
4
 
6
5
  // src/payouts.ts
@@ -2216,6 +2215,27 @@ var SandboxSubscriptionsServer = class {
2216
2215
  var SandboxServer = class {
2217
2216
  constructor(http, auth, clockKey) {
2218
2217
  this.subscriptions = new SandboxSubscriptionsServer(http, auth, clockKey);
2218
+ this.http = http;
2219
+ this.auth = auth;
2220
+ }
2221
+ /**
2222
+ * Public demo key only (3.30.0): approve a send or transfer the demo player started, without
2223
+ * a passkey. INVO's demo sandbox answers with the claim code, which the recipient's game
2224
+ * server then uses with `claimCurrency` (a send) or `claimTransfer` (a transfer). Refused on
2225
+ * every other key and in production.
2226
+ */
2227
+ async approveDemoMove(transactionId, kind, opts) {
2228
+ if (typeof transactionId !== "string" || !transactionId.trim()) {
2229
+ throw invalidInput2("transactionId", transactionId, "is required");
2230
+ }
2231
+ const path = `/test-auth/${kind === "send" ? "sends" : "transfers"}/${encodeURIComponent(transactionId)}/approve`;
2232
+ const raw = await this.http.post(path, {}, this.auth, { signal: opts?.signal });
2233
+ return {
2234
+ status: String(raw["status"] ?? ""),
2235
+ claimCode: typeof raw["claim_code"] === "string" ? raw["claim_code"] : null,
2236
+ claimCodeExpiresAt: typeof raw["claim_code_expires_at"] === "string" ? raw["claim_code_expires_at"] : null,
2237
+ raw
2238
+ };
2219
2239
  }
2220
2240
  };
2221
2241
  var InvoServer = class {
@@ -3748,5 +3768,5 @@ var InvoServer = class {
3748
3768
  };
3749
3769
 
3750
3770
  export { CardsServer, DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, PRODUCTION_BASE_URL, PayoutsServer, PlatformCommerceServer, SANDBOX_BASE_URL, SandboxServer, SandboxSubscriptionsServer, SubscriptionsServer, baseUrlForKey, createWebhookHandler, isDemoKey, isRefundPendingApproval, resolveEnvironment, verifyInvoSignature, verifyWebhook, verifyWebhookAsync };
3751
- //# sourceMappingURL=chunk-YONO4JE5.js.map
3752
- //# sourceMappingURL=chunk-YONO4JE5.js.map
3771
+ //# sourceMappingURL=chunk-664RAO2T.js.map
3772
+ //# sourceMappingURL=chunk-664RAO2T.js.map
@@ -0,0 +1,6 @@
1
+ // src/version.ts
2
+ var SDK_VERSION = "3.30.0";
3
+
4
+ export { SDK_VERSION };
5
+ //# sourceMappingURL=chunk-BIK6UXY7.js.map
6
+ //# sourceMappingURL=chunk-BIK6UXY7.js.map