@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,78 @@
1
+ import UserProperty from './UserProperty';
2
+ import {UserPropertyKey} from './enums';
3
+
4
+ class UserProperties {
5
+ /**
6
+ * List of all user properties.
7
+ */
8
+ properties: UserProperty[];
9
+
10
+ /**
11
+ * List of user properties, set for the Qonversion defined keys.
12
+ * This is a subset of all {@link properties} list.
13
+ * See {@link QonversionApi.setUserProperty}.
14
+ */
15
+ definedProperties: UserProperty[];
16
+
17
+ /**
18
+ * List of user properties, set for custom keys.
19
+ * This is a subset of all {@link properties} list.
20
+ * See {@link QonversionApi.setCustomUserProperty}.
21
+ */
22
+ customProperties: UserProperty[];
23
+
24
+ /**
25
+ * Map of all user properties.
26
+ * This is a flattened version of the {@link properties} list as a key-value map.
27
+ */
28
+ flatPropertiesMap: Map<string, string>;
29
+
30
+ /**
31
+ * Map of user properties, set for the Qonversion defined keys.
32
+ * This is a flattened version of the {@link definedProperties} list as a key-value map.
33
+ * See {@link QonversionApi.setUserProperty}.
34
+ */
35
+ flatDefinedPropertiesMap: Map<UserPropertyKey, string>;
36
+
37
+ /**
38
+ * Map of user properties, set for custom keys.
39
+ * This is a flattened version of the {@link customProperties} list as a key-value map.
40
+ * See {@link QonversionApi.setCustomUserProperty}.
41
+ */
42
+ flatCustomPropertiesMap: Map<string, string>;
43
+
44
+ constructor(properties: UserProperty[]) {
45
+ this.properties = properties;
46
+ this.definedProperties = properties.filter(property => property.definedKey !== UserPropertyKey.CUSTOM);
47
+ this.customProperties = properties.filter(property => property.definedKey === UserPropertyKey.CUSTOM);
48
+
49
+ this.flatPropertiesMap = new Map<string, string>();
50
+ this.flatDefinedPropertiesMap = new Map<UserPropertyKey, string>();
51
+ this.flatCustomPropertiesMap = new Map<string, string>();
52
+ properties.forEach(property => {
53
+ this.flatPropertiesMap.set(property.key, property.value);
54
+ if (property.definedKey == UserPropertyKey.CUSTOM) {
55
+ this.flatCustomPropertiesMap.set(property.key, property.value);
56
+ } else {
57
+ this.flatDefinedPropertiesMap.set(property.definedKey, property.value);
58
+ }
59
+ });
60
+ }
61
+
62
+ /**
63
+ * Searches for a property with the given property {@link key} in all properties list.
64
+ */
65
+ getProperty(key: string): UserProperty | undefined {
66
+ return this.properties.find(userProperty => userProperty.key == key);
67
+ }
68
+
69
+ /**
70
+ * Searches for a property with the given Qonversion defined property {@link key}
71
+ * in defined properties list.
72
+ */
73
+ getDefinedProperty(key: UserPropertyKey): UserProperty | undefined {
74
+ return this.definedProperties.find(userProperty => userProperty.definedKey == key);
75
+ }
76
+ }
77
+
78
+ export default UserProperties;
@@ -0,0 +1,21 @@
1
+ import {UserPropertyKey} from './enums';
2
+ import mapper from '../internal/Mapper';
3
+
4
+ class UserProperty {
5
+ key: string;
6
+ value: string;
7
+
8
+ /**
9
+ * {@link UserPropertyKey} used to set this property.
10
+ * Returns {@link UserPropertyKey.CUSTOM} for custom properties.
11
+ */
12
+ definedKey: UserPropertyKey;
13
+
14
+ constructor(key: string, value: string) {
15
+ this.key = key;
16
+ this.value = value;
17
+ this.definedKey = mapper.convertDefinedUserPropertyKey(key);
18
+ }
19
+ }
20
+
21
+ export default UserProperty;
@@ -0,0 +1,389 @@
1
+ export enum LaunchMode {
2
+ ANALYTICS = 'Analytics',
3
+ SUBSCRIPTION_MANAGEMENT = 'SubscriptionManagement',
4
+ }
5
+
6
+ export enum Environment {
7
+ SANDBOX = "Sandbox",
8
+ PRODUCTION = "Production",
9
+ }
10
+
11
+ export enum ProductType {
12
+ TRIAL = "Trial",
13
+ INTRO = "Intro", /** Currently works for Android only. iOS support will be added soon. */
14
+ SUBSCRIPTION = "Subscription",
15
+ IN_APP = "InApp",
16
+ UNKNOWN = "Unknown",
17
+ }
18
+
19
+ export enum SubscriptionPeriodUnit {
20
+ DAY = "Day",
21
+ WEEK = "Week",
22
+ MONTH = "Month",
23
+ YEAR = "Year",
24
+ UNKNOWN = "Unknown",
25
+ }
26
+
27
+ /**
28
+ * Recurrence mode of the pricing phase.
29
+ */
30
+ export enum PricingPhaseRecurrenceMode {
31
+ /**
32
+ * The billing plan payment recurs for infinite billing periods unless canceled.
33
+ */
34
+ INFINITE_RECURRING = "InfiniteRecurring",
35
+
36
+ /**
37
+ * The billing plan payment recurs for a fixed number of billing periods
38
+ * set in {@link ProductPricingPhase.billingCycleCount}.
39
+ */
40
+ FINITE_RECURRING = "FiniteRecurring",
41
+
42
+ /**
43
+ * The billing plan payment is a one-time charge that does not repeat.
44
+ */
45
+ NON_RECURRING = "NonRecurring",
46
+
47
+ /**
48
+ * Unknown recurrence mode.
49
+ */
50
+ UNKNOWN = "Unknown",
51
+ }
52
+
53
+ /**
54
+ * Type of the pricing phase.
55
+ */
56
+ export enum PricingPhaseType {
57
+ /**
58
+ * Regular subscription without any discounts like trial or intro offers.
59
+ */
60
+ REGULAR = "Regular",
61
+
62
+ /**
63
+ * A free phase.
64
+ */
65
+ FREE_TRIAL = "FreeTrial",
66
+
67
+ /**
68
+ * A phase with a discounted payment for a single period.
69
+ */
70
+ DISCOUNTED_SINGLE_PAYMENT = "DiscountedSinglePayment",
71
+
72
+ /**
73
+ * A phase with a discounted payment for several periods, described in {@link ProductPricingPhase.billingCycleCount}.
74
+ */
75
+ DISCOUNTED_RECURRING_PAYMENT = "DiscountedRecurringPayment",
76
+
77
+ /**
78
+ * Unknown pricing phase type.
79
+ */
80
+ UNKNOWN = "Unknown",
81
+ }
82
+
83
+ export enum EntitlementRenewState {
84
+ NON_RENEWABLE = 'non_renewable',
85
+ UNKNOWN = 'unknown',
86
+ WILL_RENEW = 'will_renew',
87
+ CANCELED = 'canceled',
88
+ BILLING_ISSUE = 'billing_issue',
89
+ }
90
+
91
+ export enum EntitlementSource {
92
+ UNKNOWN = "Unknown",
93
+ APP_STORE = "AppStore",
94
+ PLAY_STORE = "PlayStore",
95
+ STRIPE = "Stripe",
96
+ MANUAL = "Manual",
97
+ }
98
+
99
+ export enum TransactionEnvironment {
100
+ PRODUCTION = "Production",
101
+ SANDBOX = "Sandbox"
102
+ }
103
+
104
+ export enum TransactionOwnershipType {
105
+ OWNER = "Owner",
106
+ FAMILY_SHARING = "FamilySharing"
107
+ }
108
+
109
+ export enum EntitlementGrantType {
110
+ PURCHASE = "Purchase",
111
+ FAMILY_SHARING = "FamilySharing",
112
+ OFFER_CODE = "OfferCode",
113
+ MANUAL = "Manual",
114
+ }
115
+
116
+ export enum TransactionType {
117
+ UNKNOWN = "Unknown",
118
+ SUBSCRIPTION_STARTED = "SubscriptionStarted",
119
+ SUBSCRIPTION_RENEWED = "SubscriptionRenewed",
120
+ TRIAL_STARTED = "TrialStarted",
121
+ INTRO_STARTED = "IntroStarted",
122
+ INTRO_RENEWED = "IntroRenewed",
123
+ NON_CONSUMABLE_PURCHASE = "NonConsumablePurchase"
124
+ }
125
+
126
+ export enum UserPropertyKey {
127
+ EMAIL = "Email",
128
+ NAME = "Name",
129
+ KOCHAVA_DEVICE_ID = "KochavaDeviceId",
130
+ APPS_FLYER_USER_ID = "AppsFlyerUserId",
131
+ ADJUST_AD_ID = "AdjustAdId",
132
+ CUSTOM_USER_ID = "CustomUserId",
133
+ FACEBOOK_ATTRIBUTION = "FacebookAttribution", // Android only
134
+ FIREBASE_APP_INSTANCE_ID = "FirebaseAppInstanceId",
135
+ APP_SET_ID = "AppSetId", // Android only
136
+ ADVERTISING_ID = "AdvertisingId", // iOS only
137
+ APP_METRICA_DEVICE_ID = "AppMetricaDeviceId",
138
+ APP_METRICA_USER_PROFILE_ID = "AppMetricaUserProfileId",
139
+ PUSH_WOOSH_HW_ID = "PushWooshHwId",
140
+ PUSH_WOOSH_USER_ID = "PushWooshUserId",
141
+ TENJIN_ANALYTICS_INSTALLATION_ID = "TenjinAnalyticsInstallationId",
142
+ CUSTOM = "Custom",
143
+ }
144
+
145
+ export enum AttributionProvider {
146
+ APPSFLYER = "AppsFlyer",
147
+ BRANCH = "Branch",
148
+ ADJUST = "Adjust",
149
+ APPLE_SEARCH_ADS = "AppleSearchAds", // ios only
150
+ APPLE_AD_SERVICES = "AppleAdServices", // ios only
151
+ }
152
+
153
+ /**
154
+ * A policy used for purchase updates on Android, which describes
155
+ * how to migrate from purchased plan to a new one.
156
+ *
157
+ * Used in {@link PurchaseOptions} class for purchase updates.
158
+ */
159
+ export enum PurchaseUpdatePolicy {
160
+ /**
161
+ * The new plan takes effect immediately, and the user is charged full price of new plan
162
+ * and is given a full billing cycle of subscription, plus remaining prorated time
163
+ * from the old plan.
164
+ */
165
+ CHARGE_FULL_PRICE = 'ChargeFullPrice',
166
+
167
+ /**
168
+ * The new plan takes effect immediately, and the billing cycle remains the same.
169
+ */
170
+ CHARGE_PRORATED_PRICE = 'ChargeProratedPrice',
171
+
172
+ /**
173
+ * The new plan takes effect immediately, and the remaining time will be prorated
174
+ * and credited to the user.
175
+ */
176
+ WITH_TIME_PRORATION = 'WithTimeProration',
177
+
178
+ /**
179
+ * The new purchase takes effect immediately, the new plan will take effect
180
+ * when the old item expires.
181
+ */
182
+ DEFERRED = 'Deferred',
183
+
184
+ /**
185
+ * The new plan takes effect immediately, and the new price will be charged
186
+ * on next recurrence time.
187
+ */
188
+ WITHOUT_PRORATION = 'WithoutProration',
189
+
190
+ /**
191
+ * Unknown police.
192
+ */
193
+ UNKNOWN = 'Unknown',
194
+ }
195
+
196
+ export enum EntitlementsCacheLifetime {
197
+ WEEK = "Week",
198
+ TWO_WEEKS = "TwoWeeks",
199
+ MONTH = "Month",
200
+ TWO_MONTHS = "TwoMonths",
201
+ THREE_MONTHS = "ThreeMonths",
202
+ SIX_MONTHS = "SixMonths",
203
+ YEAR = "Year",
204
+ UNLIMITED = "Unlimited",
205
+ }
206
+
207
+ export const SKPeriodUnit = {
208
+ 0: "DAY",
209
+ 1: "WEEK",
210
+ 2: "MONTH",
211
+ 3: "YEAR",
212
+ } as const;
213
+ export type SKPeriodUnits = typeof SKPeriodUnit[keyof typeof SKPeriodUnit];
214
+
215
+ export const SKProductDiscountType = {
216
+ 0: "INTRODUCTORY",
217
+ 1: "SUBSCRIPTION",
218
+ } as const;
219
+
220
+ export type SKProductDiscountTypes = typeof SKProductDiscountType[keyof typeof SKProductDiscountType];
221
+
222
+ export const SKProductDiscountPaymentMode = {
223
+ 0: "PAY_AS_YOU_GO",
224
+ 1: "PAY_UP_FRONT",
225
+ 2: "FREE_TRIAL",
226
+ } as const;
227
+ export type SKProductDiscountPaymentModes = typeof SKProductDiscountPaymentMode[keyof typeof SKProductDiscountPaymentMode];
228
+
229
+ export const OfferingTag = {
230
+ "-1": "UNKNOWN",
231
+ "0": "NONE",
232
+ "1": "MAIN",
233
+ } as const;
234
+ export type OfferingTags = typeof OfferingTag[keyof typeof OfferingTag];
235
+
236
+ export enum IntroEligibilityStatus {
237
+ UNKNOWN = "unknown",
238
+ NON_INTRO_OR_TRIAL_PRODUCT = "non_intro_or_trial_product",
239
+ ELIGIBLE = "intro_or_trial_eligible",
240
+ INELIGIBLE = "intro_or_trial_ineligible",
241
+ }
242
+
243
+ export enum ExperimentGroupType {
244
+ UNKNOWN = "unknown",
245
+ CONTROL = "control",
246
+ TREATMENT = "treatment",
247
+ }
248
+
249
+ export enum RemoteConfigurationSourceType {
250
+ UNKNOWN = "unknown",
251
+ EXPERIMENT_CONTROL_GROUP = "experiment_control_group",
252
+ EXPERIMENT_TREATMENT_GROUP = "experiment_treatment_group",
253
+ REMOTE_CONFIGURATION = "remote_configuration",
254
+ }
255
+
256
+ export enum ActionType {
257
+ /**
258
+ * Unspecified action type
259
+ */
260
+ UNKNOWN = 'unknown',
261
+
262
+ /**
263
+ * URL action that opens the URL using SafariViewController
264
+ */
265
+ URL = 'url',
266
+
267
+ /**
268
+ * Deeplink action that opens if Application can open specified deeplink
269
+ */
270
+ DEEPLINK = 'deeplink',
271
+
272
+ /**
273
+ * Navigation to another No-Codes screen
274
+ */
275
+ NAVIGATION = 'navigation',
276
+
277
+ /**
278
+ * Purchase the product
279
+ */
280
+ PURCHASE = 'purchase',
281
+
282
+ /**
283
+ * Restore all purchases
284
+ */
285
+ RESTORE = 'restore',
286
+
287
+ /**
288
+ * Close current screen
289
+ */
290
+ CLOSE = 'close',
291
+
292
+ /**
293
+ * Close all No-Code screens
294
+ */
295
+ CLOSE_ALL = 'closeAll',
296
+ }
297
+
298
+ export enum RemoteConfigurationAssignmentType {
299
+ UNKNOWN = "unknown",
300
+ AUTO = "auto",
301
+ MANUAL = "manual",
302
+ }
303
+
304
+ export enum ScreenPresentationStyle {
305
+ /**
306
+ * on Android - default screen transaction animation will be used.
307
+ * on iOS - not a modal presentation. This style pushes a controller to a current navigation stack.
308
+ * For iOS NavigationController on the top of the stack is required.
309
+ */
310
+ PUSH = 'Push',
311
+ /**
312
+ * on Android - screen will move from bottom to top.
313
+ * on iOS - UIModalPresentationFullScreen analog.
314
+ */
315
+ FULL_SCREEN = 'FullScreen',
316
+ /**
317
+ * iOS only - UIModalPresentationPopover analog
318
+ */
319
+ POPOVER = 'Popover',
320
+ /**
321
+ * Android only - screen will appear/disappear without any animation.
322
+ * For iOS consider providing the {@link ScreenPresentationConfig.animated} flag.
323
+ */
324
+ NO_ANIMATION = 'NoAnimation',
325
+ }
326
+
327
+ export enum QonversionErrorCode {
328
+ UNKNOWN = "Unknown", // Unknown error
329
+ API_RATE_LIMIT_EXCEEDED = "ApiRateLimitExceeded", // API requests rate limit exceeded
330
+ APPLE_STORE_ERROR = "AppleStoreError", // Apple Store error received
331
+ BACKEND_ERROR = "BackendError", // There was a backend error
332
+ BILLING_UNAVAILABLE = "BillingUnavailable", // The Billing service is unavailable on the device
333
+ CLIENT_INVALID = "ClientInvalid", // Client is not allowed to issue the request, etc
334
+ CLOUD_SERVICE_NETWORK_CONNECTION_FAILED = "CloudServiceNetworkConnectionFailed", // The device could not connect to the network
335
+ CLOUD_SERVICE_PERMISSION_DENIED = "CloudServicePermissionDenied", // User is not allowed to access cloud service information
336
+ CLOUD_SERVICE_REVOKED = "CloudServiceRevoked", // User has revoked permission to use this cloud service
337
+ FAILED_TO_RECEIVE_DATA = "FailedToReceiveData", // Could not receive data
338
+ FEATURE_NOT_SUPPORTED = "FeatureNotSupported", // The requested feature is not supported
339
+ FRAUD_PURCHASE = "FraudPurchase", // Fraud purchase was detected
340
+ INCORRECT_REQUEST = "IncorrectRequest", // Request failed
341
+ INTERNAL_ERROR = "InternalError", // Internal backend error
342
+ INVALID_CLIENT_UID = "InvalidClientUid", // Client Uid is invalid or not set
343
+ INVALID_CREDENTIALS = "InvalidCredentials", // Access token is invalid or not set
344
+ INVALID_STORE_CREDENTIALS = "InvalidStoreCredentials", // This account does not have access to the requested application
345
+ LAUNCH_ERROR = "LaunchError", // There was an error while launching Qonversion SDK
346
+ NETWORK_CONNECTION_FAILED = "NetworkConnectionFailed", // There was a network issue. Make sure that the Internet connection is available on the device
347
+ OFFERINGS_NOT_FOUND = "OfferingsNotFound", // No offerings found
348
+ PAYMENT_INVALID = "PaymentInvalid", // Purchase identifier was invalid, etc.
349
+ PAYMENT_NOT_ALLOWED = "PaymentNotAllowed", // This device is not allowed to make the payment
350
+ PLAY_STORE_ERROR = "PlayStoreError", // There was an issue with the Play Store service
351
+ PRIVACY_ACKNOWLEDGEMENT_REQUIRED = "PrivacyAcknowledgementRequired", // User needs to acknowledge Apple's privacy policy
352
+ PRODUCT_ALREADY_OWNED = "ProductAlreadyOwned", // Failed to purchase since item is already owned
353
+ PRODUCT_NOT_FOUND = "ProductNotFound", // Failed to purchase since the Qonversion product was not found
354
+ PRODUCT_NOT_OWNED = "ProductNotOwned", // Failed to consume purchase since item is not owned
355
+ PROJECT_CONFIG_ERROR = "ProjectConfigError", // The project is not configured or configured incorrectly in the Qonversion Dashboard
356
+ PURCHASE_CANCELED = "PurchaseCanceled", // User pressed back or canceled a dialog for purchase
357
+ PURCHASE_INVALID = "PurchaseInvalid", // Failure of purchase
358
+ PURCHASE_PENDING = "PurchasePending", // Purchase is pending
359
+ PURCHASE_UNSPECIFIED = "PurchaseUnspecified", // Unspecified state of the purchase
360
+ RECEIPT_VALIDATION_ERROR = "ReceiptValidationError", // Receipt validation error
361
+ REMOTE_CONFIGURATION_NOT_AVAILABLE = "RemoteConfigurationNotAvailable", // Remote configuration is not available for the current user or for the provided context key
362
+ RESPONSE_PARSING_FAILED = "ResponseParsingFailed", // A problem occurred while serializing or deserializing data
363
+ STORE_PRODUCT_NOT_AVAILABLE = "StoreProductNotAvailable", // Requested product is not available for purchase or its product id was not found
364
+ UNAUTHORIZED_REQUEST_DATA = "UnauthorizedRequestData", // App is attempting to use SKPayment's requestData property, but does not have the appropriate entitlement
365
+ UNKNOWN_CLIENT_PLATFORM = "UnknownClientPlatform", // The current platform is not supported
366
+ }
367
+
368
+ export enum NoCodesErrorCode {
369
+ UNKNOWN = "Unknown",
370
+ BAD_NETWORK_REQUEST = "BadNetworkRequest",
371
+ BAD_RESPONSE = "BadResponse",
372
+ ACTIVITY_START = "ActivityStart", // Android
373
+ NETWORK_REQUEST_EXECUTION = "NetworkRequestExecution", // Android
374
+ SERIALIZATION = "Serialization", // Android
375
+ DESERIALIZATION = "Deserialization", // Android
376
+ REQUEST_DENIED = "RequestDenied", // Android
377
+ MAPPING = "Mapping", // Android
378
+ BACKEND_ERROR = "BackendError", // Android
379
+ SCREEN_NOT_FOUND = "ScreenNotFound", // Android
380
+ QONVERSION_ERROR = "QonversionError",
381
+ INTERNAL = "Internal", // iOS
382
+ AUTHORIZATION_FAILED = "AuthorizationFailed", // iOS
383
+ CRITICAL = "Critical", // iOS
384
+ PRODUCT_NOT_FOUND = "ProductNotFound", // iOS
385
+ PRODUCTS_LOADING_FAILED = "ProductsLoadingFailed", // iOS
386
+ RATE_LIMIT_EXCEEDED = "RateLimitExceeded", // iOS
387
+ SCREEN_LOADING_FAILED = "ScreenLoadingFailed", // iOS
388
+ SDK_INITIALIZATION_ERROR = "SDKInitializationError" // iOS
389
+ }
@@ -0,0 +1,17 @@
1
+ import ProductPrice from "./ProductPrice";
2
+
3
+ /**
4
+ * This class contains all the information about the Google in-app product details.
5
+ */
6
+ class ProductInAppDetails {
7
+ /**
8
+ * The price of the in-app product.
9
+ */
10
+ price: ProductPrice;
11
+
12
+ constructor(price: ProductPrice) {
13
+ this.price = price;
14
+ }
15
+ }
16
+
17
+ export default ProductInAppDetails;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * This class represents the details about the installment plan for a subscription product.
3
+ */
4
+ class ProductInstallmentPlanDetails {
5
+ /**
6
+ * Committed payments count after a user signs up for this subscription plan.
7
+ */
8
+ commitmentPaymentsCount: number;
9
+
10
+ /**
11
+ * Subsequent committed payments count after this subscription plan renews.
12
+ *
13
+ * Returns 0 if the installment plan doesn't have any subsequent commitment,
14
+ * which means this subscription plan will fall back to a normal
15
+ * non-installment monthly plan when the plan renews.
16
+ */
17
+ subsequentCommitmentPaymentsCount: number;
18
+
19
+ constructor(
20
+ commitmentPaymentsCount: number,
21
+ subsequentCommitmentPaymentsCount: number
22
+ ) {
23
+ this.commitmentPaymentsCount = commitmentPaymentsCount;
24
+ this.subsequentCommitmentPaymentsCount = subsequentCommitmentPaymentsCount;
25
+ }
26
+ }
27
+
28
+ export default ProductInstallmentPlanDetails;
@@ -0,0 +1,102 @@
1
+ import ProductPricingPhase from "./ProductPricingPhase";
2
+ import ProductInstallmentPlanDetails from './ProductInstallmentPlanDetails';
3
+
4
+ /**
5
+ * This class contains all the information about the Google subscription offer details.
6
+ * It might be either a plain base plan details or a base plan with the concrete offer details.
7
+ */
8
+ class ProductOfferDetails {
9
+ /**
10
+ * The identifier of the current base plan.
11
+ */
12
+ basePlanId: string;
13
+
14
+ /**
15
+ * The identifier of the concrete offer, to which these details belong.
16
+ * Null, if these are plain base plan details.
17
+ */
18
+ offerId: string | null;
19
+
20
+ /**
21
+ * A token to purchase the current offer.
22
+ */
23
+ offerToken: string;
24
+
25
+ /**
26
+ * List of tags set for the current offer.
27
+ */
28
+ tags: string[];
29
+
30
+ /**
31
+ * A time-ordered list of pricing phases for the current offer.
32
+ */
33
+ pricingPhases: ProductPricingPhase[];
34
+
35
+ /**
36
+ * A base plan phase details.
37
+ */
38
+ basePlan: ProductPricingPhase | null;
39
+
40
+ /**
41
+ * Additional details of an installment plan, if exists.
42
+ */
43
+ installmentPlanDetails: ProductInstallmentPlanDetails | null;
44
+
45
+ /**
46
+ * A trial phase details, if exists.
47
+ */
48
+ introPhase: ProductPricingPhase | null;
49
+
50
+ /**
51
+ * An intro phase details, if exists.
52
+ * The intro phase is one of single or recurrent discounted payments.
53
+ */
54
+ trialPhase: ProductPricingPhase | null;
55
+
56
+ /**
57
+ * True, if there is a trial phase in the current offer. False otherwise.
58
+ */
59
+ hasTrial: boolean;
60
+
61
+ /**
62
+ * True, if there is any intro phase in the current offer. False otherwise.
63
+ * The intro phase is one of single or recurrent discounted payments.
64
+ */
65
+ hasIntro: boolean;
66
+
67
+ /**
68
+ * True, if there is any trial or intro phase in the current offer. False otherwise.
69
+ * The intro phase is one of single or recurrent discounted payments.
70
+ */
71
+ hasTrialOrIntro: boolean;
72
+
73
+ constructor(
74
+ basePlanId: string,
75
+ offerId: string | null,
76
+ offerToken: string,
77
+ tags: string[],
78
+ pricingPhases: ProductPricingPhase[],
79
+ basePlan: ProductPricingPhase | null,
80
+ installmentPlanDetails: ProductInstallmentPlanDetails | null,
81
+ introPhase: ProductPricingPhase | null,
82
+ trialPhase: ProductPricingPhase | null,
83
+ hasTrial: boolean,
84
+ hasIntro: boolean,
85
+ hasTrialOrIntro: boolean,
86
+ ) {
87
+ this.basePlanId = basePlanId;
88
+ this.offerId = offerId;
89
+ this.offerToken = offerToken;
90
+ this.tags = tags;
91
+ this.pricingPhases = pricingPhases;
92
+ this.basePlan = basePlan;
93
+ this.installmentPlanDetails = installmentPlanDetails;
94
+ this.introPhase = introPhase;
95
+ this.trialPhase = trialPhase;
96
+ this.hasTrial = hasTrial;
97
+ this.hasIntro = hasIntro;
98
+ this.hasTrialOrIntro = hasTrialOrIntro;
99
+ }
100
+ }
101
+
102
+ export default ProductOfferDetails;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Information about the Google product's price.
3
+ */
4
+ class ProductPrice {
5
+ /**
6
+ * Total amount of money in micro-units,
7
+ * where 1,000,000 micro-units equal one unit of the currency.
8
+ */
9
+ priceAmountMicros: number;
10
+
11
+ /**
12
+ * ISO 4217 currency code for price.
13
+ */
14
+ priceCurrencyCode: string;
15
+
16
+ /**
17
+ * Formatted price for the payment, including its currency sign.
18
+ */
19
+ formattedPrice: string;
20
+
21
+ /**
22
+ * True, if the price is zero. False otherwise.
23
+ */
24
+ isFree: boolean;
25
+
26
+ /**
27
+ * Price currency symbol. Null if failed to parse.
28
+ */
29
+ currencySymbol: string | null;
30
+
31
+ constructor(
32
+ priceAmountMicros: number,
33
+ priceCurrencyCode: string,
34
+ formattedPrice: string,
35
+ isFree: boolean,
36
+ currencySymbol: string | null = null
37
+ ) {
38
+ this.priceAmountMicros = priceAmountMicros;
39
+ this.priceCurrencyCode = priceCurrencyCode;
40
+ this.formattedPrice = formattedPrice;
41
+ this.isFree = isFree;
42
+ this.currencySymbol = currencySymbol;
43
+ }
44
+ }
45
+
46
+ export default ProductPrice;