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,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__string.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
|
+
* Wraps a Swift `(_ value: String) -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void_std__string {
|
|
15
|
+
public typealias bridge = margelo.nitro.securiticonsentsdk.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: String) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: String) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: std.string) -> Void {
|
|
25
|
+
self.closure(String(value))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_std__string`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__string>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__string {
|
|
44
|
+
return Unmanaged<Func_void_std__string>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__vector_AppPermission_.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
|
+
* Wraps a Swift `(_ value: [AppPermission]) -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void_std__vector_AppPermission_ {
|
|
15
|
+
public typealias bridge = margelo.nitro.securiticonsentsdk.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: [AppPermission]) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: [AppPermission]) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: bridge.std__vector_AppPermission_) -> Void {
|
|
25
|
+
self.closure(value.map({ __item in __item }))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_std__vector_AppPermission_`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__vector_AppPermission_>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_AppPermission_ {
|
|
44
|
+
return Unmanaged<Func_void_std__vector_AppPermission_>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__vector_Purpose_.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
|
+
* Wraps a Swift `(_ value: [Purpose]) -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void_std__vector_Purpose_ {
|
|
15
|
+
public typealias bridge = margelo.nitro.securiticonsentsdk.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: [Purpose]) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: [Purpose]) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: bridge.std__vector_Purpose_) -> Void {
|
|
25
|
+
self.closure(value.map({ __item in __item }))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_std__vector_Purpose_`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__vector_Purpose_>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_Purpose_ {
|
|
44
|
+
return Unmanaged<Func_void_std__vector_Purpose_>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__vector_SDK_.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
|
+
* Wraps a Swift `(_ value: [SDK]) -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void_std__vector_SDK_ {
|
|
15
|
+
public typealias bridge = margelo.nitro.securiticonsentsdk.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: [SDK]) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: [SDK]) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: bridge.std__vector_SDK_) -> Void {
|
|
25
|
+
self.closure(value.map({ __item in __item }))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_std__vector_SDK_`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__vector_SDK_>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_SDK_ {
|
|
44
|
+
return Unmanaged<Func_void_std__vector_SDK_>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridConsentSDKSpec.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 Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/// See ``HybridConsentSDKSpec``
|
|
12
|
+
public protocol HybridConsentSDKSpec_protocol: HybridObject {
|
|
13
|
+
// Properties
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// Methods
|
|
17
|
+
func initialize(options: CmpSDKOptions) throws -> Void
|
|
18
|
+
func isSdkReady() throws -> Bool
|
|
19
|
+
func presentConsentBanner() throws -> Void
|
|
20
|
+
func presentPreferenceCenter() throws -> Void
|
|
21
|
+
func isReady(callback: @escaping (_ isReady: Bool) -> Void) throws -> Void
|
|
22
|
+
func resetConsents() throws -> Void
|
|
23
|
+
func getConsentByPurposeId(purposeId: Double) throws -> Promise<String>
|
|
24
|
+
func getConsentByPermissionId(permissionId: String) throws -> Promise<String>
|
|
25
|
+
func getPermissions() throws -> Promise<[AppPermission]>
|
|
26
|
+
func getPurposes() throws -> Promise<[Purpose]>
|
|
27
|
+
func getSdksInPurpose(purposeId: Double) throws -> Promise<[SDK]>
|
|
28
|
+
func setPurposeConsent(purpose: Purpose, consent: String) throws -> Bool
|
|
29
|
+
func setPermissionConsent(permission: AppPermission, consent: String) throws -> Bool
|
|
30
|
+
func getBannerConfig() throws -> Promise<BannerConfig?>
|
|
31
|
+
func options() throws -> CmpSDKOptions?
|
|
32
|
+
func getSettingsPrompt() throws -> Promise<SettingsPrompt?>
|
|
33
|
+
func uploadConsents(request: PostConsentsRequest) throws -> Promise<Bool>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// See ``HybridConsentSDKSpec``
|
|
37
|
+
public class HybridConsentSDKSpec_base {
|
|
38
|
+
private weak var cxxWrapper: HybridConsentSDKSpec_cxx? = nil
|
|
39
|
+
public func getCxxWrapper() -> HybridConsentSDKSpec_cxx {
|
|
40
|
+
#if DEBUG
|
|
41
|
+
guard self is HybridConsentSDKSpec else {
|
|
42
|
+
fatalError("`self` is not a `HybridConsentSDKSpec`! Did you accidentally inherit from `HybridConsentSDKSpec_base` instead of `HybridConsentSDKSpec`?")
|
|
43
|
+
}
|
|
44
|
+
#endif
|
|
45
|
+
if let cxxWrapper = self.cxxWrapper {
|
|
46
|
+
return cxxWrapper
|
|
47
|
+
} else {
|
|
48
|
+
let cxxWrapper = HybridConsentSDKSpec_cxx(self as! HybridConsentSDKSpec)
|
|
49
|
+
self.cxxWrapper = cxxWrapper
|
|
50
|
+
return cxxWrapper
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A Swift base-protocol representing the ConsentSDK HybridObject.
|
|
57
|
+
* Implement this protocol to create Swift-based instances of ConsentSDK.
|
|
58
|
+
* ```swift
|
|
59
|
+
* class HybridConsentSDK : HybridConsentSDKSpec {
|
|
60
|
+
* // ...
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
public typealias HybridConsentSDKSpec = HybridConsentSDKSpec_protocol & HybridConsentSDKSpec_base
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridConsentSDKSpec_cxx.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 Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A class implementation that bridges HybridConsentSDKSpec over to C++.
|
|
13
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
14
|
+
*
|
|
15
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
16
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
17
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
18
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
19
|
+
*/
|
|
20
|
+
public class HybridConsentSDKSpec_cxx {
|
|
21
|
+
/**
|
|
22
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::securiticonsentsdk::bridge::swift`)
|
|
23
|
+
* from `NitroSecuritiConsentSdk-Swift-Cxx-Bridge.hpp`.
|
|
24
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
25
|
+
*/
|
|
26
|
+
public typealias bridge = margelo.nitro.securiticonsentsdk.bridge.swift
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Holds an instance of the `HybridConsentSDKSpec` Swift protocol.
|
|
30
|
+
*/
|
|
31
|
+
private var __implementation: any HybridConsentSDKSpec
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
35
|
+
*/
|
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__securiticonsentsdk__HybridConsentSDKSpec_
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Create a new `HybridConsentSDKSpec_cxx` that wraps the given `HybridConsentSDKSpec`.
|
|
40
|
+
* All properties and methods bridge to C++ types.
|
|
41
|
+
*/
|
|
42
|
+
public init(_ implementation: any HybridConsentSDKSpec) {
|
|
43
|
+
self.__implementation = implementation
|
|
44
|
+
self.__cxxPart = .init()
|
|
45
|
+
/* no base class */
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get the actual `HybridConsentSDKSpec` instance this class wraps.
|
|
50
|
+
*/
|
|
51
|
+
@inline(__always)
|
|
52
|
+
public func getHybridConsentSDKSpec() -> any HybridConsentSDKSpec {
|
|
53
|
+
return __implementation
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
58
|
+
* This acquires one additional strong reference on the object!
|
|
59
|
+
*/
|
|
60
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
61
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Casts an unsafe pointer to a `HybridConsentSDKSpec_cxx`.
|
|
66
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridConsentSDKSpec_cxx>`.
|
|
67
|
+
* This removes one strong reference from the object!
|
|
68
|
+
*/
|
|
69
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridConsentSDKSpec_cxx {
|
|
70
|
+
return Unmanaged<HybridConsentSDKSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
75
|
+
* The C++ part is a `std::shared_ptr<margelo::nitro::securiticonsentsdk::HybridConsentSDKSpec>`.
|
|
76
|
+
*/
|
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__securiticonsentsdk__HybridConsentSDKSpec_ {
|
|
78
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
79
|
+
if cachedCxxPart.__convertToBool() {
|
|
80
|
+
return cachedCxxPart
|
|
81
|
+
} else {
|
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__securiticonsentsdk__HybridConsentSDKSpec_(self.toUnsafe())
|
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__securiticonsentsdk__HybridConsentSDKSpec_(newCxxPart)
|
|
84
|
+
return newCxxPart
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
92
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
93
|
+
*/
|
|
94
|
+
@inline(__always)
|
|
95
|
+
public var memorySize: Int {
|
|
96
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Properties
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
// Methods
|
|
103
|
+
@inline(__always)
|
|
104
|
+
public final func initialize(options: CmpSDKOptions) -> bridge.Result_void_ {
|
|
105
|
+
do {
|
|
106
|
+
try self.__implementation.initialize(options: options)
|
|
107
|
+
return bridge.create_Result_void_()
|
|
108
|
+
} catch (let __error) {
|
|
109
|
+
let __exceptionPtr = __error.toCpp()
|
|
110
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@inline(__always)
|
|
115
|
+
public final func isSdkReady() -> bridge.Result_bool_ {
|
|
116
|
+
do {
|
|
117
|
+
let __result = try self.__implementation.isSdkReady()
|
|
118
|
+
let __resultCpp = __result
|
|
119
|
+
return bridge.create_Result_bool_(__resultCpp)
|
|
120
|
+
} catch (let __error) {
|
|
121
|
+
let __exceptionPtr = __error.toCpp()
|
|
122
|
+
return bridge.create_Result_bool_(__exceptionPtr)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@inline(__always)
|
|
127
|
+
public final func presentConsentBanner() -> bridge.Result_void_ {
|
|
128
|
+
do {
|
|
129
|
+
try self.__implementation.presentConsentBanner()
|
|
130
|
+
return bridge.create_Result_void_()
|
|
131
|
+
} catch (let __error) {
|
|
132
|
+
let __exceptionPtr = __error.toCpp()
|
|
133
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@inline(__always)
|
|
138
|
+
public final func presentPreferenceCenter() -> bridge.Result_void_ {
|
|
139
|
+
do {
|
|
140
|
+
try self.__implementation.presentPreferenceCenter()
|
|
141
|
+
return bridge.create_Result_void_()
|
|
142
|
+
} catch (let __error) {
|
|
143
|
+
let __exceptionPtr = __error.toCpp()
|
|
144
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@inline(__always)
|
|
149
|
+
public final func isReady(callback: bridge.Func_void_bool) -> bridge.Result_void_ {
|
|
150
|
+
do {
|
|
151
|
+
try self.__implementation.isReady(callback: { () -> (Bool) -> Void in
|
|
152
|
+
let __wrappedFunction = bridge.wrap_Func_void_bool(callback)
|
|
153
|
+
return { (__isReady: Bool) -> Void in
|
|
154
|
+
__wrappedFunction.call(__isReady)
|
|
155
|
+
}
|
|
156
|
+
}())
|
|
157
|
+
return bridge.create_Result_void_()
|
|
158
|
+
} catch (let __error) {
|
|
159
|
+
let __exceptionPtr = __error.toCpp()
|
|
160
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@inline(__always)
|
|
165
|
+
public final func resetConsents() -> bridge.Result_void_ {
|
|
166
|
+
do {
|
|
167
|
+
try self.__implementation.resetConsents()
|
|
168
|
+
return bridge.create_Result_void_()
|
|
169
|
+
} catch (let __error) {
|
|
170
|
+
let __exceptionPtr = __error.toCpp()
|
|
171
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@inline(__always)
|
|
176
|
+
public final func getConsentByPurposeId(purposeId: Double) -> bridge.Result_std__shared_ptr_Promise_std__string___ {
|
|
177
|
+
do {
|
|
178
|
+
let __result = try self.__implementation.getConsentByPurposeId(purposeId: purposeId)
|
|
179
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in
|
|
180
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__string__()
|
|
181
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise)
|
|
182
|
+
__result
|
|
183
|
+
.then({ __result in __promiseHolder.resolve(std.string(__result)) })
|
|
184
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
185
|
+
return __promise
|
|
186
|
+
}()
|
|
187
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp)
|
|
188
|
+
} catch (let __error) {
|
|
189
|
+
let __exceptionPtr = __error.toCpp()
|
|
190
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr)
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@inline(__always)
|
|
195
|
+
public final func getConsentByPermissionId(permissionId: std.string) -> bridge.Result_std__shared_ptr_Promise_std__string___ {
|
|
196
|
+
do {
|
|
197
|
+
let __result = try self.__implementation.getConsentByPermissionId(permissionId: String(permissionId))
|
|
198
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in
|
|
199
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__string__()
|
|
200
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise)
|
|
201
|
+
__result
|
|
202
|
+
.then({ __result in __promiseHolder.resolve(std.string(__result)) })
|
|
203
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
204
|
+
return __promise
|
|
205
|
+
}()
|
|
206
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp)
|
|
207
|
+
} catch (let __error) {
|
|
208
|
+
let __exceptionPtr = __error.toCpp()
|
|
209
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr)
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@inline(__always)
|
|
214
|
+
public final func getPermissions() -> bridge.Result_std__shared_ptr_Promise_std__vector_AppPermission____ {
|
|
215
|
+
do {
|
|
216
|
+
let __result = try self.__implementation.getPermissions()
|
|
217
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_AppPermission___ in
|
|
218
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_AppPermission___()
|
|
219
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_AppPermission___(__promise)
|
|
220
|
+
__result
|
|
221
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_AppPermission_ in
|
|
222
|
+
var __vector = bridge.create_std__vector_AppPermission_(__result.count)
|
|
223
|
+
for __item in __result {
|
|
224
|
+
__vector.push_back(__item)
|
|
225
|
+
}
|
|
226
|
+
return __vector
|
|
227
|
+
}()) })
|
|
228
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
229
|
+
return __promise
|
|
230
|
+
}()
|
|
231
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_AppPermission____(__resultCpp)
|
|
232
|
+
} catch (let __error) {
|
|
233
|
+
let __exceptionPtr = __error.toCpp()
|
|
234
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_AppPermission____(__exceptionPtr)
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@inline(__always)
|
|
239
|
+
public final func getPurposes() -> bridge.Result_std__shared_ptr_Promise_std__vector_Purpose____ {
|
|
240
|
+
do {
|
|
241
|
+
let __result = try self.__implementation.getPurposes()
|
|
242
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_Purpose___ in
|
|
243
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_Purpose___()
|
|
244
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_Purpose___(__promise)
|
|
245
|
+
__result
|
|
246
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_Purpose_ in
|
|
247
|
+
var __vector = bridge.create_std__vector_Purpose_(__result.count)
|
|
248
|
+
for __item in __result {
|
|
249
|
+
__vector.push_back(__item)
|
|
250
|
+
}
|
|
251
|
+
return __vector
|
|
252
|
+
}()) })
|
|
253
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
254
|
+
return __promise
|
|
255
|
+
}()
|
|
256
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_Purpose____(__resultCpp)
|
|
257
|
+
} catch (let __error) {
|
|
258
|
+
let __exceptionPtr = __error.toCpp()
|
|
259
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_Purpose____(__exceptionPtr)
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@inline(__always)
|
|
264
|
+
public final func getSdksInPurpose(purposeId: Double) -> bridge.Result_std__shared_ptr_Promise_std__vector_SDK____ {
|
|
265
|
+
do {
|
|
266
|
+
let __result = try self.__implementation.getSdksInPurpose(purposeId: purposeId)
|
|
267
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_SDK___ in
|
|
268
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__vector_SDK___()
|
|
269
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_SDK___(__promise)
|
|
270
|
+
__result
|
|
271
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_SDK_ in
|
|
272
|
+
var __vector = bridge.create_std__vector_SDK_(__result.count)
|
|
273
|
+
for __item in __result {
|
|
274
|
+
__vector.push_back(__item)
|
|
275
|
+
}
|
|
276
|
+
return __vector
|
|
277
|
+
}()) })
|
|
278
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
279
|
+
return __promise
|
|
280
|
+
}()
|
|
281
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_SDK____(__resultCpp)
|
|
282
|
+
} catch (let __error) {
|
|
283
|
+
let __exceptionPtr = __error.toCpp()
|
|
284
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__vector_SDK____(__exceptionPtr)
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
@inline(__always)
|
|
289
|
+
public final func setPurposeConsent(purpose: Purpose, consent: std.string) -> bridge.Result_bool_ {
|
|
290
|
+
do {
|
|
291
|
+
let __result = try self.__implementation.setPurposeConsent(purpose: purpose, consent: String(consent))
|
|
292
|
+
let __resultCpp = __result
|
|
293
|
+
return bridge.create_Result_bool_(__resultCpp)
|
|
294
|
+
} catch (let __error) {
|
|
295
|
+
let __exceptionPtr = __error.toCpp()
|
|
296
|
+
return bridge.create_Result_bool_(__exceptionPtr)
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
@inline(__always)
|
|
301
|
+
public final func setPermissionConsent(permission: AppPermission, consent: std.string) -> bridge.Result_bool_ {
|
|
302
|
+
do {
|
|
303
|
+
let __result = try self.__implementation.setPermissionConsent(permission: permission, consent: String(consent))
|
|
304
|
+
let __resultCpp = __result
|
|
305
|
+
return bridge.create_Result_bool_(__resultCpp)
|
|
306
|
+
} catch (let __error) {
|
|
307
|
+
let __exceptionPtr = __error.toCpp()
|
|
308
|
+
return bridge.create_Result_bool_(__exceptionPtr)
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
@inline(__always)
|
|
313
|
+
public final func getBannerConfig() -> bridge.Result_std__shared_ptr_Promise_std__optional_BannerConfig____ {
|
|
314
|
+
do {
|
|
315
|
+
let __result = try self.__implementation.getBannerConfig()
|
|
316
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__optional_BannerConfig___ in
|
|
317
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__optional_BannerConfig___()
|
|
318
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__optional_BannerConfig___(__promise)
|
|
319
|
+
__result
|
|
320
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__optional_BannerConfig_ in
|
|
321
|
+
if let __unwrappedValue = __result {
|
|
322
|
+
return bridge.create_std__optional_BannerConfig_(__unwrappedValue)
|
|
323
|
+
} else {
|
|
324
|
+
return .init()
|
|
325
|
+
}
|
|
326
|
+
}()) })
|
|
327
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
328
|
+
return __promise
|
|
329
|
+
}()
|
|
330
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_BannerConfig____(__resultCpp)
|
|
331
|
+
} catch (let __error) {
|
|
332
|
+
let __exceptionPtr = __error.toCpp()
|
|
333
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_BannerConfig____(__exceptionPtr)
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
@inline(__always)
|
|
338
|
+
public final func options() -> bridge.Result_std__optional_CmpSDKOptions__ {
|
|
339
|
+
do {
|
|
340
|
+
let __result = try self.__implementation.options()
|
|
341
|
+
let __resultCpp = { () -> bridge.std__optional_CmpSDKOptions_ in
|
|
342
|
+
if let __unwrappedValue = __result {
|
|
343
|
+
return bridge.create_std__optional_CmpSDKOptions_(__unwrappedValue)
|
|
344
|
+
} else {
|
|
345
|
+
return .init()
|
|
346
|
+
}
|
|
347
|
+
}()
|
|
348
|
+
return bridge.create_Result_std__optional_CmpSDKOptions__(__resultCpp)
|
|
349
|
+
} catch (let __error) {
|
|
350
|
+
let __exceptionPtr = __error.toCpp()
|
|
351
|
+
return bridge.create_Result_std__optional_CmpSDKOptions__(__exceptionPtr)
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
@inline(__always)
|
|
356
|
+
public final func getSettingsPrompt() -> bridge.Result_std__shared_ptr_Promise_std__optional_SettingsPrompt____ {
|
|
357
|
+
do {
|
|
358
|
+
let __result = try self.__implementation.getSettingsPrompt()
|
|
359
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__optional_SettingsPrompt___ in
|
|
360
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__optional_SettingsPrompt___()
|
|
361
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__optional_SettingsPrompt___(__promise)
|
|
362
|
+
__result
|
|
363
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__optional_SettingsPrompt_ in
|
|
364
|
+
if let __unwrappedValue = __result {
|
|
365
|
+
return bridge.create_std__optional_SettingsPrompt_(__unwrappedValue)
|
|
366
|
+
} else {
|
|
367
|
+
return .init()
|
|
368
|
+
}
|
|
369
|
+
}()) })
|
|
370
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
371
|
+
return __promise
|
|
372
|
+
}()
|
|
373
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_SettingsPrompt____(__resultCpp)
|
|
374
|
+
} catch (let __error) {
|
|
375
|
+
let __exceptionPtr = __error.toCpp()
|
|
376
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__optional_SettingsPrompt____(__exceptionPtr)
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
@inline(__always)
|
|
381
|
+
public final func uploadConsents(request: PostConsentsRequest) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
382
|
+
do {
|
|
383
|
+
let __result = try self.__implementation.uploadConsents(request: request)
|
|
384
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
385
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
386
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
387
|
+
__result
|
|
388
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
389
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
390
|
+
return __promise
|
|
391
|
+
}()
|
|
392
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
393
|
+
} catch (let __error) {
|
|
394
|
+
let __exceptionPtr = __error.toCpp()
|
|
395
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|