@invonetwork/web-sdk 3.34.0 → 3.35.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 (33) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +104 -11
  3. package/dist/chunk-6763YM7P.js +6 -0
  4. package/dist/{chunk-R65CANFG.js → chunk-BGCSSWVL.js} +105 -3
  5. package/dist/{chunk-DMTNU5PM.js → chunk-SCFK6IVH.js} +3 -3
  6. package/dist/{chunk-D2AUZRYS.js → chunk-XN6MCLQV.js} +231 -70
  7. package/dist/game-server.cjs +294 -74
  8. package/dist/game-server.d.cts +4 -4
  9. package/dist/game-server.d.ts +4 -4
  10. package/dist/game-server.js +5 -5
  11. package/dist/game.cjs +105 -3
  12. package/dist/game.d.cts +3 -3
  13. package/dist/game.d.ts +3 -3
  14. package/dist/game.js +4 -4
  15. package/dist/{hosted-approval-CFlj4UQE.d.ts → hosted-approval-DIYUGgHi.d.ts} +1 -1
  16. package/dist/{hosted-approval-C1hQvbu6.d.cts → hosted-approval-VQ3uyeDh.d.cts} +1 -1
  17. package/dist/index.cjs +103 -1
  18. package/dist/index.d.cts +4 -4
  19. package/dist/index.d.ts +4 -4
  20. package/dist/index.js +2 -2
  21. package/dist/{server-CtXpytKt.d.ts → server-CMJHOmYL.d.ts} +120 -9
  22. package/dist/{server-ZnCyLWA2.d.cts → server-DF-BZU0B.d.cts} +120 -9
  23. package/dist/server.cjs +333 -67
  24. package/dist/server.d.cts +3 -3
  25. package/dist/server.d.ts +3 -3
  26. package/dist/server.js +3 -3
  27. package/dist/{types-Ctn8N2_l.d.ts → types-Dv0UavA9.d.cts} +149 -4
  28. package/dist/{types-Ctn8N2_l.d.cts → types-Dv0UavA9.d.ts} +149 -4
  29. package/dist/{version-Ce_pLpJf.d.cts → version-DB2wgiPY.d.cts} +1 -1
  30. package/dist/{version-Ce_pLpJf.d.ts → version-DB2wgiPY.d.ts} +1 -1
  31. package/docs/apple-in-app-purchases.md +382 -0
  32. package/package.json +2 -1
  33. package/dist/chunk-73ZVDQZV.js +0 -6
package/dist/server.cjs CHANGED
@@ -845,7 +845,7 @@ var InvoError = class _InvoError extends Error {
845
845
  /**
846
846
  * True when a sandbox clock call was refused for a missing, wrong or never-issued
847
847
  * `X-Sandbox-Clock-Key` (`SANDBOX_CLOCK_UNAUTHORIZED`, 401). Reveal or rotate the key on
848
- * the game's Game Settings page in the sandbox console.
848
+ * the game's Game Settings page in the INVO console in test mode (console.invo.network/test).
849
849
  */
850
850
  get isSandboxClockUnauthorized() {
851
851
  return this.code === "SANDBOX_CLOCK_UNAUTHORIZED";
@@ -1165,6 +1165,108 @@ var InvoError = class _InvoError extends Error {
1165
1165
  get isRateLimited() {
1166
1166
  return this.code === "RATE_LIMITED" || this.code === "rate_limited" || this.status === 429;
1167
1167
  }
1168
+ // ---- Apple In-App Purchase (verifyApplePurchase / appleProducts, 3.35.0) ----
1169
+ //
1170
+ // Apple has already charged the player when verifyApplePurchase runs. Decide whether to
1171
+ // call StoreKit's Transaction.finish() with shouldFinishAppleTransaction() (or `finish`),
1172
+ // not with these: among the errors only APPLE_TRANSACTION_REVOKED,
1173
+ // APPLE_TRANSACTION_ALREADY_USED and APPLE_TRANSACTION_TOO_OLD are finished.
1174
+ /**
1175
+ * The body's boolean `finish` (additive, 3.35.0), sent on every `verifyApplePurchase`
1176
+ * answer: `true` when the game should call StoreKit's `Transaction.finish()` for this
1177
+ * refusal (nothing can ever be delivered), `false` when it should leave the transaction
1178
+ * unfinished and retry. `undefined` when the body carries none (any other endpoint, an
1179
+ * older backend, or a network error); `shouldFinishAppleTransaction(err)` then falls back
1180
+ * to the error code.
1181
+ */
1182
+ get finish() {
1183
+ const f = this.bodyObject()["finish"];
1184
+ return typeof f === "boolean" ? f : void 0;
1185
+ }
1186
+ /** Not a genuine Apple transaction (`APPLE_SIGNATURE_INVALID`, 400). Leave it unfinished. */
1187
+ get isAppleSignatureInvalid() {
1188
+ return this.code === "APPLE_SIGNATURE_INVALID";
1189
+ }
1190
+ /** Another app's transaction: the bundle id (or Apple ID) is not this game's
1191
+ * (`APPLE_BUNDLE_MISMATCH`, 400). */
1192
+ get isAppleBundleMismatch() {
1193
+ return this.code === "APPLE_BUNDLE_MISMATCH";
1194
+ }
1195
+ /** The transaction's environment is not accepted here (`APPLE_ENVIRONMENT_NOT_ALLOWED`, 400).
1196
+ * The INVO sandbox takes only Sandbox transactions; Xcode StoreKit-testing transactions are
1197
+ * never accepted, because Apple does not sign them. */
1198
+ get isAppleEnvironmentNotAllowed() {
1199
+ return this.code === "APPLE_ENVIRONMENT_NOT_ALLOWED";
1200
+ }
1201
+ /** Only consumable products buy currency (`APPLE_PRODUCT_TYPE_UNSUPPORTED`, 400). */
1202
+ get isAppleProductTypeUnsupported() {
1203
+ return this.code === "APPLE_PRODUCT_TYPE_UNSUPPORTED";
1204
+ }
1205
+ /** The product id is not registered for this game (`APPLE_PRODUCT_UNKNOWN`, 400). Register
1206
+ * it in the INVO console and retry; keep the transaction unfinished meanwhile. */
1207
+ get isAppleProductUnknown() {
1208
+ return this.code === "APPLE_PRODUCT_UNKNOWN";
1209
+ }
1210
+ /** `metadata` was refused (`INVALID_METADATA`, 400). Fix the request and retry. */
1211
+ get isInvalidMetadata() {
1212
+ return this.code === "INVALID_METADATA";
1213
+ }
1214
+ /** A Sandbox purchase on INVO production by an account not on the game's App Review list
1215
+ * (`APPLE_REVIEW_ACCOUNT_REQUIRED`, 403). */
1216
+ get isAppleReviewAccountRequired() {
1217
+ return this.code === "APPLE_REVIEW_ACCOUNT_REQUIRED";
1218
+ }
1219
+ /** Apple refunded or revoked the transaction (`APPLE_TRANSACTION_REVOKED`, 409). Nothing can
1220
+ * ever be delivered for it: **finish it** (`finish: true`). */
1221
+ get isAppleTransactionRevoked() {
1222
+ return this.code === "APPLE_TRANSACTION_REVOKED";
1223
+ }
1224
+ /** The transaction was already credited in another INVO game
1225
+ * (`APPLE_TRANSACTION_ALREADY_USED`, 409). Terminal: **finish it** (`finish: true`). */
1226
+ get isAppleTransactionAlreadyUsed() {
1227
+ return this.code === "APPLE_TRANSACTION_ALREADY_USED";
1228
+ }
1229
+ /** Bought before the game sold through INVO (`APPLE_TRANSACTION_TOO_OLD`, 409). Terminal:
1230
+ * **finish it** (`finish: true`). */
1231
+ get isAppleTransactionTooOld() {
1232
+ return this.code === "APPLE_TRANSACTION_TOO_OLD";
1233
+ }
1234
+ /** The product's coins are out of proportion to its signed price, or over the per-purchase
1235
+ * maximum (`APPLE_VALUE_EXCEEDS_PRICE`, 409). Fix the product mapping and retry. */
1236
+ get isAppleValueExceedsPrice() {
1237
+ return this.code === "APPLE_VALUE_EXCEEDS_PRICE";
1238
+ }
1239
+ /** The transaction's `appAccountToken` is not the one you sent: it was made for a
1240
+ * different player (`APPLE_ACCOUNT_TOKEN_MISMATCH`, 409). */
1241
+ get isAppleAccountTokenMismatch() {
1242
+ return this.code === "APPLE_ACCOUNT_TOKEN_MISMATCH";
1243
+ }
1244
+ /** The game's Apple configuration is missing or turned off (`APPLE_NOT_CONFIGURED`, 409).
1245
+ * Retry once it is set up. */
1246
+ get isAppleNotConfigured() {
1247
+ return this.code === "APPLE_NOT_CONFIGURED";
1248
+ }
1249
+ /** Production has not yet confirmed you own the App Store app (`APPLE_NOT_VERIFIED`, 409).
1250
+ * Point App Store Server Notifications at INVO; retry once verified. */
1251
+ get isAppleNotVerified() {
1252
+ return this.code === "APPLE_NOT_VERIFIED";
1253
+ }
1254
+ /** Today's App Review purchase cap on production is reached (`APPLE_REVIEW_PURCHASE_LIMIT`,
1255
+ * 429). */
1256
+ get isAppleReviewPurchaseLimit() {
1257
+ return this.code === "APPLE_REVIEW_PURCHASE_LIMIT";
1258
+ }
1259
+ /** Verified and held, not refused (`APPLE_CREDIT_PENDING`, 503): the coins will credit on a
1260
+ * later retry. Keep the transaction unfinished and retry; StoreKit also redelivers it. */
1261
+ get isAppleCreditPending() {
1262
+ return this.code === "APPLE_CREDIT_PENDING";
1263
+ }
1264
+ /** A card purchase (`purchaseCurrency`) was made with a key on the Apple rail
1265
+ * (`WRONG_RAIL_ENDPOINT`, 400, `status: "use_apple_endpoint"`). Use
1266
+ * `verifyApplePurchase` for that key. */
1267
+ get isAppleEndpointRequired() {
1268
+ return this.code === "WRONG_RAIL_ENDPOINT" && this.bodyObject()["status"] === "use_apple_endpoint";
1269
+ }
1168
1270
  /** `body` as a plain object, or `{}` if it's a string/number/null (non-JSON responses).
1169
1271
  * The `in` operator throws on primitives, so callers must go through this. */
1170
1272
  bodyObject() {
@@ -1490,6 +1592,92 @@ function toPurchaseStatusResult(raw, sessionId) {
1490
1592
  };
1491
1593
  }
1492
1594
 
1595
+ // src/shared/apple.ts
1596
+ var FINISHED_STATUSES = /* @__PURE__ */ new Set(["credited", "already_credited"]);
1597
+ var APPLE_FINISH_ERROR_CODES = Object.freeze([
1598
+ "APPLE_TRANSACTION_REVOKED",
1599
+ "APPLE_TRANSACTION_ALREADY_USED",
1600
+ "APPLE_TRANSACTION_TOO_OLD"
1601
+ ]);
1602
+ function bodyFinish(body) {
1603
+ if (body && typeof body === "object") {
1604
+ const f = body["finish"];
1605
+ if (typeof f === "boolean") return f;
1606
+ }
1607
+ return void 0;
1608
+ }
1609
+ function errorView(e) {
1610
+ if (e instanceof InvoError) return { isError: true, codes: [e.code, e.rawCode], finish: bodyFinish(e.body) };
1611
+ if (e instanceof Error && e.name === "InvoError") {
1612
+ const r = e;
1613
+ return {
1614
+ isError: true,
1615
+ codes: [typeof r.code === "string" ? r.code : void 0, typeof r.rawCode === "string" ? r.rawCode : void 0],
1616
+ finish: bodyFinish(r.body)
1617
+ };
1618
+ }
1619
+ if (e instanceof Error) return { isError: true, codes: [], finish: void 0 };
1620
+ return { isError: false, codes: [], finish: void 0 };
1621
+ }
1622
+ function shouldFinishAppleTransaction(outcome) {
1623
+ const err = errorView(outcome);
1624
+ if (err.isError) {
1625
+ if (err.finish !== void 0) return err.finish;
1626
+ return err.codes.some((c) => c !== void 0 && APPLE_FINISH_ERROR_CODES.includes(c));
1627
+ }
1628
+ if (outcome && typeof outcome === "object") {
1629
+ const o = outcome;
1630
+ if (typeof o.finish === "boolean") return o.finish;
1631
+ const rawFinish = bodyFinish(o.raw);
1632
+ if (rawFinish !== void 0) return rawFinish;
1633
+ return typeof o.status === "string" && FINISHED_STATUSES.has(o.status);
1634
+ }
1635
+ return false;
1636
+ }
1637
+ function isAppleCreditPending(err) {
1638
+ return errorView(err).codes.includes("APPLE_CREDIT_PENDING");
1639
+ }
1640
+ function nullableString(v) {
1641
+ return v === null || v === void 0 ? null : String(v);
1642
+ }
1643
+ function toNumber(v) {
1644
+ const n = typeof v === "number" ? v : Number(v);
1645
+ return Number.isFinite(n) ? n : 0;
1646
+ }
1647
+ function toAppleProductsResult(raw) {
1648
+ const rows2 = Array.isArray(raw["products"]) ? raw["products"] : [];
1649
+ return {
1650
+ bundleId: String(raw["bundle_id"] ?? ""),
1651
+ canSell: raw["can_sell"] === true,
1652
+ unavailableReason: nullableString(raw["unavailable_reason"]),
1653
+ products: rows2.map((p) => ({
1654
+ productId: String(p["product_id"] ?? ""),
1655
+ coins: toNumber(p["coins"]),
1656
+ label: String(p["label"] ?? p["product_id"] ?? ""),
1657
+ priceUsd: nullableString(p["price_usd"]),
1658
+ active: p["active"] !== false,
1659
+ // Fail closed: only an explicit `true` offers the product.
1660
+ available: p["available"] === true,
1661
+ unavailableReason: nullableString(p["unavailable_reason"])
1662
+ })),
1663
+ raw
1664
+ };
1665
+ }
1666
+ function toApplePurchaseResult(raw) {
1667
+ return {
1668
+ status: String(raw["status"] ?? ""),
1669
+ orderId: String(raw["order_id"] ?? ""),
1670
+ transactionId: String(raw["transaction_id"] ?? ""),
1671
+ productId: String(raw["product_id"] ?? ""),
1672
+ coins: toNumber(raw["coins"]),
1673
+ balance: nullableString(raw["balance"]),
1674
+ environment: String(raw["environment"] ?? ""),
1675
+ testMode: raw["test_mode"] === true,
1676
+ finish: typeof raw["finish"] === "boolean" ? raw["finish"] : FINISHED_STATUSES.has(String(raw["status"] ?? "")),
1677
+ raw
1678
+ };
1679
+ }
1680
+
1493
1681
  // src/shared/loyalty.ts
1494
1682
  var obj = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : {};
1495
1683
  var rows = (v) => Array.isArray(v) ? v.filter((r) => r && typeof r === "object" && !Array.isArray(r)) : [];
@@ -1680,7 +1868,7 @@ function toPhoneChangeRequest(raw) {
1680
1868
  }
1681
1869
 
1682
1870
  // src/version.ts
1683
- var SDK_VERSION = "3.34.0";
1871
+ var SDK_VERSION = "3.34.1";
1684
1872
 
1685
1873
  // src/payouts.ts
1686
1874
  var AMOUNT = /^\d+(\.\d{1,2})?$/;
@@ -2997,11 +3185,11 @@ function toSavedCard(row) {
2997
3185
  raw: r
2998
3186
  };
2999
3187
  }
3000
- function nullableString(v) {
3188
+ function nullableString2(v) {
3001
3189
  return v == null ? null : String(v);
3002
3190
  }
3003
3191
  function optionalString(r, key) {
3004
- return key in r ? nullableString(r[key]) : void 0;
3192
+ return key in r ? nullableString2(r[key]) : void 0;
3005
3193
  }
3006
3194
  function toCheckoutWarnings(v) {
3007
3195
  if (!Array.isArray(v)) return void 0;
@@ -3021,27 +3209,27 @@ function toRefundResult(raw, subscriptionId, clientRequestId) {
3021
3209
  const base = {
3022
3210
  status: String(raw["status"] ?? ""),
3023
3211
  idempotentReplay: raw["idempotent_replay"] === true,
3024
- refundKey: nullableString(raw["refund_key"]),
3025
- clientRequestId: nullableString(raw["client_request_id"]) ?? clientRequestId,
3212
+ refundKey: nullableString2(raw["refund_key"]),
3213
+ clientRequestId: nullableString2(raw["client_request_id"]) ?? clientRequestId,
3026
3214
  subscriptionId: String(raw["subscription_id"] ?? subscriptionId),
3027
3215
  periodSeq: raw["period_seq"] == null ? null : Number(raw["period_seq"]),
3028
- transactionId: nullableString(raw["transaction_id"]),
3029
- refundedAmountUsd: nullableString(raw["refunded_amount_usd"]),
3030
- totalRefundedAmountUsd: nullableString(raw["total_refunded_amount_usd"]),
3031
- remainingRefundableUsd: nullableString(raw["remaining_refundable_usd"]),
3216
+ transactionId: nullableString2(raw["transaction_id"]),
3217
+ refundedAmountUsd: nullableString2(raw["refunded_amount_usd"]),
3218
+ totalRefundedAmountUsd: nullableString2(raw["total_refunded_amount_usd"]),
3219
+ remainingRefundableUsd: nullableString2(raw["remaining_refundable_usd"]),
3032
3220
  isFullRefund: raw["is_full_refund"] === true,
3033
- fundingShape: nullableString(raw["funding_shape"]),
3034
- balanceDeltaCoins: nullableString(raw["balance_delta_coins"]),
3035
- cardRefundedUsd: nullableString(raw["card_refunded_usd"]),
3221
+ fundingShape: nullableString2(raw["funding_shape"]),
3222
+ balanceDeltaCoins: nullableString2(raw["balance_delta_coins"]),
3223
+ cardRefundedUsd: nullableString2(raw["card_refunded_usd"]),
3036
3224
  // Neutral field only; the vendor-named sibling is deliberately not read.
3037
- processorRefundReference: nullableString(raw["processor_refund_reference"]),
3225
+ processorRefundReference: nullableString2(raw["processor_refund_reference"]),
3038
3226
  processorRefundAdopted: raw["processor_refund_adopted"] === true,
3039
3227
  invoFeeRetained: raw["invo_fee_retained"] === true,
3040
- partnerRevenueReversedUsd: nullableString(raw["partner_revenue_reversed_usd"]),
3041
- partnerRevenueReversalMode: nullableString(raw["partner_revenue_reversal_mode"]),
3042
- reason: nullableString(raw["reason"]),
3043
- refundedAt: nullableString(raw["refunded_at"]),
3044
- newBalance: nullableString(raw["new_balance"]),
3228
+ partnerRevenueReversedUsd: nullableString2(raw["partner_revenue_reversed_usd"]),
3229
+ partnerRevenueReversalMode: nullableString2(raw["partner_revenue_reversal_mode"]),
3230
+ reason: nullableString2(raw["reason"]),
3231
+ refundedAt: nullableString2(raw["refunded_at"]),
3232
+ newBalance: nullableString2(raw["new_balance"]),
3045
3233
  revenueShareAttribution: a ? {
3046
3234
  recipientPlayerId: Number(a["recipient_player_id"] ?? 0),
3047
3235
  percent: String(a["percent"] ?? ""),
@@ -3074,11 +3262,11 @@ function toRefundResult(raw, subscriptionId, clientRequestId) {
3074
3262
  status: "pending_approval",
3075
3263
  requestId: String(raw["request_id"] ?? raw["refund_request_id"] ?? ""),
3076
3264
  requestStatus: String(raw["request_status"] ?? ""),
3077
- requestedAmountUsd: nullableString(raw["requested_amount_usd"]),
3078
- requestedAt: nullableString(raw["requested_at"]),
3079
- dailyCapUsd: nullableString(raw["daily_cap_usd"]),
3080
- executedTodayUsd: nullableString(raw["executed_today_usd"]),
3081
- message: nullableString(raw["message"])
3265
+ requestedAmountUsd: nullableString2(raw["requested_amount_usd"]),
3266
+ requestedAt: nullableString2(raw["requested_at"]),
3267
+ dailyCapUsd: nullableString2(raw["daily_cap_usd"]),
3268
+ executedTodayUsd: nullableString2(raw["executed_today_usd"]),
3269
+ message: nullableString2(raw["message"])
3082
3270
  };
3083
3271
  return pending;
3084
3272
  }
@@ -3095,35 +3283,35 @@ function toSubscription(row) {
3095
3283
  clientRequestId: String(r["client_request_id"] ?? ""),
3096
3284
  status: String(r["status"] ?? ""),
3097
3285
  amountUsd: String(r["amount_usd"] ?? ""),
3098
- pendingAmountUsd: nullableString(r["pending_amount_usd"]),
3286
+ pendingAmountUsd: nullableString2(r["pending_amount_usd"]),
3099
3287
  interval: String(r["interval"] ?? "month"),
3100
3288
  intervalCount: Number(r["interval_count"] ?? 1),
3101
3289
  itemId: String(r["item_id"] ?? ""),
3102
- itemName: nullableString(r["item_name"]),
3290
+ itemName: nullableString2(r["item_name"]),
3103
3291
  currentPeriodStart: String(r["current_period_start"] ?? ""),
3104
3292
  currentPeriodEnd: String(r["current_period_end"] ?? ""),
3105
3293
  periodSeq: Number(r["period_seq"] ?? 0),
3106
- nextChargeAt: nullableString(r["next_charge_at"]),
3294
+ nextChargeAt: nullableString2(r["next_charge_at"]),
3107
3295
  cancelAtPeriodEnd: r["cancel_at_period_end"] === true,
3108
- trialEnd: nullableString(r["trial_end"]),
3109
- trialAmountUsd: nullableString(r["trial_amount_usd"]),
3110
- canceledAt: nullableString(r["canceled_at"]),
3111
- endedAt: nullableString(r["ended_at"]),
3296
+ trialEnd: nullableString2(r["trial_end"]),
3297
+ trialAmountUsd: nullableString2(r["trial_amount_usd"]),
3298
+ canceledAt: nullableString2(r["canceled_at"]),
3299
+ endedAt: nullableString2(r["ended_at"]),
3112
3300
  walletOnly: r["wallet_only"] === true,
3113
3301
  hasPaymentMethod: r["has_payment_method"] === true,
3114
3302
  fundingRail: String(r["funding_rail"] ?? "card"),
3115
- steamAgreementStatus: nullableString(r["steam_agreement_status"]),
3303
+ steamAgreementStatus: nullableString2(r["steam_agreement_status"]),
3116
3304
  metadata: r["metadata"] && typeof r["metadata"] === "object" ? r["metadata"] : null,
3117
3305
  consent: {
3118
- consent_at: nullableString(consent["consent_at"]),
3119
- consent_ip: nullableString(consent["consent_ip"]),
3120
- consent_user_agent: nullableString(consent["consent_user_agent"]),
3121
- disclosed_amount_usd: nullableString(consent["disclosed_amount_usd"]),
3122
- disclosed_interval: nullableString(consent["disclosed_interval"]),
3123
- terms_version: nullableString(consent["terms_version"]),
3124
- disclosed_trial_amount_usd: nullableString(consent["disclosed_trial_amount_usd"]),
3306
+ consent_at: nullableString2(consent["consent_at"]),
3307
+ consent_ip: nullableString2(consent["consent_ip"]),
3308
+ consent_user_agent: nullableString2(consent["consent_user_agent"]),
3309
+ disclosed_amount_usd: nullableString2(consent["disclosed_amount_usd"]),
3310
+ disclosed_interval: nullableString2(consent["disclosed_interval"]),
3311
+ terms_version: nullableString2(consent["terms_version"]),
3312
+ disclosed_trial_amount_usd: nullableString2(consent["disclosed_trial_amount_usd"]),
3125
3313
  disclosed_trial_days: typeof consent["disclosed_trial_days"] === "number" ? consent["disclosed_trial_days"] : null,
3126
- disclosed_trial_end: nullableString(consent["disclosed_trial_end"])
3314
+ disclosed_trial_end: nullableString2(consent["disclosed_trial_end"])
3127
3315
  },
3128
3316
  createdAt: String(r["created_at"] ?? ""),
3129
3317
  updatedAt: String(r["updated_at"] ?? ""),
@@ -3133,13 +3321,13 @@ function toSubscription(row) {
3133
3321
  // Attribution only: INVO never pays the recipient. Read the wire value, never assume.
3134
3322
  settledByInvo: share["settled_by_invo"] === true
3135
3323
  } : null,
3136
- paidThrough: nullableString(r["paid_through"]),
3324
+ paidThrough: nullableString2(r["paid_through"]),
3137
3325
  amountCoinsEstimate: r["amount_coins_estimate"] == null ? void 0 : String(r["amount_coins_estimate"]),
3138
3326
  // Present (possibly null) only on create/finalize bodies from 2026-09-23 on.
3139
- ..."trial_amount_coins_estimate" in r ? { trialAmountCoinsEstimate: nullableString(r["trial_amount_coins_estimate"]) } : {},
3327
+ ..."trial_amount_coins_estimate" in r ? { trialAmountCoinsEstimate: nullableString2(r["trial_amount_coins_estimate"]) } : {},
3140
3328
  // `include_player` puts these two ON the object (there is no separate block).
3141
- ..."player_email" in r ? { playerEmail: nullableString(r["player_email"]) } : {},
3142
- ..."player_name" in r ? { playerName: nullableString(r["player_name"]) } : {},
3329
+ ..."player_email" in r ? { playerEmail: nullableString2(r["player_email"]) } : {},
3330
+ ..."player_name" in r ? { playerName: nullableString2(r["player_name"]) } : {},
3143
3331
  raw: r
3144
3332
  };
3145
3333
  }
@@ -3147,14 +3335,14 @@ function toFirstCharge(row) {
3147
3335
  const r = row && typeof row === "object" ? row : {};
3148
3336
  return {
3149
3337
  status: String(r["status"] ?? "pending"),
3150
- amountUsd: nullableString(r["amount_usd"]),
3338
+ amountUsd: nullableString2(r["amount_usd"]),
3151
3339
  paidPeriodSeq: typeof r["paid_period_seq"] === "number" ? r["paid_period_seq"] : null,
3152
- paidThrough: nullableString(r["paid_through"]),
3153
- failureCode: nullableString(r["failure_code"]),
3154
- nextRetryAt: nullableString(r["next_retry_at"]),
3155
- confirmationUrl: nullableString(r["confirmation_url"]),
3156
- expiresAt: nullableString(r["expires_at"]),
3157
- message: nullableString(r["message"]),
3340
+ paidThrough: nullableString2(r["paid_through"]),
3341
+ failureCode: nullableString2(r["failure_code"]),
3342
+ nextRetryAt: nullableString2(r["next_retry_at"]),
3343
+ confirmationUrl: nullableString2(r["confirmation_url"]),
3344
+ expiresAt: nullableString2(r["expires_at"]),
3345
+ message: nullableString2(r["message"]),
3158
3346
  ...receiptFields(r),
3159
3347
  raw: r
3160
3348
  };
@@ -3176,10 +3364,10 @@ function toSandboxClockState(row) {
3176
3364
  return {
3177
3365
  status: String(r["status"] ?? ""),
3178
3366
  periodSeq: Number(r["period_seq"] ?? 0),
3179
- currentPeriodStart: nullableString(r["current_period_start"]),
3180
- currentPeriodEnd: nullableString(r["current_period_end"]),
3181
- nextChargeAt: nullableString(r["next_charge_at"]),
3182
- trialEnd: nullableString(r["trial_end"]),
3367
+ currentPeriodStart: nullableString2(r["current_period_start"]),
3368
+ currentPeriodEnd: nullableString2(r["current_period_end"]),
3369
+ nextChargeAt: nullableString2(r["next_charge_at"]),
3370
+ trialEnd: nullableString2(r["trial_end"]),
3183
3371
  cancelAtPeriodEnd: r["cancel_at_period_end"] === true,
3184
3372
  walletOnly: r["wallet_only"] === true,
3185
3373
  hasPaymentMethod: r["has_payment_method"] === true,
@@ -3482,14 +3670,14 @@ var SubscriptionsServer = class {
3482
3670
  alreadyCanceled: raw["already_canceled"] === true,
3483
3671
  finalStatus: typeof raw["final_status"] === "string" ? raw["final_status"] : void 0,
3484
3672
  cancelAtPeriodEnd: raw["cancel_at_period_end"] === true,
3485
- effectiveAt: nullableString(raw["effective_at"]),
3486
- currentPeriodEnd: nullableString(raw["current_period_end"]),
3487
- accessUntil: nullableString(raw["access_until"]),
3488
- paidThrough: nullableString(raw["paid_through"]),
3673
+ effectiveAt: nullableString2(raw["effective_at"]),
3674
+ currentPeriodEnd: nullableString2(raw["current_period_end"]),
3675
+ accessUntil: nullableString2(raw["access_until"]),
3676
+ paidThrough: nullableString2(raw["paid_through"]),
3489
3677
  terminatedImmediately: raw["terminated_immediately"] === true,
3490
3678
  downgradeReason: typeof raw["downgrade_reason"] === "string" ? raw["downgrade_reason"] : void 0,
3491
3679
  message: typeof raw["message"] === "string" ? raw["message"] : void 0,
3492
- steamAgreementStatus: "steam_agreement_status" in raw ? nullableString(raw["steam_agreement_status"]) : void 0,
3680
+ steamAgreementStatus: "steam_agreement_status" in raw ? nullableString2(raw["steam_agreement_status"]) : void 0,
3493
3681
  steamAgreementCanceled: typeof raw["steam_agreement_canceled"] === "boolean" ? raw["steam_agreement_canceled"] : void 0,
3494
3682
  subscription: raw["subscription"] ? toSubscription(raw["subscription"]) : null,
3495
3683
  raw
@@ -3520,12 +3708,12 @@ var SubscriptionsServer = class {
3520
3708
  status: String(raw["status"] ?? ""),
3521
3709
  oldAmountUsd: String(raw["old_amount_usd"] ?? ""),
3522
3710
  newAmountUsd: String(raw["new_amount_usd"] ?? amount),
3523
- pendingAmountUsd: nullableString(raw["pending_amount_usd"]),
3711
+ pendingAmountUsd: nullableString2(raw["pending_amount_usd"]),
3524
3712
  changeQueued: raw["change_queued"] === true,
3525
- appliesFrom: nullableString(raw["applies_from"]),
3713
+ appliesFrom: nullableString2(raw["applies_from"]),
3526
3714
  appliesFromPeriodSeq: Number(raw["applies_from_period_seq"] ?? 0),
3527
- paidThrough: nullableString(raw["paid_through"]),
3528
- currentPeriodEnd: nullableString(raw["current_period_end"]),
3715
+ paidThrough: nullableString2(raw["paid_through"]),
3716
+ currentPeriodEnd: nullableString2(raw["current_period_end"]),
3529
3717
  prorated: raw["prorated"] === true,
3530
3718
  subscription: raw["subscription"] ? toSubscription(raw["subscription"]) : null,
3531
3719
  raw
@@ -3711,7 +3899,7 @@ var SubscriptionsServer = class {
3711
3899
  orderId: String(raw["order_id"] ?? ""),
3712
3900
  steamOrderId: String(raw["steam_order_id"] ?? ""),
3713
3901
  steamTransid: String(raw["steam_transid"] ?? ""),
3714
- steamCheckoutUrl: nullableString(raw["steam_checkout_url"]),
3902
+ steamCheckoutUrl: nullableString2(raw["steam_checkout_url"]),
3715
3903
  amountUsd: String(raw["amount_usd"] ?? ""),
3716
3904
  amountCoins: String(raw["amount_coins"] ?? ""),
3717
3905
  steamChargeUsd: String(raw["steam_charge_usd"] ?? ""),
@@ -3749,7 +3937,7 @@ var SubscriptionsServer = class {
3749
3937
  return {
3750
3938
  ...toSubscriptionResult(raw),
3751
3939
  alreadyProcessed: raw["already_processed"] === true,
3752
- steamAgreementStatus: nullableString(raw["steam_agreement_status"]),
3940
+ steamAgreementStatus: nullableString2(raw["steam_agreement_status"]),
3753
3941
  sandboxAutoApproved: raw["sandbox_auto_approved"] === true
3754
3942
  };
3755
3943
  }
@@ -3955,7 +4143,7 @@ var SandboxSubscriptionsServer = class {
3955
4143
  throw invalidInput2(
3956
4144
  "sandboxClockKey",
3957
4145
  this.clockKey,
3958
- 'is required for invo.sandbox.subscriptions.* \u2014 pass it to new InvoServer({ sandboxClockKey }) from the sandbox console (Game Settings, "Sandbox clock key")'
4146
+ 'is required for invo.sandbox.subscriptions.*: pass it to new InvoServer({ sandboxClockKey }) from the INVO console in test mode, console.invo.network/test (Game Settings, "Sandbox clock key")'
3959
4147
  );
3960
4148
  }
3961
4149
  const raw = await this.http.post(
@@ -4673,6 +4861,81 @@ var InvoServer = class {
4673
4861
  raw
4674
4862
  };
4675
4863
  }
4864
+ /**
4865
+ * The App Store products registered for this game, and whether INVO will sell each one
4866
+ * right now. Call it with the game's iOS key **before every purchase** and offer only
4867
+ * products with `available: true`: Apple charges the player before INVO sees the
4868
+ * purchase, so this is the only point where INVO can say no. Ask StoreKit for exactly the
4869
+ * `productId`s listed.
4870
+ *
4871
+ * `unavailableReason` (per product, and for the whole game when `canSell` is `false`):
4872
+ * `APPLE_NOT_VERIFIED`, `PARTNER_BILLING_NOT_SET_UP`, `PARTNER_RAIL_SUSPENDED`,
4873
+ * `PARTNER_CREDIT_UNAVAILABLE`.
4874
+ *
4875
+ * Refusals: `err.isAppleNotConfigured` (409, no Apple configuration or turned off),
4876
+ * `err.isRailChannelMismatch` (409, the key is not an iOS key on the Apple rail).
4877
+ */
4878
+ async appleProducts(opts) {
4879
+ const raw = await this.http.get(
4880
+ "/api/currency-purchases/apple/products",
4881
+ this.auth,
4882
+ { signal: opts?.signal }
4883
+ );
4884
+ return toAppleProductsResult(raw);
4885
+ }
4886
+ /**
4887
+ * Verify a StoreKit 2 transaction and credit its coins, once. Call it from your game
4888
+ * SERVER, never the device, after StoreKit returns a verified transaction, with the
4889
+ * game's iOS key. Send `Transaction.jwsRepresentation` unchanged as `signedTransaction`.
4890
+ *
4891
+ * Then decide `Transaction.finish()` with {@link shouldFinishAppleTransaction}, passing
4892
+ * the result or the thrown error. It reads INVO's `finish` flag, which every answer carries
4893
+ * (`result.finish`, `err.finish`): `true` for `credited`, `already_credited` and the terminal
4894
+ * errors `isAppleTransactionRevoked`, `isAppleTransactionAlreadyUsed` and
4895
+ * `isAppleTransactionTooOld`. On anything else leave the transaction unfinished and
4896
+ * retry: StoreKit redelivers it, and a retry with the same signed transaction never credits
4897
+ * twice (a replay answers `already_credited`, with `balance` `null` unless you name the
4898
+ * same player). Safe to auto-retry for the same reason.
4899
+ *
4900
+ * Refusals: `isAppleSignatureInvalid`, `isAppleBundleMismatch`,
4901
+ * `isAppleEnvironmentNotAllowed`, `isAppleProductTypeUnsupported`, `isAppleProductUnknown`,
4902
+ * `isInvalidMetadata` / `isInvalidInput` (400); `isAppleReviewAccountRequired` (403);
4903
+ * `isAppleTransactionRevoked`, `isAppleTransactionAlreadyUsed`, `isAppleTransactionTooOld`,
4904
+ * `isAppleValueExceedsPrice`, `isAppleAccountTokenMismatch`, `isAppleNotConfigured`,
4905
+ * `isAppleNotVerified`, `isRailChannelMismatch` (409); `isAppleReviewPurchaseLimit` (429);
4906
+ * `isAppleCreditPending` (503, verified and held: retry; also while payments are paused);
4907
+ * and the usual game-key refusals, which carry no `finish` (treated as not finished).
4908
+ */
4909
+ async verifyApplePurchase(input, opts) {
4910
+ if (typeof input?.playerEmail !== "string" || !input.playerEmail.trim()) {
4911
+ throw invalidInput2("playerEmail", input?.playerEmail, "is required");
4912
+ }
4913
+ if (typeof input.signedTransaction !== "string" || !input.signedTransaction.trim()) {
4914
+ throw invalidInput2(
4915
+ "signedTransaction",
4916
+ typeof input.signedTransaction === "string" ? "(empty)" : input.signedTransaction,
4917
+ "is required: StoreKit's Transaction.jwsRepresentation"
4918
+ );
4919
+ }
4920
+ if (input.appAccountToken !== void 0 && (typeof input.appAccountToken !== "string" || !input.appAccountToken || input.appAccountToken.length > 64)) {
4921
+ throw invalidInput2("appAccountToken", input.appAccountToken, "must be the UUID string the game set");
4922
+ }
4923
+ const body = {
4924
+ player_email: input.playerEmail,
4925
+ signed_transaction: input.signedTransaction
4926
+ };
4927
+ if (input.appAccountToken !== void 0) body["app_account_token"] = input.appAccountToken;
4928
+ if (input.playerName) body["player_name"] = input.playerName;
4929
+ if (input.metadata) body["metadata"] = input.metadata;
4930
+ const raw = await this.http.post(
4931
+ "/api/currency-purchases/apple/verify-purchase",
4932
+ body,
4933
+ this.auth,
4934
+ { idempotent: true, signal: opts?.signal }
4935
+ // INVO credits each Apple transaction once
4936
+ );
4937
+ return toApplePurchaseResult(raw);
4938
+ }
4676
4939
  /**
4677
4940
  * Buy an in-game item by SPENDING the player's existing game currency (§4.8).
4678
4941
  * No real money, no payment rail, no passkey — it's a balance debit, authenticated
@@ -5598,6 +5861,7 @@ var InvoServer = class {
5598
5861
  }
5599
5862
  };
5600
5863
 
5864
+ exports.APPLE_FINISH_ERROR_CODES = APPLE_FINISH_ERROR_CODES;
5601
5865
  exports.CardsServer = CardsServer;
5602
5866
  exports.DEMO_KEY_PREFIX = DEMO_KEY_PREFIX;
5603
5867
  exports.EnvironmentUnknownError = EnvironmentUnknownError;
@@ -5618,9 +5882,11 @@ exports.baseUrlForKey = baseUrlForKey;
5618
5882
  exports.createWebhookHandler = createWebhookHandler;
5619
5883
  exports.environmentForBaseUrl = environmentForBaseUrl;
5620
5884
  exports.environmentFromKeyPrefix = environmentFromKeyPrefix;
5885
+ exports.isAppleCreditPending = isAppleCreditPending;
5621
5886
  exports.isDemoKey = isDemoKey;
5622
5887
  exports.isRefundPendingApproval = isRefundPendingApproval;
5623
5888
  exports.resolveEnvironment = resolveEnvironment;
5889
+ exports.shouldFinishAppleTransaction = shouldFinishAppleTransaction;
5624
5890
  exports.verifyWebhook = verifyWebhook;
5625
5891
  exports.verifyWebhookAsync = verifyWebhookAsync;
5626
5892
  //# sourceMappingURL=server.cjs.map
package/dist/server.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { bu as ApproveWithDeviceCodeInput, bo as BeginDeviceApprovalInput, g as CallOptions, af as CancelResult, ae as CancelSubscriptionOptions, as as CardSetupConfirmInput, at as CardSetupConfirmResult, aq as CardSetupInput, ar as CardSetupResult, ao as CardSetupSessionInput, ap as CardSetupSessionResult, by as CardSetupStatus, ag as ChangeAmountResult, bz as CheckoutWarning, bf as ClaimCurrencyInput, y as ClaimDelivery, be as ClaimResult, bd as ClaimTransferInput, bw as CompleteDeviceApprovalInput, bx as CompleteDeviceApprovalResult, bs as ConfirmDeviceEnrollmentInput, bt as ConfirmDeviceEnrollmentResult, aS as ConfirmPaymentResult, aM as CreateCheckoutInput, aN as CreateCheckoutResult, a8 as CreateSubscriptionInput, bA as CurrencyBalance, aR as CurrencyPurchaseQuote, bB as CurrencyPurchaseQuoteBreakdown, aQ as CurrencyPurchaseQuoteInput, D as DestinationGame, p as DestinationsResult, bC as DeviceApprovalChannel, bD as DeviceApprovalEnrollment, bE as DeviceApprovalFlow, bp as DeviceApprovalGrant, br as DeviceApprovalPollResult, bF as DeviceApprovalPollStatus, bv as DeviceApprovalSettleResult, bG as DeviceEnrollmentDecision, bH as DeviceEnrollmentRespond, bI as ExpiryReason, bJ as FeeTakenFrom, bK as FirstCharge, bL as FirstChargeStatus, bM as FundingSource, aa as GetSubscriptionOptions, ab as GetSubscriptionResult, bh as GuardianApprovalStatusResult, bN as InboundPendingItem, b8 as InboundPendingQuery, b9 as InboundPendingResult, aK as InitiateResult, aJ as InitiateSendInput, aL as InitiateTransferInput, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, b0 as ItemHistoryQuery, b1 as ItemHistoryResult, b2 as ItemOrderQuery, ba as LinkedIdentitiesQuery, bb as LinkedIdentitiesResult, bO as LinkedIdentityEmail, ac as ListSubscriptionsOptions, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, q as LoyaltyCardsResult, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, bP as MinPurchaseWarning, aA as MintPlayerTokenInput, aT as OrderDetailsResult, bQ as PhoneChangeConfirmation, aI as PhoneChangeRequest, bR as PhoneChangeRequestStatus, bl as PhoneShareApproveInput, bm as PhoneShareApproveResult, bj as PhoneShareContact, bk as PhoneShareInitiateResult, bn as PhoneShareStatusResult, a2 as PlatformApprovalResult, a3 as PlatformOrderStatusResult, a4 as PlatformPurchaseHistoryQuery, a5 as PlatformPurchaseHistoryResult, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, bS as PlatformPurchaseStatus, a6 as PlatformRefundInput, a7 as PlatformRefundResult, b5 as PlayerActivityEntry, b3 as PlayerActivityQuery, b4 as PlayerActivityResult, bT as PlayerActivityType, b6 as PlayerBalanceQuery, b7 as PlayerBalanceResult, au as PlayerCardsResult, aB as PlayerToken, bq as PollDeviceApprovalInput, aO as PurchaseInput, a_ as PurchaseItemInput, a$ as PurchaseItemResult, aP as PurchaseResult, Z as Rail, bU as RefundInitiation, bV as RefundPendingApproval, bW as RefundProcessingFeeBasis, bX as RefundReceipt, ak as RefundResult, bY as RefundRevenueShareAttribution, aj as RefundSubscriptionInput, bZ as RefundWarning, aC as RegisterPlayerInput, aD as RegisterPlayerResult, aG as RequestPhoneChangeInput, aH as RequestPhoneChangeResult, av as SandboxClockResult, b_ as SandboxClockState, aw as SandboxFailureOutcome, ay as SandboxForceAuthChallengeOptions, ax as SandboxForceFailureOptions, b$ as SavedCard, az as ServerConfig, bi as ServerDestinationsQuery, ah as SetPaymentMethodInput, ai as SetPaymentMethodResult, bc as SmsVerifyResult, aY as SteamFinalizeInput, aZ as SteamFinalizeResult, an as SteamFinalizeSubscriptionResult, aW as SteamInitPurchaseInput, aX as SteamInitPurchaseResult, am as SteamInitResult, c0 as SteamPack, aU as SteamPacksQuery, aV as SteamPacksResult, al as SteamSubscriptionInitInput, c1 as SteamUserSession, c2 as Subscription, c3 as SubscriptionBaseInput, c4 as SubscriptionConsent, c5 as SubscriptionConsentInput, c6 as SubscriptionFundingRail, c7 as SubscriptionInterval, ad as SubscriptionListResult, a9 as SubscriptionResult, c8 as SubscriptionRevenueShare, c9 as SubscriptionRevenueShareInput, ca as SubscriptionStatus, bg as TransactionStatusResult, cb as UnacknowledgedPurchaseOutcome, aE as UpdatePlayerPhoneInput, aF as UpdatePlayerPhoneResult, _ as VerificationMethod, cc as isRefundPendingApproval } from './types-Ctn8N2_l.cjs';
1
+ export { bB as AppleEnvironment, bC as AppleProduct, a$ as AppleProductsResult, a0 as ApplePurchaseResult, bD as ApplePurchaseStatus, bE as AppleUnavailableReason, bx as ApproveWithDeviceCodeInput, br as BeginDeviceApprovalInput, g as CallOptions, ag as CancelResult, af as CancelSubscriptionOptions, at as CardSetupConfirmInput, au as CardSetupConfirmResult, ar as CardSetupInput, as as CardSetupResult, ap as CardSetupSessionInput, aq as CardSetupSessionResult, bF as CardSetupStatus, ah as ChangeAmountResult, bG as CheckoutWarning, bi as ClaimCurrencyInput, y as ClaimDelivery, bh as ClaimResult, bg as ClaimTransferInput, bz as CompleteDeviceApprovalInput, bA as CompleteDeviceApprovalResult, bv as ConfirmDeviceEnrollmentInput, bw as ConfirmDeviceEnrollmentResult, aT as ConfirmPaymentResult, aN as CreateCheckoutInput, aO as CreateCheckoutResult, a9 as CreateSubscriptionInput, bH as CurrencyBalance, aS as CurrencyPurchaseQuote, bI as CurrencyPurchaseQuoteBreakdown, aR as CurrencyPurchaseQuoteInput, D as DestinationGame, p as DestinationsResult, bJ as DeviceApprovalChannel, bK as DeviceApprovalEnrollment, bL as DeviceApprovalFlow, bs as DeviceApprovalGrant, bu as DeviceApprovalPollResult, bM as DeviceApprovalPollStatus, by as DeviceApprovalSettleResult, bN as DeviceEnrollmentDecision, bO as DeviceEnrollmentRespond, bP as ExpiryReason, bQ as FeeTakenFrom, bR as FirstCharge, bS as FirstChargeStatus, bT as FundingSource, ab as GetSubscriptionOptions, ac as GetSubscriptionResult, bk as GuardianApprovalStatusResult, bU as InboundPendingItem, bb as InboundPendingQuery, bc as InboundPendingResult, aL as InitiateResult, aK as InitiateSendInput, aM as InitiateTransferInput, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, b3 as ItemHistoryQuery, b4 as ItemHistoryResult, b5 as ItemOrderQuery, bd as LinkedIdentitiesQuery, be as LinkedIdentitiesResult, bV as LinkedIdentityEmail, ad as ListSubscriptionsOptions, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, q as LoyaltyCardsResult, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, bW as MinPurchaseWarning, aB as MintPlayerTokenInput, aU as OrderDetailsResult, bX as PhoneChangeConfirmation, aJ as PhoneChangeRequest, bY as PhoneChangeRequestStatus, bo as PhoneShareApproveInput, bp as PhoneShareApproveResult, bm as PhoneShareContact, bn as PhoneShareInitiateResult, bq as PhoneShareStatusResult, a3 as PlatformApprovalResult, a4 as PlatformOrderStatusResult, a5 as PlatformPurchaseHistoryQuery, a6 as PlatformPurchaseHistoryResult, a1 as PlatformPurchaseInput, a2 as PlatformPurchaseResult, bZ as PlatformPurchaseStatus, a7 as PlatformRefundInput, a8 as PlatformRefundResult, b8 as PlayerActivityEntry, b6 as PlayerActivityQuery, b7 as PlayerActivityResult, b_ as PlayerActivityType, b9 as PlayerBalanceQuery, ba as PlayerBalanceResult, av as PlayerCardsResult, aC as PlayerToken, bt as PollDeviceApprovalInput, aP as PurchaseInput, b1 as PurchaseItemInput, b2 as PurchaseItemResult, aQ as PurchaseResult, Z as Rail, b$ as RefundInitiation, c0 as RefundPendingApproval, c1 as RefundProcessingFeeBasis, c2 as RefundReceipt, al as RefundResult, c3 as RefundRevenueShareAttribution, ak as RefundSubscriptionInput, c4 as RefundWarning, aD as RegisterPlayerInput, aE as RegisterPlayerResult, aH as RequestPhoneChangeInput, aI as RequestPhoneChangeResult, aw as SandboxClockResult, c5 as SandboxClockState, ax as SandboxFailureOutcome, az as SandboxForceAuthChallengeOptions, ay as SandboxForceFailureOptions, c6 as SavedCard, aA as ServerConfig, bl as ServerDestinationsQuery, ai as SetPaymentMethodInput, aj as SetPaymentMethodResult, bf as SmsVerifyResult, aZ as SteamFinalizeInput, a_ as SteamFinalizeResult, ao as SteamFinalizeSubscriptionResult, aX as SteamInitPurchaseInput, aY as SteamInitPurchaseResult, an as SteamInitResult, c7 as SteamPack, aV as SteamPacksQuery, aW as SteamPacksResult, am as SteamSubscriptionInitInput, c8 as SteamUserSession, c9 as Subscription, ca as SubscriptionBaseInput, cb as SubscriptionConsent, cc as SubscriptionConsentInput, cd as SubscriptionFundingRail, ce as SubscriptionInterval, ae as SubscriptionListResult, aa as SubscriptionResult, cf as SubscriptionRevenueShare, cg as SubscriptionRevenueShareInput, ch as SubscriptionStatus, bj as TransactionStatusResult, ci as UnacknowledgedPurchaseOutcome, aF as UpdatePlayerPhoneInput, aG as UpdatePlayerPhoneResult, _ as VerificationMethod, b0 as VerifyApplePurchaseInput, cj as isRefundPendingApproval } from './types-Dv0UavA9.cjs';
2
2
  export { G as GameEventType, R as ReportGameEventInput, a as ReportGameEventResult, b as ReportServerGameEventInput } from './loyalty-events-CmDw2ZoR.cjs';
3
- export { C as CardsServer, D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, d as IdentityPasskeyResetData, a as InvoEnvironment, I as InvoServer, f as InvoWebhookEvent, g as ItemPurchasedData, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, h as ListPayeesQuery, j as ListPayeesResult, k as ListPayoutsQuery, l as ListPayoutsResult, P as PRODUCTION_BASE_URL, m as PayableBlocker, n as Payee, o as PayeeInvite, p as PayeeStatus, q as PayeeStatusChangedData, s as Payout, t as PayoutStatus, u as PayoutStatusChangedData, w as PayoutsServer, x as PlatformCommercePurchasedData, y as PlatformCommerceRefundedData, z as PlatformCommerceServer, A as PlayerPhoneChangedData, B as PurchaseCompletedData, F as PurchaseEventData, R as RegisterPayeeInput, G as RegisterPayeeResult, H as RequestPayoutInput, J as RequestPayoutResult, M as ReturnReasonCode, S as SANDBOX_BASE_URL, N as SandboxServer, O as SandboxSubscriptionsServer, Q as SubscriptionAuthenticationRequiredData, U as SubscriptionCanceledData, V as SubscriptionEventCommon, W as SubscriptionExpiredData, X as SubscriptionPastDueData, Y as SubscriptionPaymentFailedData, Z as SubscriptionRefundApprovedData, _ as SubscriptionRefundDetail, $ as SubscriptionRefundRejectedData, a0 as SubscriptionRefundRequestData, a1 as SubscriptionRefundedData, a2 as SubscriptionRenewalFunding, a3 as SubscriptionRenewalSplit, a4 as SubscriptionRenewedData, a5 as SubscriptionRevenueShareAttribution, a6 as SubscriptionTrialEventFields, a7 as SubscriptionsServer, T as TEST_KEY_PREFIX, a8 as TransferEventData, a9 as VerifyWebhookOptions, aa as WebhookHandlerOptions, b as baseUrlForKey, ab as createWebhookHandler, e as environmentForBaseUrl, c as environmentFromKeyPrefix, i as isDemoKey, r as resolveEnvironment, ac as verifyWebhook, ad as verifyWebhookAsync } from './server-ZnCyLWA2.cjs';
4
- export { S as SDK_VERSION } from './version-Ce_pLpJf.cjs';
3
+ export { A as APPLE_FINISH_ERROR_CODES, d as AppleWebhookDetails, C as CardsServer, D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, f as IdentityPasskeyResetData, a as InvoEnvironment, I as InvoServer, g as InvoWebhookEvent, h as ItemPurchasedData, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, j as ListPayeesQuery, k as ListPayeesResult, l as ListPayoutsQuery, m as ListPayoutsResult, P as PRODUCTION_BASE_URL, n as PayableBlocker, o as Payee, p as PayeeInvite, q as PayeeStatus, s as PayeeStatusChangedData, t as Payout, u as PayoutStatus, w as PayoutStatusChangedData, x as PayoutsServer, y as PlatformCommercePurchasedData, z as PlatformCommerceRefundedData, B as PlatformCommerceServer, F as PlayerPhoneChangedData, G as PurchaseCompletedData, H as PurchaseEventData, R as RegisterPayeeInput, J as RegisterPayeeResult, M as RequestPayoutInput, N as RequestPayoutResult, O as ReturnReasonCode, S as SANDBOX_BASE_URL, Q as SandboxServer, U as SandboxSubscriptionsServer, V as SubscriptionAuthenticationRequiredData, W as SubscriptionCanceledData, X as SubscriptionEventCommon, Y as SubscriptionExpiredData, Z as SubscriptionPastDueData, _ as SubscriptionPaymentFailedData, $ as SubscriptionRefundApprovedData, a0 as SubscriptionRefundDetail, a1 as SubscriptionRefundRejectedData, a2 as SubscriptionRefundRequestData, a3 as SubscriptionRefundedData, a4 as SubscriptionRenewalFunding, a5 as SubscriptionRenewalSplit, a6 as SubscriptionRenewedData, a7 as SubscriptionRevenueShareAttribution, a8 as SubscriptionTrialEventFields, a9 as SubscriptionsServer, T as TEST_KEY_PREFIX, aa as TransferEventData, ab as VerifyWebhookOptions, ac as WebhookHandlerOptions, b as baseUrlForKey, ad as createWebhookHandler, e as environmentForBaseUrl, c as environmentFromKeyPrefix, ae as isAppleCreditPending, i as isDemoKey, r as resolveEnvironment, af as shouldFinishAppleTransaction, ag as verifyWebhook, ah as verifyWebhookAsync } from './server-DF-BZU0B.cjs';
4
+ export { S as SDK_VERSION } from './version-DB2wgiPY.cjs';