securiti-consent-sdk 1.141.0-11rc → 1.141.0-13rc

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
@@ -5,6 +5,7 @@
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
+ import Foundation
8
9
  import NitroModules
9
10
 
10
11
  /**
@@ -121,7 +122,8 @@ public extension Purpose {
121
122
  @inline(__always)
122
123
  get {
123
124
  return { () -> String? in
124
- if let __unwrapped = self.__purposeName.value {
125
+ if bridge.has_value_std__optional_std__string_(self.__purposeName) {
126
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__purposeName)
125
127
  return String(__unwrapped)
126
128
  } else {
127
129
  return nil
@@ -144,7 +146,8 @@ public extension Purpose {
144
146
  @inline(__always)
145
147
  get {
146
148
  return { () -> String? in
147
- if let __unwrapped = self.__purposeDescription.value {
149
+ if bridge.has_value_std__optional_std__string_(self.__purposeDescription) {
150
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__purposeDescription)
148
151
  return String(__unwrapped)
149
152
  } else {
150
153
  return nil
@@ -167,7 +170,8 @@ public extension Purpose {
167
170
  @inline(__always)
168
171
  get {
169
172
  return { () -> [SDK]? in
170
- if let __unwrapped = self.__sdks.value {
173
+ if bridge.has_value_std__optional_std__vector_SDK__(self.__sdks) {
174
+ let __unwrapped = bridge.get_std__optional_std__vector_SDK__(self.__sdks)
171
175
  return __unwrapped.map({ __item in __item })
172
176
  } else {
173
177
  return nil
@@ -196,7 +200,8 @@ public extension Purpose {
196
200
  @inline(__always)
197
201
  get {
198
202
  return { () -> String? in
199
- if let __unwrapped = self.__consentStatus.value {
203
+ if bridge.has_value_std__optional_std__string_(self.__consentStatus) {
204
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__consentStatus)
200
205
  return String(__unwrapped)
201
206
  } else {
202
207
  return nil
@@ -218,7 +223,14 @@ public extension Purpose {
218
223
  var disableOptOut: Bool? {
219
224
  @inline(__always)
220
225
  get {
221
- return self.__disableOptOut.value
226
+ return { () -> Bool? in
227
+ if bridge.has_value_std__optional_bool_(self.__disableOptOut) {
228
+ let __unwrapped = bridge.get_std__optional_bool_(self.__disableOptOut)
229
+ return __unwrapped
230
+ } else {
231
+ return nil
232
+ }
233
+ }()
222
234
  }
223
235
  @inline(__always)
224
236
  set {
@@ -236,7 +248,8 @@ public extension Purpose {
236
248
  @inline(__always)
237
249
  get {
238
250
  return { () -> String? in
239
- if let __unwrapped = self.__optOutText.value {
251
+ if bridge.has_value_std__optional_std__string_(self.__optOutText) {
252
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__optOutText)
240
253
  return String(__unwrapped)
241
254
  } else {
242
255
  return nil
@@ -258,7 +271,14 @@ public extension Purpose {
258
271
  var hideDetails: Bool? {
259
272
  @inline(__always)
260
273
  get {
261
- return self.__hideDetails.value
274
+ return { () -> Bool? in
275
+ if bridge.has_value_std__optional_bool_(self.__hideDetails) {
276
+ let __unwrapped = bridge.get_std__optional_bool_(self.__hideDetails)
277
+ return __unwrapped
278
+ } else {
279
+ return nil
280
+ }
281
+ }()
262
282
  }
263
283
  @inline(__always)
264
284
  set {
@@ -275,7 +295,14 @@ public extension Purpose {
275
295
  var isGADMapped: Bool? {
276
296
  @inline(__always)
277
297
  get {
278
- return self.__isGADMapped.value
298
+ return { () -> Bool? in
299
+ if bridge.has_value_std__optional_bool_(self.__isGADMapped) {
300
+ let __unwrapped = bridge.get_std__optional_bool_(self.__isGADMapped)
301
+ return __unwrapped
302
+ } else {
303
+ return nil
304
+ }
305
+ }()
279
306
  }
280
307
  @inline(__always)
281
308
  set {
@@ -293,7 +320,8 @@ public extension Purpose {
293
320
  @inline(__always)
294
321
  get {
295
322
  return { () -> String? in
296
- if let __unwrapped = self.__gadDescription.value {
323
+ if bridge.has_value_std__optional_std__string_(self.__gadDescription) {
324
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__gadDescription)
297
325
  return String(__unwrapped)
298
326
  } else {
299
327
  return nil
@@ -315,7 +343,14 @@ public extension Purpose {
315
343
  var isATTMapped: Bool? {
316
344
  @inline(__always)
317
345
  get {
318
- return self.__isATTMapped.value
346
+ return { () -> Bool? in
347
+ if bridge.has_value_std__optional_bool_(self.__isATTMapped) {
348
+ let __unwrapped = bridge.get_std__optional_bool_(self.__isATTMapped)
349
+ return __unwrapped
350
+ } else {
351
+ return nil
352
+ }
353
+ }()
319
354
  }
320
355
  @inline(__always)
321
356
  set {
@@ -333,7 +368,8 @@ public extension Purpose {
333
368
  @inline(__always)
334
369
  get {
335
370
  return { () -> String? in
336
- if let __unwrapped = self.__attDescription.value {
371
+ if bridge.has_value_std__optional_std__string_(self.__attDescription) {
372
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__attDescription)
337
373
  return String(__unwrapped)
338
374
  } else {
339
375
  return nil
@@ -5,6 +5,7 @@
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
+ import Foundation
8
9
  import NitroModules
9
10
 
10
11
  /**
@@ -5,6 +5,7 @@
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
+ import Foundation
8
9
  import NitroModules
9
10
 
10
11
  /**
@@ -103,7 +104,8 @@ public extension SDK {
103
104
  @inline(__always)
104
105
  get {
105
106
  return { () -> String? in
106
- if let __unwrapped = self.__namespaceId.value {
107
+ if bridge.has_value_std__optional_std__string_(self.__namespaceId) {
108
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__namespaceId)
107
109
  return String(__unwrapped)
108
110
  } else {
109
111
  return nil
@@ -126,7 +128,8 @@ public extension SDK {
126
128
  @inline(__always)
127
129
  get {
128
130
  return { () -> String? in
129
- if let __unwrapped = self.__sdkName.value {
131
+ if bridge.has_value_std__optional_std__string_(self.__sdkName) {
132
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__sdkName)
130
133
  return String(__unwrapped)
131
134
  } else {
132
135
  return nil
@@ -149,7 +152,8 @@ public extension SDK {
149
152
  @inline(__always)
150
153
  get {
151
154
  return { () -> String? in
152
- if let __unwrapped = self.__sdkDescription.value {
155
+ if bridge.has_value_std__optional_std__string_(self.__sdkDescription) {
156
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__sdkDescription)
153
157
  return String(__unwrapped)
154
158
  } else {
155
159
  return nil
@@ -172,7 +176,8 @@ public extension SDK {
172
176
  @inline(__always)
173
177
  get {
174
178
  return { () -> String? in
175
- if let __unwrapped = self.__vendor.value {
179
+ if bridge.has_value_std__optional_std__string_(self.__vendor) {
180
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__vendor)
176
181
  return String(__unwrapped)
177
182
  } else {
178
183
  return nil
@@ -195,7 +200,8 @@ public extension SDK {
195
200
  @inline(__always)
196
201
  get {
197
202
  return { () -> String? in
198
- if let __unwrapped = self.__logoBase64.value {
203
+ if bridge.has_value_std__optional_std__string_(self.__logoBase64) {
204
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__logoBase64)
199
205
  return String(__unwrapped)
200
206
  } else {
201
207
  return nil
@@ -218,7 +224,8 @@ public extension SDK {
218
224
  @inline(__always)
219
225
  get {
220
226
  return { () -> String? in
221
- if let __unwrapped = self.__website.value {
227
+ if bridge.has_value_std__optional_std__string_(self.__website) {
228
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__website)
222
229
  return String(__unwrapped)
223
230
  } else {
224
231
  return nil
@@ -241,7 +248,8 @@ public extension SDK {
241
248
  @inline(__always)
242
249
  get {
243
250
  return { () -> [String]? in
244
- if let __unwrapped = self.__matchedBy.value {
251
+ if bridge.has_value_std__optional_std__vector_std__string__(self.__matchedBy) {
252
+ let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__matchedBy)
245
253
  return __unwrapped.map({ __item in String(__item) })
246
254
  } else {
247
255
  return nil
@@ -269,7 +277,14 @@ public extension SDK {
269
277
  var collectingData: Bool? {
270
278
  @inline(__always)
271
279
  get {
272
- return self.__collectingData.value
280
+ return { () -> Bool? in
281
+ if bridge.has_value_std__optional_bool_(self.__collectingData) {
282
+ let __unwrapped = bridge.get_std__optional_bool_(self.__collectingData)
283
+ return __unwrapped
284
+ } else {
285
+ return nil
286
+ }
287
+ }()
273
288
  }
274
289
  @inline(__always)
275
290
  set {
@@ -5,6 +5,7 @@
5
5
  /// Copyright © 2025 Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
+ import Foundation
8
9
  import NitroModules
9
10
 
10
11
  /**
@@ -62,7 +63,8 @@ public extension SettingsPrompt {
62
63
  @inline(__always)
63
64
  get {
64
65
  return { () -> String? in
65
- if let __unwrapped = self.__promptHeading.value {
66
+ if bridge.has_value_std__optional_std__string_(self.__promptHeading) {
67
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__promptHeading)
66
68
  return String(__unwrapped)
67
69
  } else {
68
70
  return nil
@@ -85,7 +87,8 @@ public extension SettingsPrompt {
85
87
  @inline(__always)
86
88
  get {
87
89
  return { () -> String? in
88
- if let __unwrapped = self.__promptMessage.value {
90
+ if bridge.has_value_std__optional_std__string_(self.__promptMessage) {
91
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__promptMessage)
89
92
  return String(__unwrapped)
90
93
  } else {
91
94
  return nil
@@ -108,7 +111,8 @@ public extension SettingsPrompt {
108
111
  @inline(__always)
109
112
  get {
110
113
  return { () -> String? in
111
- if let __unwrapped = self.__settingsButtonText.value {
114
+ if bridge.has_value_std__optional_std__string_(self.__settingsButtonText) {
115
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__settingsButtonText)
112
116
  return String(__unwrapped)
113
117
  } else {
114
118
  return nil
@@ -131,7 +135,8 @@ public extension SettingsPrompt {
131
135
  @inline(__always)
132
136
  get {
133
137
  return { () -> String? in
134
- if let __unwrapped = self.__notNowButtonText.value {
138
+ if bridge.has_value_std__optional_std__string_(self.__notNowButtonText) {
139
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__notNowButtonText)
135
140
  return String(__unwrapped)
136
141
  } else {
137
142
  return nil
@@ -154,7 +159,8 @@ public extension SettingsPrompt {
154
159
  @inline(__always)
155
160
  get {
156
161
  return { () -> [String]? in
157
- if let __unwrapped = self.__permissions.value {
162
+ if bridge.has_value_std__optional_std__vector_std__string__(self.__permissions) {
163
+ let __unwrapped = bridge.get_std__optional_std__vector_std__string__(self.__permissions)
158
164
  return __unwrapped.map({ __item in String(__item) })
159
165
  } else {
160
166
  return nil
@@ -0,0 +1,18 @@
1
+ ///
2
+ /// Variant_NullType_BannerConfig.swift
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
+ import NitroModules
9
+
10
+ /**
11
+ * An Swift enum with associated values representing a Variant/Union type.
12
+ * JS type: `null | struct`
13
+ */
14
+ @frozen
15
+ public indirect enum Variant_NullType_BannerConfig {
16
+ case first(NullType)
17
+ case second(BannerConfig)
18
+ }
@@ -0,0 +1,18 @@
1
+ ///
2
+ /// Variant_NullType_CmpSDKOptions.swift
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
+ import NitroModules
9
+
10
+ /**
11
+ * An Swift enum with associated values representing a Variant/Union type.
12
+ * JS type: `null | struct`
13
+ */
14
+ @frozen
15
+ public indirect enum Variant_NullType_CmpSDKOptions {
16
+ case first(NullType)
17
+ case second(CmpSDKOptions)
18
+ }
@@ -0,0 +1,18 @@
1
+ ///
2
+ /// Variant_NullType_SettingsPrompt.swift
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
+ import NitroModules
9
+
10
+ /**
11
+ * An Swift enum with associated values representing a Variant/Union type.
12
+ * JS type: `null | struct`
13
+ */
14
+ @frozen
15
+ public indirect enum Variant_NullType_SettingsPrompt {
16
+ case first(NullType)
17
+ case second(SettingsPrompt)
18
+ }
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -49,14 +54,12 @@ namespace margelo::nitro::securiticonsentsdk {
49
54
 
50
55
  namespace margelo::nitro {
51
56
 
52
- using namespace margelo::nitro::securiticonsentsdk;
53
-
54
57
  // C++ AppPermission <> JS AppPermission (object)
55
58
  template <>
56
- struct JSIConverter<AppPermission> final {
57
- static inline AppPermission fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
59
+ struct JSIConverter<margelo::nitro::securiticonsentsdk::AppPermission> final {
60
+ static inline margelo::nitro::securiticonsentsdk::AppPermission fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
61
  jsi::Object obj = arg.asObject(runtime);
59
- return AppPermission(
62
+ return margelo::nitro::securiticonsentsdk::AppPermission(
60
63
  JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "id")),
61
64
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "name")),
62
65
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "permissionId")),
@@ -68,7 +71,7 @@ namespace margelo::nitro {
68
71
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "isSettingsPromptEnabled"))
69
72
  );
70
73
  }
71
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const AppPermission& arg) {
74
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::securiticonsentsdk::AppPermission& arg) {
72
75
  jsi::Object obj(runtime);
73
76
  obj.setProperty(runtime, "id", JSIConverter<std::optional<double>>::toJSI(runtime, arg.id));
74
77
  obj.setProperty(runtime, "name", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.name));
@@ -86,6 +89,9 @@ namespace margelo::nitro {
86
89
  return false;
87
90
  }
88
91
  jsi::Object obj = value.getObject(runtime);
92
+ if (!nitro::isPlainObject(runtime, obj)) {
93
+ return false;
94
+ }
89
95
  if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
90
96
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "name"))) return false;
91
97
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "permissionId"))) return false;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
  // Forward declaration of `CustomColors` to properly resolve imports.
22
27
  namespace margelo::nitro::securiticonsentsdk { struct CustomColors; }
@@ -75,14 +80,12 @@ namespace margelo::nitro::securiticonsentsdk {
75
80
 
76
81
  namespace margelo::nitro {
77
82
 
78
- using namespace margelo::nitro::securiticonsentsdk;
79
-
80
83
  // C++ BannerConfig <> JS BannerConfig (object)
81
84
  template <>
82
- struct JSIConverter<BannerConfig> final {
83
- static inline BannerConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
85
+ struct JSIConverter<margelo::nitro::securiticonsentsdk::BannerConfig> final {
86
+ static inline margelo::nitro::securiticonsentsdk::BannerConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
84
87
  jsi::Object obj = arg.asObject(runtime);
85
- return BannerConfig(
88
+ return margelo::nitro::securiticonsentsdk::BannerConfig(
86
89
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "hideCloseButton")),
87
90
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "hideAcceptButton")),
88
91
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "embedDSRPortalLink")),
@@ -112,12 +115,12 @@ namespace margelo::nitro {
112
115
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bannerPosition")),
113
116
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "buttonShape")),
114
117
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "companyLogo")),
115
- JSIConverter<std::optional<CustomColors>>::fromJSI(runtime, obj.getProperty(runtime, "customPaletteTheme")),
118
+ JSIConverter<std::optional<margelo::nitro::securiticonsentsdk::CustomColors>>::fromJSI(runtime, obj.getProperty(runtime, "customPaletteTheme")),
116
119
  JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "shouldShowSettingsPrompt")),
117
120
  JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, "translations"))
118
121
  );
119
122
  }
120
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const BannerConfig& arg) {
123
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::securiticonsentsdk::BannerConfig& arg) {
121
124
  jsi::Object obj(runtime);
122
125
  obj.setProperty(runtime, "hideCloseButton", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.hideCloseButton));
123
126
  obj.setProperty(runtime, "hideAcceptButton", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.hideAcceptButton));
@@ -148,7 +151,7 @@ namespace margelo::nitro {
148
151
  obj.setProperty(runtime, "bannerPosition", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bannerPosition));
149
152
  obj.setProperty(runtime, "buttonShape", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.buttonShape));
150
153
  obj.setProperty(runtime, "companyLogo", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.companyLogo));
151
- obj.setProperty(runtime, "customPaletteTheme", JSIConverter<std::optional<CustomColors>>::toJSI(runtime, arg.customPaletteTheme));
154
+ obj.setProperty(runtime, "customPaletteTheme", JSIConverter<std::optional<margelo::nitro::securiticonsentsdk::CustomColors>>::toJSI(runtime, arg.customPaletteTheme));
152
155
  obj.setProperty(runtime, "shouldShowSettingsPrompt", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.shouldShowSettingsPrompt));
153
156
  obj.setProperty(runtime, "translations", JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::toJSI(runtime, arg.translations));
154
157
  return obj;
@@ -158,6 +161,9 @@ namespace margelo::nitro {
158
161
  return false;
159
162
  }
160
163
  jsi::Object obj = value.getObject(runtime);
164
+ if (!nitro::isPlainObject(runtime, obj)) {
165
+ return false;
166
+ }
161
167
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "hideCloseButton"))) return false;
162
168
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "hideAcceptButton"))) return false;
163
169
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "embedDSRPortalLink"))) return false;
@@ -187,7 +193,7 @@ namespace margelo::nitro {
187
193
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bannerPosition"))) return false;
188
194
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "buttonShape"))) return false;
189
195
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "companyLogo"))) return false;
190
- if (!JSIConverter<std::optional<CustomColors>>::canConvert(runtime, obj.getProperty(runtime, "customPaletteTheme"))) return false;
196
+ if (!JSIConverter<std::optional<margelo::nitro::securiticonsentsdk::CustomColors>>::canConvert(runtime, obj.getProperty(runtime, "customPaletteTheme"))) return false;
191
197
  if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "shouldShowSettingsPrompt"))) return false;
192
198
  if (!JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::canConvert(runtime, obj.getProperty(runtime, "translations"))) return false;
193
199
  return true;
@@ -17,6 +17,11 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
@@ -51,14 +56,12 @@ namespace margelo::nitro::securiticonsentsdk {
51
56
 
52
57
  namespace margelo::nitro {
53
58
 
54
- using namespace margelo::nitro::securiticonsentsdk;
55
-
56
59
  // C++ CmpSDKOptions <> JS CmpSDKOptions (object)
57
60
  template <>
58
- struct JSIConverter<CmpSDKOptions> final {
59
- static inline CmpSDKOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
61
+ struct JSIConverter<margelo::nitro::securiticonsentsdk::CmpSDKOptions> final {
62
+ static inline margelo::nitro::securiticonsentsdk::CmpSDKOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
60
63
  jsi::Object obj = arg.asObject(runtime);
61
- return CmpSDKOptions(
64
+ return margelo::nitro::securiticonsentsdk::CmpSDKOptions(
62
65
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "appURL")),
63
66
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cdnURL")),
64
67
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "tenantID")),
@@ -72,7 +75,7 @@ namespace margelo::nitro {
72
75
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "mode"))
73
76
  );
74
77
  }
75
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const CmpSDKOptions& arg) {
78
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::securiticonsentsdk::CmpSDKOptions& arg) {
76
79
  jsi::Object obj(runtime);
77
80
  obj.setProperty(runtime, "appURL", JSIConverter<std::string>::toJSI(runtime, arg.appURL));
78
81
  obj.setProperty(runtime, "cdnURL", JSIConverter<std::string>::toJSI(runtime, arg.cdnURL));
@@ -92,6 +95,9 @@ namespace margelo::nitro {
92
95
  return false;
93
96
  }
94
97
  jsi::Object obj = value.getObject(runtime);
98
+ if (!nitro::isPlainObject(runtime, obj)) {
99
+ return false;
100
+ }
95
101
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "appURL"))) return false;
96
102
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cdnURL"))) return false;
97
103
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "tenantID"))) return false;
@@ -17,11 +17,16 @@
17
17
  #else
18
18
  #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
19
  #endif
20
+ #if __has_include(<NitroModules/JSIHelpers.hpp>)
21
+ #include <NitroModules/JSIHelpers.hpp>
22
+ #else
23
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
24
+ #endif
20
25
 
21
26
 
22
27
 
23
- #include <optional>
24
28
  #include <string>
29
+ #include <optional>
25
30
 
26
31
  namespace margelo::nitro::securiticonsentsdk {
27
32
 
@@ -48,14 +53,12 @@ namespace margelo::nitro::securiticonsentsdk {
48
53
 
49
54
  namespace margelo::nitro {
50
55
 
51
- using namespace margelo::nitro::securiticonsentsdk;
52
-
53
56
  // C++ CustomColors <> JS CustomColors (object)
54
57
  template <>
55
- struct JSIConverter<CustomColors> final {
56
- static inline CustomColors fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
58
+ struct JSIConverter<margelo::nitro::securiticonsentsdk::CustomColors> final {
59
+ static inline margelo::nitro::securiticonsentsdk::CustomColors fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
57
60
  jsi::Object obj = arg.asObject(runtime);
58
- return CustomColors(
61
+ return margelo::nitro::securiticonsentsdk::CustomColors(
59
62
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "buttonBackground")),
60
63
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "buttonText")),
61
64
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "buttonBorder")),
@@ -66,7 +69,7 @@ namespace margelo::nitro {
66
69
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "preferenceCenterFooterSelector"))
67
70
  );
68
71
  }
69
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const CustomColors& arg) {
72
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::securiticonsentsdk::CustomColors& arg) {
70
73
  jsi::Object obj(runtime);
71
74
  obj.setProperty(runtime, "buttonBackground", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.buttonBackground));
72
75
  obj.setProperty(runtime, "buttonText", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.buttonText));
@@ -83,6 +86,9 @@ namespace margelo::nitro {
83
86
  return false;
84
87
  }
85
88
  jsi::Object obj = value.getObject(runtime);
89
+ if (!nitro::isPlainObject(runtime, obj)) {
90
+ return false;
91
+ }
86
92
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "buttonBackground"))) return false;
87
93
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "buttonText"))) return false;
88
94
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "buttonBorder"))) return false;
@@ -27,6 +27,7 @@ namespace margelo::nitro::securiticonsentsdk {
27
27
  prototype.registerHybridMethod("getSdksInPurpose", &HybridConsentSDKSpec::getSdksInPurpose);
28
28
  prototype.registerHybridMethod("setPurposeConsent", &HybridConsentSDKSpec::setPurposeConsent);
29
29
  prototype.registerHybridMethod("setPermissionConsent", &HybridConsentSDKSpec::setPermissionConsent);
30
+ prototype.registerHybridMethod("getGCMConsents", &HybridConsentSDKSpec::getGCMConsents);
30
31
  prototype.registerHybridMethod("getBannerConfig", &HybridConsentSDKSpec::getBannerConfig);
31
32
  prototype.registerHybridMethod("options", &HybridConsentSDKSpec::options);
32
33
  prototype.registerHybridMethod("getSettingsPrompt", &HybridConsentSDKSpec::getSettingsPrompt);
@@ -30,14 +30,16 @@ namespace margelo::nitro::securiticonsentsdk { struct PostConsentsRequest; }
30
30
 
31
31
  #include "CmpSDKOptions.hpp"
32
32
  #include <functional>
33
- #include <NitroModules/Promise.hpp>
34
33
  #include <string>
35
- #include <vector>
34
+ #include <NitroModules/Promise.hpp>
36
35
  #include "AppPermission.hpp"
36
+ #include <vector>
37
37
  #include "Purpose.hpp"
38
38
  #include "SDK.hpp"
39
- #include <optional>
39
+ #include <unordered_map>
40
+ #include <NitroModules/Null.hpp>
40
41
  #include "BannerConfig.hpp"
42
+ #include <variant>
41
43
  #include "SettingsPrompt.hpp"
42
44
  #include "PostConsentsRequest.hpp"
43
45
 
@@ -85,9 +87,10 @@ namespace margelo::nitro::securiticonsentsdk {
85
87
  virtual std::shared_ptr<Promise<std::vector<SDK>>> getSdksInPurpose(double purposeId) = 0;
86
88
  virtual bool setPurposeConsent(const Purpose& purpose, const std::string& consent) = 0;
87
89
  virtual bool setPermissionConsent(const AppPermission& permission, const std::string& consent) = 0;
88
- virtual std::shared_ptr<Promise<std::optional<BannerConfig>>> getBannerConfig() = 0;
89
- virtual std::optional<CmpSDKOptions> options() = 0;
90
- virtual std::shared_ptr<Promise<std::optional<SettingsPrompt>>> getSettingsPrompt() = 0;
90
+ virtual std::shared_ptr<Promise<std::unordered_map<std::string, std::string>>> getGCMConsents() = 0;
91
+ virtual std::shared_ptr<Promise<std::variant<nitro::NullType, BannerConfig>>> getBannerConfig() = 0;
92
+ virtual std::variant<nitro::NullType, CmpSDKOptions> options() = 0;
93
+ virtual std::shared_ptr<Promise<std::variant<nitro::NullType, SettingsPrompt>>> getSettingsPrompt() = 0;
91
94
  virtual std::shared_ptr<Promise<bool>> uploadConsents(const PostConsentsRequest& request) = 0;
92
95
 
93
96
  protected: