securiti-consent-sdk 1.132.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.
- package/NitroSecuritiConsentSdk.podspec +37 -0
- package/README.md +45 -0
- package/android/CMakeLists.txt +29 -0
- package/android/build.gradle +146 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/securiticonsentsdk/HybridConsentSDK.kt +669 -0
- package/android/src/main/java/com/margelo/nitro/securiticonsentsdk/NitroSecuritiConsentSdkPackage.java +33 -0
- package/ios/Bridge.h +10 -0
- package/ios/HybridConsentSDK.swift +640 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdk+autolinking.cmake +78 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdk+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdkOnLoad.cpp +48 -0
- package/nitrogen/generated/android/NitroSecuritiConsentSdkOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JAppPermission.hpp +86 -0
- package/nitrogen/generated/android/c++/JBannerConfig.hpp +194 -0
- package/nitrogen/generated/android/c++/JCmpSDKOptions.hpp +94 -0
- package/nitrogen/generated/android/c++/JCustomColors.hpp +82 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +74 -0
- package/nitrogen/generated/android/c++/JHybridConsentSDKSpec.cpp +277 -0
- package/nitrogen/generated/android/c++/JHybridConsentSDKSpec.hpp +78 -0
- package/nitrogen/generated/android/c++/JPermissionConsent.hpp +61 -0
- package/nitrogen/generated/android/c++/JPostConsentsRequest.hpp +137 -0
- package/nitrogen/generated/android/c++/JPurpose.hpp +118 -0
- package/nitrogen/generated/android/c++/JPurposeConsent.hpp +65 -0
- package/nitrogen/generated/android/c++/JSDK.hpp +104 -0
- package/nitrogen/generated/android/c++/JSettingsPrompt.hpp +88 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/AppPermission.kt +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/BannerConfig.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/CmpSDKOptions.kt +36 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/CustomColors.kt +33 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Func_void_bool.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/HybridConsentSDKSpec.kt +121 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/NitroSecuritiConsentSdkOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PermissionConsent.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PostConsentsRequest.kt +37 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/Purpose.kt +37 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/PurposeConsent.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/SDK.kt +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/securiticonsentsdk/SettingsPrompt.kt +30 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Bridge.cpp +96 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Bridge.hpp +604 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdk-Swift-Cxx-Umbrella.hpp +78 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdkAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroSecuritiConsentSdkAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridConsentSDKSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridConsentSDKSpecSwift.hpp +223 -0
- package/nitrogen/generated/ios/swift/AppPermission.swift +267 -0
- package/nitrogen/generated/ios/swift/BannerConfig.swift +918 -0
- package/nitrogen/generated/ios/swift/CmpSDKOptions.swift +217 -0
- package/nitrogen/generated/ios/swift/CustomColors.swift +256 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_BannerConfig_.swift +52 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_SettingsPrompt_.swift +52 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_AppPermission_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_Purpose_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_SDK_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridConsentSDKSpec.swift +64 -0
- package/nitrogen/generated/ios/swift/HybridConsentSDKSpec_cxx.swift +398 -0
- package/nitrogen/generated/ios/swift/PermissionConsent.swift +57 -0
- package/nitrogen/generated/ios/swift/PostConsentsRequest.swift +216 -0
- package/nitrogen/generated/ios/swift/Purpose.swift +354 -0
- package/nitrogen/generated/ios/swift/PurposeConsent.swift +68 -0
- package/nitrogen/generated/ios/swift/SDK.swift +285 -0
- package/nitrogen/generated/ios/swift/SettingsPrompt.swift +181 -0
- package/nitrogen/generated/shared/c++/AppPermission.hpp +102 -0
- package/nitrogen/generated/shared/c++/BannerConfig.hpp +197 -0
- package/nitrogen/generated/shared/c++/CmpSDKOptions.hpp +110 -0
- package/nitrogen/generated/shared/c++/CustomColors.hpp +98 -0
- package/nitrogen/generated/shared/c++/HybridConsentSDKSpec.cpp +37 -0
- package/nitrogen/generated/shared/c++/HybridConsentSDKSpec.hpp +102 -0
- package/nitrogen/generated/shared/c++/PermissionConsent.hpp +77 -0
- package/nitrogen/generated/shared/c++/PostConsentsRequest.hpp +120 -0
- package/nitrogen/generated/shared/c++/Purpose.hpp +117 -0
- package/nitrogen/generated/shared/c++/PurposeConsent.hpp +81 -0
- package/nitrogen/generated/shared/c++/SDK.hpp +103 -0
- package/nitrogen/generated/shared/c++/SettingsPrompt.hpp +87 -0
- package/package.json +107 -0
- package/react-native.config.js +16 -0
- package/src/ConsentSDK.nitro.ts +232 -0
- package/src/index.ts +133 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// BannerConfig.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
// Forward declaration of `CustomColors` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::securiticonsentsdk { struct CustomColors; }
|
|
23
|
+
|
|
24
|
+
#include <optional>
|
|
25
|
+
#include <string>
|
|
26
|
+
#include "CustomColors.hpp"
|
|
27
|
+
#include <unordered_map>
|
|
28
|
+
|
|
29
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A struct which can be represented as a JavaScript object (BannerConfig).
|
|
33
|
+
*/
|
|
34
|
+
struct BannerConfig {
|
|
35
|
+
public:
|
|
36
|
+
std::optional<bool> hideCloseButton SWIFT_PRIVATE;
|
|
37
|
+
std::optional<bool> hideAcceptButton SWIFT_PRIVATE;
|
|
38
|
+
std::optional<bool> embedDSRPortalLink SWIFT_PRIVATE;
|
|
39
|
+
std::optional<bool> recordConsentUponAppStart SWIFT_PRIVATE;
|
|
40
|
+
std::optional<bool> hideToggleForEssentialCategories SWIFT_PRIVATE;
|
|
41
|
+
std::optional<std::string> name SWIFT_PRIVATE;
|
|
42
|
+
std::optional<std::string> dsrPortalLink SWIFT_PRIVATE;
|
|
43
|
+
std::optional<std::string> complianceType SWIFT_PRIVATE;
|
|
44
|
+
std::optional<std::string> bannerReappearanceTime SWIFT_PRIVATE;
|
|
45
|
+
std::optional<std::string> privacyNoticeLink SWIFT_PRIVATE;
|
|
46
|
+
std::optional<std::string> accept SWIFT_PRIVATE;
|
|
47
|
+
std::optional<std::string> reject SWIFT_PRIVATE;
|
|
48
|
+
std::optional<std::string> bannerText SWIFT_PRIVATE;
|
|
49
|
+
std::optional<std::string> bannerHeading SWIFT_PRIVATE;
|
|
50
|
+
std::optional<std::string> sdkTabHeading SWIFT_PRIVATE;
|
|
51
|
+
std::optional<std::string> privacyNoticeText SWIFT_PRIVATE;
|
|
52
|
+
std::optional<std::string> preferenceCenterLink SWIFT_PRIVATE;
|
|
53
|
+
std::optional<std::string> permissionsTabHeading SWIFT_PRIVATE;
|
|
54
|
+
std::optional<std::string> permissionsTabGuidance SWIFT_PRIVATE;
|
|
55
|
+
std::optional<std::string> preferenceCenterHeading SWIFT_PRIVATE;
|
|
56
|
+
std::optional<std::string> preferenceCenterGuidance SWIFT_PRIVATE;
|
|
57
|
+
std::optional<std::string> permissionsTabDescription SWIFT_PRIVATE;
|
|
58
|
+
std::optional<std::string> preferenceCenterDescription SWIFT_PRIVATE;
|
|
59
|
+
std::optional<bool> showPoweredBySecuritiLogo SWIFT_PRIVATE;
|
|
60
|
+
std::optional<bool> showDescriptionTextWithPrefCenterToggle SWIFT_PRIVATE;
|
|
61
|
+
std::optional<double> paletteTheme SWIFT_PRIVATE;
|
|
62
|
+
std::optional<std::string> bannerPosition SWIFT_PRIVATE;
|
|
63
|
+
std::optional<std::string> buttonShape SWIFT_PRIVATE;
|
|
64
|
+
std::optional<std::string> companyLogo SWIFT_PRIVATE;
|
|
65
|
+
std::optional<CustomColors> customPaletteTheme SWIFT_PRIVATE;
|
|
66
|
+
std::optional<bool> shouldShowSettingsPrompt SWIFT_PRIVATE;
|
|
67
|
+
std::optional<std::unordered_map<std::string, std::string>> translations SWIFT_PRIVATE;
|
|
68
|
+
|
|
69
|
+
public:
|
|
70
|
+
BannerConfig() = default;
|
|
71
|
+
explicit BannerConfig(std::optional<bool> hideCloseButton, std::optional<bool> hideAcceptButton, std::optional<bool> embedDSRPortalLink, std::optional<bool> recordConsentUponAppStart, std::optional<bool> hideToggleForEssentialCategories, std::optional<std::string> name, std::optional<std::string> dsrPortalLink, std::optional<std::string> complianceType, std::optional<std::string> bannerReappearanceTime, std::optional<std::string> privacyNoticeLink, std::optional<std::string> accept, std::optional<std::string> reject, std::optional<std::string> bannerText, std::optional<std::string> bannerHeading, std::optional<std::string> sdkTabHeading, std::optional<std::string> privacyNoticeText, std::optional<std::string> preferenceCenterLink, std::optional<std::string> permissionsTabHeading, std::optional<std::string> permissionsTabGuidance, std::optional<std::string> preferenceCenterHeading, std::optional<std::string> preferenceCenterGuidance, std::optional<std::string> permissionsTabDescription, std::optional<std::string> preferenceCenterDescription, std::optional<bool> showPoweredBySecuritiLogo, std::optional<bool> showDescriptionTextWithPrefCenterToggle, std::optional<double> paletteTheme, std::optional<std::string> bannerPosition, std::optional<std::string> buttonShape, std::optional<std::string> companyLogo, std::optional<CustomColors> customPaletteTheme, std::optional<bool> shouldShowSettingsPrompt, std::optional<std::unordered_map<std::string, std::string>> translations): hideCloseButton(hideCloseButton), hideAcceptButton(hideAcceptButton), embedDSRPortalLink(embedDSRPortalLink), recordConsentUponAppStart(recordConsentUponAppStart), hideToggleForEssentialCategories(hideToggleForEssentialCategories), name(name), dsrPortalLink(dsrPortalLink), complianceType(complianceType), bannerReappearanceTime(bannerReappearanceTime), privacyNoticeLink(privacyNoticeLink), accept(accept), reject(reject), bannerText(bannerText), bannerHeading(bannerHeading), sdkTabHeading(sdkTabHeading), privacyNoticeText(privacyNoticeText), preferenceCenterLink(preferenceCenterLink), permissionsTabHeading(permissionsTabHeading), permissionsTabGuidance(permissionsTabGuidance), preferenceCenterHeading(preferenceCenterHeading), preferenceCenterGuidance(preferenceCenterGuidance), permissionsTabDescription(permissionsTabDescription), preferenceCenterDescription(preferenceCenterDescription), showPoweredBySecuritiLogo(showPoweredBySecuritiLogo), showDescriptionTextWithPrefCenterToggle(showDescriptionTextWithPrefCenterToggle), paletteTheme(paletteTheme), bannerPosition(bannerPosition), buttonShape(buttonShape), companyLogo(companyLogo), customPaletteTheme(customPaletteTheme), shouldShowSettingsPrompt(shouldShowSettingsPrompt), translations(translations) {}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
75
|
+
|
|
76
|
+
namespace margelo::nitro {
|
|
77
|
+
|
|
78
|
+
using namespace margelo::nitro::securiticonsentsdk;
|
|
79
|
+
|
|
80
|
+
// C++ BannerConfig <> JS BannerConfig (object)
|
|
81
|
+
template <>
|
|
82
|
+
struct JSIConverter<BannerConfig> final {
|
|
83
|
+
static inline BannerConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
84
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
85
|
+
return BannerConfig(
|
|
86
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "hideCloseButton")),
|
|
87
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "hideAcceptButton")),
|
|
88
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "embedDSRPortalLink")),
|
|
89
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "recordConsentUponAppStart")),
|
|
90
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "hideToggleForEssentialCategories")),
|
|
91
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "name")),
|
|
92
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "dsrPortalLink")),
|
|
93
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "complianceType")),
|
|
94
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bannerReappearanceTime")),
|
|
95
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "privacyNoticeLink")),
|
|
96
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "accept")),
|
|
97
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "reject")),
|
|
98
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bannerText")),
|
|
99
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bannerHeading")),
|
|
100
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "sdkTabHeading")),
|
|
101
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "privacyNoticeText")),
|
|
102
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "preferenceCenterLink")),
|
|
103
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "permissionsTabHeading")),
|
|
104
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "permissionsTabGuidance")),
|
|
105
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "preferenceCenterHeading")),
|
|
106
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "preferenceCenterGuidance")),
|
|
107
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "permissionsTabDescription")),
|
|
108
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "preferenceCenterDescription")),
|
|
109
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "showPoweredBySecuritiLogo")),
|
|
110
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "showDescriptionTextWithPrefCenterToggle")),
|
|
111
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "paletteTheme")),
|
|
112
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bannerPosition")),
|
|
113
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "buttonShape")),
|
|
114
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "companyLogo")),
|
|
115
|
+
JSIConverter<std::optional<CustomColors>>::fromJSI(runtime, obj.getProperty(runtime, "customPaletteTheme")),
|
|
116
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, "shouldShowSettingsPrompt")),
|
|
117
|
+
JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, "translations"))
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const BannerConfig& arg) {
|
|
121
|
+
jsi::Object obj(runtime);
|
|
122
|
+
obj.setProperty(runtime, "hideCloseButton", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.hideCloseButton));
|
|
123
|
+
obj.setProperty(runtime, "hideAcceptButton", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.hideAcceptButton));
|
|
124
|
+
obj.setProperty(runtime, "embedDSRPortalLink", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.embedDSRPortalLink));
|
|
125
|
+
obj.setProperty(runtime, "recordConsentUponAppStart", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.recordConsentUponAppStart));
|
|
126
|
+
obj.setProperty(runtime, "hideToggleForEssentialCategories", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.hideToggleForEssentialCategories));
|
|
127
|
+
obj.setProperty(runtime, "name", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.name));
|
|
128
|
+
obj.setProperty(runtime, "dsrPortalLink", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.dsrPortalLink));
|
|
129
|
+
obj.setProperty(runtime, "complianceType", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.complianceType));
|
|
130
|
+
obj.setProperty(runtime, "bannerReappearanceTime", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bannerReappearanceTime));
|
|
131
|
+
obj.setProperty(runtime, "privacyNoticeLink", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.privacyNoticeLink));
|
|
132
|
+
obj.setProperty(runtime, "accept", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accept));
|
|
133
|
+
obj.setProperty(runtime, "reject", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.reject));
|
|
134
|
+
obj.setProperty(runtime, "bannerText", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bannerText));
|
|
135
|
+
obj.setProperty(runtime, "bannerHeading", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bannerHeading));
|
|
136
|
+
obj.setProperty(runtime, "sdkTabHeading", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.sdkTabHeading));
|
|
137
|
+
obj.setProperty(runtime, "privacyNoticeText", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.privacyNoticeText));
|
|
138
|
+
obj.setProperty(runtime, "preferenceCenterLink", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.preferenceCenterLink));
|
|
139
|
+
obj.setProperty(runtime, "permissionsTabHeading", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.permissionsTabHeading));
|
|
140
|
+
obj.setProperty(runtime, "permissionsTabGuidance", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.permissionsTabGuidance));
|
|
141
|
+
obj.setProperty(runtime, "preferenceCenterHeading", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.preferenceCenterHeading));
|
|
142
|
+
obj.setProperty(runtime, "preferenceCenterGuidance", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.preferenceCenterGuidance));
|
|
143
|
+
obj.setProperty(runtime, "permissionsTabDescription", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.permissionsTabDescription));
|
|
144
|
+
obj.setProperty(runtime, "preferenceCenterDescription", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.preferenceCenterDescription));
|
|
145
|
+
obj.setProperty(runtime, "showPoweredBySecuritiLogo", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.showPoweredBySecuritiLogo));
|
|
146
|
+
obj.setProperty(runtime, "showDescriptionTextWithPrefCenterToggle", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.showDescriptionTextWithPrefCenterToggle));
|
|
147
|
+
obj.setProperty(runtime, "paletteTheme", JSIConverter<std::optional<double>>::toJSI(runtime, arg.paletteTheme));
|
|
148
|
+
obj.setProperty(runtime, "bannerPosition", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bannerPosition));
|
|
149
|
+
obj.setProperty(runtime, "buttonShape", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.buttonShape));
|
|
150
|
+
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));
|
|
152
|
+
obj.setProperty(runtime, "shouldShowSettingsPrompt", JSIConverter<std::optional<bool>>::toJSI(runtime, arg.shouldShowSettingsPrompt));
|
|
153
|
+
obj.setProperty(runtime, "translations", JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::toJSI(runtime, arg.translations));
|
|
154
|
+
return obj;
|
|
155
|
+
}
|
|
156
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
157
|
+
if (!value.isObject()) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
jsi::Object obj = value.getObject(runtime);
|
|
161
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "hideCloseButton"))) return false;
|
|
162
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "hideAcceptButton"))) return false;
|
|
163
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "embedDSRPortalLink"))) return false;
|
|
164
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "recordConsentUponAppStart"))) return false;
|
|
165
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "hideToggleForEssentialCategories"))) return false;
|
|
166
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "name"))) return false;
|
|
167
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "dsrPortalLink"))) return false;
|
|
168
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "complianceType"))) return false;
|
|
169
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bannerReappearanceTime"))) return false;
|
|
170
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "privacyNoticeLink"))) return false;
|
|
171
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "accept"))) return false;
|
|
172
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "reject"))) return false;
|
|
173
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bannerText"))) return false;
|
|
174
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bannerHeading"))) return false;
|
|
175
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "sdkTabHeading"))) return false;
|
|
176
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "privacyNoticeText"))) return false;
|
|
177
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "preferenceCenterLink"))) return false;
|
|
178
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "permissionsTabHeading"))) return false;
|
|
179
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "permissionsTabGuidance"))) return false;
|
|
180
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "preferenceCenterHeading"))) return false;
|
|
181
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "preferenceCenterGuidance"))) return false;
|
|
182
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "permissionsTabDescription"))) return false;
|
|
183
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "preferenceCenterDescription"))) return false;
|
|
184
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "showPoweredBySecuritiLogo"))) return false;
|
|
185
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "showDescriptionTextWithPrefCenterToggle"))) return false;
|
|
186
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "paletteTheme"))) return false;
|
|
187
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bannerPosition"))) return false;
|
|
188
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "buttonShape"))) return false;
|
|
189
|
+
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;
|
|
191
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, "shouldShowSettingsPrompt"))) return false;
|
|
192
|
+
if (!JSIConverter<std::optional<std::unordered_map<std::string, std::string>>>::canConvert(runtime, obj.getProperty(runtime, "translations"))) return false;
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CmpSDKOptions.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#include <string>
|
|
24
|
+
#include <optional>
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (CmpSDKOptions).
|
|
30
|
+
*/
|
|
31
|
+
struct CmpSDKOptions {
|
|
32
|
+
public:
|
|
33
|
+
std::string appURL SWIFT_PRIVATE;
|
|
34
|
+
std::string cdnURL SWIFT_PRIVATE;
|
|
35
|
+
std::string tenantID SWIFT_PRIVATE;
|
|
36
|
+
std::string appID SWIFT_PRIVATE;
|
|
37
|
+
bool testingMode SWIFT_PRIVATE;
|
|
38
|
+
std::string loggerLevel SWIFT_PRIVATE;
|
|
39
|
+
double consentsCheckInterval SWIFT_PRIVATE;
|
|
40
|
+
std::optional<std::string> subjectId SWIFT_PRIVATE;
|
|
41
|
+
std::optional<std::string> languageCode SWIFT_PRIVATE;
|
|
42
|
+
std::optional<std::string> locationCode SWIFT_PRIVATE;
|
|
43
|
+
std::optional<std::string> mode SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
CmpSDKOptions() = default;
|
|
47
|
+
explicit CmpSDKOptions(std::string appURL, std::string cdnURL, std::string tenantID, std::string appID, bool testingMode, std::string loggerLevel, double consentsCheckInterval, std::optional<std::string> subjectId, std::optional<std::string> languageCode, std::optional<std::string> locationCode, std::optional<std::string> mode): appURL(appURL), cdnURL(cdnURL), tenantID(tenantID), appID(appID), testingMode(testingMode), loggerLevel(loggerLevel), consentsCheckInterval(consentsCheckInterval), subjectId(subjectId), languageCode(languageCode), locationCode(locationCode), mode(mode) {}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
51
|
+
|
|
52
|
+
namespace margelo::nitro {
|
|
53
|
+
|
|
54
|
+
using namespace margelo::nitro::securiticonsentsdk;
|
|
55
|
+
|
|
56
|
+
// C++ CmpSDKOptions <> JS CmpSDKOptions (object)
|
|
57
|
+
template <>
|
|
58
|
+
struct JSIConverter<CmpSDKOptions> final {
|
|
59
|
+
static inline CmpSDKOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
60
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
61
|
+
return CmpSDKOptions(
|
|
62
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "appURL")),
|
|
63
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cdnURL")),
|
|
64
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "tenantID")),
|
|
65
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "appID")),
|
|
66
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "testingMode")),
|
|
67
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "loggerLevel")),
|
|
68
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "consentsCheckInterval")),
|
|
69
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "subjectId")),
|
|
70
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "languageCode")),
|
|
71
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "locationCode")),
|
|
72
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "mode"))
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const CmpSDKOptions& arg) {
|
|
76
|
+
jsi::Object obj(runtime);
|
|
77
|
+
obj.setProperty(runtime, "appURL", JSIConverter<std::string>::toJSI(runtime, arg.appURL));
|
|
78
|
+
obj.setProperty(runtime, "cdnURL", JSIConverter<std::string>::toJSI(runtime, arg.cdnURL));
|
|
79
|
+
obj.setProperty(runtime, "tenantID", JSIConverter<std::string>::toJSI(runtime, arg.tenantID));
|
|
80
|
+
obj.setProperty(runtime, "appID", JSIConverter<std::string>::toJSI(runtime, arg.appID));
|
|
81
|
+
obj.setProperty(runtime, "testingMode", JSIConverter<bool>::toJSI(runtime, arg.testingMode));
|
|
82
|
+
obj.setProperty(runtime, "loggerLevel", JSIConverter<std::string>::toJSI(runtime, arg.loggerLevel));
|
|
83
|
+
obj.setProperty(runtime, "consentsCheckInterval", JSIConverter<double>::toJSI(runtime, arg.consentsCheckInterval));
|
|
84
|
+
obj.setProperty(runtime, "subjectId", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.subjectId));
|
|
85
|
+
obj.setProperty(runtime, "languageCode", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.languageCode));
|
|
86
|
+
obj.setProperty(runtime, "locationCode", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.locationCode));
|
|
87
|
+
obj.setProperty(runtime, "mode", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.mode));
|
|
88
|
+
return obj;
|
|
89
|
+
}
|
|
90
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
91
|
+
if (!value.isObject()) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
jsi::Object obj = value.getObject(runtime);
|
|
95
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "appURL"))) return false;
|
|
96
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cdnURL"))) return false;
|
|
97
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "tenantID"))) return false;
|
|
98
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "appID"))) return false;
|
|
99
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "testingMode"))) return false;
|
|
100
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "loggerLevel"))) return false;
|
|
101
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "consentsCheckInterval"))) return false;
|
|
102
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "subjectId"))) return false;
|
|
103
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "languageCode"))) return false;
|
|
104
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "locationCode"))) return false;
|
|
105
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "mode"))) return false;
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CustomColors.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#include <optional>
|
|
24
|
+
#include <string>
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A struct which can be represented as a JavaScript object (CustomColors).
|
|
30
|
+
*/
|
|
31
|
+
struct CustomColors {
|
|
32
|
+
public:
|
|
33
|
+
std::optional<std::string> buttonBackground SWIFT_PRIVATE;
|
|
34
|
+
std::optional<std::string> buttonText SWIFT_PRIVATE;
|
|
35
|
+
std::optional<std::string> buttonBorder SWIFT_PRIVATE;
|
|
36
|
+
std::optional<std::string> bannerBackground SWIFT_PRIVATE;
|
|
37
|
+
std::optional<std::string> bannerText SWIFT_PRIVATE;
|
|
38
|
+
std::optional<std::string> bannerLinks SWIFT_PRIVATE;
|
|
39
|
+
std::optional<std::string> preferenceCenterFooterBackground SWIFT_PRIVATE;
|
|
40
|
+
std::optional<std::string> preferenceCenterFooterSelector SWIFT_PRIVATE;
|
|
41
|
+
|
|
42
|
+
public:
|
|
43
|
+
CustomColors() = default;
|
|
44
|
+
explicit CustomColors(std::optional<std::string> buttonBackground, std::optional<std::string> buttonText, std::optional<std::string> buttonBorder, std::optional<std::string> bannerBackground, std::optional<std::string> bannerText, std::optional<std::string> bannerLinks, std::optional<std::string> preferenceCenterFooterBackground, std::optional<std::string> preferenceCenterFooterSelector): buttonBackground(buttonBackground), buttonText(buttonText), buttonBorder(buttonBorder), bannerBackground(bannerBackground), bannerText(bannerText), bannerLinks(bannerLinks), preferenceCenterFooterBackground(preferenceCenterFooterBackground), preferenceCenterFooterSelector(preferenceCenterFooterSelector) {}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
48
|
+
|
|
49
|
+
namespace margelo::nitro {
|
|
50
|
+
|
|
51
|
+
using namespace margelo::nitro::securiticonsentsdk;
|
|
52
|
+
|
|
53
|
+
// C++ CustomColors <> JS CustomColors (object)
|
|
54
|
+
template <>
|
|
55
|
+
struct JSIConverter<CustomColors> final {
|
|
56
|
+
static inline CustomColors fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
57
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
58
|
+
return CustomColors(
|
|
59
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "buttonBackground")),
|
|
60
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "buttonText")),
|
|
61
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "buttonBorder")),
|
|
62
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bannerBackground")),
|
|
63
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bannerText")),
|
|
64
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "bannerLinks")),
|
|
65
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "preferenceCenterFooterBackground")),
|
|
66
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "preferenceCenterFooterSelector"))
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const CustomColors& arg) {
|
|
70
|
+
jsi::Object obj(runtime);
|
|
71
|
+
obj.setProperty(runtime, "buttonBackground", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.buttonBackground));
|
|
72
|
+
obj.setProperty(runtime, "buttonText", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.buttonText));
|
|
73
|
+
obj.setProperty(runtime, "buttonBorder", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.buttonBorder));
|
|
74
|
+
obj.setProperty(runtime, "bannerBackground", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bannerBackground));
|
|
75
|
+
obj.setProperty(runtime, "bannerText", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bannerText));
|
|
76
|
+
obj.setProperty(runtime, "bannerLinks", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bannerLinks));
|
|
77
|
+
obj.setProperty(runtime, "preferenceCenterFooterBackground", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.preferenceCenterFooterBackground));
|
|
78
|
+
obj.setProperty(runtime, "preferenceCenterFooterSelector", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.preferenceCenterFooterSelector));
|
|
79
|
+
return obj;
|
|
80
|
+
}
|
|
81
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
82
|
+
if (!value.isObject()) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
jsi::Object obj = value.getObject(runtime);
|
|
86
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "buttonBackground"))) return false;
|
|
87
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "buttonText"))) return false;
|
|
88
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "buttonBorder"))) return false;
|
|
89
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bannerBackground"))) return false;
|
|
90
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bannerText"))) return false;
|
|
91
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "bannerLinks"))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "preferenceCenterFooterBackground"))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "preferenceCenterFooterSelector"))) return false;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridConsentSDKSpec.cpp
|
|
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
|
+
#include "HybridConsentSDKSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
11
|
+
|
|
12
|
+
void HybridConsentSDKSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("initialize", &HybridConsentSDKSpec::initialize);
|
|
18
|
+
prototype.registerHybridMethod("isSdkReady", &HybridConsentSDKSpec::isSdkReady);
|
|
19
|
+
prototype.registerHybridMethod("presentConsentBanner", &HybridConsentSDKSpec::presentConsentBanner);
|
|
20
|
+
prototype.registerHybridMethod("presentPreferenceCenter", &HybridConsentSDKSpec::presentPreferenceCenter);
|
|
21
|
+
prototype.registerHybridMethod("isReady", &HybridConsentSDKSpec::isReady);
|
|
22
|
+
prototype.registerHybridMethod("resetConsents", &HybridConsentSDKSpec::resetConsents);
|
|
23
|
+
prototype.registerHybridMethod("getConsentByPurposeId", &HybridConsentSDKSpec::getConsentByPurposeId);
|
|
24
|
+
prototype.registerHybridMethod("getConsentByPermissionId", &HybridConsentSDKSpec::getConsentByPermissionId);
|
|
25
|
+
prototype.registerHybridMethod("getPermissions", &HybridConsentSDKSpec::getPermissions);
|
|
26
|
+
prototype.registerHybridMethod("getPurposes", &HybridConsentSDKSpec::getPurposes);
|
|
27
|
+
prototype.registerHybridMethod("getSdksInPurpose", &HybridConsentSDKSpec::getSdksInPurpose);
|
|
28
|
+
prototype.registerHybridMethod("setPurposeConsent", &HybridConsentSDKSpec::setPurposeConsent);
|
|
29
|
+
prototype.registerHybridMethod("setPermissionConsent", &HybridConsentSDKSpec::setPermissionConsent);
|
|
30
|
+
prototype.registerHybridMethod("getBannerConfig", &HybridConsentSDKSpec::getBannerConfig);
|
|
31
|
+
prototype.registerHybridMethod("options", &HybridConsentSDKSpec::options);
|
|
32
|
+
prototype.registerHybridMethod("getSettingsPrompt", &HybridConsentSDKSpec::getSettingsPrompt);
|
|
33
|
+
prototype.registerHybridMethod("uploadConsents", &HybridConsentSDKSpec::uploadConsents);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridConsentSDKSpec.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `CmpSDKOptions` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::securiticonsentsdk { struct CmpSDKOptions; }
|
|
18
|
+
// Forward declaration of `AppPermission` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::securiticonsentsdk { struct AppPermission; }
|
|
20
|
+
// Forward declaration of `Purpose` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::securiticonsentsdk { struct Purpose; }
|
|
22
|
+
// Forward declaration of `SDK` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::securiticonsentsdk { struct SDK; }
|
|
24
|
+
// Forward declaration of `BannerConfig` to properly resolve imports.
|
|
25
|
+
namespace margelo::nitro::securiticonsentsdk { struct BannerConfig; }
|
|
26
|
+
// Forward declaration of `SettingsPrompt` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::securiticonsentsdk { struct SettingsPrompt; }
|
|
28
|
+
// Forward declaration of `PostConsentsRequest` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::securiticonsentsdk { struct PostConsentsRequest; }
|
|
30
|
+
|
|
31
|
+
#include "CmpSDKOptions.hpp"
|
|
32
|
+
#include <functional>
|
|
33
|
+
#include <NitroModules/Promise.hpp>
|
|
34
|
+
#include <string>
|
|
35
|
+
#include <vector>
|
|
36
|
+
#include "AppPermission.hpp"
|
|
37
|
+
#include "Purpose.hpp"
|
|
38
|
+
#include "SDK.hpp"
|
|
39
|
+
#include <optional>
|
|
40
|
+
#include "BannerConfig.hpp"
|
|
41
|
+
#include "SettingsPrompt.hpp"
|
|
42
|
+
#include "PostConsentsRequest.hpp"
|
|
43
|
+
|
|
44
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
45
|
+
|
|
46
|
+
using namespace margelo::nitro;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* An abstract base class for `ConsentSDK`
|
|
50
|
+
* Inherit this class to create instances of `HybridConsentSDKSpec` in C++.
|
|
51
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
52
|
+
* @example
|
|
53
|
+
* ```cpp
|
|
54
|
+
* class HybridConsentSDK: public HybridConsentSDKSpec {
|
|
55
|
+
* public:
|
|
56
|
+
* HybridConsentSDK(...): HybridObject(TAG) { ... }
|
|
57
|
+
* // ...
|
|
58
|
+
* };
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
class HybridConsentSDKSpec: public virtual HybridObject {
|
|
62
|
+
public:
|
|
63
|
+
// Constructor
|
|
64
|
+
explicit HybridConsentSDKSpec(): HybridObject(TAG) { }
|
|
65
|
+
|
|
66
|
+
// Destructor
|
|
67
|
+
~HybridConsentSDKSpec() override = default;
|
|
68
|
+
|
|
69
|
+
public:
|
|
70
|
+
// Properties
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
public:
|
|
74
|
+
// Methods
|
|
75
|
+
virtual void initialize(const CmpSDKOptions& options) = 0;
|
|
76
|
+
virtual bool isSdkReady() = 0;
|
|
77
|
+
virtual void presentConsentBanner() = 0;
|
|
78
|
+
virtual void presentPreferenceCenter() = 0;
|
|
79
|
+
virtual void isReady(const std::function<void(bool /* isReady */)>& callback) = 0;
|
|
80
|
+
virtual void resetConsents() = 0;
|
|
81
|
+
virtual std::shared_ptr<Promise<std::string>> getConsentByPurposeId(double purposeId) = 0;
|
|
82
|
+
virtual std::shared_ptr<Promise<std::string>> getConsentByPermissionId(const std::string& permissionId) = 0;
|
|
83
|
+
virtual std::shared_ptr<Promise<std::vector<AppPermission>>> getPermissions() = 0;
|
|
84
|
+
virtual std::shared_ptr<Promise<std::vector<Purpose>>> getPurposes() = 0;
|
|
85
|
+
virtual std::shared_ptr<Promise<std::vector<SDK>>> getSdksInPurpose(double purposeId) = 0;
|
|
86
|
+
virtual bool setPurposeConsent(const Purpose& purpose, const std::string& consent) = 0;
|
|
87
|
+
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;
|
|
91
|
+
virtual std::shared_ptr<Promise<bool>> uploadConsents(const PostConsentsRequest& request) = 0;
|
|
92
|
+
|
|
93
|
+
protected:
|
|
94
|
+
// Hybrid Setup
|
|
95
|
+
void loadHybridMethods() override;
|
|
96
|
+
|
|
97
|
+
protected:
|
|
98
|
+
// Tag for logging
|
|
99
|
+
static constexpr auto TAG = "ConsentSDK";
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PermissionConsent.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
#include <string>
|
|
24
|
+
|
|
25
|
+
namespace margelo::nitro::securiticonsentsdk {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A struct which can be represented as a JavaScript object (PermissionConsent).
|
|
29
|
+
*/
|
|
30
|
+
struct PermissionConsent {
|
|
31
|
+
public:
|
|
32
|
+
std::string permission SWIFT_PRIVATE;
|
|
33
|
+
std::string consentStatus SWIFT_PRIVATE;
|
|
34
|
+
double timestamp SWIFT_PRIVATE;
|
|
35
|
+
|
|
36
|
+
public:
|
|
37
|
+
PermissionConsent() = default;
|
|
38
|
+
explicit PermissionConsent(std::string permission, std::string consentStatus, double timestamp): permission(permission), consentStatus(consentStatus), timestamp(timestamp) {}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::securiticonsentsdk
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
using namespace margelo::nitro::securiticonsentsdk;
|
|
46
|
+
|
|
47
|
+
// C++ PermissionConsent <> JS PermissionConsent (object)
|
|
48
|
+
template <>
|
|
49
|
+
struct JSIConverter<PermissionConsent> final {
|
|
50
|
+
static inline PermissionConsent fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
51
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
52
|
+
return PermissionConsent(
|
|
53
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "permission")),
|
|
54
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "consentStatus")),
|
|
55
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "timestamp"))
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const PermissionConsent& arg) {
|
|
59
|
+
jsi::Object obj(runtime);
|
|
60
|
+
obj.setProperty(runtime, "permission", JSIConverter<std::string>::toJSI(runtime, arg.permission));
|
|
61
|
+
obj.setProperty(runtime, "consentStatus", JSIConverter<std::string>::toJSI(runtime, arg.consentStatus));
|
|
62
|
+
obj.setProperty(runtime, "timestamp", JSIConverter<double>::toJSI(runtime, arg.timestamp));
|
|
63
|
+
return obj;
|
|
64
|
+
}
|
|
65
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
66
|
+
if (!value.isObject()) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
jsi::Object obj = value.getObject(runtime);
|
|
70
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "permission"))) return false;
|
|
71
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "consentStatus"))) return false;
|
|
72
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "timestamp"))) return false;
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro
|