react-native-carrot-quest 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CarrotQuest.podspec +34 -0
  2. package/LICENSE +20 -0
  3. package/README.md +457 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +136 -0
  6. package/android/src/main/AndroidManifest.xml +2 -0
  7. package/android/src/main/cpp/cpp-adapter.cpp +11 -0
  8. package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuest.kt +585 -0
  9. package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuestPackage.kt +22 -0
  10. package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuestSetup.kt +472 -0
  11. package/ios/CarrotQuest.swift +588 -0
  12. package/ios/CarrotQuestSetup.swift +333 -0
  13. package/lib/module/CarrotQuest.nitro.js +4 -0
  14. package/lib/module/CarrotQuest.nitro.js.map +1 -0
  15. package/lib/module/carrot-quest.js +136 -0
  16. package/lib/module/carrot-quest.js.map +1 -0
  17. package/lib/module/carrot-quest.native.js +155 -0
  18. package/lib/module/carrot-quest.native.js.map +1 -0
  19. package/lib/module/index.js +6 -0
  20. package/lib/module/index.js.map +1 -0
  21. package/lib/module/package.json +1 -0
  22. package/lib/module/subscriptions.js +76 -0
  23. package/lib/module/subscriptions.js.map +1 -0
  24. package/lib/typescript/package.json +1 -0
  25. package/lib/typescript/src/CarrotQuest.nitro.d.ts +394 -0
  26. package/lib/typescript/src/CarrotQuest.nitro.d.ts.map +1 -0
  27. package/lib/typescript/src/carrot-quest.d.ts +37 -0
  28. package/lib/typescript/src/carrot-quest.d.ts.map +1 -0
  29. package/lib/typescript/src/carrot-quest.native.d.ts +37 -0
  30. package/lib/typescript/src/carrot-quest.native.d.ts.map +1 -0
  31. package/lib/typescript/src/index.d.ts +6 -0
  32. package/lib/typescript/src/index.d.ts.map +1 -0
  33. package/lib/typescript/src/subscriptions.d.ts +32 -0
  34. package/lib/typescript/src/subscriptions.d.ts.map +1 -0
  35. package/nitro.json +23 -0
  36. package/nitrogen/generated/android/c++/JCarrotQuestEventValue.cpp +30 -0
  37. package/nitrogen/generated/android/c++/JCarrotQuestEventValue.hpp +83 -0
  38. package/nitrogen/generated/android/c++/JCarrotQuestLogCategory.hpp +76 -0
  39. package/nitrogen/generated/android/c++/JCarrotQuestLogEntry.hpp +100 -0
  40. package/nitrogen/generated/android/c++/JCarrotQuestLogLevel.hpp +70 -0
  41. package/nitrogen/generated/android/c++/JCarrotQuestProperty.hpp +74 -0
  42. package/nitrogen/generated/android/c++/JCarrotQuestPropertyKind.hpp +61 -0
  43. package/nitrogen/generated/android/c++/JCarrotQuestPropertyOperation.hpp +73 -0
  44. package/nitrogen/generated/android/c++/JCarrotQuestSetupOptions.hpp +94 -0
  45. package/nitrogen/generated/android/c++/JCarrotQuestTheme.hpp +64 -0
  46. package/nitrogen/generated/android/c++/JCarrotQuestUrlSource.hpp +64 -0
  47. package/nitrogen/generated/android/c++/JCarrotQuestUserProperties.hpp +84 -0
  48. package/nitrogen/generated/android/c++/JFunc_void_CarrotQuestLogEntry.hpp +84 -0
  49. package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
  50. package/nitrogen/generated/android/c++/JFunc_void_double.hpp +75 -0
  51. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
  52. package/nitrogen/generated/android/c++/JHybridCarrotQuestSpec.cpp +388 -0
  53. package/nitrogen/generated/android/c++/JHybridCarrotQuestSpec.hpp +96 -0
  54. package/nitrogen/generated/android/carrotquest+autolinking.cmake +82 -0
  55. package/nitrogen/generated/android/carrotquest+autolinking.gradle +27 -0
  56. package/nitrogen/generated/android/carrotquestOnLoad.cpp +62 -0
  57. package/nitrogen/generated/android/carrotquestOnLoad.hpp +34 -0
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestEventValue.kt +75 -0
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogCategory.kt +29 -0
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogEntry.kt +81 -0
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogLevel.kt +27 -0
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestProperty.kt +66 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestPropertyKind.kt +24 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestPropertyOperation.kt +28 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestSetupOptions.kt +91 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestTheme.kt +25 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestUrlSource.kt +25 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestUserProperties.kt +66 -0
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_CarrotQuestLogEntry.kt +80 -0
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_bool.kt +80 -0
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_double.kt +80 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_std__string.kt +80 -0
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/HybridCarrotQuestSpec.kt +209 -0
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/carrotquestOnLoad.kt +35 -0
  75. package/nitrogen/generated/ios/CarrotQuest+autolinking.rb +62 -0
  76. package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Bridge.cpp +97 -0
  77. package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Bridge.hpp +637 -0
  78. package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Umbrella.hpp +80 -0
  79. package/nitrogen/generated/ios/CarrotQuestAutolinking.mm +33 -0
  80. package/nitrogen/generated/ios/CarrotQuestAutolinking.swift +26 -0
  81. package/nitrogen/generated/ios/c++/HybridCarrotQuestSpecSwift.cpp +11 -0
  82. package/nitrogen/generated/ios/c++/HybridCarrotQuestSpecSwift.hpp +344 -0
  83. package/nitrogen/generated/ios/swift/CarrotQuestEventValue.swift +32 -0
  84. package/nitrogen/generated/ios/swift/CarrotQuestLogCategory.swift +64 -0
  85. package/nitrogen/generated/ios/swift/CarrotQuestLogEntry.swift +86 -0
  86. package/nitrogen/generated/ios/swift/CarrotQuestLogLevel.swift +56 -0
  87. package/nitrogen/generated/ios/swift/CarrotQuestProperty.swift +56 -0
  88. package/nitrogen/generated/ios/swift/CarrotQuestPropertyKind.swift +44 -0
  89. package/nitrogen/generated/ios/swift/CarrotQuestPropertyOperation.swift +60 -0
  90. package/nitrogen/generated/ios/swift/CarrotQuestSetupOptions.swift +172 -0
  91. package/nitrogen/generated/ios/swift/CarrotQuestTheme.swift +48 -0
  92. package/nitrogen/generated/ios/swift/CarrotQuestUrlSource.swift +48 -0
  93. package/nitrogen/generated/ios/swift/CarrotQuestUserProperties.swift +110 -0
  94. package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
  95. package/nitrogen/generated/ios/swift/Func_void_CarrotQuestLogEntry.swift +46 -0
  96. package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
  97. package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
  98. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  99. package/nitrogen/generated/ios/swift/Func_void_std__optional_double_.swift +53 -0
  100. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +53 -0
  101. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  102. package/nitrogen/generated/ios/swift/HybridCarrotQuestSpec.swift +88 -0
  103. package/nitrogen/generated/ios/swift/HybridCarrotQuestSpec_cxx.swift +674 -0
  104. package/nitrogen/generated/shared/c++/CarrotQuestLogCategory.hpp +100 -0
  105. package/nitrogen/generated/shared/c++/CarrotQuestLogEntry.hpp +114 -0
  106. package/nitrogen/generated/shared/c++/CarrotQuestLogLevel.hpp +92 -0
  107. package/nitrogen/generated/shared/c++/CarrotQuestProperty.hpp +101 -0
  108. package/nitrogen/generated/shared/c++/CarrotQuestPropertyKind.hpp +80 -0
  109. package/nitrogen/generated/shared/c++/CarrotQuestPropertyOperation.hpp +96 -0
  110. package/nitrogen/generated/shared/c++/CarrotQuestSetupOptions.hpp +121 -0
  111. package/nitrogen/generated/shared/c++/CarrotQuestTheme.hpp +84 -0
  112. package/nitrogen/generated/shared/c++/CarrotQuestUrlSource.hpp +84 -0
  113. package/nitrogen/generated/shared/c++/CarrotQuestUserProperties.hpp +97 -0
  114. package/nitrogen/generated/shared/c++/HybridCarrotQuestSpec.cpp +55 -0
  115. package/nitrogen/generated/shared/c++/HybridCarrotQuestSpec.hpp +118 -0
  116. package/package.json +140 -0
  117. package/src/CarrotQuest.nitro.ts +493 -0
  118. package/src/carrot-quest.native.tsx +241 -0
  119. package/src/carrot-quest.tsx +207 -0
  120. package/src/index.tsx +57 -0
  121. package/src/subscriptions.ts +83 -0
@@ -0,0 +1,34 @@
1
+ ///
2
+ /// carrotquestOnLoad.hpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include <jni.h>
9
+ #include <functional>
10
+ #include <NitroModules/NitroDefines.hpp>
11
+
12
+ namespace margelo::nitro::carrotquest {
13
+
14
+ [[deprecated("Use registerNatives() instead.")]]
15
+ int initialize(JavaVM* vm);
16
+
17
+ /**
18
+ * Register the native (C++) part of carrotquest, and autolinks all Hybrid Objects.
19
+ * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`),
20
+ * inside a `facebook::jni::initialize(vm, ...)` call.
21
+ * Example:
22
+ * ```cpp (cpp-adapter.cpp)
23
+ * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
24
+ * return facebook::jni::initialize(vm, []() {
25
+ * // register all carrotquest HybridObjects
26
+ * margelo::nitro::carrotquest::registerNatives();
27
+ * // any other custom registrations go here.
28
+ * });
29
+ * }
30
+ * ```
31
+ */
32
+ void registerAllNatives();
33
+
34
+ } // namespace margelo::nitro::carrotquest
@@ -0,0 +1,75 @@
1
+ ///
2
+ /// CarrotQuestEventValue.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip
11
+
12
+
13
+ /**
14
+ * Represents the TypeScript variant "Boolean | String | Double".
15
+ */
16
+ @Suppress("ClassName")
17
+ @DoNotStrip
18
+ sealed class CarrotQuestEventValue {
19
+ @DoNotStrip
20
+ data class First(@DoNotStrip val value: Boolean): CarrotQuestEventValue()
21
+ @DoNotStrip
22
+ data class Second(@DoNotStrip val value: String): CarrotQuestEventValue()
23
+ @DoNotStrip
24
+ data class Third(@DoNotStrip val value: Double): CarrotQuestEventValue()
25
+
26
+ inline fun <reified T> asType(): T? {
27
+ return when (this) {
28
+ is First -> (value) as? T
29
+ is Second -> (value) as? T
30
+ is Third -> (value) as? T
31
+ }
32
+ }
33
+ inline fun <reified T> isType(): Boolean {
34
+ return asType<T>() != null
35
+ }
36
+ inline fun <R> match(first: (Boolean) -> R, second: (String) -> R, third: (Double) -> R): R {
37
+ return when (this) {
38
+ is First -> first(value)
39
+ is Second -> second(value)
40
+ is Third -> third(value)
41
+ }
42
+ }
43
+
44
+ val isFirst: Boolean
45
+ get() = this is First
46
+ val isSecond: Boolean
47
+ get() = this is Second
48
+ val isThird: Boolean
49
+ get() = this is Third
50
+
51
+ fun asFirstOrNull(): Boolean? {
52
+ val value = (this as? First)?.value ?: return null
53
+ return value
54
+ }
55
+ fun asSecondOrNull(): String? {
56
+ val value = (this as? Second)?.value ?: return null
57
+ return value
58
+ }
59
+ fun asThirdOrNull(): Double? {
60
+ val value = (this as? Third)?.value ?: return null
61
+ return value
62
+ }
63
+
64
+ companion object {
65
+ @JvmStatic
66
+ @DoNotStrip
67
+ fun create(value: Boolean): CarrotQuestEventValue = First(value)
68
+ @JvmStatic
69
+ @DoNotStrip
70
+ fun create(value: String): CarrotQuestEventValue = Second(value)
71
+ @JvmStatic
72
+ @DoNotStrip
73
+ fun create(value: Double): CarrotQuestEventValue = Third(value)
74
+ }
75
+ }
@@ -0,0 +1,29 @@
1
+ ///
2
+ /// CarrotQuestLogCategory.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "CarrotQuestLogCategory".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class CarrotQuestLogCategory(@DoNotStrip @Keep val value: Int) {
19
+ PUSH(0),
20
+ GENERAL(1),
21
+ NETWORK(2),
22
+ CONNECTIVITY(3),
23
+ AUTH(4),
24
+ REALTIME(5),
25
+ LIFECYCLE(6),
26
+ DATABASE(7);
27
+
28
+ companion object
29
+ }
@@ -0,0 +1,81 @@
1
+ ///
2
+ /// CarrotQuestLogEntry.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "CarrotQuestLogEntry".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class CarrotQuestLogEntry(
21
+ @DoNotStrip
22
+ @Keep
23
+ val timestampMs: Double,
24
+ @DoNotStrip
25
+ @Keep
26
+ val level: CarrotQuestLogLevel,
27
+ @DoNotStrip
28
+ @Keep
29
+ val category: CarrotQuestLogCategory,
30
+ @DoNotStrip
31
+ @Keep
32
+ val tag: String,
33
+ @DoNotStrip
34
+ @Keep
35
+ val message: String,
36
+ @DoNotStrip
37
+ @Keep
38
+ val fields: Map<String, String>,
39
+ @DoNotStrip
40
+ @Keep
41
+ val error: String?
42
+ ) {
43
+ /* primary constructor */
44
+
45
+ override fun equals(other: Any?): Boolean {
46
+ if (this === other) return true
47
+ if (other !is CarrotQuestLogEntry) return false
48
+ return Objects.deepEquals(this.timestampMs, other.timestampMs)
49
+ && Objects.deepEquals(this.level, other.level)
50
+ && Objects.deepEquals(this.category, other.category)
51
+ && Objects.deepEquals(this.tag, other.tag)
52
+ && Objects.deepEquals(this.message, other.message)
53
+ && Objects.deepEquals(this.fields, other.fields)
54
+ && Objects.deepEquals(this.error, other.error)
55
+ }
56
+
57
+ override fun hashCode(): Int {
58
+ return arrayOf<Any?>(
59
+ timestampMs,
60
+ level,
61
+ category,
62
+ tag,
63
+ message,
64
+ fields,
65
+ error
66
+ ).contentDeepHashCode()
67
+ }
68
+
69
+ companion object {
70
+ /**
71
+ * Constructor called from C++
72
+ */
73
+ @DoNotStrip
74
+ @Keep
75
+ @Suppress("unused")
76
+ @JvmStatic
77
+ private fun fromCpp(timestampMs: Double, level: CarrotQuestLogLevel, category: CarrotQuestLogCategory, tag: String, message: String, fields: Map<String, String>, error: String?): CarrotQuestLogEntry {
78
+ return CarrotQuestLogEntry(timestampMs, level, category, tag, message, fields, error)
79
+ }
80
+ }
81
+ }
@@ -0,0 +1,27 @@
1
+ ///
2
+ /// CarrotQuestLogLevel.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "CarrotQuestLogLevel".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class CarrotQuestLogLevel(@DoNotStrip @Keep val value: Int) {
19
+ NONE(0),
20
+ ERROR(1),
21
+ WARN(2),
22
+ INFO(3),
23
+ DEBUGGING(4),
24
+ VERBOSE(5);
25
+
26
+ companion object
27
+ }
@@ -0,0 +1,66 @@
1
+ ///
2
+ /// CarrotQuestProperty.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "CarrotQuestProperty".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class CarrotQuestProperty(
21
+ @DoNotStrip
22
+ @Keep
23
+ val key: String,
24
+ @DoNotStrip
25
+ @Keep
26
+ val value: String,
27
+ @DoNotStrip
28
+ @Keep
29
+ val operation: CarrotQuestPropertyOperation?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val kind: CarrotQuestPropertyKind?
33
+ ) {
34
+ /* primary constructor */
35
+
36
+ override fun equals(other: Any?): Boolean {
37
+ if (this === other) return true
38
+ if (other !is CarrotQuestProperty) return false
39
+ return Objects.deepEquals(this.key, other.key)
40
+ && Objects.deepEquals(this.value, other.value)
41
+ && Objects.deepEquals(this.operation, other.operation)
42
+ && Objects.deepEquals(this.kind, other.kind)
43
+ }
44
+
45
+ override fun hashCode(): Int {
46
+ return arrayOf<Any?>(
47
+ key,
48
+ value,
49
+ operation,
50
+ kind
51
+ ).contentDeepHashCode()
52
+ }
53
+
54
+ companion object {
55
+ /**
56
+ * Constructor called from C++
57
+ */
58
+ @DoNotStrip
59
+ @Keep
60
+ @Suppress("unused")
61
+ @JvmStatic
62
+ private fun fromCpp(key: String, value: String, operation: CarrotQuestPropertyOperation?, kind: CarrotQuestPropertyKind?): CarrotQuestProperty {
63
+ return CarrotQuestProperty(key, value, operation, kind)
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,24 @@
1
+ ///
2
+ /// CarrotQuestPropertyKind.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "CarrotQuestPropertyKind".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class CarrotQuestPropertyKind(@DoNotStrip @Keep val value: Int) {
19
+ CUSTOM(0),
20
+ SYSTEM(1),
21
+ ECOMMERCE(2);
22
+
23
+ companion object
24
+ }
@@ -0,0 +1,28 @@
1
+ ///
2
+ /// CarrotQuestPropertyOperation.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "CarrotQuestPropertyOperation".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class CarrotQuestPropertyOperation(@DoNotStrip @Keep val value: Int) {
19
+ UPDATEORCREATE(0),
20
+ SETONCE(1),
21
+ ADD(2),
22
+ DELETE(3),
23
+ APPEND(4),
24
+ UNION(5),
25
+ EXCLUDE(6);
26
+
27
+ companion object
28
+ }
@@ -0,0 +1,91 @@
1
+ ///
2
+ /// CarrotQuestSetupOptions.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "CarrotQuestSetupOptions".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class CarrotQuestSetupOptions(
21
+ @DoNotStrip
22
+ @Keep
23
+ val locale: String?,
24
+ @DoNotStrip
25
+ @Keep
26
+ val theme: CarrotQuestTheme?,
27
+ @DoNotStrip
28
+ @Keep
29
+ val useEuServer: Boolean?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val appGroup: String?,
33
+ @DoNotStrip
34
+ @Keep
35
+ val isServiceMode: Boolean?,
36
+ @DoNotStrip
37
+ @Keep
38
+ val parentActivityClassName: String?,
39
+ @DoNotStrip
40
+ @Keep
41
+ val notificationIconResourceName: String?,
42
+ @DoNotStrip
43
+ @Keep
44
+ val logLevel: CarrotQuestLogLevel?,
45
+ @DoNotStrip
46
+ @Keep
47
+ val logIncludeSensitive: Boolean?
48
+ ) {
49
+ /* primary constructor */
50
+
51
+ override fun equals(other: Any?): Boolean {
52
+ if (this === other) return true
53
+ if (other !is CarrotQuestSetupOptions) return false
54
+ return Objects.deepEquals(this.locale, other.locale)
55
+ && Objects.deepEquals(this.theme, other.theme)
56
+ && Objects.deepEquals(this.useEuServer, other.useEuServer)
57
+ && Objects.deepEquals(this.appGroup, other.appGroup)
58
+ && Objects.deepEquals(this.isServiceMode, other.isServiceMode)
59
+ && Objects.deepEquals(this.parentActivityClassName, other.parentActivityClassName)
60
+ && Objects.deepEquals(this.notificationIconResourceName, other.notificationIconResourceName)
61
+ && Objects.deepEquals(this.logLevel, other.logLevel)
62
+ && Objects.deepEquals(this.logIncludeSensitive, other.logIncludeSensitive)
63
+ }
64
+
65
+ override fun hashCode(): Int {
66
+ return arrayOf<Any?>(
67
+ locale,
68
+ theme,
69
+ useEuServer,
70
+ appGroup,
71
+ isServiceMode,
72
+ parentActivityClassName,
73
+ notificationIconResourceName,
74
+ logLevel,
75
+ logIncludeSensitive
76
+ ).contentDeepHashCode()
77
+ }
78
+
79
+ companion object {
80
+ /**
81
+ * Constructor called from C++
82
+ */
83
+ @DoNotStrip
84
+ @Keep
85
+ @Suppress("unused")
86
+ @JvmStatic
87
+ private fun fromCpp(locale: String?, theme: CarrotQuestTheme?, useEuServer: Boolean?, appGroup: String?, isServiceMode: Boolean?, parentActivityClassName: String?, notificationIconResourceName: String?, logLevel: CarrotQuestLogLevel?, logIncludeSensitive: Boolean?): CarrotQuestSetupOptions {
88
+ return CarrotQuestSetupOptions(locale, theme, useEuServer, appGroup, isServiceMode, parentActivityClassName, notificationIconResourceName, logLevel, logIncludeSensitive)
89
+ }
90
+ }
91
+ }
@@ -0,0 +1,25 @@
1
+ ///
2
+ /// CarrotQuestTheme.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "CarrotQuestTheme".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class CarrotQuestTheme(@DoNotStrip @Keep val value: Int) {
19
+ LIGHT(0),
20
+ DARK(1),
21
+ FROMDEVICE(2),
22
+ FROMWEB(3);
23
+
24
+ companion object
25
+ }
@@ -0,0 +1,25 @@
1
+ ///
2
+ /// CarrotQuestUrlSource.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "CarrotQuestUrlSource".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class CarrotQuestUrlSource(@DoNotStrip @Keep val value: Int) {
19
+ PUSH(0),
20
+ CHAT(1),
21
+ POPUP(2),
22
+ ALL(3);
23
+
24
+ companion object
25
+ }
@@ -0,0 +1,66 @@
1
+ ///
2
+ /// CarrotQuestUserProperties.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
13
+
14
+
15
+ /**
16
+ * Represents the JavaScript object/struct "CarrotQuestUserProperties".
17
+ */
18
+ @DoNotStrip
19
+ @Keep
20
+ data class CarrotQuestUserProperties(
21
+ @DoNotStrip
22
+ @Keep
23
+ val name: String?,
24
+ @DoNotStrip
25
+ @Keep
26
+ val phone: String?,
27
+ @DoNotStrip
28
+ @Keep
29
+ val email: String?,
30
+ @DoNotStrip
31
+ @Keep
32
+ val custom: Map<String, String>?
33
+ ) {
34
+ /* primary constructor */
35
+
36
+ override fun equals(other: Any?): Boolean {
37
+ if (this === other) return true
38
+ if (other !is CarrotQuestUserProperties) return false
39
+ return Objects.deepEquals(this.name, other.name)
40
+ && Objects.deepEquals(this.phone, other.phone)
41
+ && Objects.deepEquals(this.email, other.email)
42
+ && Objects.deepEquals(this.custom, other.custom)
43
+ }
44
+
45
+ override fun hashCode(): Int {
46
+ return arrayOf<Any?>(
47
+ name,
48
+ phone,
49
+ email,
50
+ custom
51
+ ).contentDeepHashCode()
52
+ }
53
+
54
+ companion object {
55
+ /**
56
+ * Constructor called from C++
57
+ */
58
+ @DoNotStrip
59
+ @Keep
60
+ @Suppress("unused")
61
+ @JvmStatic
62
+ private fun fromCpp(name: String?, phone: String?, email: String?, custom: Map<String, String>?): CarrotQuestUserProperties {
63
+ return CarrotQuestUserProperties(name, phone, email, custom)
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// Func_void_CarrotQuestLogEntry.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.carrotquest
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.jni.HybridData
12
+ import com.facebook.proguard.annotations.DoNotStrip
13
+ import dalvik.annotation.optimization.FastNative
14
+
15
+
16
+ /**
17
+ * Represents the JavaScript callback `(entry: struct) => void`.
18
+ * This can be either implemented in C++ (in which case it might be a callback coming from JS),
19
+ * or in Kotlin/Java (in which case it is a native callback).
20
+ */
21
+ @DoNotStrip
22
+ @Keep
23
+ @Suppress("ClassName", "RedundantUnitReturnType")
24
+ fun interface Func_void_CarrotQuestLogEntry: (CarrotQuestLogEntry) -> Unit {
25
+ /**
26
+ * Call the given JS callback.
27
+ * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
28
+ */
29
+ @DoNotStrip
30
+ @Keep
31
+ override fun invoke(entry: CarrotQuestLogEntry): Unit
32
+ }
33
+
34
+ /**
35
+ * Represents the JavaScript callback `(entry: struct) => void`.
36
+ * This is implemented in C++, via a `std::function<...>`.
37
+ * The callback might be coming from JS.
38
+ */
39
+ @DoNotStrip
40
+ @Keep
41
+ @Suppress(
42
+ "KotlinJniMissingFunction", "unused",
43
+ "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
44
+ "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
45
+ )
46
+ class Func_void_CarrotQuestLogEntry_cxx: Func_void_CarrotQuestLogEntry {
47
+ @DoNotStrip
48
+ @Keep
49
+ private val mHybridData: HybridData
50
+
51
+ @DoNotStrip
52
+ @Keep
53
+ private constructor(hybridData: HybridData) {
54
+ mHybridData = hybridData
55
+ }
56
+
57
+ @DoNotStrip
58
+ @Keep
59
+ override fun invoke(entry: CarrotQuestLogEntry): Unit
60
+ = invoke_cxx(entry)
61
+
62
+ @FastNative
63
+ private external fun invoke_cxx(entry: CarrotQuestLogEntry): Unit
64
+ }
65
+
66
+ /**
67
+ * Represents the JavaScript callback `(entry: struct) => void`.
68
+ * This is implemented in Java/Kotlin, via a `(CarrotQuestLogEntry) -> Unit`.
69
+ * The callback is always coming from native.
70
+ */
71
+ @DoNotStrip
72
+ @Keep
73
+ @Suppress("ClassName", "RedundantUnitReturnType", "unused")
74
+ class Func_void_CarrotQuestLogEntry_java(private val function: (CarrotQuestLogEntry) -> Unit): Func_void_CarrotQuestLogEntry {
75
+ @DoNotStrip
76
+ @Keep
77
+ override fun invoke(entry: CarrotQuestLogEntry): Unit {
78
+ return this.function(entry)
79
+ }
80
+ }