securiti-consent-sdk 1.132.2 → 1.134.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 +1 -1
- package/android/build.gradle +1 -1
- package/ios/HybridConsentSDK.swift +2 -1
- package/lib/ConsentSDK.nitro.d.ts +191 -0
- package/lib/ConsentSDK.nitro.js +33 -0
- package/lib/index.d.ts +20 -0
- package/lib/index.js +58 -0
- package/package.json +1 -1
- package/src/ConsentSDK.nitro.ts +1 -1
package/android/build.gradle
CHANGED
|
@@ -138,7 +138,7 @@ dependencies {
|
|
|
138
138
|
implementation "com.facebook.react:react-native:+"
|
|
139
139
|
|
|
140
140
|
|
|
141
|
-
implementation 'ai.securiti.cmpsdkcore:consent-sdk:1.
|
|
141
|
+
implementation 'ai.securiti.cmpsdkcore:consent-sdk:1.134.0'
|
|
142
142
|
|
|
143
143
|
// Add a dependency on NitroModules
|
|
144
144
|
implementation project(":react-native-nitro-modules")
|
|
@@ -46,8 +46,9 @@ public class HybridConsentSDK : HybridConsentSDKSpec {
|
|
|
46
46
|
testingMode: options.testingMode,
|
|
47
47
|
logLevel: logLevel,
|
|
48
48
|
consentsCheckInterval: Int(options.consentsCheckInterval),
|
|
49
|
+
subjectId: options.subjectId,
|
|
49
50
|
languageCode: options.languageCode,
|
|
50
|
-
locationCode: options.locationCode
|
|
51
|
+
locationCode: options.locationCode,
|
|
51
52
|
))
|
|
52
53
|
|
|
53
54
|
// Register for ready status
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
export type CmpSDKLoggerLevel = string;
|
|
3
|
+
export declare const LoggerLevel: {
|
|
4
|
+
DEBUG: CmpSDKLoggerLevel;
|
|
5
|
+
INFO: CmpSDKLoggerLevel;
|
|
6
|
+
WARNING: CmpSDKLoggerLevel;
|
|
7
|
+
ERROR: CmpSDKLoggerLevel;
|
|
8
|
+
};
|
|
9
|
+
export type Mode = string;
|
|
10
|
+
export declare const ModeValues: {
|
|
11
|
+
DRAFT: string;
|
|
12
|
+
LIVE: string;
|
|
13
|
+
};
|
|
14
|
+
export interface CmpSDKOptions {
|
|
15
|
+
appURL: string;
|
|
16
|
+
cdnURL: string;
|
|
17
|
+
tenantID: string;
|
|
18
|
+
appID: string;
|
|
19
|
+
testingMode: boolean;
|
|
20
|
+
loggerLevel: CmpSDKLoggerLevel;
|
|
21
|
+
consentsCheckInterval: number;
|
|
22
|
+
subjectId?: string;
|
|
23
|
+
languageCode?: string;
|
|
24
|
+
locationCode?: string;
|
|
25
|
+
mode?: Mode;
|
|
26
|
+
}
|
|
27
|
+
export type ConsentStatus = string;
|
|
28
|
+
export declare const ConsentStatusValues: {
|
|
29
|
+
GRANTED: ConsentStatus;
|
|
30
|
+
DECLINED: ConsentStatus;
|
|
31
|
+
NOT_DETERMINED: ConsentStatus;
|
|
32
|
+
WITHDRAWN: ConsentStatus;
|
|
33
|
+
};
|
|
34
|
+
export interface Purpose {
|
|
35
|
+
purposeId?: number;
|
|
36
|
+
purposeName?: string;
|
|
37
|
+
purposeDescription?: string;
|
|
38
|
+
sdks?: SDK[];
|
|
39
|
+
consentStatus?: ConsentStatus;
|
|
40
|
+
disableOptOut?: boolean;
|
|
41
|
+
optOutText?: string;
|
|
42
|
+
hideDetails?: boolean;
|
|
43
|
+
isGADMapped?: boolean;
|
|
44
|
+
gadDescription?: string;
|
|
45
|
+
isATTMapped?: boolean;
|
|
46
|
+
attDescription?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface AppPermission {
|
|
49
|
+
id?: number;
|
|
50
|
+
name?: string;
|
|
51
|
+
permissionId?: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
group?: string;
|
|
54
|
+
groupId?: number;
|
|
55
|
+
consentStatus?: ConsentStatus;
|
|
56
|
+
nameMap?: string;
|
|
57
|
+
isSettingsPromptEnabled?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface SDK {
|
|
60
|
+
sdkId?: number;
|
|
61
|
+
namespaceId?: string;
|
|
62
|
+
sdkName?: string;
|
|
63
|
+
sdkDescription?: string;
|
|
64
|
+
vendor?: string;
|
|
65
|
+
logoBase64?: string;
|
|
66
|
+
website?: string;
|
|
67
|
+
matchedBy?: string[];
|
|
68
|
+
collectingData?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export type ComplianceType = string;
|
|
71
|
+
export declare const ComplianceTypeValues: {
|
|
72
|
+
NOTICE_ONLY: string;
|
|
73
|
+
OPT_IN: string;
|
|
74
|
+
OPT_OUT: string;
|
|
75
|
+
};
|
|
76
|
+
export type BannerPosition = string;
|
|
77
|
+
export declare const BannerPositionValues: {
|
|
78
|
+
BOTTOM: string;
|
|
79
|
+
CENTER: string;
|
|
80
|
+
};
|
|
81
|
+
export type ButtonShape = string;
|
|
82
|
+
export declare const ButtonShapeValues: {
|
|
83
|
+
ROUNDED: string;
|
|
84
|
+
SQUARE: string;
|
|
85
|
+
PILL: string;
|
|
86
|
+
OUTLINED: string;
|
|
87
|
+
};
|
|
88
|
+
export interface CustomColors {
|
|
89
|
+
buttonBackground?: string;
|
|
90
|
+
buttonText?: string;
|
|
91
|
+
buttonBorder?: string;
|
|
92
|
+
bannerBackground?: string;
|
|
93
|
+
bannerText?: string;
|
|
94
|
+
bannerLinks?: string;
|
|
95
|
+
preferenceCenterFooterBackground?: string;
|
|
96
|
+
preferenceCenterFooterSelector?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface BannerConfig {
|
|
99
|
+
hideCloseButton?: boolean;
|
|
100
|
+
hideAcceptButton?: boolean;
|
|
101
|
+
embedDSRPortalLink?: boolean;
|
|
102
|
+
recordConsentUponAppStart?: boolean;
|
|
103
|
+
hideToggleForEssentialCategories?: boolean;
|
|
104
|
+
name?: string;
|
|
105
|
+
dsrPortalLink?: string;
|
|
106
|
+
complianceType?: ComplianceType;
|
|
107
|
+
bannerReappearanceTime?: string;
|
|
108
|
+
privacyNoticeLink?: string;
|
|
109
|
+
accept?: string;
|
|
110
|
+
reject?: string;
|
|
111
|
+
bannerText?: string;
|
|
112
|
+
bannerHeading?: string;
|
|
113
|
+
sdkTabHeading?: string;
|
|
114
|
+
privacyNoticeText?: string;
|
|
115
|
+
preferenceCenterLink?: string;
|
|
116
|
+
permissionsTabHeading?: string;
|
|
117
|
+
permissionsTabGuidance?: string;
|
|
118
|
+
preferenceCenterHeading?: string;
|
|
119
|
+
preferenceCenterGuidance?: string;
|
|
120
|
+
permissionsTabDescription?: string;
|
|
121
|
+
preferenceCenterDescription?: string;
|
|
122
|
+
showPoweredBySecuritiLogo?: boolean;
|
|
123
|
+
showDescriptionTextWithPrefCenterToggle?: boolean;
|
|
124
|
+
paletteTheme?: number;
|
|
125
|
+
bannerPosition?: BannerPosition;
|
|
126
|
+
buttonShape?: ButtonShape;
|
|
127
|
+
companyLogo?: string;
|
|
128
|
+
customPaletteTheme?: CustomColors;
|
|
129
|
+
shouldShowSettingsPrompt?: boolean;
|
|
130
|
+
translations?: Record<string, string>;
|
|
131
|
+
}
|
|
132
|
+
export interface SettingsPrompt {
|
|
133
|
+
promptHeading?: string;
|
|
134
|
+
promptMessage?: string;
|
|
135
|
+
settingsButtonText?: string;
|
|
136
|
+
notNowButtonText?: string;
|
|
137
|
+
permissions?: string[];
|
|
138
|
+
}
|
|
139
|
+
export interface PostConsentsRequest {
|
|
140
|
+
uuid: string;
|
|
141
|
+
appUUID: string;
|
|
142
|
+
device: string;
|
|
143
|
+
implicitConsent: boolean;
|
|
144
|
+
version: number;
|
|
145
|
+
purposeConsents: PurposeConsent[];
|
|
146
|
+
permissions: PermissionConsent[];
|
|
147
|
+
isTestMode: boolean;
|
|
148
|
+
adId: string;
|
|
149
|
+
bannerInfo: string;
|
|
150
|
+
sdkVersion?: string;
|
|
151
|
+
platform?: string;
|
|
152
|
+
}
|
|
153
|
+
export interface PurposeConsent {
|
|
154
|
+
purposeID: number;
|
|
155
|
+
consentStatus: ConsentStatus;
|
|
156
|
+
timestamp: number;
|
|
157
|
+
isEssential: boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface PermissionConsent {
|
|
160
|
+
permission: string;
|
|
161
|
+
consentStatus: ConsentStatus;
|
|
162
|
+
timestamp: number;
|
|
163
|
+
}
|
|
164
|
+
export interface PurposeObject {
|
|
165
|
+
purposeId: number;
|
|
166
|
+
}
|
|
167
|
+
export interface PermissionObject {
|
|
168
|
+
permissionId: string;
|
|
169
|
+
}
|
|
170
|
+
export interface ConsentSDK extends HybridObject<{
|
|
171
|
+
ios: 'swift';
|
|
172
|
+
android: 'kotlin';
|
|
173
|
+
}> {
|
|
174
|
+
initialize(options: CmpSDKOptions): void;
|
|
175
|
+
isSdkReady(): boolean;
|
|
176
|
+
presentConsentBanner(): void;
|
|
177
|
+
presentPreferenceCenter(): void;
|
|
178
|
+
isReady(callback: (isReady: boolean) => void): void;
|
|
179
|
+
resetConsents(): void;
|
|
180
|
+
getConsentByPurposeId(purposeId: number): Promise<string>;
|
|
181
|
+
getConsentByPermissionId(permissionId: string): Promise<string>;
|
|
182
|
+
getPermissions(): Promise<Array<AppPermission>>;
|
|
183
|
+
getPurposes(): Promise<Array<Purpose>>;
|
|
184
|
+
getSdksInPurpose(purposeId: number): Promise<Array<SDK>>;
|
|
185
|
+
setPurposeConsent(purpose: Purpose, consent: string): boolean;
|
|
186
|
+
setPermissionConsent(permission: AppPermission, consent: string): boolean;
|
|
187
|
+
getBannerConfig(): Promise<BannerConfig | null>;
|
|
188
|
+
options(): CmpSDKOptions | null;
|
|
189
|
+
getSettingsPrompt(): Promise<SettingsPrompt | null>;
|
|
190
|
+
uploadConsents(request: PostConsentsRequest): Promise<boolean>;
|
|
191
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// CmpSDKLoggerLevel constants
|
|
2
|
+
export const LoggerLevel = {
|
|
3
|
+
DEBUG: 'DEBUG',
|
|
4
|
+
INFO: 'INFO',
|
|
5
|
+
WARNING: 'WARNING',
|
|
6
|
+
ERROR: 'ERROR',
|
|
7
|
+
};
|
|
8
|
+
export const ModeValues = {
|
|
9
|
+
DRAFT: 'draft',
|
|
10
|
+
LIVE: 'live',
|
|
11
|
+
};
|
|
12
|
+
// Constants object for reference with the exact values from native SDK
|
|
13
|
+
export const ConsentStatusValues = {
|
|
14
|
+
GRANTED: 'granted',
|
|
15
|
+
DECLINED: 'declined',
|
|
16
|
+
NOT_DETERMINED: 'not_determined',
|
|
17
|
+
WITHDRAWN: 'withdrawn',
|
|
18
|
+
};
|
|
19
|
+
export const ComplianceTypeValues = {
|
|
20
|
+
NOTICE_ONLY: 'notice-only',
|
|
21
|
+
OPT_IN: 'opt-in',
|
|
22
|
+
OPT_OUT: 'opt-out',
|
|
23
|
+
};
|
|
24
|
+
export const BannerPositionValues = {
|
|
25
|
+
BOTTOM: 'bottom',
|
|
26
|
+
CENTER: 'center',
|
|
27
|
+
};
|
|
28
|
+
export const ButtonShapeValues = {
|
|
29
|
+
ROUNDED: 'rounded',
|
|
30
|
+
SQUARE: 'square',
|
|
31
|
+
PILL: 'pill',
|
|
32
|
+
OUTLINED: 'outlined',
|
|
33
|
+
};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CmpSDKLoggerLevel, CmpSDKOptions, ConsentStatus, Purpose, AppPermission, SDK, BannerConfig, SettingsPrompt, PostConsentsRequest, ComplianceType, BannerPosition, ButtonShape, CustomColors, PurposeConsent, PermissionConsent, Mode, PurposeObject, PermissionObject } from './ConsentSDK.nitro';
|
|
2
|
+
export type { CmpSDKLoggerLevel, CmpSDKOptions, ConsentStatus, Purpose, AppPermission, SDK, BannerConfig, SettingsPrompt, PostConsentsRequest, ComplianceType, BannerPosition, ButtonShape, CustomColors, PurposeConsent, PermissionConsent, Mode, PurposeObject, PermissionObject, };
|
|
3
|
+
export { LoggerLevel, ModeValues, ConsentStatusValues, ComplianceTypeValues, BannerPositionValues, ButtonShapeValues, } from './ConsentSDK.nitro';
|
|
4
|
+
export declare function initialize(sdkOptions: CmpSDKOptions): void;
|
|
5
|
+
export declare function presentConsentBanner(): void;
|
|
6
|
+
export declare function presentPreferenceCenter(): void;
|
|
7
|
+
export declare function isSdkReady(): boolean;
|
|
8
|
+
export declare function isReady(callback: (isReady: boolean) => void): void;
|
|
9
|
+
export declare function resetConsents(): void;
|
|
10
|
+
export declare function getConsentByPurposeId(purposeId: number): Promise<string>;
|
|
11
|
+
export declare function getConsentByPermissionId(permissionId: string): Promise<string>;
|
|
12
|
+
export declare function getPermissions(): Promise<Array<AppPermission>>;
|
|
13
|
+
export declare function getPurposes(): Promise<Array<Purpose>>;
|
|
14
|
+
export declare function getSdksInPurpose(purposeId: number): Promise<Array<SDK>>;
|
|
15
|
+
export declare function setPurposeConsent(purpose: Purpose, consent: string): boolean;
|
|
16
|
+
export declare function setPermissionConsent(permission: AppPermission, consent: string): boolean;
|
|
17
|
+
export declare function getBannerConfig(): Promise<BannerConfig | null>;
|
|
18
|
+
export declare function options(): CmpSDKOptions | null;
|
|
19
|
+
export declare function getSettingsPrompt(): Promise<SettingsPrompt | null>;
|
|
20
|
+
export declare function uploadConsents(request: PostConsentsRequest): Promise<boolean>;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { NitroModules } from 'react-native-nitro-modules';
|
|
2
|
+
export { LoggerLevel, ModeValues, ConsentStatusValues, ComplianceTypeValues, BannerPositionValues, ButtonShapeValues, } from './ConsentSDK.nitro';
|
|
3
|
+
// Create the hybrid object
|
|
4
|
+
const ConsentSDKHybridObject = NitroModules.createHybridObject('ConsentSDK');
|
|
5
|
+
// Core methods
|
|
6
|
+
export function initialize(sdkOptions) {
|
|
7
|
+
ConsentSDKHybridObject.initialize(sdkOptions);
|
|
8
|
+
}
|
|
9
|
+
export function presentConsentBanner() {
|
|
10
|
+
ConsentSDKHybridObject.presentConsentBanner();
|
|
11
|
+
}
|
|
12
|
+
export function presentPreferenceCenter() {
|
|
13
|
+
ConsentSDKHybridObject.presentPreferenceCenter();
|
|
14
|
+
}
|
|
15
|
+
export function isSdkReady() {
|
|
16
|
+
return ConsentSDKHybridObject.isSdkReady();
|
|
17
|
+
}
|
|
18
|
+
export function isReady(callback) {
|
|
19
|
+
ConsentSDKHybridObject.isReady(callback);
|
|
20
|
+
}
|
|
21
|
+
export function resetConsents() {
|
|
22
|
+
ConsentSDKHybridObject.resetConsents();
|
|
23
|
+
}
|
|
24
|
+
// Consent Management methods
|
|
25
|
+
export function getConsentByPurposeId(purposeId) {
|
|
26
|
+
return ConsentSDKHybridObject.getConsentByPurposeId(purposeId);
|
|
27
|
+
}
|
|
28
|
+
export function getConsentByPermissionId(permissionId) {
|
|
29
|
+
return ConsentSDKHybridObject.getConsentByPermissionId(permissionId);
|
|
30
|
+
}
|
|
31
|
+
export function getPermissions() {
|
|
32
|
+
return ConsentSDKHybridObject.getPermissions();
|
|
33
|
+
}
|
|
34
|
+
export function getPurposes() {
|
|
35
|
+
return ConsentSDKHybridObject.getPurposes();
|
|
36
|
+
}
|
|
37
|
+
export function getSdksInPurpose(purposeId) {
|
|
38
|
+
return ConsentSDKHybridObject.getSdksInPurpose(purposeId);
|
|
39
|
+
}
|
|
40
|
+
export function setPurposeConsent(purpose, consent) {
|
|
41
|
+
return ConsentSDKHybridObject.setPurposeConsent(purpose, consent);
|
|
42
|
+
}
|
|
43
|
+
export function setPermissionConsent(permission, consent) {
|
|
44
|
+
return ConsentSDKHybridObject.setPermissionConsent(permission, consent);
|
|
45
|
+
}
|
|
46
|
+
// Configuration methods
|
|
47
|
+
export function getBannerConfig() {
|
|
48
|
+
return ConsentSDKHybridObject.getBannerConfig();
|
|
49
|
+
}
|
|
50
|
+
export function options() {
|
|
51
|
+
return ConsentSDKHybridObject.options();
|
|
52
|
+
}
|
|
53
|
+
export function getSettingsPrompt() {
|
|
54
|
+
return ConsentSDKHybridObject.getSettingsPrompt();
|
|
55
|
+
}
|
|
56
|
+
export function uploadConsents(request) {
|
|
57
|
+
return ConsentSDKHybridObject.uploadConsents(request);
|
|
58
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "securiti-consent-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.134.0",
|
|
4
4
|
"description": "A React Native Library for managing user consent preferences and compliance with privacy regulations. Integrates with Securiti's Consent Management Platform.",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|