react-native-iap 14.4.26 → 14.4.28

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 (152) hide show
  1. package/android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt +1 -1
  2. package/ios/RnIapHelper.swift +7 -1
  3. package/lib/module/index.js +3 -0
  4. package/lib/module/index.js.map +1 -1
  5. package/lib/module/utils/type-bridge.js +2 -1
  6. package/lib/module/utils/type-bridge.js.map +1 -1
  7. package/lib/typescript/src/index.d.ts.map +1 -1
  8. package/lib/typescript/src/specs/RnIap.nitro.d.ts +52 -8
  9. package/lib/typescript/src/specs/RnIap.nitro.d.ts.map +1 -1
  10. package/lib/typescript/src/types.d.ts +1 -1
  11. package/lib/typescript/src/types.d.ts.map +1 -1
  12. package/lib/typescript/src/utils/type-bridge.d.ts.map +1 -1
  13. package/nitrogen/generated/android/c++/JAndroidSubscriptionOfferInput.hpp +5 -1
  14. package/nitrogen/generated/android/c++/JExternalPurchaseLinkResultIOS.hpp +5 -1
  15. package/nitrogen/generated/android/c++/JExternalPurchaseNoticeResultIOS.hpp +5 -1
  16. package/nitrogen/generated/android/c++/JFunc_void_NitroProduct.hpp +2 -0
  17. package/nitrogen/generated/android/c++/JHybridRnIapSpec.cpp +4 -0
  18. package/nitrogen/generated/android/c++/JInitConnectionConfig.hpp +5 -1
  19. package/nitrogen/generated/android/c++/JNitroActiveSubscription.hpp +5 -1
  20. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesAndroidOptions.hpp +5 -1
  21. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesIosOptions.hpp +5 -1
  22. package/nitrogen/generated/android/c++/JNitroAvailablePurchasesOptions.hpp +5 -1
  23. package/nitrogen/generated/android/c++/JNitroDeepLinkOptionsAndroid.hpp +5 -1
  24. package/nitrogen/generated/android/c++/JNitroFinishTransactionAndroidParams.hpp +5 -1
  25. package/nitrogen/generated/android/c++/JNitroFinishTransactionIosParams.hpp +5 -1
  26. package/nitrogen/generated/android/c++/JNitroFinishTransactionParams.hpp +5 -1
  27. package/nitrogen/generated/android/c++/JNitroOneTimePurchaseOfferDetail.hpp +5 -1
  28. package/nitrogen/generated/android/c++/JNitroProduct.hpp +11 -5
  29. package/nitrogen/generated/android/c++/JNitroPurchase.hpp +5 -1
  30. package/nitrogen/generated/android/c++/JNitroPurchaseRequest.hpp +5 -1
  31. package/nitrogen/generated/android/c++/JNitroPurchaseResult.hpp +5 -1
  32. package/nitrogen/generated/android/c++/JNitroReceiptValidationAndroidOptions.hpp +5 -1
  33. package/nitrogen/generated/android/c++/JNitroReceiptValidationParams.hpp +5 -1
  34. package/nitrogen/generated/android/c++/JNitroReceiptValidationResultAndroid.hpp +5 -1
  35. package/nitrogen/generated/android/c++/JNitroReceiptValidationResultIOS.hpp +5 -1
  36. package/nitrogen/generated/android/c++/JNitroRenewalInfoIOS.hpp +5 -1
  37. package/nitrogen/generated/android/c++/JNitroRequestPurchaseAndroid.hpp +5 -1
  38. package/nitrogen/generated/android/c++/JNitroRequestPurchaseIos.hpp +5 -1
  39. package/nitrogen/generated/android/c++/JNitroSubscriptionRenewalInfo.hpp +5 -1
  40. package/nitrogen/generated/android/c++/JNitroSubscriptionStatus.hpp +5 -1
  41. package/nitrogen/generated/android/c++/JPaymentModeIOS.hpp +65 -0
  42. package/nitrogen/generated/android/c++/JPurchaseAndroid.hpp +5 -1
  43. package/nitrogen/generated/android/c++/JPurchaseIOS.hpp +5 -1
  44. package/nitrogen/generated/android/c++/JPurchaseOfferIOS.hpp +5 -1
  45. package/nitrogen/generated/android/c++/JRenewalInfoIOS.hpp +5 -1
  46. package/nitrogen/generated/android/c++/JUserChoiceBillingDetails.hpp +5 -1
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/AndroidSubscriptionOfferInput.kt +16 -9
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalPurchaseLinkResultIOS.kt +16 -9
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/ExternalPurchaseNoticeResultIOS.kt +16 -9
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroProduct.kt +0 -1
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroPurchase.kt +0 -1
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_NitroPurchaseResult.kt +0 -1
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Func_void_UserChoiceBillingDetails.kt +0 -1
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/HybridRnIapSpec.kt +3 -2
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/InitConnectionConfig.kt +13 -6
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroActiveSubscription.kt +52 -45
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesAndroidOptions.kt +13 -6
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesIosOptions.kt +22 -15
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroAvailablePurchasesOptions.kt +16 -9
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroDeepLinkOptionsAndroid.kt +16 -9
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionAndroidParams.kt +16 -9
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionIosParams.kt +13 -6
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroFinishTransactionParams.kt +16 -9
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroOneTimePurchaseOfferDetail.kt +19 -12
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroProduct.kt +102 -95
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchase.kt +132 -125
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseRequest.kt +16 -9
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroPurchaseResult.kt +25 -18
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationAndroidOptions.kt +22 -15
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationParams.kt +16 -9
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultAndroid.kt +66 -59
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroReceiptValidationResultIOS.kt +22 -15
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRenewalInfoIOS.kt +43 -36
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseAndroid.kt +31 -24
  75. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroRequestPurchaseIos.kt +25 -18
  76. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionRenewalInfo.kt +28 -21
  77. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/NitroSubscriptionStatus.kt +19 -12
  78. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PaymentModeIOS.kt +23 -0
  79. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Purchase.kt +18 -1
  80. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseAndroid.kt +69 -62
  81. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseIOS.kt +111 -104
  82. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/PurchaseOfferIOS.kt +19 -12
  83. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RenewalInfoIOS.kt +43 -36
  84. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/RequestPurchaseResult.kt +23 -1
  85. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/UserChoiceBillingDetails.kt +16 -9
  86. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_Boolean_NitroPurchaseResult.kt +18 -1
  87. package/nitrogen/generated/android/kotlin/com/margelo/nitro/iap/Variant_NitroReceiptValidationResultIOS_NitroReceiptValidationResultAndroid.kt +18 -1
  88. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.cpp +22 -22
  89. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Bridge.hpp +26 -22
  90. package/nitrogen/generated/ios/NitroIap-Swift-Cxx-Umbrella.hpp +3 -0
  91. package/nitrogen/generated/ios/c++/HybridRnIapSpecSwift.hpp +7 -4
  92. package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroProduct_.swift +1 -8
  93. package/nitrogen/generated/ios/swift/Func_void_std__optional_NitroPurchase_.swift +1 -8
  94. package/nitrogen/generated/ios/swift/HybridRnIapSpec.swift +1 -0
  95. package/nitrogen/generated/ios/swift/HybridRnIapSpec_cxx.swift +3 -16
  96. package/nitrogen/generated/ios/swift/NitroActiveSubscription.swift +17 -10
  97. package/nitrogen/generated/ios/swift/NitroAvailablePurchasesIosOptions.swift +32 -4
  98. package/nitrogen/generated/ios/swift/NitroAvailablePurchasesOptions.swift +2 -16
  99. package/nitrogen/generated/ios/swift/NitroFinishTransactionAndroidParams.swift +8 -1
  100. package/nitrogen/generated/ios/swift/NitroFinishTransactionParams.swift +2 -16
  101. package/nitrogen/generated/ios/swift/NitroProduct.swift +14 -33
  102. package/nitrogen/generated/ios/swift/NitroPurchase.swift +25 -11
  103. package/nitrogen/generated/ios/swift/NitroPurchaseRequest.swift +2 -16
  104. package/nitrogen/generated/ios/swift/NitroReceiptValidationAndroidOptions.swift +8 -1
  105. package/nitrogen/generated/ios/swift/NitroReceiptValidationParams.swift +1 -8
  106. package/nitrogen/generated/ios/swift/NitroReceiptValidationResultIOS.swift +1 -8
  107. package/nitrogen/generated/ios/swift/NitroRenewalInfoIOS.swift +8 -1
  108. package/nitrogen/generated/ios/swift/NitroRequestPurchaseAndroid.swift +8 -1
  109. package/nitrogen/generated/ios/swift/NitroRequestPurchaseIos.swift +8 -1
  110. package/nitrogen/generated/ios/swift/NitroSubscriptionStatus.swift +1 -8
  111. package/nitrogen/generated/ios/swift/PaymentModeIOS.swift +48 -0
  112. package/nitrogen/generated/ios/swift/PurchaseAndroid.swift +16 -2
  113. package/nitrogen/generated/ios/swift/PurchaseIOS.swift +10 -17
  114. package/nitrogen/generated/ios/swift/RenewalInfoIOS.swift +8 -1
  115. package/nitrogen/generated/shared/c++/AndroidSubscriptionOfferInput.hpp +8 -0
  116. package/nitrogen/generated/shared/c++/ExternalPurchaseLinkResultIOS.hpp +8 -0
  117. package/nitrogen/generated/shared/c++/ExternalPurchaseNoticeResultIOS.hpp +8 -0
  118. package/nitrogen/generated/shared/c++/InitConnectionConfig.hpp +8 -0
  119. package/nitrogen/generated/shared/c++/NitroActiveSubscription.hpp +8 -0
  120. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesAndroidOptions.hpp +8 -0
  121. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesIosOptions.hpp +8 -0
  122. package/nitrogen/generated/shared/c++/NitroAvailablePurchasesOptions.hpp +8 -0
  123. package/nitrogen/generated/shared/c++/NitroDeepLinkOptionsAndroid.hpp +8 -0
  124. package/nitrogen/generated/shared/c++/NitroFinishTransactionAndroidParams.hpp +8 -0
  125. package/nitrogen/generated/shared/c++/NitroFinishTransactionIosParams.hpp +8 -0
  126. package/nitrogen/generated/shared/c++/NitroFinishTransactionParams.hpp +8 -0
  127. package/nitrogen/generated/shared/c++/NitroOneTimePurchaseOfferDetail.hpp +8 -0
  128. package/nitrogen/generated/shared/c++/NitroProduct.hpp +16 -5
  129. package/nitrogen/generated/shared/c++/NitroPurchase.hpp +8 -0
  130. package/nitrogen/generated/shared/c++/NitroPurchaseRequest.hpp +8 -0
  131. package/nitrogen/generated/shared/c++/NitroPurchaseResult.hpp +8 -0
  132. package/nitrogen/generated/shared/c++/NitroReceiptValidationAndroidOptions.hpp +8 -0
  133. package/nitrogen/generated/shared/c++/NitroReceiptValidationParams.hpp +8 -0
  134. package/nitrogen/generated/shared/c++/NitroReceiptValidationResultAndroid.hpp +8 -0
  135. package/nitrogen/generated/shared/c++/NitroReceiptValidationResultIOS.hpp +8 -0
  136. package/nitrogen/generated/shared/c++/NitroRenewalInfoIOS.hpp +8 -0
  137. package/nitrogen/generated/shared/c++/NitroRequestPurchaseAndroid.hpp +8 -0
  138. package/nitrogen/generated/shared/c++/NitroRequestPurchaseIos.hpp +8 -0
  139. package/nitrogen/generated/shared/c++/NitroSubscriptionRenewalInfo.hpp +8 -0
  140. package/nitrogen/generated/shared/c++/NitroSubscriptionStatus.hpp +8 -0
  141. package/nitrogen/generated/shared/c++/PaymentModeIOS.hpp +84 -0
  142. package/nitrogen/generated/shared/c++/PurchaseAndroid.hpp +8 -0
  143. package/nitrogen/generated/shared/c++/PurchaseIOS.hpp +8 -0
  144. package/nitrogen/generated/shared/c++/PurchaseOfferIOS.hpp +8 -0
  145. package/nitrogen/generated/shared/c++/RenewalInfoIOS.hpp +8 -0
  146. package/nitrogen/generated/shared/c++/UserChoiceBillingDetails.hpp +8 -0
  147. package/openiap-versions.json +2 -2
  148. package/package.json +4 -4
  149. package/src/index.ts +18 -0
  150. package/src/specs/RnIap.nitro.ts +52 -7
  151. package/src/types.ts +1 -1
  152. package/src/utils/type-bridge.ts +2 -1
@@ -150,7 +150,14 @@ public extension RenewalInfoIOS {
150
150
  var isInBillingRetry: Bool? {
151
151
  @inline(__always)
152
152
  get {
153
- return self.__isInBillingRetry.value
153
+ return { () -> Bool? in
154
+ if bridge.has_value_std__optional_bool_(self.__isInBillingRetry) {
155
+ let __unwrapped = bridge.get_std__optional_bool_(self.__isInBillingRetry)
156
+ return __unwrapped
157
+ } else {
158
+ return nil
159
+ }
160
+ }()
154
161
  }
155
162
  @inline(__always)
156
163
  set {
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -62,6 +67,9 @@ namespace margelo::nitro {
62
67
  return false;
63
68
  }
64
69
  jsi::Object obj = value.getObject(runtime);
70
+ if (!nitro::isPlainObject(runtime, obj)) {
71
+ return false;
72
+ }
65
73
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "offerToken"))) return false;
66
74
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sku"))) return false;
67
75
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -63,6 +68,9 @@ namespace margelo::nitro {
63
68
  return false;
64
69
  }
65
70
  jsi::Object obj = value.getObject(runtime);
71
+ if (!nitro::isPlainObject(runtime, obj)) {
72
+ return false;
73
+ }
66
74
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "error"))) return false;
67
75
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "success"))) return false;
68
76
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `ExternalPurchaseNoticeAction` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { enum class ExternalPurchaseNoticeAction; }
@@ -65,6 +70,9 @@ namespace margelo::nitro {
65
70
  return false;
66
71
  }
67
72
  jsi::Object obj = value.getObject(runtime);
73
+ if (!nitro::isPlainObject(runtime, obj)) {
74
+ return false;
75
+ }
68
76
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "error"))) return false;
69
77
  if (!JSIConverter<margelo::nitro::iap::ExternalPurchaseNoticeAction>::canConvert(runtime, obj.getProperty(runtime, "result"))) return false;
70
78
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `AlternativeBillingModeAndroid` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { enum class AlternativeBillingModeAndroid; }
@@ -61,6 +66,9 @@ namespace margelo::nitro {
61
66
  return false;
62
67
  }
63
68
  jsi::Object obj = value.getObject(runtime);
69
+ if (!nitro::isPlainObject(runtime, obj)) {
70
+ return false;
71
+ }
64
72
  if (!JSIConverter<std::optional<margelo::nitro::iap::AlternativeBillingModeAndroid>>::canConvert(runtime, obj.getProperty(runtime, "alternativeBillingModeAndroid"))) return false;
65
73
  return true;
66
74
  }
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `NitroRenewalInfoIOS` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { struct NitroRenewalInfoIOS; }
@@ -101,6 +106,9 @@ namespace margelo::nitro {
101
106
  return false;
102
107
  }
103
108
  jsi::Object obj = value.getObject(runtime);
109
+ if (!nitro::isPlainObject(runtime, obj)) {
110
+ return false;
111
+ }
104
112
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "productId"))) return false;
105
113
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isActive"))) return false;
106
114
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "transactionId"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `NitroAvailablePurchasesAndroidType` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { enum class NitroAvailablePurchasesAndroidType; }
@@ -61,6 +66,9 @@ namespace margelo::nitro {
61
66
  return false;
62
67
  }
63
68
  jsi::Object obj = value.getObject(runtime);
69
+ if (!nitro::isPlainObject(runtime, obj)) {
70
+ return false;
71
+ }
64
72
  if (!JSIConverter<std::optional<margelo::nitro::iap::NitroAvailablePurchasesAndroidType>>::canConvert(runtime, obj.getProperty(runtime, "type"))) return false;
65
73
  return true;
66
74
  }
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -68,6 +73,9 @@ namespace margelo::nitro {
68
73
  return false;
69
74
  }
70
75
  jsi::Object obj = value.getObject(runtime);
76
+ if (!nitro::isPlainObject(runtime, obj)) {
77
+ return false;
78
+ }
71
79
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "alsoPublishToEventListener"))) return false;
72
80
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "onlyIncludeActiveItems"))) return false;
73
81
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "alsoPublishToEventListenerIOS"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `NitroAvailablePurchasesIosOptions` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { struct NitroAvailablePurchasesIosOptions; }
@@ -67,6 +72,9 @@ namespace margelo::nitro {
67
72
  return false;
68
73
  }
69
74
  jsi::Object obj = value.getObject(runtime);
75
+ if (!nitro::isPlainObject(runtime, obj)) {
76
+ return false;
77
+ }
70
78
  if (!JSIConverter<std::optional<margelo::nitro::iap::NitroAvailablePurchasesIosOptions>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
71
79
  if (!JSIConverter<std::optional<margelo::nitro::iap::NitroAvailablePurchasesAndroidOptions>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
72
80
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -63,6 +68,9 @@ namespace margelo::nitro {
63
68
  return false;
64
69
  }
65
70
  jsi::Object obj = value.getObject(runtime);
71
+ if (!nitro::isPlainObject(runtime, obj)) {
72
+ return false;
73
+ }
66
74
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "skuAndroid"))) return false;
67
75
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "packageNameAndroid"))) return false;
68
76
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -63,6 +68,9 @@ namespace margelo::nitro {
63
68
  return false;
64
69
  }
65
70
  jsi::Object obj = value.getObject(runtime);
71
+ if (!nitro::isPlainObject(runtime, obj)) {
72
+ return false;
73
+ }
66
74
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "purchaseToken"))) return false;
67
75
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isConsumable"))) return false;
68
76
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -59,6 +64,9 @@ namespace margelo::nitro {
59
64
  return false;
60
65
  }
61
66
  jsi::Object obj = value.getObject(runtime);
67
+ if (!nitro::isPlainObject(runtime, obj)) {
68
+ return false;
69
+ }
62
70
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "transactionId"))) return false;
63
71
  return true;
64
72
  }
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `NitroFinishTransactionIosParams` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { struct NitroFinishTransactionIosParams; }
@@ -67,6 +72,9 @@ namespace margelo::nitro {
67
72
  return false;
68
73
  }
69
74
  jsi::Object obj = value.getObject(runtime);
75
+ if (!nitro::isPlainObject(runtime, obj)) {
76
+ return false;
77
+ }
70
78
  if (!JSIConverter<std::optional<margelo::nitro::iap::NitroFinishTransactionIosParams>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
71
79
  if (!JSIConverter<std::optional<margelo::nitro::iap::NitroFinishTransactionAndroidParams>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
72
80
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -65,6 +70,9 @@ namespace margelo::nitro {
65
70
  return false;
66
71
  }
67
72
  jsi::Object obj = value.getObject(runtime);
73
+ if (!nitro::isPlainObject(runtime, obj)) {
74
+ return false;
75
+ }
68
76
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "formattedPrice"))) return false;
69
77
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "priceAmountMicros"))) return false;
70
78
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "priceCurrencyCode"))) return false;
@@ -17,15 +17,23 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `IapPlatform` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { enum class IapPlatform; }
28
+ // Forward declaration of `PaymentModeIOS` to properly resolve imports.
29
+ namespace margelo::nitro::iap { enum class PaymentModeIOS; }
23
30
  // Forward declaration of `NitroOneTimePurchaseOfferDetail` to properly resolve imports.
24
31
  namespace margelo::nitro::iap { struct NitroOneTimePurchaseOfferDetail; }
25
32
 
26
33
  #include <string>
27
34
  #include <optional>
28
35
  #include "IapPlatform.hpp"
36
+ #include "PaymentModeIOS.hpp"
29
37
  #include "NitroOneTimePurchaseOfferDetail.hpp"
30
38
 
31
39
  namespace margelo::nitro::iap {
@@ -51,7 +59,7 @@ namespace margelo::nitro::iap {
51
59
  std::optional<std::string> introductoryPriceIOS SWIFT_PRIVATE;
52
60
  std::optional<double> introductoryPriceAsAmountIOS SWIFT_PRIVATE;
53
61
  std::optional<double> introductoryPriceNumberOfPeriodsIOS SWIFT_PRIVATE;
54
- std::optional<std::string> introductoryPricePaymentModeIOS SWIFT_PRIVATE;
62
+ PaymentModeIOS introductoryPricePaymentModeIOS SWIFT_PRIVATE;
55
63
  std::optional<std::string> introductoryPriceSubscriptionPeriodIOS SWIFT_PRIVATE;
56
64
  std::optional<double> subscriptionPeriodNumberIOS SWIFT_PRIVATE;
57
65
  std::optional<std::string> subscriptionPeriodUnitIOS SWIFT_PRIVATE;
@@ -68,7 +76,7 @@ namespace margelo::nitro::iap {
68
76
 
69
77
  public:
70
78
  NitroProduct() = default;
71
- explicit NitroProduct(std::string id, std::string title, std::string description, std::string type, std::optional<std::string> displayName, std::optional<std::string> displayPrice, std::optional<std::string> currency, std::optional<double> price, IapPlatform platform, std::optional<std::string> typeIOS, std::optional<bool> isFamilyShareableIOS, std::optional<std::string> jsonRepresentationIOS, std::optional<std::string> discountsIOS, std::optional<std::string> introductoryPriceIOS, std::optional<double> introductoryPriceAsAmountIOS, std::optional<double> introductoryPriceNumberOfPeriodsIOS, std::optional<std::string> introductoryPricePaymentModeIOS, std::optional<std::string> introductoryPriceSubscriptionPeriodIOS, std::optional<double> subscriptionPeriodNumberIOS, std::optional<std::string> subscriptionPeriodUnitIOS, std::optional<std::string> nameAndroid, std::optional<std::string> originalPriceAndroid, std::optional<double> originalPriceAmountMicrosAndroid, std::optional<double> introductoryPriceCyclesAndroid, std::optional<std::string> introductoryPricePeriodAndroid, std::optional<double> introductoryPriceValueAndroid, std::optional<std::string> subscriptionPeriodAndroid, std::optional<std::string> freeTrialPeriodAndroid, std::optional<std::string> subscriptionOfferDetailsAndroid, std::optional<NitroOneTimePurchaseOfferDetail> oneTimePurchaseOfferDetailsAndroid): id(id), title(title), description(description), type(type), displayName(displayName), displayPrice(displayPrice), currency(currency), price(price), platform(platform), typeIOS(typeIOS), isFamilyShareableIOS(isFamilyShareableIOS), jsonRepresentationIOS(jsonRepresentationIOS), discountsIOS(discountsIOS), introductoryPriceIOS(introductoryPriceIOS), introductoryPriceAsAmountIOS(introductoryPriceAsAmountIOS), introductoryPriceNumberOfPeriodsIOS(introductoryPriceNumberOfPeriodsIOS), introductoryPricePaymentModeIOS(introductoryPricePaymentModeIOS), introductoryPriceSubscriptionPeriodIOS(introductoryPriceSubscriptionPeriodIOS), subscriptionPeriodNumberIOS(subscriptionPeriodNumberIOS), subscriptionPeriodUnitIOS(subscriptionPeriodUnitIOS), nameAndroid(nameAndroid), originalPriceAndroid(originalPriceAndroid), originalPriceAmountMicrosAndroid(originalPriceAmountMicrosAndroid), introductoryPriceCyclesAndroid(introductoryPriceCyclesAndroid), introductoryPricePeriodAndroid(introductoryPricePeriodAndroid), introductoryPriceValueAndroid(introductoryPriceValueAndroid), subscriptionPeriodAndroid(subscriptionPeriodAndroid), freeTrialPeriodAndroid(freeTrialPeriodAndroid), subscriptionOfferDetailsAndroid(subscriptionOfferDetailsAndroid), oneTimePurchaseOfferDetailsAndroid(oneTimePurchaseOfferDetailsAndroid) {}
79
+ explicit NitroProduct(std::string id, std::string title, std::string description, std::string type, std::optional<std::string> displayName, std::optional<std::string> displayPrice, std::optional<std::string> currency, std::optional<double> price, IapPlatform platform, std::optional<std::string> typeIOS, std::optional<bool> isFamilyShareableIOS, std::optional<std::string> jsonRepresentationIOS, std::optional<std::string> discountsIOS, std::optional<std::string> introductoryPriceIOS, std::optional<double> introductoryPriceAsAmountIOS, std::optional<double> introductoryPriceNumberOfPeriodsIOS, PaymentModeIOS introductoryPricePaymentModeIOS, std::optional<std::string> introductoryPriceSubscriptionPeriodIOS, std::optional<double> subscriptionPeriodNumberIOS, std::optional<std::string> subscriptionPeriodUnitIOS, std::optional<std::string> nameAndroid, std::optional<std::string> originalPriceAndroid, std::optional<double> originalPriceAmountMicrosAndroid, std::optional<double> introductoryPriceCyclesAndroid, std::optional<std::string> introductoryPricePeriodAndroid, std::optional<double> introductoryPriceValueAndroid, std::optional<std::string> subscriptionPeriodAndroid, std::optional<std::string> freeTrialPeriodAndroid, std::optional<std::string> subscriptionOfferDetailsAndroid, std::optional<NitroOneTimePurchaseOfferDetail> oneTimePurchaseOfferDetailsAndroid): id(id), title(title), description(description), type(type), displayName(displayName), displayPrice(displayPrice), currency(currency), price(price), platform(platform), typeIOS(typeIOS), isFamilyShareableIOS(isFamilyShareableIOS), jsonRepresentationIOS(jsonRepresentationIOS), discountsIOS(discountsIOS), introductoryPriceIOS(introductoryPriceIOS), introductoryPriceAsAmountIOS(introductoryPriceAsAmountIOS), introductoryPriceNumberOfPeriodsIOS(introductoryPriceNumberOfPeriodsIOS), introductoryPricePaymentModeIOS(introductoryPricePaymentModeIOS), introductoryPriceSubscriptionPeriodIOS(introductoryPriceSubscriptionPeriodIOS), subscriptionPeriodNumberIOS(subscriptionPeriodNumberIOS), subscriptionPeriodUnitIOS(subscriptionPeriodUnitIOS), nameAndroid(nameAndroid), originalPriceAndroid(originalPriceAndroid), originalPriceAmountMicrosAndroid(originalPriceAmountMicrosAndroid), introductoryPriceCyclesAndroid(introductoryPriceCyclesAndroid), introductoryPricePeriodAndroid(introductoryPricePeriodAndroid), introductoryPriceValueAndroid(introductoryPriceValueAndroid), subscriptionPeriodAndroid(subscriptionPeriodAndroid), freeTrialPeriodAndroid(freeTrialPeriodAndroid), subscriptionOfferDetailsAndroid(subscriptionOfferDetailsAndroid), oneTimePurchaseOfferDetailsAndroid(oneTimePurchaseOfferDetailsAndroid) {}
72
80
  };
73
81
 
74
82
  } // namespace margelo::nitro::iap
@@ -97,7 +105,7 @@ namespace margelo::nitro {
97
105
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "introductoryPriceIOS")),
98
106
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "introductoryPriceAsAmountIOS")),
99
107
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "introductoryPriceNumberOfPeriodsIOS")),
100
- JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "introductoryPricePaymentModeIOS")),
108
+ JSIConverter<margelo::nitro::iap::PaymentModeIOS>::fromJSI(runtime, obj.getProperty(runtime, "introductoryPricePaymentModeIOS")),
101
109
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "introductoryPriceSubscriptionPeriodIOS")),
102
110
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "subscriptionPeriodNumberIOS")),
103
111
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "subscriptionPeriodUnitIOS")),
@@ -131,7 +139,7 @@ namespace margelo::nitro {
131
139
  obj.setProperty(runtime, "introductoryPriceIOS", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.introductoryPriceIOS));
132
140
  obj.setProperty(runtime, "introductoryPriceAsAmountIOS", JSIConverter<std::optional<double>>::toJSI(runtime, arg.introductoryPriceAsAmountIOS));
133
141
  obj.setProperty(runtime, "introductoryPriceNumberOfPeriodsIOS", JSIConverter<std::optional<double>>::toJSI(runtime, arg.introductoryPriceNumberOfPeriodsIOS));
134
- obj.setProperty(runtime, "introductoryPricePaymentModeIOS", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.introductoryPricePaymentModeIOS));
142
+ obj.setProperty(runtime, "introductoryPricePaymentModeIOS", JSIConverter<margelo::nitro::iap::PaymentModeIOS>::toJSI(runtime, arg.introductoryPricePaymentModeIOS));
135
143
  obj.setProperty(runtime, "introductoryPriceSubscriptionPeriodIOS", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.introductoryPriceSubscriptionPeriodIOS));
136
144
  obj.setProperty(runtime, "subscriptionPeriodNumberIOS", JSIConverter<std::optional<double>>::toJSI(runtime, arg.subscriptionPeriodNumberIOS));
137
145
  obj.setProperty(runtime, "subscriptionPeriodUnitIOS", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.subscriptionPeriodUnitIOS));
@@ -152,6 +160,9 @@ namespace margelo::nitro {
152
160
  return false;
153
161
  }
154
162
  jsi::Object obj = value.getObject(runtime);
163
+ if (!nitro::isPlainObject(runtime, obj)) {
164
+ return false;
165
+ }
155
166
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
156
167
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "title"))) return false;
157
168
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "description"))) return false;
@@ -168,7 +179,7 @@ namespace margelo::nitro {
168
179
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "introductoryPriceIOS"))) return false;
169
180
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "introductoryPriceAsAmountIOS"))) return false;
170
181
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "introductoryPriceNumberOfPeriodsIOS"))) return false;
171
- if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "introductoryPricePaymentModeIOS"))) return false;
182
+ if (!JSIConverter<margelo::nitro::iap::PaymentModeIOS>::canConvert(runtime, obj.getProperty(runtime, "introductoryPricePaymentModeIOS"))) return false;
172
183
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "introductoryPriceSubscriptionPeriodIOS"))) return false;
173
184
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "subscriptionPeriodNumberIOS"))) return false;
174
185
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "subscriptionPeriodUnitIOS"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `IapPlatform` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { enum class IapPlatform; }
@@ -185,6 +190,9 @@ namespace margelo::nitro {
185
190
  return false;
186
191
  }
187
192
  jsi::Object obj = value.getObject(runtime);
193
+ if (!nitro::isPlainObject(runtime, obj)) {
194
+ return false;
195
+ }
188
196
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
189
197
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "productId"))) return false;
190
198
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "transactionDate"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `NitroRequestPurchaseIos` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { struct NitroRequestPurchaseIos; }
@@ -67,6 +72,9 @@ namespace margelo::nitro {
67
72
  return false;
68
73
  }
69
74
  jsi::Object obj = value.getObject(runtime);
75
+ if (!nitro::isPlainObject(runtime, obj)) {
76
+ return false;
77
+ }
70
78
  if (!JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseIos>>::canConvert(runtime, obj.getProperty(runtime, "ios"))) return false;
71
79
  if (!JSIConverter<std::optional<margelo::nitro::iap::NitroRequestPurchaseAndroid>>::canConvert(runtime, obj.getProperty(runtime, "android"))) return false;
72
80
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -72,6 +77,9 @@ namespace margelo::nitro {
72
77
  return false;
73
78
  }
74
79
  jsi::Object obj = value.getObject(runtime);
80
+ if (!nitro::isPlainObject(runtime, obj)) {
81
+ return false;
82
+ }
75
83
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "responseCode"))) return false;
76
84
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "debugMessage"))) return false;
77
85
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "code"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -69,6 +74,9 @@ namespace margelo::nitro {
69
74
  return false;
70
75
  }
71
76
  jsi::Object obj = value.getObject(runtime);
77
+ if (!nitro::isPlainObject(runtime, obj)) {
78
+ return false;
79
+ }
72
80
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "accessToken"))) return false;
73
81
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "isSub"))) return false;
74
82
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "packageName"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `NitroReceiptValidationAndroidOptions` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { struct NitroReceiptValidationAndroidOptions; }
@@ -65,6 +70,9 @@ namespace margelo::nitro {
65
70
  return false;
66
71
  }
67
72
  jsi::Object obj = value.getObject(runtime);
73
+ if (!nitro::isPlainObject(runtime, obj)) {
74
+ return false;
75
+ }
68
76
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sku"))) return false;
69
77
  if (!JSIConverter<std::optional<margelo::nitro::iap::NitroReceiptValidationAndroidOptions>>::canConvert(runtime, obj.getProperty(runtime, "androidOptions"))) return false;
70
78
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -111,6 +116,9 @@ namespace margelo::nitro {
111
116
  return false;
112
117
  }
113
118
  jsi::Object obj = value.getObject(runtime);
119
+ if (!nitro::isPlainObject(runtime, obj)) {
120
+ return false;
121
+ }
114
122
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "autoRenewing"))) return false;
115
123
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "betaProduct"))) return false;
116
124
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "cancelDate"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `NitroPurchase` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { struct NitroPurchase; }
@@ -71,6 +76,9 @@ namespace margelo::nitro {
71
76
  return false;
72
77
  }
73
78
  jsi::Object obj = value.getObject(runtime);
79
+ if (!nitro::isPlainObject(runtime, obj)) {
80
+ return false;
81
+ }
74
82
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isValid"))) return false;
75
83
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "receiptData"))) return false;
76
84
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "jwsRepresentation"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -90,6 +95,9 @@ namespace margelo::nitro {
90
95
  return false;
91
96
  }
92
97
  jsi::Object obj = value.getObject(runtime);
98
+ if (!nitro::isPlainObject(runtime, obj)) {
99
+ return false;
100
+ }
93
101
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "willAutoRenew"))) return false;
94
102
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "autoRenewPreference"))) return false;
95
103
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "pendingUpgradeProductId"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `AndroidSubscriptionOfferInput` to properly resolve imports.
22
27
  namespace margelo::nitro::iap { struct AndroidSubscriptionOfferInput; }
@@ -81,6 +86,9 @@ namespace margelo::nitro {
81
86
  return false;
82
87
  }
83
88
  jsi::Object obj = value.getObject(runtime);
89
+ if (!nitro::isPlainObject(runtime, obj)) {
90
+ return false;
91
+ }
84
92
  if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "skus"))) return false;
85
93
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "obfuscatedAccountIdAndroid"))) return false;
86
94
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "obfuscatedProfileIdAndroid"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -73,6 +78,9 @@ namespace margelo::nitro {
73
78
  return false;
74
79
  }
75
80
  jsi::Object obj = value.getObject(runtime);
81
+ if (!nitro::isPlainObject(runtime, obj)) {
82
+ return false;
83
+ }
76
84
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "sku"))) return false;
77
85
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "andDangerouslyFinishTransactionAutomatically"))) return false;
78
86
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "appAccountToken"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -75,6 +80,9 @@ namespace margelo::nitro {
75
80
  return false;
76
81
  }
77
82
  jsi::Object obj = value.getObject(runtime);
83
+ if (!nitro::isPlainObject(runtime, obj)) {
84
+ return false;
85
+ }
78
86
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "autoRenewStatus"))) return false;
79
87
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "autoRenewPreference"))) return false;
80
88
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "expirationReason"))) return false;