securiti-consent-sdk 1.141.0-1rc → 1.141.0-20rc

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 (94) hide show
  1. package/NitroSecuritiConsentSdk.podspec +1 -1
  2. package/README.md +508 -2
  3. package/android/build.gradle +2 -2
  4. package/android/src/main/java/com/margelo/nitro/securiticonsentsdk/HybridConsentSDK.kt +168 -34
  5. package/android/src/main/java/com/margelo/nitro/securiticonsentsdk/NullTypeCompat.kt +19 -0
  6. package/ios/HybridConsentSDK.swift +78 -32
  7. package/lib/ConsentSDK.nitro.d.ts +8 -0
  8. package/lib/ConsentSDK.nitro.js +6 -0
  9. package/lib/index.js +8 -1
  10. package/nitrogen/generated/.gitattributes +1 -1
  11. package/nitrogen/generated/android/NitroSecuritiConsentSdk+autolinking.cmake +10 -4
  12. package/nitrogen/generated/android/NitroSecuritiConsentSdkOnLoad.cpp +1 -3
  13. package/nitrogen/generated/android/c++/JAppPermission.hpp +5 -1
  14. package/nitrogen/generated/android/c++/JBannerConfig.hpp +5 -1
  15. package/nitrogen/generated/android/c++/JCmpSDKOptions.hpp +5 -1
  16. package/nitrogen/generated/android/c++/JCustomColors.hpp +5 -1
  17. package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +2 -1
  18. package/nitrogen/generated/android/c++/JHybridConsentSDKSpec.cpp +55 -14
  19. package/nitrogen/generated/android/c++/JHybridConsentSDKSpec.hpp +7 -3
  20. package/nitrogen/generated/android/c++/JPermissionConsent.hpp +5 -1
  21. package/nitrogen/generated/android/c++/JPostConsentsRequest.hpp +9 -3
  22. package/nitrogen/generated/android/c++/JPurpose.hpp +7 -2
  23. package/nitrogen/generated/android/c++/JPurposeConsent.hpp +5 -1
  24. package/nitrogen/generated/android/c++/JSDK.hpp +7 -2
  25. package/nitrogen/generated/android/c++/JSettingsPrompt.hpp +7 -2
  26. package/nitrogen/generated/android/c++/JVariant_NullType_BannerConfig.cpp +26 -0
  27. package/nitrogen/generated/android/c++/JVariant_NullType_BannerConfig.hpp +76 -0
  28. package/nitrogen/generated/android/c++/JVariant_NullType_CmpSDKOptions.cpp +26 -0
  29. package/nitrogen/generated/android/c++/JVariant_NullType_CmpSDKOptions.hpp +73 -0
  30. package/nitrogen/generated/android/c++/JVariant_NullType_SettingsPrompt.cpp +26 -0
  31. package/nitrogen/generated/android/c++/JVariant_NullType_SettingsPrompt.hpp +74 -0
  32. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/AppPermission.kt +44 -16
  33. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/BannerConfig.kt +113 -39
  34. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/CmpSDKOptions.kt +50 -18
  35. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/CustomColors.kt +41 -15
  36. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Func_void_bool.kt +1 -1
  37. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/HybridConsentSDKSpec.kt +16 -5
  38. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PermissionConsent.kt +24 -8
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PostConsentsRequest.kt +53 -19
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Purpose.kt +53 -19
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PurposeConsent.kt +27 -9
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/SDK.kt +44 -16
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/SettingsPrompt.kt +30 -10
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Variant_NullType_BannerConfig.kt +59 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Variant_NullType_CmpSDKOptions.kt +59 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Variant_NullType_SettingsPrompt.kt +59 -0
  47. package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Bridge.cpp +28 -19
  48. package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Bridge.hpp +313 -163
  49. package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Umbrella.hpp +4 -1
  50. package/nitrogen/generated/ios/NitroSecuritiConsentSdkAutolinking.mm +1 -1
  51. package/nitrogen/generated/ios/NitroSecuritiConsentSdkAutolinking.swift +2 -2
  52. package/nitrogen/generated/ios/c++/HybridConsentSDKSpecSwift.hpp +25 -10
  53. package/nitrogen/generated/ios/swift/AppPermission.swift +21 -7
  54. package/nitrogen/generated/ios/swift/BannerConfig.swift +111 -38
  55. package/nitrogen/generated/ios/swift/CmpSDKOptions.swift +9 -4
  56. package/nitrogen/generated/ios/swift/CustomColors.swift +17 -8
  57. package/nitrogen/generated/ios/swift/Func_void_bool.swift +6 -5
  58. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -0
  59. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -0
  60. package/nitrogen/generated/ios/swift/Func_void_std__unordered_map_std__string__std__string_.swift +55 -0
  61. package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__BannerConfig_.swift +59 -0
  62. package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__SettingsPrompt_.swift +59 -0
  63. package/nitrogen/generated/ios/swift/Func_void_std__vector_AppPermission_.swift +1 -0
  64. package/nitrogen/generated/ios/swift/Func_void_std__vector_Purpose_.swift +1 -0
  65. package/nitrogen/generated/ios/swift/Func_void_std__vector_SDK_.swift +1 -0
  66. package/nitrogen/generated/ios/swift/HybridConsentSDKSpec.swift +13 -4
  67. package/nitrogen/generated/ios/swift/HybridConsentSDKSpec_cxx.swift +85 -40
  68. package/nitrogen/generated/ios/swift/PermissionConsent.swift +1 -0
  69. package/nitrogen/generated/ios/swift/PostConsentsRequest.swift +5 -2
  70. package/nitrogen/generated/ios/swift/Purpose.swift +47 -11
  71. package/nitrogen/generated/ios/swift/PurposeConsent.swift +1 -0
  72. package/nitrogen/generated/ios/swift/SDK.swift +23 -8
  73. package/nitrogen/generated/ios/swift/SettingsPrompt.swift +11 -5
  74. package/nitrogen/generated/ios/swift/Variant_NullType_BannerConfig.swift +18 -0
  75. package/nitrogen/generated/ios/swift/Variant_NullType_CmpSDKOptions.swift +18 -0
  76. package/nitrogen/generated/ios/swift/Variant_NullType_SettingsPrompt.swift +18 -0
  77. package/nitrogen/generated/shared/c++/AppPermission.hpp +12 -6
  78. package/nitrogen/generated/shared/c++/BannerConfig.hpp +15 -9
  79. package/nitrogen/generated/shared/c++/CmpSDKOptions.hpp +12 -6
  80. package/nitrogen/generated/shared/c++/CustomColors.hpp +13 -7
  81. package/nitrogen/generated/shared/c++/HybridConsentSDKSpec.cpp +1 -0
  82. package/nitrogen/generated/shared/c++/HybridConsentSDKSpec.hpp +9 -6
  83. package/nitrogen/generated/shared/c++/PermissionConsent.hpp +12 -6
  84. package/nitrogen/generated/shared/c++/PostConsentsRequest.hpp +19 -13
  85. package/nitrogen/generated/shared/c++/Purpose.hpp +16 -10
  86. package/nitrogen/generated/shared/c++/PurposeConsent.hpp +12 -6
  87. package/nitrogen/generated/shared/c++/SDK.hpp +12 -6
  88. package/nitrogen/generated/shared/c++/SettingsPrompt.hpp +13 -7
  89. package/package.json +1 -1
  90. package/src/ConsentSDK.nitro.ts +11 -0
  91. package/src/index.ts +11 -0
  92. package/lib/index.d.ts +0 -20
  93. package/nitrogen/generated/ios/swift/Func_void_std__optional_BannerConfig_.swift +0 -52
  94. package/nitrogen/generated/ios/swift/Func_void_std__optional_SettingsPrompt_.swift +0 -52
@@ -9,29 +9,63 @@ package com.margelo.nitro.securiticonsentsdk
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
- import com.margelo.nitro.core.*
12
+
13
13
 
14
14
  /**
15
15
  * Represents the JavaScript object/struct "Purpose".
16
16
  */
17
17
  @DoNotStrip
18
18
  @Keep
19
- data class Purpose
20
- @DoNotStrip
21
- @Keep
22
- constructor(
23
- val purposeId: Double?,
24
- val purposeName: String?,
25
- val purposeDescription: String?,
26
- val sdks: Array<SDK>?,
27
- val consentStatus: String?,
28
- val disableOptOut: Boolean?,
29
- val optOutText: String?,
30
- val hideDetails: Boolean?,
31
- val isGADMapped: Boolean?,
32
- val gadDescription: String?,
33
- val isATTMapped: Boolean?,
34
- val attDescription: String?
35
- ) {
36
- /* main constructor */
19
+ data class Purpose(
20
+ @DoNotStrip
21
+ @Keep
22
+ val purposeId: Double?,
23
+ @DoNotStrip
24
+ @Keep
25
+ val purposeName: String?,
26
+ @DoNotStrip
27
+ @Keep
28
+ val purposeDescription: String?,
29
+ @DoNotStrip
30
+ @Keep
31
+ val sdks: Array<SDK>?,
32
+ @DoNotStrip
33
+ @Keep
34
+ val consentStatus: String?,
35
+ @DoNotStrip
36
+ @Keep
37
+ val disableOptOut: Boolean?,
38
+ @DoNotStrip
39
+ @Keep
40
+ val optOutText: String?,
41
+ @DoNotStrip
42
+ @Keep
43
+ val hideDetails: Boolean?,
44
+ @DoNotStrip
45
+ @Keep
46
+ val isGADMapped: Boolean?,
47
+ @DoNotStrip
48
+ @Keep
49
+ val gadDescription: String?,
50
+ @DoNotStrip
51
+ @Keep
52
+ val isATTMapped: Boolean?,
53
+ @DoNotStrip
54
+ @Keep
55
+ val attDescription: String?
56
+ ) {
57
+ /* primary constructor */
58
+
59
+ private companion object {
60
+ /**
61
+ * Constructor called from C++
62
+ */
63
+ @DoNotStrip
64
+ @Keep
65
+ @Suppress("unused")
66
+ @JvmStatic
67
+ private fun fromCpp(purposeId: Double?, purposeName: String?, purposeDescription: String?, sdks: Array<SDK>?, consentStatus: String?, disableOptOut: Boolean?, optOutText: String?, hideDetails: Boolean?, isGADMapped: Boolean?, gadDescription: String?, isATTMapped: Boolean?, attDescription: String?): Purpose {
68
+ return Purpose(purposeId, purposeName, purposeDescription, sdks, consentStatus, disableOptOut, optOutText, hideDetails, isGADMapped, gadDescription, isATTMapped, attDescription)
69
+ }
70
+ }
37
71
  }
@@ -9,21 +9,39 @@ package com.margelo.nitro.securiticonsentsdk
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
- import com.margelo.nitro.core.*
12
+
13
13
 
14
14
  /**
15
15
  * Represents the JavaScript object/struct "PurposeConsent".
16
16
  */
17
17
  @DoNotStrip
18
18
  @Keep
19
- data class PurposeConsent
19
+ data class PurposeConsent(
20
+ @DoNotStrip
21
+ @Keep
22
+ val purposeID: Double,
23
+ @DoNotStrip
24
+ @Keep
25
+ val consentStatus: String,
26
+ @DoNotStrip
27
+ @Keep
28
+ val timestamp: Double,
20
29
  @DoNotStrip
21
30
  @Keep
22
- constructor(
23
- val purposeID: Double,
24
- val consentStatus: String,
25
- val timestamp: Double,
26
- val isEssential: Boolean
27
- ) {
28
- /* main constructor */
31
+ val isEssential: Boolean
32
+ ) {
33
+ /* primary constructor */
34
+
35
+ private companion object {
36
+ /**
37
+ * Constructor called from C++
38
+ */
39
+ @DoNotStrip
40
+ @Keep
41
+ @Suppress("unused")
42
+ @JvmStatic
43
+ private fun fromCpp(purposeID: Double, consentStatus: String, timestamp: Double, isEssential: Boolean): PurposeConsent {
44
+ return PurposeConsent(purposeID, consentStatus, timestamp, isEssential)
45
+ }
46
+ }
29
47
  }
@@ -9,26 +9,54 @@ package com.margelo.nitro.securiticonsentsdk
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
- import com.margelo.nitro.core.*
12
+
13
13
 
14
14
  /**
15
15
  * Represents the JavaScript object/struct "SDK".
16
16
  */
17
17
  @DoNotStrip
18
18
  @Keep
19
- data class SDK
20
- @DoNotStrip
21
- @Keep
22
- constructor(
23
- val sdkId: Double?,
24
- val namespaceId: String?,
25
- val sdkName: String?,
26
- val sdkDescription: String?,
27
- val vendor: String?,
28
- val logoBase64: String?,
29
- val website: String?,
30
- val matchedBy: Array<String>?,
31
- val collectingData: Boolean?
32
- ) {
33
- /* main constructor */
19
+ data class SDK(
20
+ @DoNotStrip
21
+ @Keep
22
+ val sdkId: Double?,
23
+ @DoNotStrip
24
+ @Keep
25
+ val namespaceId: String?,
26
+ @DoNotStrip
27
+ @Keep
28
+ val sdkName: String?,
29
+ @DoNotStrip
30
+ @Keep
31
+ val sdkDescription: String?,
32
+ @DoNotStrip
33
+ @Keep
34
+ val vendor: String?,
35
+ @DoNotStrip
36
+ @Keep
37
+ val logoBase64: String?,
38
+ @DoNotStrip
39
+ @Keep
40
+ val website: String?,
41
+ @DoNotStrip
42
+ @Keep
43
+ val matchedBy: Array<String>?,
44
+ @DoNotStrip
45
+ @Keep
46
+ val collectingData: Boolean?
47
+ ) {
48
+ /* primary constructor */
49
+
50
+ private companion object {
51
+ /**
52
+ * Constructor called from C++
53
+ */
54
+ @DoNotStrip
55
+ @Keep
56
+ @Suppress("unused")
57
+ @JvmStatic
58
+ private fun fromCpp(sdkId: Double?, namespaceId: String?, sdkName: String?, sdkDescription: String?, vendor: String?, logoBase64: String?, website: String?, matchedBy: Array<String>?, collectingData: Boolean?): SDK {
59
+ return SDK(sdkId, namespaceId, sdkName, sdkDescription, vendor, logoBase64, website, matchedBy, collectingData)
60
+ }
61
+ }
34
62
  }
@@ -9,22 +9,42 @@ package com.margelo.nitro.securiticonsentsdk
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
- import com.margelo.nitro.core.*
12
+
13
13
 
14
14
  /**
15
15
  * Represents the JavaScript object/struct "SettingsPrompt".
16
16
  */
17
17
  @DoNotStrip
18
18
  @Keep
19
- data class SettingsPrompt
19
+ data class SettingsPrompt(
20
+ @DoNotStrip
21
+ @Keep
22
+ val promptHeading: String?,
23
+ @DoNotStrip
24
+ @Keep
25
+ val promptMessage: String?,
20
26
  @DoNotStrip
21
27
  @Keep
22
- constructor(
23
- val promptHeading: String?,
24
- val promptMessage: String?,
25
- val settingsButtonText: String?,
26
- val notNowButtonText: String?,
27
- val permissions: Array<String>?
28
- ) {
29
- /* main constructor */
28
+ val settingsButtonText: String?,
29
+ @DoNotStrip
30
+ @Keep
31
+ val notNowButtonText: String?,
32
+ @DoNotStrip
33
+ @Keep
34
+ val permissions: Array<String>?
35
+ ) {
36
+ /* primary constructor */
37
+
38
+ private companion object {
39
+ /**
40
+ * Constructor called from C++
41
+ */
42
+ @DoNotStrip
43
+ @Keep
44
+ @Suppress("unused")
45
+ @JvmStatic
46
+ private fun fromCpp(promptHeading: String?, promptMessage: String?, settingsButtonText: String?, notNowButtonText: String?, permissions: Array<String>?): SettingsPrompt {
47
+ return SettingsPrompt(promptHeading, promptMessage, settingsButtonText, notNowButtonText, permissions)
48
+ }
49
+ }
30
50
  }
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// Variant_NullType_BannerConfig.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.securiticonsentsdk
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip
11
+ import com.margelo.nitro.core.NullType
12
+
13
+ /**
14
+ * Represents the TypeScript variant "NullType | BannerConfig".
15
+ */
16
+ @Suppress("ClassName")
17
+ @DoNotStrip
18
+ sealed class Variant_NullType_BannerConfig {
19
+ @DoNotStrip
20
+ data class First(@DoNotStrip val value: NullType): Variant_NullType_BannerConfig()
21
+ @DoNotStrip
22
+ data class Second(@DoNotStrip val value: BannerConfig): Variant_NullType_BannerConfig()
23
+
24
+ @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
25
+ inline fun <reified T> getAs(): T? = when (this) {
26
+ is First -> value as? T
27
+ is Second -> value as? T
28
+ }
29
+
30
+ val isFirst: Boolean
31
+ get() = this is First
32
+ val isSecond: Boolean
33
+ get() = this is Second
34
+
35
+ fun asFirstOrNull(): NullType? {
36
+ val value = (this as? First)?.value ?: return null
37
+ return value
38
+ }
39
+ fun asSecondOrNull(): BannerConfig? {
40
+ val value = (this as? Second)?.value ?: return null
41
+ return value
42
+ }
43
+
44
+ inline fun <R> match(first: (NullType) -> R, second: (BannerConfig) -> R): R {
45
+ return when (this) {
46
+ is First -> first(value)
47
+ is Second -> second(value)
48
+ }
49
+ }
50
+
51
+ companion object {
52
+ @JvmStatic
53
+ @DoNotStrip
54
+ fun create(value: NullType): Variant_NullType_BannerConfig = First(value)
55
+ @JvmStatic
56
+ @DoNotStrip
57
+ fun create(value: BannerConfig): Variant_NullType_BannerConfig = Second(value)
58
+ }
59
+ }
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// Variant_NullType_CmpSDKOptions.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.securiticonsentsdk
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip
11
+ import com.margelo.nitro.core.NullType
12
+
13
+ /**
14
+ * Represents the TypeScript variant "NullType | CmpSDKOptions".
15
+ */
16
+ @Suppress("ClassName")
17
+ @DoNotStrip
18
+ sealed class Variant_NullType_CmpSDKOptions {
19
+ @DoNotStrip
20
+ data class First(@DoNotStrip val value: NullType): Variant_NullType_CmpSDKOptions()
21
+ @DoNotStrip
22
+ data class Second(@DoNotStrip val value: CmpSDKOptions): Variant_NullType_CmpSDKOptions()
23
+
24
+ @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
25
+ inline fun <reified T> getAs(): T? = when (this) {
26
+ is First -> value as? T
27
+ is Second -> value as? T
28
+ }
29
+
30
+ val isFirst: Boolean
31
+ get() = this is First
32
+ val isSecond: Boolean
33
+ get() = this is Second
34
+
35
+ fun asFirstOrNull(): NullType? {
36
+ val value = (this as? First)?.value ?: return null
37
+ return value
38
+ }
39
+ fun asSecondOrNull(): CmpSDKOptions? {
40
+ val value = (this as? Second)?.value ?: return null
41
+ return value
42
+ }
43
+
44
+ inline fun <R> match(first: (NullType) -> R, second: (CmpSDKOptions) -> R): R {
45
+ return when (this) {
46
+ is First -> first(value)
47
+ is Second -> second(value)
48
+ }
49
+ }
50
+
51
+ companion object {
52
+ @JvmStatic
53
+ @DoNotStrip
54
+ fun create(value: NullType): Variant_NullType_CmpSDKOptions = First(value)
55
+ @JvmStatic
56
+ @DoNotStrip
57
+ fun create(value: CmpSDKOptions): Variant_NullType_CmpSDKOptions = Second(value)
58
+ }
59
+ }
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// Variant_NullType_SettingsPrompt.kt
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2025 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ package com.margelo.nitro.securiticonsentsdk
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip
11
+ import com.margelo.nitro.core.NullType
12
+
13
+ /**
14
+ * Represents the TypeScript variant "NullType | SettingsPrompt".
15
+ */
16
+ @Suppress("ClassName")
17
+ @DoNotStrip
18
+ sealed class Variant_NullType_SettingsPrompt {
19
+ @DoNotStrip
20
+ data class First(@DoNotStrip val value: NullType): Variant_NullType_SettingsPrompt()
21
+ @DoNotStrip
22
+ data class Second(@DoNotStrip val value: SettingsPrompt): Variant_NullType_SettingsPrompt()
23
+
24
+ @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
25
+ inline fun <reified T> getAs(): T? = when (this) {
26
+ is First -> value as? T
27
+ is Second -> value as? T
28
+ }
29
+
30
+ val isFirst: Boolean
31
+ get() = this is First
32
+ val isSecond: Boolean
33
+ get() = this is Second
34
+
35
+ fun asFirstOrNull(): NullType? {
36
+ val value = (this as? First)?.value ?: return null
37
+ return value
38
+ }
39
+ fun asSecondOrNull(): SettingsPrompt? {
40
+ val value = (this as? Second)?.value ?: return null
41
+ return value
42
+ }
43
+
44
+ inline fun <R> match(first: (NullType) -> R, second: (SettingsPrompt) -> R): R {
45
+ return when (this) {
46
+ is First -> first(value)
47
+ is Second -> second(value)
48
+ }
49
+ }
50
+
51
+ companion object {
52
+ @JvmStatic
53
+ @DoNotStrip
54
+ fun create(value: NullType): Variant_NullType_SettingsPrompt = First(value)
55
+ @JvmStatic
56
+ @DoNotStrip
57
+ fun create(value: SettingsPrompt): Variant_NullType_SettingsPrompt = Second(value)
58
+ }
59
+ }
@@ -10,11 +10,12 @@
10
10
  // Include C++ implementation defined types
11
11
  #include "HybridConsentSDKSpecSwift.hpp"
12
12
  #include "NitroSecuritiConsentSdk-Swift-Cxx-Umbrella.hpp"
13
+ #include <NitroModules/NitroDefines.hpp>
13
14
 
14
15
  namespace margelo::nitro::securiticonsentsdk::bridge::swift {
15
16
 
16
17
  // pragma MARK: std::function<void(bool /* isReady */)>
17
- Func_void_bool create_Func_void_bool(void* _Nonnull swiftClosureWrapper) {
18
+ Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept {
18
19
  auto swiftClosure = NitroSecuritiConsentSdk::Func_void_bool::fromUnsafe(swiftClosureWrapper);
19
20
  return [swiftClosure = std::move(swiftClosure)](bool isReady) mutable -> void {
20
21
  swiftClosure.call(isReady);
@@ -22,7 +23,7 @@ namespace margelo::nitro::securiticonsentsdk::bridge::swift {
22
23
  }
23
24
 
24
25
  // pragma MARK: std::function<void(const std::string& /* result */)>
25
- Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper) {
26
+ Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
26
27
  auto swiftClosure = NitroSecuritiConsentSdk::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
27
28
  return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void {
28
29
  swiftClosure.call(result);
@@ -30,7 +31,7 @@ namespace margelo::nitro::securiticonsentsdk::bridge::swift {
30
31
  }
31
32
 
32
33
  // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
33
- Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper) {
34
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
34
35
  auto swiftClosure = NitroSecuritiConsentSdk::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
35
36
  return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
36
37
  swiftClosure.call(error);
@@ -38,7 +39,7 @@ namespace margelo::nitro::securiticonsentsdk::bridge::swift {
38
39
  }
39
40
 
40
41
  // pragma MARK: std::function<void(const std::vector<AppPermission>& /* result */)>
41
- Func_void_std__vector_AppPermission_ create_Func_void_std__vector_AppPermission_(void* _Nonnull swiftClosureWrapper) {
42
+ Func_void_std__vector_AppPermission_ create_Func_void_std__vector_AppPermission_(void* NON_NULL swiftClosureWrapper) noexcept {
42
43
  auto swiftClosure = NitroSecuritiConsentSdk::Func_void_std__vector_AppPermission_::fromUnsafe(swiftClosureWrapper);
43
44
  return [swiftClosure = std::move(swiftClosure)](const std::vector<AppPermission>& result) mutable -> void {
44
45
  swiftClosure.call(result);
@@ -46,7 +47,7 @@ namespace margelo::nitro::securiticonsentsdk::bridge::swift {
46
47
  }
47
48
 
48
49
  // pragma MARK: std::function<void(const std::vector<Purpose>& /* result */)>
49
- Func_void_std__vector_Purpose_ create_Func_void_std__vector_Purpose_(void* _Nonnull swiftClosureWrapper) {
50
+ Func_void_std__vector_Purpose_ create_Func_void_std__vector_Purpose_(void* NON_NULL swiftClosureWrapper) noexcept {
50
51
  auto swiftClosure = NitroSecuritiConsentSdk::Func_void_std__vector_Purpose_::fromUnsafe(swiftClosureWrapper);
51
52
  return [swiftClosure = std::move(swiftClosure)](const std::vector<Purpose>& result) mutable -> void {
52
53
  swiftClosure.call(result);
@@ -54,41 +55,49 @@ namespace margelo::nitro::securiticonsentsdk::bridge::swift {
54
55
  }
55
56
 
56
57
  // pragma MARK: std::function<void(const std::vector<SDK>& /* result */)>
57
- Func_void_std__vector_SDK_ create_Func_void_std__vector_SDK_(void* _Nonnull swiftClosureWrapper) {
58
+ Func_void_std__vector_SDK_ create_Func_void_std__vector_SDK_(void* NON_NULL swiftClosureWrapper) noexcept {
58
59
  auto swiftClosure = NitroSecuritiConsentSdk::Func_void_std__vector_SDK_::fromUnsafe(swiftClosureWrapper);
59
60
  return [swiftClosure = std::move(swiftClosure)](const std::vector<SDK>& result) mutable -> void {
60
61
  swiftClosure.call(result);
61
62
  };
62
63
  }
63
64
 
64
- // pragma MARK: std::function<void(const std::optional<BannerConfig>& /* result */)>
65
- Func_void_std__optional_BannerConfig_ create_Func_void_std__optional_BannerConfig_(void* _Nonnull swiftClosureWrapper) {
66
- auto swiftClosure = NitroSecuritiConsentSdk::Func_void_std__optional_BannerConfig_::fromUnsafe(swiftClosureWrapper);
67
- return [swiftClosure = std::move(swiftClosure)](const std::optional<BannerConfig>& result) mutable -> void {
65
+ // pragma MARK: std::function<void(const std::unordered_map<std::string, std::string>& /* result */)>
66
+ Func_void_std__unordered_map_std__string__std__string_ create_Func_void_std__unordered_map_std__string__std__string_(void* NON_NULL swiftClosureWrapper) noexcept {
67
+ auto swiftClosure = NitroSecuritiConsentSdk::Func_void_std__unordered_map_std__string__std__string_::fromUnsafe(swiftClosureWrapper);
68
+ return [swiftClosure = std::move(swiftClosure)](const std::unordered_map<std::string, std::string>& result) mutable -> void {
68
69
  swiftClosure.call(result);
69
70
  };
70
71
  }
71
72
 
72
- // pragma MARK: std::function<void(const std::optional<SettingsPrompt>& /* result */)>
73
- Func_void_std__optional_SettingsPrompt_ create_Func_void_std__optional_SettingsPrompt_(void* _Nonnull swiftClosureWrapper) {
74
- auto swiftClosure = NitroSecuritiConsentSdk::Func_void_std__optional_SettingsPrompt_::fromUnsafe(swiftClosureWrapper);
75
- return [swiftClosure = std::move(swiftClosure)](const std::optional<SettingsPrompt>& result) mutable -> void {
73
+ // pragma MARK: std::function<void(const std::variant<nitro::NullType, BannerConfig>& /* result */)>
74
+ Func_void_std__variant_nitro__NullType__BannerConfig_ create_Func_void_std__variant_nitro__NullType__BannerConfig_(void* NON_NULL swiftClosureWrapper) noexcept {
75
+ auto swiftClosure = NitroSecuritiConsentSdk::Func_void_std__variant_nitro__NullType__BannerConfig_::fromUnsafe(swiftClosureWrapper);
76
+ return [swiftClosure = std::move(swiftClosure)](const std::variant<nitro::NullType, BannerConfig>& result) mutable -> void {
76
77
  swiftClosure.call(result);
77
78
  };
78
79
  }
79
80
 
80
- // pragma MARK: std::shared_ptr<margelo::nitro::securiticonsentsdk::HybridConsentSDKSpec>
81
- std::shared_ptr<margelo::nitro::securiticonsentsdk::HybridConsentSDKSpec> create_std__shared_ptr_margelo__nitro__securiticonsentsdk__HybridConsentSDKSpec_(void* _Nonnull swiftUnsafePointer) {
81
+ // pragma MARK: std::function<void(const std::variant<nitro::NullType, SettingsPrompt>& /* result */)>
82
+ Func_void_std__variant_nitro__NullType__SettingsPrompt_ create_Func_void_std__variant_nitro__NullType__SettingsPrompt_(void* NON_NULL swiftClosureWrapper) noexcept {
83
+ auto swiftClosure = NitroSecuritiConsentSdk::Func_void_std__variant_nitro__NullType__SettingsPrompt_::fromUnsafe(swiftClosureWrapper);
84
+ return [swiftClosure = std::move(swiftClosure)](const std::variant<nitro::NullType, SettingsPrompt>& result) mutable -> void {
85
+ swiftClosure.call(result);
86
+ };
87
+ }
88
+
89
+ // pragma MARK: std::shared_ptr<HybridConsentSDKSpec>
90
+ std::shared_ptr<HybridConsentSDKSpec> create_std__shared_ptr_HybridConsentSDKSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
82
91
  NitroSecuritiConsentSdk::HybridConsentSDKSpec_cxx swiftPart = NitroSecuritiConsentSdk::HybridConsentSDKSpec_cxx::fromUnsafe(swiftUnsafePointer);
83
92
  return std::make_shared<margelo::nitro::securiticonsentsdk::HybridConsentSDKSpecSwift>(swiftPart);
84
93
  }
85
- void* _Nonnull get_std__shared_ptr_margelo__nitro__securiticonsentsdk__HybridConsentSDKSpec_(std__shared_ptr_margelo__nitro__securiticonsentsdk__HybridConsentSDKSpec_ cppType) {
94
+ void* NON_NULL get_std__shared_ptr_HybridConsentSDKSpec_(std__shared_ptr_HybridConsentSDKSpec_ cppType) {
86
95
  std::shared_ptr<margelo::nitro::securiticonsentsdk::HybridConsentSDKSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::securiticonsentsdk::HybridConsentSDKSpecSwift>(cppType);
87
- #ifdef NITRO_DEBUG
96
+ #ifdef NITRO_DEBUG
88
97
  if (swiftWrapper == nullptr) [[unlikely]] {
89
98
  throw std::runtime_error("Class \"HybridConsentSDKSpec\" is not implemented in Swift!");
90
99
  }
91
- #endif
100
+ #endif
92
101
  NitroSecuritiConsentSdk::HybridConsentSDKSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
93
102
  return swiftPart.toUnsafe();
94
103
  }