@qonversion/react-native-sdk 10.0.0-RC1

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 (290) hide show
  1. package/README.md +129 -0
  2. package/android/build.gradle +92 -0
  3. package/android/gradle.properties +6 -0
  4. package/android/src/main/AndroidManifest.xml +2 -0
  5. package/android/src/main/java/com/qonversion/reactnativesdk/EntitiesConverter.kt +135 -0
  6. package/android/src/main/java/com/qonversion/reactnativesdk/NoCodesModule.kt +76 -0
  7. package/android/src/main/java/com/qonversion/reactnativesdk/QonversionModule.kt +278 -0
  8. package/android/src/main/java/com/qonversion/reactnativesdk/QonversionPackage.kt +43 -0
  9. package/android/src/main/java/com/qonversion/reactnativesdk/Utils.kt +32 -0
  10. package/ios/RNNoCodes.h +5 -0
  11. package/ios/RNNoCodes.mm +61 -0
  12. package/ios/RNNoCodesImpl.swift +69 -0
  13. package/ios/RNQonversion.h +5 -0
  14. package/ios/RNQonversion.mm +189 -0
  15. package/ios/RNQonversionImpl.swift +250 -0
  16. package/ios/qonversion-react-native-sdk-Bridging-Header.h +6 -0
  17. package/lib/module/NoCodes.js +32 -0
  18. package/lib/module/NoCodes.js.map +1 -0
  19. package/lib/module/NoCodesApi.js +2 -0
  20. package/lib/module/NoCodesApi.js.map +1 -0
  21. package/lib/module/NoCodesConfig.js +10 -0
  22. package/lib/module/NoCodesConfig.js.map +1 -0
  23. package/lib/module/NoCodesConfigBuilder.js +35 -0
  24. package/lib/module/NoCodesConfigBuilder.js.map +1 -0
  25. package/lib/module/Qonversion.js +35 -0
  26. package/lib/module/Qonversion.js.map +1 -0
  27. package/lib/module/QonversionApi.js +4 -0
  28. package/lib/module/QonversionApi.js.map +1 -0
  29. package/lib/module/QonversionConfig.js +16 -0
  30. package/lib/module/QonversionConfig.js.map +1 -0
  31. package/lib/module/QonversionConfigBuilder.js +90 -0
  32. package/lib/module/QonversionConfigBuilder.js.map +1 -0
  33. package/lib/module/dto/Entitlement.js +24 -0
  34. package/lib/module/dto/Entitlement.js.map +1 -0
  35. package/lib/module/dto/EntitlementsUpdateListener.js +4 -0
  36. package/lib/module/dto/EntitlementsUpdateListener.js.map +1 -0
  37. package/lib/module/dto/Experiment.js +11 -0
  38. package/lib/module/dto/Experiment.js.map +1 -0
  39. package/lib/module/dto/ExperimentGroup.js +11 -0
  40. package/lib/module/dto/ExperimentGroup.js.map +1 -0
  41. package/lib/module/dto/IntroEligibility.js +9 -0
  42. package/lib/module/dto/IntroEligibility.js.map +1 -0
  43. package/lib/module/dto/NoCodesAction.js +11 -0
  44. package/lib/module/dto/NoCodesAction.js.map +1 -0
  45. package/lib/module/dto/NoCodesError.js +13 -0
  46. package/lib/module/dto/NoCodesError.js.map +1 -0
  47. package/lib/module/dto/NoCodesListener.js +4 -0
  48. package/lib/module/dto/NoCodesListener.js.map +1 -0
  49. package/lib/module/dto/Offering.js +14 -0
  50. package/lib/module/dto/Offering.js.map +1 -0
  51. package/lib/module/dto/Offerings.js +13 -0
  52. package/lib/module/dto/Offerings.js.map +1 -0
  53. package/lib/module/dto/Product.js +114 -0
  54. package/lib/module/dto/Product.js.map +1 -0
  55. package/lib/module/dto/PromoPurchasesListener.js +4 -0
  56. package/lib/module/dto/PromoPurchasesListener.js.map +1 -0
  57. package/lib/module/dto/PromotionalOffer.js +10 -0
  58. package/lib/module/dto/PromotionalOffer.js.map +1 -0
  59. package/lib/module/dto/PurchaseModel.js +26 -0
  60. package/lib/module/dto/PurchaseModel.js.map +1 -0
  61. package/lib/module/dto/PurchaseOptions.js +15 -0
  62. package/lib/module/dto/PurchaseOptions.js.map +1 -0
  63. package/lib/module/dto/PurchaseOptionsBuilder.js +117 -0
  64. package/lib/module/dto/PurchaseOptionsBuilder.js.map +1 -0
  65. package/lib/module/dto/PurchaseUpdateModel.js +32 -0
  66. package/lib/module/dto/PurchaseUpdateModel.js.map +1 -0
  67. package/lib/module/dto/QonversionError.js +15 -0
  68. package/lib/module/dto/QonversionError.js.map +1 -0
  69. package/lib/module/dto/RemoteConfig.js +11 -0
  70. package/lib/module/dto/RemoteConfig.js.map +1 -0
  71. package/lib/module/dto/RemoteConfigList.js +18 -0
  72. package/lib/module/dto/RemoteConfigList.js.map +1 -0
  73. package/lib/module/dto/RemoteConfigurationSource.js +13 -0
  74. package/lib/module/dto/RemoteConfigurationSource.js.map +1 -0
  75. package/lib/module/dto/ScreenPresentationConfig.js +22 -0
  76. package/lib/module/dto/ScreenPresentationConfig.js.map +1 -0
  77. package/lib/module/dto/SubscriptionPeriod.js +26 -0
  78. package/lib/module/dto/SubscriptionPeriod.js.map +1 -0
  79. package/lib/module/dto/Transaction.js +18 -0
  80. package/lib/module/dto/Transaction.js.map +1 -0
  81. package/lib/module/dto/User.js +10 -0
  82. package/lib/module/dto/User.js.map +1 -0
  83. package/lib/module/dto/UserProperties.js +71 -0
  84. package/lib/module/dto/UserProperties.js.map +1 -0
  85. package/lib/module/dto/UserProperty.js +17 -0
  86. package/lib/module/dto/UserProperty.js.map +1 -0
  87. package/lib/module/dto/enums.js +425 -0
  88. package/lib/module/dto/enums.js.map +1 -0
  89. package/lib/module/dto/storeProducts/ProductInAppDetails.js +16 -0
  90. package/lib/module/dto/storeProducts/ProductInAppDetails.js.map +1 -0
  91. package/lib/module/dto/storeProducts/ProductInstallmentPlanDetails.js +25 -0
  92. package/lib/module/dto/storeProducts/ProductInstallmentPlanDetails.js.map +1 -0
  93. package/lib/module/dto/storeProducts/ProductOfferDetails.js +76 -0
  94. package/lib/module/dto/storeProducts/ProductOfferDetails.js.map +1 -0
  95. package/lib/module/dto/storeProducts/ProductPrice.js +37 -0
  96. package/lib/module/dto/storeProducts/ProductPrice.js.map +1 -0
  97. package/lib/module/dto/storeProducts/ProductPricingPhase.js +52 -0
  98. package/lib/module/dto/storeProducts/ProductPricingPhase.js.map +1 -0
  99. package/lib/module/dto/storeProducts/ProductStoreDetails.js +114 -0
  100. package/lib/module/dto/storeProducts/ProductStoreDetails.js.map +1 -0
  101. package/lib/module/dto/storeProducts/SKPaymentDiscount.js +13 -0
  102. package/lib/module/dto/storeProducts/SKPaymentDiscount.js.map +1 -0
  103. package/lib/module/dto/storeProducts/SKProduct.js +22 -0
  104. package/lib/module/dto/storeProducts/SKProduct.js.map +1 -0
  105. package/lib/module/dto/storeProducts/SKProductDiscount.js +16 -0
  106. package/lib/module/dto/storeProducts/SKProductDiscount.js.map +1 -0
  107. package/lib/module/dto/storeProducts/SKSubscriptionPeriod.js +10 -0
  108. package/lib/module/dto/storeProducts/SKSubscriptionPeriod.js.map +1 -0
  109. package/lib/module/dto/storeProducts/SkuDetails.js +30 -0
  110. package/lib/module/dto/storeProducts/SkuDetails.js.map +1 -0
  111. package/lib/module/index.js +40 -0
  112. package/lib/module/index.js.map +1 -0
  113. package/lib/module/internal/Mapper.js +676 -0
  114. package/lib/module/internal/Mapper.js.map +1 -0
  115. package/lib/module/internal/NoCodesInternal.js +70 -0
  116. package/lib/module/internal/NoCodesInternal.js.map +1 -0
  117. package/lib/module/internal/QonversionInternal.js +237 -0
  118. package/lib/module/internal/QonversionInternal.js.map +1 -0
  119. package/lib/module/internal/specs/NativeNoCodesModule.js +5 -0
  120. package/lib/module/internal/specs/NativeNoCodesModule.js.map +1 -0
  121. package/lib/module/internal/specs/NativeQonversionModule.js +5 -0
  122. package/lib/module/internal/specs/NativeQonversionModule.js.map +1 -0
  123. package/lib/module/internal/utils.js +10 -0
  124. package/lib/module/internal/utils.js.map +1 -0
  125. package/lib/module/package.json +1 -0
  126. package/lib/typescript/package.json +1 -0
  127. package/lib/typescript/src/NoCodes.d.ts +23 -0
  128. package/lib/typescript/src/NoCodes.d.ts.map +1 -0
  129. package/lib/typescript/src/NoCodesApi.d.ts +20 -0
  130. package/lib/typescript/src/NoCodesApi.d.ts.map +1 -0
  131. package/lib/typescript/src/NoCodesConfig.d.ts +8 -0
  132. package/lib/typescript/src/NoCodesConfig.d.ts.map +1 -0
  133. package/lib/typescript/src/NoCodesConfigBuilder.d.ts +26 -0
  134. package/lib/typescript/src/NoCodesConfigBuilder.d.ts.map +1 -0
  135. package/lib/typescript/src/Qonversion.d.ts +26 -0
  136. package/lib/typescript/src/Qonversion.d.ts.map +1 -0
  137. package/lib/typescript/src/QonversionApi.d.ts +285 -0
  138. package/lib/typescript/src/QonversionApi.d.ts.map +1 -0
  139. package/lib/typescript/src/QonversionConfig.d.ts +14 -0
  140. package/lib/typescript/src/QonversionConfig.d.ts.map +1 -0
  141. package/lib/typescript/src/QonversionConfigBuilder.d.ts +65 -0
  142. package/lib/typescript/src/QonversionConfigBuilder.d.ts.map +1 -0
  143. package/lib/typescript/src/dto/Entitlement.d.ts +22 -0
  144. package/lib/typescript/src/dto/Entitlement.d.ts.map +1 -0
  145. package/lib/typescript/src/dto/EntitlementsUpdateListener.d.ts +10 -0
  146. package/lib/typescript/src/dto/EntitlementsUpdateListener.d.ts.map +1 -0
  147. package/lib/typescript/src/dto/Experiment.d.ts +9 -0
  148. package/lib/typescript/src/dto/Experiment.d.ts.map +1 -0
  149. package/lib/typescript/src/dto/ExperimentGroup.d.ts +9 -0
  150. package/lib/typescript/src/dto/ExperimentGroup.d.ts.map +1 -0
  151. package/lib/typescript/src/dto/IntroEligibility.d.ts +7 -0
  152. package/lib/typescript/src/dto/IntroEligibility.d.ts.map +1 -0
  153. package/lib/typescript/src/dto/NoCodesAction.d.ts +10 -0
  154. package/lib/typescript/src/dto/NoCodesAction.d.ts.map +1 -0
  155. package/lib/typescript/src/dto/NoCodesError.d.ts +12 -0
  156. package/lib/typescript/src/dto/NoCodesError.d.ts.map +1 -0
  157. package/lib/typescript/src/dto/NoCodesListener.d.ts +34 -0
  158. package/lib/typescript/src/dto/NoCodesListener.d.ts.map +1 -0
  159. package/lib/typescript/src/dto/Offering.d.ts +11 -0
  160. package/lib/typescript/src/dto/Offering.d.ts.map +1 -0
  161. package/lib/typescript/src/dto/Offerings.d.ts +9 -0
  162. package/lib/typescript/src/dto/Offerings.d.ts.map +1 -0
  163. package/lib/typescript/src/dto/Product.d.ts +95 -0
  164. package/lib/typescript/src/dto/Product.d.ts.map +1 -0
  165. package/lib/typescript/src/dto/PromoPurchasesListener.d.ts +12 -0
  166. package/lib/typescript/src/dto/PromoPurchasesListener.d.ts.map +1 -0
  167. package/lib/typescript/src/dto/PromotionalOffer.d.ts +9 -0
  168. package/lib/typescript/src/dto/PromotionalOffer.d.ts.map +1 -0
  169. package/lib/typescript/src/dto/PurchaseModel.d.ts +19 -0
  170. package/lib/typescript/src/dto/PurchaseModel.d.ts.map +1 -0
  171. package/lib/typescript/src/dto/PurchaseOptions.d.ts +15 -0
  172. package/lib/typescript/src/dto/PurchaseOptions.d.ts.map +1 -0
  173. package/lib/typescript/src/dto/PurchaseOptionsBuilder.d.ts +84 -0
  174. package/lib/typescript/src/dto/PurchaseOptionsBuilder.d.ts.map +1 -0
  175. package/lib/typescript/src/dto/PurchaseUpdateModel.d.ts +25 -0
  176. package/lib/typescript/src/dto/PurchaseUpdateModel.d.ts.map +1 -0
  177. package/lib/typescript/src/dto/QonversionError.d.ts +11 -0
  178. package/lib/typescript/src/dto/QonversionError.d.ts.map +1 -0
  179. package/lib/typescript/src/dto/RemoteConfig.d.ts +10 -0
  180. package/lib/typescript/src/dto/RemoteConfig.d.ts.map +1 -0
  181. package/lib/typescript/src/dto/RemoteConfigList.d.ts +10 -0
  182. package/lib/typescript/src/dto/RemoteConfigList.d.ts.map +1 -0
  183. package/lib/typescript/src/dto/RemoteConfigurationSource.d.ts +11 -0
  184. package/lib/typescript/src/dto/RemoteConfigurationSource.d.ts.map +1 -0
  185. package/lib/typescript/src/dto/ScreenPresentationConfig.d.ts +18 -0
  186. package/lib/typescript/src/dto/ScreenPresentationConfig.d.ts.map +1 -0
  187. package/lib/typescript/src/dto/SubscriptionPeriod.d.ts +21 -0
  188. package/lib/typescript/src/dto/SubscriptionPeriod.d.ts.map +1 -0
  189. package/lib/typescript/src/dto/Transaction.d.ts +16 -0
  190. package/lib/typescript/src/dto/Transaction.d.ts.map +1 -0
  191. package/lib/typescript/src/dto/User.d.ts +7 -0
  192. package/lib/typescript/src/dto/User.d.ts.map +1 -0
  193. package/lib/typescript/src/dto/UserProperties.d.ts +49 -0
  194. package/lib/typescript/src/dto/UserProperties.d.ts.map +1 -0
  195. package/lib/typescript/src/dto/UserProperty.d.ts +13 -0
  196. package/lib/typescript/src/dto/UserProperty.d.ts.map +1 -0
  197. package/lib/typescript/src/dto/enums.d.ts +343 -0
  198. package/lib/typescript/src/dto/enums.d.ts.map +1 -0
  199. package/lib/typescript/src/dto/storeProducts/ProductInAppDetails.d.ts +13 -0
  200. package/lib/typescript/src/dto/storeProducts/ProductInAppDetails.d.ts.map +1 -0
  201. package/lib/typescript/src/dto/storeProducts/ProductInstallmentPlanDetails.d.ts +20 -0
  202. package/lib/typescript/src/dto/storeProducts/ProductInstallmentPlanDetails.d.ts.map +1 -0
  203. package/lib/typescript/src/dto/storeProducts/ProductOfferDetails.d.ts +63 -0
  204. package/lib/typescript/src/dto/storeProducts/ProductOfferDetails.d.ts.map +1 -0
  205. package/lib/typescript/src/dto/storeProducts/ProductPrice.d.ts +29 -0
  206. package/lib/typescript/src/dto/storeProducts/ProductPrice.d.ts.map +1 -0
  207. package/lib/typescript/src/dto/storeProducts/ProductPricingPhase.d.ts +44 -0
  208. package/lib/typescript/src/dto/storeProducts/ProductPricingPhase.d.ts.map +1 -0
  209. package/lib/typescript/src/dto/storeProducts/ProductStoreDetails.d.ts +97 -0
  210. package/lib/typescript/src/dto/storeProducts/ProductStoreDetails.d.ts.map +1 -0
  211. package/lib/typescript/src/dto/storeProducts/SKPaymentDiscount.d.ts +10 -0
  212. package/lib/typescript/src/dto/storeProducts/SKPaymentDiscount.d.ts.map +1 -0
  213. package/lib/typescript/src/dto/storeProducts/SKProduct.d.ts +21 -0
  214. package/lib/typescript/src/dto/storeProducts/SKProduct.d.ts.map +1 -0
  215. package/lib/typescript/src/dto/storeProducts/SKProductDiscount.d.ts +15 -0
  216. package/lib/typescript/src/dto/storeProducts/SKProductDiscount.d.ts.map +1 -0
  217. package/lib/typescript/src/dto/storeProducts/SKSubscriptionPeriod.d.ts +8 -0
  218. package/lib/typescript/src/dto/storeProducts/SKSubscriptionPeriod.d.ts.map +1 -0
  219. package/lib/typescript/src/dto/storeProducts/SkuDetails.d.ts +27 -0
  220. package/lib/typescript/src/dto/storeProducts/SkuDetails.d.ts.map +1 -0
  221. package/lib/typescript/src/index.d.ts +41 -0
  222. package/lib/typescript/src/index.d.ts.map +1 -0
  223. package/lib/typescript/src/internal/Mapper.d.ts +312 -0
  224. package/lib/typescript/src/internal/Mapper.d.ts.map +1 -0
  225. package/lib/typescript/src/internal/NoCodesInternal.d.ts +14 -0
  226. package/lib/typescript/src/internal/NoCodesInternal.d.ts.map +1 -0
  227. package/lib/typescript/src/internal/QonversionInternal.d.ts +60 -0
  228. package/lib/typescript/src/internal/QonversionInternal.d.ts.map +1 -0
  229. package/lib/typescript/src/internal/specs/NativeNoCodesModule.d.ts +17 -0
  230. package/lib/typescript/src/internal/specs/NativeNoCodesModule.d.ts.map +1 -0
  231. package/lib/typescript/src/internal/specs/NativeQonversionModule.d.ts +56 -0
  232. package/lib/typescript/src/internal/specs/NativeQonversionModule.d.ts.map +1 -0
  233. package/lib/typescript/src/internal/utils.d.ts +3 -0
  234. package/lib/typescript/src/internal/utils.d.ts.map +1 -0
  235. package/package.json +151 -0
  236. package/qonversion-react-native-sdk.podspec +21 -0
  237. package/src/NoCodes.ts +37 -0
  238. package/src/NoCodesApi.ts +22 -0
  239. package/src/NoCodesConfig.ts +16 -0
  240. package/src/NoCodesConfigBuilder.ts +40 -0
  241. package/src/Qonversion.ts +40 -0
  242. package/src/QonversionApi.ts +318 -0
  243. package/src/QonversionConfig.ts +32 -0
  244. package/src/QonversionConfigBuilder.ts +102 -0
  245. package/src/dto/Entitlement.ts +57 -0
  246. package/src/dto/EntitlementsUpdateListener.ts +11 -0
  247. package/src/dto/Experiment.ts +15 -0
  248. package/src/dto/ExperimentGroup.ts +15 -0
  249. package/src/dto/IntroEligibility.ts +11 -0
  250. package/src/dto/NoCodesAction.ts +21 -0
  251. package/src/dto/NoCodesError.ts +26 -0
  252. package/src/dto/NoCodesListener.ts +39 -0
  253. package/src/dto/Offering.ts +20 -0
  254. package/src/dto/Offerings.ts +17 -0
  255. package/src/dto/Product.ts +159 -0
  256. package/src/dto/PromoPurchasesListener.ts +13 -0
  257. package/src/dto/PromotionalOffer.ts +17 -0
  258. package/src/dto/PurchaseModel.ts +29 -0
  259. package/src/dto/PurchaseOptions.ts +33 -0
  260. package/src/dto/PurchaseOptionsBuilder.ts +127 -0
  261. package/src/dto/PurchaseUpdateModel.ts +43 -0
  262. package/src/dto/QonversionError.ts +24 -0
  263. package/src/dto/RemoteConfig.ts +16 -0
  264. package/src/dto/RemoteConfigList.ts +23 -0
  265. package/src/dto/RemoteConfigurationSource.ts +26 -0
  266. package/src/dto/ScreenPresentationConfig.ts +24 -0
  267. package/src/dto/SubscriptionPeriod.ts +33 -0
  268. package/src/dto/Transaction.ts +40 -0
  269. package/src/dto/User.ts +11 -0
  270. package/src/dto/UserProperties.ts +78 -0
  271. package/src/dto/UserProperty.ts +21 -0
  272. package/src/dto/enums.ts +389 -0
  273. package/src/dto/storeProducts/ProductInAppDetails.ts +17 -0
  274. package/src/dto/storeProducts/ProductInstallmentPlanDetails.ts +28 -0
  275. package/src/dto/storeProducts/ProductOfferDetails.ts +102 -0
  276. package/src/dto/storeProducts/ProductPrice.ts +46 -0
  277. package/src/dto/storeProducts/ProductPricingPhase.ts +71 -0
  278. package/src/dto/storeProducts/ProductStoreDetails.ts +151 -0
  279. package/src/dto/storeProducts/SKPaymentDiscount.ts +23 -0
  280. package/src/dto/storeProducts/SKProduct.ts +53 -0
  281. package/src/dto/storeProducts/SKProductDiscount.ts +38 -0
  282. package/src/dto/storeProducts/SKSubscriptionPeriod.ts +13 -0
  283. package/src/dto/storeProducts/SkuDetails.ts +68 -0
  284. package/src/index.ts +43 -0
  285. package/src/internal/Mapper.ts +1221 -0
  286. package/src/internal/NoCodesInternal.ts +84 -0
  287. package/src/internal/QonversionInternal.ts +370 -0
  288. package/src/internal/specs/NativeNoCodesModule.ts +20 -0
  289. package/src/internal/specs/NativeQonversionModule.ts +74 -0
  290. package/src/internal/utils.ts +9 -0
@@ -0,0 +1,71 @@
1
+ import SubscriptionPeriod from "../SubscriptionPeriod";
2
+ import ProductPrice from "./ProductPrice";
3
+ import {PricingPhaseRecurrenceMode, PricingPhaseType} from "../enums";
4
+
5
+ /**
6
+ * This class represents a pricing phase, describing how a user pays at a point in time.
7
+ */
8
+ class ProductPricingPhase {
9
+ /**
10
+ * Price for the current phase.
11
+ */
12
+ price: ProductPrice;
13
+
14
+ /**
15
+ * The billing period for which the given price applies.
16
+ */
17
+ billingPeriod: SubscriptionPeriod;
18
+
19
+ /**
20
+ * Number of cycles for which the billing period is applied.
21
+ */
22
+ billingCycleCount: number;
23
+
24
+ /**
25
+ * Recurrence mode for the pricing phase.
26
+ */
27
+ recurrenceMode: PricingPhaseRecurrenceMode;
28
+
29
+ /**
30
+ * Type of the pricing phase.
31
+ */
32
+ type: PricingPhaseType;
33
+
34
+ /**
35
+ * True, if the current phase is a trial period. False otherwise.
36
+ */
37
+ isTrial: boolean;
38
+
39
+ /**
40
+ * True, if the current phase is an intro period. False otherwise.
41
+ * The intro phase is one of single or recurrent discounted payments.
42
+ */
43
+ isIntro: boolean;
44
+
45
+ /**
46
+ * True, if the current phase represents the base plan. False otherwise.
47
+ */
48
+ isBasePlan: boolean;
49
+
50
+ constructor(
51
+ price: ProductPrice,
52
+ billingPeriod: SubscriptionPeriod,
53
+ billingCycleCount: number,
54
+ recurrenceMode: PricingPhaseRecurrenceMode,
55
+ type: PricingPhaseType,
56
+ isTrial: boolean,
57
+ isIntro: boolean,
58
+ isBasePlan: boolean,
59
+ ) {
60
+ this.price = price;
61
+ this.billingPeriod = billingPeriod;
62
+ this.billingCycleCount = billingCycleCount;
63
+ this.recurrenceMode = recurrenceMode;
64
+ this.type = type;
65
+ this.isTrial = isTrial;
66
+ this.isIntro = isIntro;
67
+ this.isBasePlan = isBasePlan;
68
+ }
69
+ }
70
+
71
+ export default ProductPricingPhase;
@@ -0,0 +1,151 @@
1
+ import {ProductType} from "../enums";
2
+ import ProductOfferDetails from "./ProductOfferDetails";
3
+ import ProductInAppDetails from "./ProductInAppDetails";
4
+
5
+ /**
6
+ * This class contains all the information about the concrete Google product,
7
+ * either subscription or in-app. In case of a subscription also determines concrete base plan.
8
+ */
9
+ class ProductStoreDetails {
10
+ /**
11
+ * Identifier of the base plan to which these details relate.
12
+ * Null for in-app products.
13
+ */
14
+ basePlanId: string | null;
15
+
16
+ /**
17
+ * Identifier of the subscription or the in-app product.
18
+ */
19
+ productId: string;
20
+
21
+ /**
22
+ * Name of the subscription or the in-app product.
23
+ */
24
+ name: string;
25
+
26
+ /**
27
+ * Title of the subscription or the in-app product.
28
+ * The title includes the name of the app.
29
+ */
30
+ title: string;
31
+
32
+ /**
33
+ * Description of the subscription or the in-app product.
34
+ */
35
+ description: string;
36
+
37
+ /**
38
+ * Offer details for the subscription.
39
+ * Offer details contain all the available variations of purchase offers,
40
+ * including both base plan and eligible base plan + offer combinations
41
+ * from Google Play Console for current {@link basePlanId}.
42
+ * Null for in-app products.
43
+ */
44
+ subscriptionOfferDetails: ProductOfferDetails[] | null;
45
+
46
+ /**
47
+ * The most profitable subscription offer for the client in our opinion from all the available offers.
48
+ * We calculate the cheapest price for the client by comparing all the trial or intro phases
49
+ * and the base plan.
50
+ */
51
+ defaultSubscriptionOfferDetails: ProductOfferDetails | null;
52
+
53
+ /**
54
+ * Subscription offer details containing only the base plan without any offer.
55
+ */
56
+ basePlanSubscriptionOfferDetails: ProductOfferDetails | null;
57
+
58
+ /**
59
+ * Offer details for the in-app product.
60
+ * Null for subscriptions.
61
+ */
62
+ inAppOfferDetails: ProductInAppDetails | null;
63
+
64
+ /**
65
+ * True, if there is any eligible offer with a trial
66
+ * for this subscription and base plan combination.
67
+ * False otherwise or for an in-app product.
68
+ */
69
+ hasTrialOffer: boolean;
70
+
71
+ /**
72
+ * True, if there is any eligible offer with an intro price
73
+ * for this subscription and base plan combination.
74
+ * False otherwise or for an in-app product.
75
+ */
76
+ hasIntroOffer: boolean;
77
+
78
+ /**
79
+ * True, if there is any eligible offer with a trial or an intro price
80
+ * for this subscription and base plan combination.
81
+ * False otherwise or for an in-app product.
82
+ */
83
+ hasTrialOrIntroOffer: boolean;
84
+
85
+ /**
86
+ * The calculated type of the current product.
87
+ */
88
+ productType: ProductType;
89
+
90
+ /**
91
+ * True, if the product type is InApp.
92
+ */
93
+ isInApp: boolean;
94
+
95
+ /**
96
+ * True, if the product type is Subscription.
97
+ */
98
+ isSubscription: boolean;
99
+
100
+ /**
101
+ * True, if the subscription product is prepaid, which means that users pay in advance -
102
+ * they will need to make a new payment to extend their plan.
103
+ */
104
+ isPrepaid: boolean;
105
+
106
+ /**
107
+ * True, if the subscription product is installment, which means that users commit
108
+ * to pay for a specified amount of periods every month.
109
+ */
110
+ isInstallment: boolean;
111
+
112
+ constructor(
113
+ basePlanId: string | null,
114
+ productId: string,
115
+ name: string,
116
+ title: string,
117
+ description: string,
118
+ subscriptionOfferDetails: ProductOfferDetails[] | null,
119
+ defaultSubscriptionOfferDetails: ProductOfferDetails | null,
120
+ basePlanSubscriptionOfferDetails: ProductOfferDetails | null,
121
+ inAppOfferDetails: ProductInAppDetails | null,
122
+ hasTrialOffer: boolean,
123
+ hasIntroOffer: boolean,
124
+ hasTrialOrIntroOffer: boolean,
125
+ productType: ProductType,
126
+ isInApp: boolean,
127
+ isSubscription: boolean,
128
+ isPrepaid: boolean,
129
+ isInstallment: boolean,
130
+ ) {
131
+ this.basePlanId = basePlanId;
132
+ this.productId = productId;
133
+ this.name = name;
134
+ this.title = title;
135
+ this.description = description;
136
+ this.subscriptionOfferDetails = subscriptionOfferDetails;
137
+ this.defaultSubscriptionOfferDetails = defaultSubscriptionOfferDetails;
138
+ this.basePlanSubscriptionOfferDetails = basePlanSubscriptionOfferDetails;
139
+ this.inAppOfferDetails = inAppOfferDetails;
140
+ this.hasTrialOffer = hasTrialOffer;
141
+ this.hasIntroOffer = hasIntroOffer;
142
+ this.hasTrialOrIntroOffer = hasTrialOrIntroOffer;
143
+ this.productType = productType;
144
+ this.isInApp = isInApp;
145
+ this.isSubscription = isSubscription;
146
+ this.isPrepaid = isPrepaid;
147
+ this.isInstallment = isInstallment;
148
+ }
149
+ }
150
+
151
+ export default ProductStoreDetails;
@@ -0,0 +1,23 @@
1
+ class SKPaymentDiscount {
2
+ identifier: string;
3
+ keyIdentifier: string;
4
+ nonce: string;
5
+ signature: string;
6
+ timestamp: number;
7
+
8
+ constructor (
9
+ identifier: string,
10
+ keyIdentifier: string,
11
+ nonce: string,
12
+ signature: string,
13
+ timestamp: number,
14
+ ) {
15
+ this.identifier = identifier;
16
+ this.keyIdentifier = keyIdentifier;
17
+ this.nonce = nonce;
18
+ this.signature = signature;
19
+ this.timestamp = timestamp;
20
+ }
21
+ }
22
+
23
+ export default SKPaymentDiscount;
@@ -0,0 +1,53 @@
1
+ import SKProductDiscount from "./SKProductDiscount";
2
+ import SKSubscriptionPeriod from "./SKSubscriptionPeriod";
3
+
4
+ class SKProduct {
5
+ localizedDescription?: string;
6
+ localizedTitle?: string;
7
+ price: string;
8
+ localeIdentifier?: string;
9
+ productIdentifier?: string;
10
+ isDownloadable: boolean;
11
+ downloadContentVersion?: string;
12
+ downloadContentLengths?: Array<number>;
13
+ subscriptionPeriod?: SKSubscriptionPeriod;
14
+ productDiscount?: SKProductDiscount;
15
+ discounts?: Array<SKProductDiscount>;
16
+ subscriptionGroupIdentifier?: string;
17
+ isFamilyShareable?: boolean;
18
+ currencyCode: string;
19
+
20
+ constructor(
21
+ localizedDescription: string | undefined,
22
+ localizedTitle: string | undefined,
23
+ price: string,
24
+ localeIdentifier: string | undefined,
25
+ productIdentifier: string | undefined,
26
+ isDownloadable: boolean,
27
+ downloadContentVersion: string | undefined,
28
+ downloadContentLengths: number[] | undefined,
29
+ subscriptionPeriod: SKSubscriptionPeriod | undefined,
30
+ productDiscount: SKProductDiscount | undefined,
31
+ discounts: SKProductDiscount[] | undefined,
32
+ subscriptionGroupIdentifier: string | undefined,
33
+ isFamilyShareable: boolean | undefined,
34
+ currencyCode: string
35
+ ) {
36
+ this.localizedDescription = localizedDescription;
37
+ this.localizedTitle = localizedTitle;
38
+ this.price = price;
39
+ this.localeIdentifier = localeIdentifier;
40
+ this.productIdentifier = productIdentifier;
41
+ this.isDownloadable = isDownloadable;
42
+ this.downloadContentVersion = downloadContentVersion;
43
+ this.downloadContentLengths = downloadContentLengths;
44
+ this.subscriptionPeriod = subscriptionPeriod;
45
+ this.productDiscount = productDiscount;
46
+ this.discounts = discounts;
47
+ this.subscriptionGroupIdentifier = subscriptionGroupIdentifier;
48
+ this.isFamilyShareable = isFamilyShareable;
49
+ this.currencyCode = currencyCode;
50
+ }
51
+ }
52
+
53
+ export default SKProduct;
@@ -0,0 +1,38 @@
1
+ import type {
2
+ SKProductDiscountPaymentModes,
3
+ SKProductDiscountTypes,
4
+ } from "../enums";
5
+ import SKSubscriptionPeriod from "./SKSubscriptionPeriod";
6
+
7
+ class SKProductDiscount {
8
+ price: string;
9
+ localeIdentifier?: string;
10
+ numberOfPeriods: number;
11
+ subscriptionPeriod?: SKSubscriptionPeriod;
12
+ paymentMode: SKProductDiscountPaymentModes;
13
+ identifier?: string;
14
+ type: SKProductDiscountTypes;
15
+ currencySymbol: string;
16
+
17
+ constructor(
18
+ price: string,
19
+ localeIdentifier: string | undefined,
20
+ numberOfPeriods: number,
21
+ subscriptionPeriod: SKSubscriptionPeriod | undefined,
22
+ paymentMode: SKProductDiscountPaymentModes,
23
+ identifier: string | undefined,
24
+ type: SKProductDiscountTypes,
25
+ currencySymbol: string
26
+ ) {
27
+ this.price = price;
28
+ this.localeIdentifier = localeIdentifier;
29
+ this.numberOfPeriods = numberOfPeriods;
30
+ this.subscriptionPeriod = subscriptionPeriod;
31
+ this.paymentMode = paymentMode;
32
+ this.identifier = identifier;
33
+ this.type = type;
34
+ this.currencySymbol = currencySymbol;
35
+ }
36
+ }
37
+
38
+ export default SKProductDiscount;
@@ -0,0 +1,13 @@
1
+ import type { SKPeriodUnits } from "../enums";
2
+
3
+ class SKSubscriptionPeriod {
4
+ numberOfUnits: number;
5
+ unit: SKPeriodUnits;
6
+
7
+ constructor(numberOfUnits: number, unit: SKPeriodUnits) {
8
+ this.numberOfUnits = numberOfUnits;
9
+ this.unit = unit;
10
+ }
11
+ }
12
+
13
+ export default SKSubscriptionPeriod;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @deprecated
3
+ */
4
+ class SkuDetails {
5
+ description: string;
6
+ freeTrialPeriod: string;
7
+ iconUrl: string;
8
+ introductoryPrice: string;
9
+ introductoryPriceAmountMicros: number;
10
+ introductoryPriceCycles: number;
11
+ introductoryPricePeriod: string;
12
+ originalJson: string;
13
+ originalPrice: string;
14
+ originalPriceAmountMicros: number;
15
+ price: string;
16
+ priceAmountMicros: number;
17
+ priceCurrencyCode: string;
18
+ sku: string;
19
+ subscriptionPeriod: string;
20
+ title: string;
21
+ type: string;
22
+ hashCode: number;
23
+ toString: string;
24
+
25
+ constructor(
26
+ description: string,
27
+ freeTrialPeriod: string,
28
+ iconUrl: string,
29
+ introductoryPrice: string,
30
+ introductoryPriceAmountMicros: number,
31
+ introductoryPriceCycles: number,
32
+ introductoryPricePeriod: string,
33
+ originalJson: string,
34
+ originalPrice: string,
35
+ originalPriceAmountMicros: number,
36
+ price: string,
37
+ priceAmountMicros: number,
38
+ priceCurrencyCode: string,
39
+ sku: string,
40
+ subscriptionPeriod: string,
41
+ title: string,
42
+ type: string,
43
+ hashCode: number,
44
+ toString: string
45
+ ) {
46
+ this.description = description;
47
+ this.freeTrialPeriod = freeTrialPeriod;
48
+ this.iconUrl = iconUrl;
49
+ this.introductoryPrice = introductoryPrice;
50
+ this.introductoryPriceAmountMicros = introductoryPriceAmountMicros;
51
+ this.introductoryPriceCycles = introductoryPriceCycles;
52
+ this.introductoryPricePeriod = introductoryPricePeriod;
53
+ this.originalJson = originalJson;
54
+ this.originalPrice = originalPrice;
55
+ this.originalPriceAmountMicros = originalPriceAmountMicros;
56
+ this.price = price;
57
+ this.priceAmountMicros = priceAmountMicros;
58
+ this.priceCurrencyCode = priceCurrencyCode;
59
+ this.sku = sku;
60
+ this.subscriptionPeriod = subscriptionPeriod;
61
+ this.title = title;
62
+ this.type = type;
63
+ this.hashCode = hashCode;
64
+ this.toString = toString;
65
+ }
66
+ }
67
+
68
+ export default SkuDetails;
package/src/index.ts ADDED
@@ -0,0 +1,43 @@
1
+ export { default } from './Qonversion';
2
+ export type { QonversionApi } from './QonversionApi';
3
+ export { default as QonversionConfig } from './QonversionConfig';
4
+ export { default as QonversionConfigBuilder } from './QonversionConfigBuilder';
5
+
6
+ export type { EntitlementsUpdateListener } from './dto/EntitlementsUpdateListener';
7
+ export * from './dto/enums';
8
+ export { default as IntroEligibility } from './dto/IntroEligibility';
9
+ export { default as Offering } from './dto/Offering';
10
+ export { default as Offerings } from './dto/Offerings';
11
+ export { default as Entitlement } from './dto/Entitlement';
12
+ export { default as Product } from './dto/Product';
13
+ export { default as PurchaseModel } from './dto/PurchaseModel';
14
+ export { default as PurchaseUpdateModel } from './dto/PurchaseUpdateModel';
15
+ export type { PromoPurchasesListener } from './dto/PromoPurchasesListener';
16
+ export { default as RemoteConfig } from './dto/RemoteConfig';
17
+ export { default as RemoteConfigList } from './dto/RemoteConfigList';
18
+ export { default as SubscriptionPeriod } from './dto/SubscriptionPeriod';
19
+ export { default as QonversionError } from './dto/QonversionError';
20
+ export { default as User } from './dto/User';
21
+ export { default as UserProperty } from './dto/UserProperty';
22
+ export { default as UserProperties } from './dto/UserProperties';
23
+ export { default as ProductInAppDetails } from './dto/storeProducts/ProductInAppDetails';
24
+ export { default as ProductInstallmentPlanDetails } from './dto/storeProducts/ProductInstallmentPlanDetails';
25
+ export { default as ProductOfferDetails } from './dto/storeProducts/ProductOfferDetails';
26
+ export { default as ProductPrice } from './dto/storeProducts/ProductPrice';
27
+ export { default as ProductPricingPhase } from './dto/storeProducts/ProductPricingPhase';
28
+ export { default as ProductStoreDetails } from './dto/storeProducts/ProductStoreDetails';
29
+ export { default as SKProduct } from './dto/storeProducts/SKProduct';
30
+ export { default as SKProductDiscount } from './dto/storeProducts/SKProductDiscount';
31
+ export { default as SKSubscriptionPeriod } from './dto/storeProducts/SKSubscriptionPeriod';
32
+ export { default as SkuDetails } from './dto/storeProducts/SkuDetails';
33
+ export { default as PurchaseOptionsBuilder } from './dto/PurchaseOptionsBuilder';
34
+ export { default as PurchaseOptions } from './dto/PurchaseOptionsBuilder';
35
+
36
+ // NoCode exports
37
+ export { default as ScreenPresentationConfig } from './dto/ScreenPresentationConfig';
38
+ export { default as NoCodes } from './NoCodes';
39
+ export type { default as NoCodesApi } from './NoCodesApi';
40
+ export { default as NoCodesConfig } from './NoCodesConfig';
41
+ export { default as NoCodesConfigBuilder } from './NoCodesConfigBuilder';
42
+ export type { NoCodesListener } from './dto/NoCodesListener';
43
+ export { default as NoCodesAction } from './dto/NoCodesAction';