react-native-iap 15.6.0 → 15.6.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.
Files changed (67) hide show
  1. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +28 -4
  2. package/android/src/main/java/com/margelo/nitro/iap/RnIapLog.kt +13 -0
  3. package/ios/HybridRnIap.swift +25 -4
  4. package/ios/RnIapHelper.swift +3 -2
  5. package/ios/RnIapLog.swift +14 -0
  6. package/lib/module/hooks/useIAP.js.map +1 -1
  7. package/lib/module/index.js +72 -30
  8. package/lib/module/index.js.map +1 -1
  9. package/lib/module/index.kepler.js +71 -5
  10. package/lib/module/index.kepler.js.map +1 -1
  11. package/lib/module/kit-api.js +78 -3
  12. package/lib/module/kit-api.js.map +1 -1
  13. package/lib/module/types.js +29 -25
  14. package/lib/module/types.js.map +1 -1
  15. package/lib/module/utils/deprecation.js +15 -0
  16. package/lib/module/utils/deprecation.js.map +1 -0
  17. package/lib/module/utils/platform-request.js +28 -0
  18. package/lib/module/utils/platform-request.js.map +1 -0
  19. package/lib/module/utils/type-bridge.js +9 -4
  20. package/lib/module/utils/type-bridge.js.map +1 -1
  21. package/lib/module/vega-adapter.js +31 -22
  22. package/lib/module/vega-adapter.js.map +1 -1
  23. package/lib/typescript/src/hooks/useIAP.d.ts +14 -2
  24. package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -1
  25. package/lib/typescript/src/index.d.ts +37 -12
  26. package/lib/typescript/src/index.d.ts.map +1 -1
  27. package/lib/typescript/src/index.kepler.d.ts +49 -4
  28. package/lib/typescript/src/index.kepler.d.ts.map +1 -1
  29. package/lib/typescript/src/kit-api.d.ts +18 -8
  30. package/lib/typescript/src/kit-api.d.ts.map +1 -1
  31. package/lib/typescript/src/specs/RnIap.nitro.d.ts +24 -6
  32. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  33. package/lib/typescript/src/types.d.ts +105 -176
  34. package/lib/typescript/src/types.d.ts.map +1 -1
  35. package/lib/typescript/src/utils/deprecation.d.ts +3 -0
  36. package/lib/typescript/src/utils/deprecation.d.ts.map +1 -0
  37. package/lib/typescript/src/utils/platform-request.d.ts +12 -0
  38. package/lib/typescript/src/utils/platform-request.d.ts.map +1 -0
  39. package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
  40. package/lib/typescript/src/vega-adapter.d.ts +1 -0
  41. package/lib/typescript/src/vega-adapter.d.ts.map +1 -1
  42. package/nitrogen/generated/android/c++/JNitroPurchase.hpp +5 -1
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +7 -2
  44. package/nitrogen/generated/ios/swift/NitroPurchase.swift +39 -2
  45. package/nitrogen/generated/shared/c++/NitroPurchase.hpp +5 -1
  46. package/openiap-versions.json +3 -3
  47. package/package.json +1 -1
  48. package/src/hooks/useIAP.ts +14 -2
  49. package/src/index.kepler.ts +82 -8
  50. package/src/index.ts +104 -47
  51. package/src/kit-api.ts +136 -13
  52. package/src/specs/RnIap.nitro.ts +24 -6
  53. package/src/types.ts +116 -204
  54. package/src/utils/deprecation.ts +16 -0
  55. package/src/utils/platform-request.ts +37 -0
  56. package/src/utils/type-bridge.ts +20 -4
  57. package/src/vega-adapter.ts +46 -24
  58. package/lib/module/hooks/useWebhookEvents.js +0 -113
  59. package/lib/module/hooks/useWebhookEvents.js.map +0 -1
  60. package/lib/module/webhook-client.js +0 -164
  61. package/lib/module/webhook-client.js.map +0 -1
  62. package/lib/typescript/src/hooks/useWebhookEvents.d.ts +0 -55
  63. package/lib/typescript/src/hooks/useWebhookEvents.d.ts.map +0 -1
  64. package/lib/typescript/src/webhook-client.d.ts +0 -82
  65. package/lib/typescript/src/webhook-client.d.ts.map +0 -1
  66. package/src/hooks/useWebhookEvents.ts +0 -180
  67. package/src/webhook-client.ts +0 -312
package/src/types.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // ============================================================================
2
2
  // AUTO-GENERATED TYPES — DO NOT EDIT DIRECTLY
3
- // Run `npm run generate` after updating any *.graphql schema file.
3
+ // Refresh this file with the generated-types workflow documented for your checkout.
4
4
  // ============================================================================
5
5
 
6
6
  export interface ActiveSubscription {
@@ -30,9 +30,9 @@ export interface ActiveSubscription {
30
30
  transactionDate: number;
31
31
  transactionId: string;
32
32
  /**
33
- * @deprecated iOS only - use daysUntilExpirationIOS instead.
34
33
  * Whether the subscription will expire soon (within 7 days).
35
34
  * Consider using daysUntilExpirationIOS for more precise control.
35
+ * @deprecated iOS only - use daysUntilExpirationIOS instead. Scheduled for removal in OpenIAP 3.0.
36
36
  */
37
37
  willExpireSoon?: (boolean | null);
38
38
  }
@@ -90,8 +90,9 @@ export interface AdvancedCommerceRefundIOS {
90
90
  /**
91
91
  * Alternative billing mode for Android
92
92
  * Controls which billing system is used
93
- * @deprecated Use enableBillingProgramAndroid with BillingProgramAndroid instead.
94
- * Use USER_CHOICE_BILLING for user choice billing, EXTERNAL_OFFER for alternative only.
93
+ * Use the user-choice-billing program for user choice billing and external-offer
94
+ * for external digital-content offers.
95
+ * @deprecated Use enableBillingProgramAndroid with BillingProgramAndroid instead. Scheduled for removal in OpenIAP 3.0.
95
96
  */
96
97
  export type AlternativeBillingModeAndroid = 'none' | 'user-choice' | 'alternative-only';
97
98
 
@@ -327,8 +328,8 @@ export interface DiscountDisplayInfoAndroid {
327
328
 
328
329
  /**
329
330
  * Discount information returned from the store.
330
- * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility.
331
- * @see https://openiap.dev/docs/types#subscription-offer
331
+ * @see https://openiap.dev/docs/types/subscription-offer
332
+ * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0.
332
333
  */
333
334
  export interface DiscountIOS {
334
335
  identifier: string;
@@ -343,12 +344,13 @@ export interface DiscountIOS {
343
344
 
344
345
  /**
345
346
  * Standardized one-time product discount offer.
346
- * Provides a unified interface for one-time purchase discounts across platforms.
347
+ * Provides a platform-neutral OpenIAP shape for Google Play one-time product
348
+ * purchase options and offers.
347
349
  *
348
- * Currently supported on Android (Google Play Billing 8.0+).
349
- * iOS does not support one-time purchase discounts in the same way.
350
+ * Currently populated only on Android (Google Play Billing 8.0+).
351
+ * iOS does not populate this type.
350
352
  *
351
- * @see https://openiap.dev/docs/features/discount
353
+ * @see https://openiap.dev/docs/types/discount-offer
352
354
  */
353
355
  export interface DiscountOffer {
354
356
  /** Currency code (ISO 4217, e.g., "USD") */
@@ -360,7 +362,7 @@ export interface DiscountOffer {
360
362
  discountAmountMicrosAndroid?: (string | null);
361
363
  /** Formatted display price string (e.g., "$4.99") */
362
364
  displayPrice: string;
363
- /** [Android] Formatted discount amount string (e.g., "$5.00 OFF"). */
365
+ /** [Android] Formatted discount amount including its currency sign (e.g., "$5.00"). */
364
366
  formattedDiscountAmountAndroid?: (string | null);
365
367
  /**
366
368
  * [Android] Original full price in micro-units before discount.
@@ -406,7 +408,11 @@ export interface DiscountOffer {
406
408
  purchaseOptionIdAndroid?: (string | null);
407
409
  /** [Android] Rental details if this is a rental offer. */
408
410
  rentalDetailsAndroid?: (RentalDetailsAndroid | null);
409
- /** Type of discount offer */
411
+ /**
412
+ * Offer category. DiscountOffer currently represents Android one-time product
413
+ * offers and is populated as OneTime. Introductory and Promotional are used by
414
+ * SubscriptionOffer.
415
+ */
410
416
  type: DiscountOfferType;
411
417
  /**
412
418
  * [Android] Valid time window for the offer.
@@ -417,8 +423,8 @@ export interface DiscountOffer {
417
423
 
418
424
  /**
419
425
  * iOS DiscountOffer (output type).
420
- * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility.
421
- * @see https://openiap.dev/docs/types#subscription-offer
426
+ * @see https://openiap.dev/docs/types/subscription-offer
427
+ * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0.
422
428
  */
423
429
  export interface DiscountOfferIOS {
424
430
  /** Discount identifier */
@@ -484,8 +490,11 @@ export enum ErrorCode {
484
490
  PurchaseVerificationFinishFailed = 'purchase-verification-finish-failed',
485
491
  PurchaseVerificationFinished = 'purchase-verification-finished',
486
492
  QueryProduct = 'query-product',
493
+ /** @deprecated Use PurchaseVerificationFailed instead. Scheduled for removal in OpenIAP 3.0. */
487
494
  ReceiptFailed = 'receipt-failed',
495
+ /** @deprecated Use PurchaseVerificationFinished instead. Scheduled for removal in OpenIAP 3.0. */
488
496
  ReceiptFinished = 'receipt-finished',
497
+ /** @deprecated Use PurchaseVerificationFinishFailed instead. Scheduled for removal in OpenIAP 3.0. */
489
498
  ReceiptFinishedFailed = 'receipt-finished-failed',
490
499
  RemoteError = 'remote-error',
491
500
  ServiceDisconnected = 'service-disconnected',
@@ -517,8 +526,8 @@ export type ExternalLinkTypeAndroid = 'unspecified' | 'link-to-digital-content-o
517
526
 
518
527
  /**
519
528
  * External offer availability result (Android)
520
- * @deprecated Use BillingProgramAvailabilityResultAndroid with isBillingProgramAvailableAsync instead
521
529
  * Available in Google Play Billing Library 6.2.0+, deprecated in 8.2.0
530
+ * @deprecated Use BillingProgramAvailabilityResultAndroid from isBillingProgramAvailableAndroid instead. Scheduled for removal in OpenIAP 3.0.
522
531
  */
523
532
  export interface ExternalOfferAvailabilityResultAndroid {
524
533
  /** Whether external offers are available for the user */
@@ -527,8 +536,8 @@ export interface ExternalOfferAvailabilityResultAndroid {
527
536
 
528
537
  /**
529
538
  * External offer reporting details (Android)
530
- * @deprecated Use BillingProgramReportingDetailsAndroid with createBillingProgramReportingDetailsAsync instead
531
539
  * Available in Google Play Billing Library 6.2.0+, deprecated in 8.2.0
540
+ * @deprecated Use BillingProgramReportingDetailsAndroid from createBillingProgramReportingDetailsAndroid instead. Scheduled for removal in OpenIAP 3.0.
532
541
  */
533
542
  export interface ExternalOfferReportingDetailsAndroid {
534
543
  /** External transaction token for reporting external offer transactions */
@@ -675,8 +684,8 @@ export interface InitConnectionConfig {
675
684
  /**
676
685
  * Alternative billing mode for Android
677
686
  * If not specified, defaults to NONE (standard Google Play billing)
678
- * @deprecated Use enableBillingProgramAndroid instead.
679
687
  * Use USER_CHOICE_BILLING for user choice billing, EXTERNAL_OFFER for alternative only.
688
+ * @deprecated Use enableBillingProgramAndroid instead. Scheduled for removal in OpenIAP 3.0.
680
689
  */
681
690
  alternativeBillingModeAndroid?: (AlternativeBillingModeAndroid | null);
682
691
  /**
@@ -773,6 +782,7 @@ export interface Mutation {
773
782
  * Returns true if available, false otherwise.
774
783
  * Throws OpenIapError.NotPrepared if billing client not ready.
775
784
  * See: https://openiap.dev/docs/apis/android/check-alternative-billing-availability-android
785
+ * @deprecated Use isBillingProgramAvailableAndroid with the external-offer BillingProgramAndroid value instead. Scheduled for removal in OpenIAP 3.0.
776
786
  */
777
787
  checkAlternativeBillingAvailabilityAndroid: Promise<boolean>;
778
788
  /**
@@ -792,6 +802,7 @@ export interface Mutation {
792
802
  * Returns token string, or null if creation failed.
793
803
  * Throws OpenIapError.NotPrepared if billing client not ready.
794
804
  * See: https://openiap.dev/docs/apis/android/create-alternative-billing-token-android
805
+ * @deprecated Use createBillingProgramReportingDetailsAndroid with the external-offer BillingProgramAndroid value instead. Scheduled for removal in OpenIAP 3.0.
795
806
  */
796
807
  createAlternativeBillingTokenAndroid?: Promise<(string | null)>;
797
808
  /**
@@ -859,7 +870,7 @@ export interface Mutation {
859
870
  * purchase while the app is running with an active billing connection; always
860
871
  * reconcile with getAvailablePurchases when the app resumes.
861
872
  * Does not require the billing client to be initialized (no Play Billing version requirement).
862
- * Planned OpenIAP availability: Spec 2.5.0 / openiap-google 2.5.0.
873
+ * Available in OpenIAP Spec 2.4.2 / openiap-google 2.5.0.
863
874
  * Android counterpart of presentCodeRedemptionSheetIOS.
864
875
  * Returns true when the redemption flow was launched, or false when the current
865
876
  * store flavor does not provide an equivalent redemption flow.
@@ -891,11 +902,8 @@ export interface Mutation {
891
902
  /**
892
903
  * Buy the currently promoted product.
893
904
  *
894
- * @deprecated Use promotedProductListenerIOS to receive the productId,
895
- * then call requestPurchase with that SKU instead. In StoreKit 2,
896
- * promoted products can be purchased directly via the standard purchase flow.
897
905
  * See: https://openiap.dev/docs/apis/ios/request-purchase-on-promoted-product-ios
898
- * @deprecated Use promotedProductListenerIOS + requestPurchase instead
906
+ * @deprecated Use the promoted-product listener or callback exposed by your SDK to receive the productId, then call requestPurchase with that SKU instead. In StoreKit 2, promoted products can be purchased directly via the standard purchase flow. Scheduled for removal in OpenIAP 3.0.
899
907
  */
900
908
  requestPurchaseOnPromotedProductIOS: Promise<boolean>;
901
909
  /**
@@ -909,6 +917,7 @@ export interface Mutation {
909
917
  * Returns true if user accepted, false if user canceled.
910
918
  * Throws OpenIapError.NotPrepared if billing client not ready.
911
919
  * See: https://openiap.dev/docs/apis/android/show-alternative-billing-dialog-android
920
+ * @deprecated Use launchExternalLinkAndroid instead. Scheduled for removal in OpenIAP 3.0.
912
921
  */
913
922
  showAlternativeBillingDialogAndroid: Promise<boolean>;
914
923
  /**
@@ -948,7 +957,7 @@ export interface Mutation {
948
957
  /**
949
958
  * Deprecated. Validate purchase receipts with the configured providers — use verifyPurchase instead.
950
959
  * See: https://openiap.dev/docs/features/validation#verify-purchase
951
- * @deprecated Use verifyPurchase
960
+ * @deprecated Use verifyPurchase. Scheduled for removal in OpenIAP 3.0.
952
961
  */
953
962
  validateReceipt: Promise<VerifyPurchaseResult>;
954
963
  /**
@@ -969,8 +978,6 @@ export interface Mutation {
969
978
  verifyPurchaseWithProvider: Promise<VerifyPurchaseWithProviderResult>;
970
979
  }
971
980
 
972
-
973
-
974
981
  export type MutationAcknowledgePurchaseAndroidArgs = string;
975
982
 
976
983
  export type MutationBeginRefundRequestIosArgs = string;
@@ -982,7 +989,6 @@ export interface MutationCreateBillingProgramReportingDetailsAndroidArgs {
982
989
  program: BillingProgramAndroid;
983
990
  }
984
991
 
985
-
986
992
  export type MutationDeepLinkToSubscriptionsArgs = (DeepLinkOptions | null) | undefined;
987
993
 
988
994
  export interface MutationFinishTransactionArgs {
@@ -990,7 +996,6 @@ export interface MutationFinishTransactionArgs {
990
996
  purchase: PurchaseInput;
991
997
  }
992
998
 
993
-
994
999
  export type MutationInitConnectionArgs = (InitConnectionConfig | null) | undefined;
995
1000
 
996
1001
  export type MutationIsBillingProgramAvailableAndroidArgs = BillingProgramAndroid;
@@ -999,22 +1004,7 @@ export type MutationLaunchExternalLinkAndroidArgs = LaunchExternalLinkParamsAndr
999
1004
 
1000
1005
  export type MutationPresentExternalPurchaseLinkIosArgs = string;
1001
1006
 
1002
- export type MutationRequestPurchaseArgs =
1003
- | {
1004
- /** Per-platform purchase request props */
1005
- request: RequestPurchasePropsByPlatforms;
1006
- type: 'in-app';
1007
- /** Use alternative billing (Google Play alternative billing, Apple external purchase link) */
1008
- useAlternativeBilling?: boolean | null;
1009
- }
1010
- | {
1011
- /** Per-platform subscription request props */
1012
- request: RequestSubscriptionPropsByPlatforms;
1013
- type: 'subs';
1014
- /** Use alternative billing (Google Play alternative billing, Apple external purchase link) */
1015
- useAlternativeBilling?: boolean | null;
1016
- };
1017
-
1007
+ export type MutationRequestPurchaseArgs = RequestPurchaseProps;
1018
1008
 
1019
1009
  export type MutationShowBillingProgramInformationDialogAndroidArgs = BillingProgramInformationDialogParamsAndroid;
1020
1010
 
@@ -1093,9 +1083,9 @@ export interface ProductAndroid extends ProductCommon {
1093
1083
  debugDescription?: (string | null);
1094
1084
  description: string;
1095
1085
  /**
1096
- * Standardized discount offers for one-time products.
1097
- * Cross-platform type with Android-specific fields using suffix.
1098
- * @see https://openiap.dev/docs/types#discount-offer
1086
+ * Standardized Android one-time product purchase options and offers.
1087
+ * Native metadata uses Android-suffixed fields.
1088
+ * @see https://openiap.dev/docs/types/discount-offer
1099
1089
  */
1100
1090
  discountOffers?: (DiscountOffer[] | null);
1101
1091
  displayName?: (string | null);
@@ -1105,8 +1095,7 @@ export interface ProductAndroid extends ProductCommon {
1105
1095
  /**
1106
1096
  * One-time purchase offer details including discounts (Android)
1107
1097
  * Returns all eligible offers. Available in Google Play Billing Library 8.0+
1108
- * @deprecated Use discountOffers instead for cross-platform compatibility.
1109
- * @deprecated Use discountOffers instead
1098
+ * @deprecated Use the standardized discountOffers field instead. Scheduled for removal in OpenIAP 3.0.
1110
1099
  */
1111
1100
  oneTimePurchaseOfferDetailsAndroid?: (ProductAndroidOneTimePurchaseOfferDetail[] | null);
1112
1101
  platform: 'android';
@@ -1119,15 +1108,12 @@ export interface ProductAndroid extends ProductCommon {
1119
1108
  * Available in Google Play Billing Library 8.0.0+
1120
1109
  */
1121
1110
  productStatusAndroid?: (ProductStatusAndroid | null);
1122
- /**
1123
- * @deprecated Use subscriptionOffers instead for cross-platform compatibility.
1124
- * @deprecated Use subscriptionOffers instead
1125
- */
1111
+ /** @deprecated Use subscriptionOffers instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0. */
1126
1112
  subscriptionOfferDetailsAndroid?: (ProductSubscriptionAndroidOfferDetails[] | null);
1127
1113
  /**
1128
1114
  * Standardized subscription offers.
1129
1115
  * Cross-platform type with Android-specific fields using suffix.
1130
- * @see https://openiap.dev/docs/types#subscription-offer
1116
+ * @see https://openiap.dev/docs/types/subscription-offer
1131
1117
  */
1132
1118
  subscriptionOffers?: (SubscriptionOffer[] | null);
1133
1119
  title: string;
@@ -1137,8 +1123,8 @@ export interface ProductAndroid extends ProductCommon {
1137
1123
  /**
1138
1124
  * One-time purchase offer details (Android).
1139
1125
  * Available in Google Play Billing Library 8.0+
1140
- * @deprecated Use the standardized DiscountOffer type instead for cross-platform compatibility.
1141
- * @see https://openiap.dev/docs/types#discount-offer
1126
+ * @see https://openiap.dev/docs/types/discount-offer
1127
+ * @deprecated Use the standardized DiscountOffer type for Android one-time offers. Scheduled for removal in OpenIAP 3.0.
1142
1128
  */
1143
1129
  export interface ProductAndroidOneTimePurchaseOfferDetail {
1144
1130
  /**
@@ -1209,16 +1195,13 @@ export interface ProductIOS extends ProductCommon {
1209
1195
  * monthly subscriptions with a 12-month commitment.
1210
1196
  */
1211
1197
  pricingTermsIOS?: (SubscriptionPricingTermsIOS[] | null);
1212
- /**
1213
- * @deprecated Use subscriptionOffers instead for cross-platform compatibility.
1214
- * @deprecated Use subscriptionOffers instead
1215
- */
1198
+ /** @deprecated Use subscriptionOffers instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0. */
1216
1199
  subscriptionInfoIOS?: (SubscriptionInfoIOS | null);
1217
1200
  /**
1218
1201
  * Standardized subscription offers.
1219
1202
  * Cross-platform type with iOS-specific fields using suffix.
1220
1203
  * Note: iOS does not support one-time product discounts.
1221
- * @see https://openiap.dev/docs/types#subscription-offer
1204
+ * @see https://openiap.dev/docs/types/subscription-offer
1222
1205
  */
1223
1206
  subscriptionOffers?: (SubscriptionOffer[] | null);
1224
1207
  title: string;
@@ -1250,9 +1233,8 @@ export interface ProductSubscriptionAndroid extends ProductCommon {
1250
1233
  debugDescription?: (string | null);
1251
1234
  description: string;
1252
1235
  /**
1253
- * Standardized discount offers for one-time products.
1254
- * Cross-platform type with Android-specific fields using suffix.
1255
- * @see https://openiap.dev/docs/types#discount-offer
1236
+ * Nullable compatibility field. Google Play does not return one-time purchase
1237
+ * offer details for subscription products; use subscriptionOffers below.
1256
1238
  */
1257
1239
  discountOffers?: (DiscountOffer[] | null);
1258
1240
  displayName?: (string | null);
@@ -1260,10 +1242,9 @@ export interface ProductSubscriptionAndroid extends ProductCommon {
1260
1242
  id: string;
1261
1243
  nameAndroid: string;
1262
1244
  /**
1263
- * One-time purchase offer details including discounts (Android)
1264
- * Returns all eligible offers. Available in Google Play Billing Library 8.0+
1265
- * @deprecated Use discountOffers instead for cross-platform compatibility.
1266
- * @deprecated Use discountOffers instead
1245
+ * Legacy nullable compatibility field. Google Play does not populate one-time
1246
+ * purchase offer details for subscription products.
1247
+ * @deprecated One-time offers belong to ProductAndroid.discountOffers; subscriptions use subscriptionOffers. Scheduled for removal in OpenIAP 3.0.
1267
1248
  */
1268
1249
  oneTimePurchaseOfferDetailsAndroid?: (ProductAndroidOneTimePurchaseOfferDetail[] | null);
1269
1250
  platform: 'android';
@@ -1276,15 +1257,12 @@ export interface ProductSubscriptionAndroid extends ProductCommon {
1276
1257
  * Available in Google Play Billing Library 8.0.0+
1277
1258
  */
1278
1259
  productStatusAndroid?: (ProductStatusAndroid | null);
1279
- /**
1280
- * @deprecated Use subscriptionOffers instead for cross-platform compatibility.
1281
- * @deprecated Use subscriptionOffers instead
1282
- */
1260
+ /** @deprecated Use subscriptionOffers instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0. */
1283
1261
  subscriptionOfferDetailsAndroid: ProductSubscriptionAndroidOfferDetails[];
1284
1262
  /**
1285
1263
  * Standardized subscription offers.
1286
1264
  * Cross-platform type with Android-specific fields using suffix.
1287
- * @see https://openiap.dev/docs/types#subscription-offer
1265
+ * @see https://openiap.dev/docs/types/subscription-offer
1288
1266
  */
1289
1267
  subscriptionOffers: SubscriptionOffer[];
1290
1268
  title: string;
@@ -1293,8 +1271,8 @@ export interface ProductSubscriptionAndroid extends ProductCommon {
1293
1271
 
1294
1272
  /**
1295
1273
  * Subscription offer details (Android).
1296
- * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility.
1297
- * @see https://openiap.dev/docs/types#subscription-offer
1274
+ * @see https://openiap.dev/docs/types/subscription-offer
1275
+ * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0.
1298
1276
  */
1299
1277
  export interface ProductSubscriptionAndroidOfferDetails {
1300
1278
  basePlanId: string;
@@ -1314,10 +1292,7 @@ export interface ProductSubscriptionIOS extends ProductCommon {
1314
1292
  currency: string;
1315
1293
  debugDescription?: (string | null);
1316
1294
  description: string;
1317
- /**
1318
- * @deprecated Use subscriptionOffers instead for cross-platform compatibility.
1319
- * @deprecated Use subscriptionOffers instead
1320
- */
1295
+ /** @deprecated Use subscriptionOffers instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0. */
1321
1296
  discountsIOS?: (DiscountIOS[] | null);
1322
1297
  displayName?: (string | null);
1323
1298
  displayNameIOS: string;
@@ -1339,15 +1314,12 @@ export interface ProductSubscriptionIOS extends ProductCommon {
1339
1314
  pricingTermsIOS?: (SubscriptionPricingTermsIOS[] | null);
1340
1315
  /** App Store subscription group identifier for intro-offer eligibility checks. */
1341
1316
  subscriptionGroupIdIOS?: (string | null);
1342
- /**
1343
- * @deprecated Use subscriptionOffers for offer metadata and subscriptionGroupIdIOS for the App Store subscription group identifier.
1344
- * @deprecated Use subscriptionOffers for offers and subscriptionGroupIdIOS for group ID
1345
- */
1317
+ /** @deprecated Use subscriptionOffers for offer metadata and subscriptionGroupIdIOS for the App Store subscription group identifier. Scheduled for removal in OpenIAP 3.0. */
1346
1318
  subscriptionInfoIOS?: (SubscriptionInfoIOS | null);
1347
1319
  /**
1348
1320
  * Standardized subscription offers.
1349
1321
  * Cross-platform type with iOS-specific fields using suffix.
1350
- * @see https://openiap.dev/docs/types#subscription-offer
1322
+ * @see https://openiap.dev/docs/types/subscription-offer
1351
1323
  */
1352
1324
  subscriptionOffers?: (SubscriptionOffer[] | null);
1353
1325
  subscriptionPeriodNumberIOS?: (string | null);
@@ -1407,7 +1379,7 @@ export interface PurchaseAndroid extends PurchaseCommon {
1407
1379
  * Available in Google Play Billing Library 5.0+
1408
1380
  */
1409
1381
  pendingPurchaseUpdateAndroid?: (PendingPurchaseUpdateAndroid | null);
1410
- /** @deprecated Use store instead */
1382
+ /** @deprecated Use store instead. Scheduled for removal in OpenIAP 3.0. */
1411
1383
  platform: IapPlatform;
1412
1384
  productId: string;
1413
1385
  purchaseState: PurchaseState;
@@ -1432,7 +1404,7 @@ export interface PurchaseCommon {
1432
1404
  id: string;
1433
1405
  ids?: (string[] | null);
1434
1406
  isAutoRenewing: boolean;
1435
- /** @deprecated Use store instead */
1407
+ /** @deprecated Use store instead. Scheduled for removal in OpenIAP 3.0. */
1436
1408
  platform: IapPlatform;
1437
1409
  productId: string;
1438
1410
  purchaseState: PurchaseState;
@@ -1484,7 +1456,7 @@ export interface PurchaseIOS extends PurchaseCommon {
1484
1456
  originalTransactionDateIOS?: (number | null);
1485
1457
  originalTransactionIdentifierIOS?: (string | null);
1486
1458
  ownershipTypeIOS?: (string | null);
1487
- /** @deprecated Use store instead */
1459
+ /** @deprecated Use store instead. Scheduled for removal in OpenIAP 3.0. */
1488
1460
  platform: IapPlatform;
1489
1461
  productId: string;
1490
1462
  purchaseState: PurchaseState;
@@ -1622,7 +1594,7 @@ export interface Query {
1622
1594
  * Deprecated. Get the current App Store storefront ISO 3166-1 alpha-3 country
1623
1595
  * code — use cross-platform getStorefront instead.
1624
1596
  * See: https://openiap.dev/docs/apis/ios/get-storefront-ios
1625
- * @deprecated Use getStorefront
1597
+ * @deprecated Use getStorefront. Scheduled for removal in OpenIAP 3.0.
1626
1598
  */
1627
1599
  getStorefrontIOS: Promise<string>;
1628
1600
  /**
@@ -1665,13 +1637,11 @@ export interface Query {
1665
1637
  /**
1666
1638
  * Deprecated. Legacy App Store receipt validation — use verifyPurchase instead.
1667
1639
  * See: https://openiap.dev/docs/apis/ios/validate-receipt-ios
1668
- * @deprecated Use verifyPurchase
1640
+ * @deprecated Use verifyPurchase. Scheduled for removal in OpenIAP 3.0.
1669
1641
  */
1670
1642
  validateReceiptIOS: Promise<VerifyPurchaseResultIOS>;
1671
1643
  }
1672
1644
 
1673
-
1674
-
1675
1645
  export type QueryCurrentEntitlementIosArgs = string;
1676
1646
 
1677
1647
  export type QueryFetchProductsArgs = ProductRequest;
@@ -1832,15 +1802,23 @@ export type RequestPurchaseProps =
1832
1802
  | {
1833
1803
  /** Per-platform purchase request props */
1834
1804
  request: RequestPurchasePropsByPlatforms;
1805
+ /** Explicit purchase type hint (defaults to in-app) */
1835
1806
  type: 'in-app';
1836
- /** Use alternative billing (Google Play alternative billing, Apple external purchase link) */
1807
+ /**
1808
+ * This flag only logs debug info and has no effect on the purchase flow.
1809
+ * @deprecated Use enableBillingProgramAndroid in InitConnectionConfig instead. Scheduled for removal in OpenIAP 3.0.
1810
+ */
1837
1811
  useAlternativeBilling?: boolean | null;
1838
1812
  }
1839
1813
  | {
1840
1814
  /** Per-platform subscription request props */
1841
1815
  request: RequestSubscriptionPropsByPlatforms;
1816
+ /** Explicit purchase type hint (defaults to in-app) */
1842
1817
  type: 'subs';
1843
- /** Use alternative billing (Google Play alternative billing, Apple external purchase link) */
1818
+ /**
1819
+ * This flag only logs debug info and has no effect on the purchase flow.
1820
+ * @deprecated Use enableBillingProgramAndroid in InitConnectionConfig instead. Scheduled for removal in OpenIAP 3.0.
1821
+ */
1844
1822
  useAlternativeBilling?: boolean | null;
1845
1823
  };
1846
1824
 
@@ -1854,13 +1832,13 @@ export type RequestPurchaseProps =
1854
1832
  * (determined at build time, not runtime)
1855
1833
  */
1856
1834
  export interface RequestPurchasePropsByPlatforms {
1857
- /** @deprecated Use google instead */
1835
+ /** @deprecated Use google instead. Scheduled for removal in OpenIAP 3.0. */
1858
1836
  android?: (RequestPurchaseAndroidProps | null);
1859
1837
  /** Apple-specific purchase parameters */
1860
1838
  apple?: (RequestPurchaseIosProps | null);
1861
1839
  /** Google-specific purchase parameters */
1862
1840
  google?: (RequestPurchaseAndroidProps | null);
1863
- /** @deprecated Use apple instead */
1841
+ /** @deprecated Use apple instead. Scheduled for removal in OpenIAP 3.0. */
1864
1842
  ios?: (RequestPurchaseIosProps | null);
1865
1843
  }
1866
1844
 
@@ -1892,7 +1870,7 @@ export interface RequestSubscriptionAndroidProps {
1892
1870
  purchaseToken?: (string | null);
1893
1871
  /**
1894
1872
  * Replacement mode for subscription changes
1895
- * @deprecated Use subscriptionProductReplacementParams instead for item-level replacement (8.1.0+)
1873
+ * @deprecated Use subscriptionProductReplacementParams instead for item-level replacement (8.1.0+). Scheduled for removal in OpenIAP 3.0.
1896
1874
  */
1897
1875
  replacementMode?: (number | null);
1898
1876
  /** List of subscription SKUs */
@@ -1963,13 +1941,13 @@ export interface RequestSubscriptionIosProps {
1963
1941
  * (determined at build time, not runtime)
1964
1942
  */
1965
1943
  export interface RequestSubscriptionPropsByPlatforms {
1966
- /** @deprecated Use google instead */
1944
+ /** @deprecated Use google instead. Scheduled for removal in OpenIAP 3.0. */
1967
1945
  android?: (RequestSubscriptionAndroidProps | null);
1968
1946
  /** Apple-specific subscription parameters */
1969
1947
  apple?: (RequestSubscriptionIosProps | null);
1970
1948
  /** Google-specific subscription parameters */
1971
1949
  google?: (RequestSubscriptionAndroidProps | null);
1972
- /** @deprecated Use apple instead */
1950
+ /** @deprecated Use apple instead. Scheduled for removal in OpenIAP 3.0. */
1973
1951
  ios?: (RequestSubscriptionIosProps | null);
1974
1952
  }
1975
1953
 
@@ -2098,8 +2076,6 @@ export interface Subscription {
2098
2076
  userChoiceBillingAndroid: UserChoiceBillingDetails;
2099
2077
  }
2100
2078
 
2101
-
2102
-
2103
2079
  export type SubscriptionPurchaseUpdatedArgs = (PurchaseUpdatedListenerOptions | null) | undefined;
2104
2080
 
2105
2081
  export type SubscriptionBillingPlanTypeIOS = 'unknown' | 'monthly' | 'up-front';
@@ -2126,8 +2102,7 @@ export interface SubscriptionInfoIOS {
2126
2102
  * - iOS: Introductory offers, promotional offers with server-side signatures
2127
2103
  * - Android: Offer tokens with pricing phases
2128
2104
  *
2129
- * @see https://openiap.dev/docs/types/ios#discount-offer
2130
- * @see https://openiap.dev/docs/types/android#subscription-offer
2105
+ * @see https://openiap.dev/docs/types/subscription-offer
2131
2106
  */
2132
2107
  export interface SubscriptionOffer {
2133
2108
  /**
@@ -2201,8 +2176,8 @@ export interface SubscriptionOffer {
2201
2176
 
2202
2177
  /**
2203
2178
  * iOS subscription offer details.
2204
- * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility.
2205
- * @see https://openiap.dev/docs/types#subscription-offer
2179
+ * @see https://openiap.dev/docs/types/subscription-offer
2180
+ * @deprecated Use the standardized SubscriptionOffer type instead for cross-platform compatibility. Scheduled for removal in OpenIAP 3.0.
2206
2181
  */
2207
2182
  export interface SubscriptionOfferIOS {
2208
2183
  displayPrice: string;
@@ -2262,8 +2237,6 @@ export interface SubscriptionProductReplacementParamsAndroid {
2262
2237
  */
2263
2238
  export type SubscriptionReplacementModeAndroid = 'unknown-replacement-mode' | 'with-time-proration' | 'charge-prorated-price' | 'charge-full-price' | 'without-proration' | 'deferred' | 'keep-existing';
2264
2239
 
2265
- export type SubscriptionState = 'active' | 'expired' | 'in-billing-retry' | 'in-grace-period' | 'paused' | 'refunded' | 'revoked' | 'unknown';
2266
-
2267
2240
  export interface SubscriptionStatusIOS {
2268
2241
  renewalInfo?: (RenewalInfoIOS | null);
2269
2242
  state: string;
@@ -2445,67 +2418,6 @@ export interface VerifyPurchaseWithProviderResult {
2445
2418
 
2446
2419
  export type VoidResult = void;
2447
2420
 
2448
- export type WebhookCancellationReason = 'billing-error' | 'other' | 'price-increase-declined' | 'product-unavailable' | 'refunded' | 'user-canceled';
2449
-
2450
- export interface WebhookEvent {
2451
- /** Reason for cancellation, when applicable. */
2452
- cancellationReason?: (WebhookCancellationReason | null);
2453
- /** Localized currency code (ISO 4217) at event time, when available. */
2454
- currency?: (string | null);
2455
- environment: WebhookEventEnvironment;
2456
- /** When the current subscription period ends. Epoch milliseconds. */
2457
- expiresAt?: (number | null);
2458
- /**
2459
- * Stable identifier suitable for idempotency. Derived from the source notification
2460
- * UUID where the store provides one (ASN v2 `notificationUUID`, RTDN message id);
2461
- * otherwise hashed from the canonicalized payload.
2462
- */
2463
- id: string;
2464
- /** Time the underlying event occurred at the store. Epoch milliseconds. */
2465
- occurredAt: number;
2466
- platform: IapPlatform;
2467
- /**
2468
- * Price in micros (1/1,000,000 of the currency unit) at event time, when available.
2469
- * Matches Google Play's `priceAmountMicros` convention; iOS values are converted.
2470
- */
2471
- priceAmountMicros?: (number | null);
2472
- /** Product the event pertains to. May be null for account-level events. */
2473
- productId?: (string | null);
2474
- /** kit project that owns the subscription / purchase this event refers to. */
2475
- projectId: string;
2476
- /**
2477
- * Cross-platform purchase identity used to correlate this event with an existing
2478
- * purchase record. iOS: `originalTransactionId`. Android: `purchaseToken`.
2479
- * Null for `TestNotification` events (Apple ASN v2 / Google RTDN test
2480
- * payloads carry no transaction); always present for every other event type.
2481
- */
2482
- purchaseToken?: (string | null);
2483
- /**
2484
- * Original signed payload from the store. ASN v2 events expose the JWS string;
2485
- * RTDN events expose the base64-decoded Pub/Sub message JSON. Provided so that
2486
- * consumers can independently verify or extract platform-specific fields. kit
2487
- * always validates this payload before emitting the event.
2488
- */
2489
- rawSignedPayload?: (string | null);
2490
- /** Time kit ingested and normalized this event. Epoch milliseconds. */
2491
- receivedAt: number;
2492
- /** When auto-renewal will charge again. Epoch milliseconds. */
2493
- renewsAt?: (number | null);
2494
- source: WebhookEventSource;
2495
- /**
2496
- * Normalized subscription state at the time of event, when the event refers to
2497
- * a subscription. Null for one-time purchase events.
2498
- */
2499
- subscriptionState?: (SubscriptionState | null);
2500
- type: WebhookEventType;
2501
- }
2502
-
2503
- export type WebhookEventEnvironment = 'production' | 'sandbox' | 'xcode';
2504
-
2505
- export type WebhookEventSource = 'apple-app-store-server-notifications-v2' | 'google-play-real-time-developer-notifications' | 'meta-horizon-reconciler';
2506
-
2507
- export type WebhookEventType = 'purchase-consumption-request' | 'purchase-refunded' | 'subscription-canceled' | 'subscription-expired' | 'subscription-in-billing-retry' | 'subscription-in-grace-period' | 'subscription-paused' | 'subscription-price-change' | 'subscription-product-changed' | 'subscription-recovered' | 'subscription-renewed' | 'subscription-resumed' | 'subscription-revoked' | 'subscription-started' | 'subscription-uncanceled' | 'test-notification';
2508
-
2509
2421
  /**
2510
2422
  * Win-back offer input for iOS 18+ (StoreKit 2)
2511
2423
  * Win-back offers are used to re-engage churned subscribers.
@@ -2516,44 +2428,6 @@ export interface WinBackOfferInputIOS {
2516
2428
  /** The win-back offer ID from App Store Connect */
2517
2429
  offerId: string;
2518
2430
  }
2519
- // -- Query helper types (auto-generated)
2520
- export type QueryArgsMap = {
2521
- canPresentExternalPurchaseNoticeIOS: never;
2522
- currentEntitlementIOS: QueryCurrentEntitlementIosArgs;
2523
- fetchProducts: QueryFetchProductsArgs;
2524
- getActiveSubscriptions: QueryGetActiveSubscriptionsArgs;
2525
- getAllTransactionsIOS: never;
2526
- getAppTransactionIOS: never;
2527
- getAvailablePurchases: QueryGetAvailablePurchasesArgs;
2528
- getBillingChoiceInfoAndroid: QueryGetBillingChoiceInfoAndroidArgs;
2529
- getExternalPurchaseCustomLinkTokenIOS: QueryGetExternalPurchaseCustomLinkTokenIosArgs;
2530
- getPendingTransactionsIOS: never;
2531
- getPromotedProductIOS: never;
2532
- getReceiptDataIOS: never;
2533
- getStorefront: never;
2534
- getStorefrontIOS: never;
2535
- getTransactionJwsIOS: QueryGetTransactionJwsIosArgs;
2536
- hasActiveSubscriptions: QueryHasActiveSubscriptionsArgs;
2537
- isEligibleForExternalPurchaseCustomLinkIOS: never;
2538
- isEligibleForIntroOfferIOS: QueryIsEligibleForIntroOfferIosArgs;
2539
- isTransactionVerifiedIOS: QueryIsTransactionVerifiedIosArgs;
2540
- latestTransactionIOS: QueryLatestTransactionIosArgs;
2541
- subscriptionStatusIOS: QuerySubscriptionStatusIosArgs;
2542
- validateReceiptIOS: QueryValidateReceiptIosArgs;
2543
- };
2544
-
2545
- export type QueryField<K extends keyof Query> =
2546
- QueryArgsMap[K] extends never
2547
- ? () => NonNullable<Query[K]>
2548
- : undefined extends QueryArgsMap[K]
2549
- ? (args?: QueryArgsMap[K]) => NonNullable<Query[K]>
2550
- : (args: QueryArgsMap[K]) => NonNullable<Query[K]>;
2551
-
2552
- export type QueryFieldMap = {
2553
- [K in keyof Query]?: QueryField<K>;
2554
- };
2555
- // -- End query helper types
2556
-
2557
2431
  // -- Mutation helper types (auto-generated)
2558
2432
  export type MutationArgsMap = {
2559
2433
  acknowledgePurchaseAndroid: MutationAcknowledgePurchaseAndroidArgs;
@@ -2599,6 +2473,44 @@ export type MutationFieldMap = {
2599
2473
  };
2600
2474
  // -- End mutation helper types
2601
2475
 
2476
+ // -- Query helper types (auto-generated)
2477
+ export type QueryArgsMap = {
2478
+ canPresentExternalPurchaseNoticeIOS: never;
2479
+ currentEntitlementIOS: QueryCurrentEntitlementIosArgs;
2480
+ fetchProducts: QueryFetchProductsArgs;
2481
+ getActiveSubscriptions: QueryGetActiveSubscriptionsArgs;
2482
+ getAllTransactionsIOS: never;
2483
+ getAppTransactionIOS: never;
2484
+ getAvailablePurchases: QueryGetAvailablePurchasesArgs;
2485
+ getBillingChoiceInfoAndroid: QueryGetBillingChoiceInfoAndroidArgs;
2486
+ getExternalPurchaseCustomLinkTokenIOS: QueryGetExternalPurchaseCustomLinkTokenIosArgs;
2487
+ getPendingTransactionsIOS: never;
2488
+ getPromotedProductIOS: never;
2489
+ getReceiptDataIOS: never;
2490
+ getStorefront: never;
2491
+ getStorefrontIOS: never;
2492
+ getTransactionJwsIOS: QueryGetTransactionJwsIosArgs;
2493
+ hasActiveSubscriptions: QueryHasActiveSubscriptionsArgs;
2494
+ isEligibleForExternalPurchaseCustomLinkIOS: never;
2495
+ isEligibleForIntroOfferIOS: QueryIsEligibleForIntroOfferIosArgs;
2496
+ isTransactionVerifiedIOS: QueryIsTransactionVerifiedIosArgs;
2497
+ latestTransactionIOS: QueryLatestTransactionIosArgs;
2498
+ subscriptionStatusIOS: QuerySubscriptionStatusIosArgs;
2499
+ validateReceiptIOS: QueryValidateReceiptIosArgs;
2500
+ };
2501
+
2502
+ export type QueryField<K extends keyof Query> =
2503
+ QueryArgsMap[K] extends never
2504
+ ? () => NonNullable<Query[K]>
2505
+ : undefined extends QueryArgsMap[K]
2506
+ ? (args?: QueryArgsMap[K]) => NonNullable<Query[K]>
2507
+ : (args: QueryArgsMap[K]) => NonNullable<Query[K]>;
2508
+
2509
+ export type QueryFieldMap = {
2510
+ [K in keyof Query]?: QueryField<K>;
2511
+ };
2512
+ // -- End query helper types
2513
+
2602
2514
  // -- Subscription helper types (auto-generated)
2603
2515
  export type SubscriptionArgsMap = {
2604
2516
  developerProvidedBillingAndroid: never;