Skip to content

Commit 8ac5f16

Browse files
committed
remove noFunctional/noTargeting privacy controls
1 parent 881fc54 commit 8ac5f16

File tree

7 files changed

+1
-159
lines changed

7 files changed

+1
-159
lines changed

src/constants.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,3 @@ export const HTTP_UNAUTHORIZED = 401 as const;
233233
export const HTTP_FORBIDDEN = 403 as const;
234234
export const HTTP_NOT_FOUND = 404 as const;
235235
export const HTTP_SERVER_ERROR = 500 as const;
236-
237-
export type PrivacyControl = 'functional' | 'targeting';
238-
239-
export type StorageTypes = 'SDKState';
240-
241-
export const StoragePrivacyMap: Record<StorageTypes, PrivacyControl> = {
242-
SDKState: 'functional'
243-
};

src/sdkRuntimeModels.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,6 @@ export interface SDKInitConfig
271271
extends Omit<MPConfiguration, 'dataPlan' | 'logLevel'> {
272272
dataPlan?: DataPlanConfig | KitBlockerDataPlan; // TODO: These should be eventually split into two different attributes
273273
logLevel?: LogLevelType;
274-
275-
noFunctional?: boolean;
276-
noTargeting?: boolean;
277274

278275
kitConfigs?: IKitConfigs[];
279276
kits?: Dictionary<UnregisteredKit>;

src/store.ts

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
UserIdentities,
99
} from '@mparticle/web-sdk';
1010
import { IKitConfigs } from './configAPIClient';
11-
import Constants, { PrivacyControl, StoragePrivacyMap, StorageTypes } from './constants';
11+
import Constants from './constants';
1212
import {
1313
DataPlanResult,
1414
KitBlockerOptions,
@@ -153,8 +153,6 @@ export interface IFeatureFlags {
153153
export interface IStore {
154154
isEnabled: boolean;
155155
isInitialized: boolean;
156-
noFunctional: boolean;
157-
noTargeting: boolean;
158156

159157
// Session Attributes are persistent attributes that are tied to the current session and
160158
// are uploaded then cleared when the session ends.
@@ -211,12 +209,6 @@ export interface IStore {
211209
_getFromPersistence?<T>(mpid: MPID, key: string): T;
212210
_setPersistence?<T>(mpid: MPID, key: string, value: T): void;
213211

214-
getNoFunctional?(): boolean;
215-
setNoFunctional?(noFunctional: boolean): void;
216-
getNoTargeting?(): boolean;
217-
setNoTargeting?(noTargeting: boolean): void;
218-
getPrivacyFlag?(storageType: StorageTypes): boolean;
219-
220212
getDeviceId?(): string;
221213
setDeviceId?(deviceId: string): void;
222214
getFirstSeenTime?(mpid: MPID): number;
@@ -252,8 +244,6 @@ export default function Store(
252244

253245
const defaultStore: Partial<IStore> = {
254246
isEnabled: true,
255-
noFunctional: false,
256-
noTargeting: false,
257247
sessionAttributes: {},
258248
localSessionAttributes: {},
259249
currentSessionMPIDs: [],
@@ -596,27 +586,6 @@ export default function Store(
596586
}
597587
};
598588

599-
this.getNoFunctional = (): boolean => this.noFunctional;
600-
this.setNoFunctional = (noFunctional: boolean): void => {
601-
this.noFunctional = noFunctional;
602-
};
603-
604-
this.getNoTargeting = (): boolean => this.noTargeting;
605-
this.setNoTargeting = (noTargeting: boolean): void => {
606-
this.noTargeting = noTargeting;
607-
};
608-
609-
this.getPrivacyFlag = (storageType: StorageTypes): boolean => {
610-
const privacyControl: PrivacyControl = StoragePrivacyMap[storageType];
611-
if (privacyControl === 'functional') {
612-
return this.getNoFunctional();
613-
}
614-
if (privacyControl === 'targeting') {
615-
return this.getNoTargeting();
616-
}
617-
return false;
618-
};
619-
620589
this.getDeviceId = () => this.deviceId;
621590
this.setDeviceId = (deviceId: string) => {
622591
this.deviceId = deviceId;
@@ -737,16 +706,6 @@ export default function Store(
737706
this.SDKConfig[baseUrlKeys] = baseUrls[baseUrlKeys];
738707
}
739708

740-
const { noFunctional, noTargeting } = config?.launcherOptions ?? {};
741-
742-
if (noFunctional != null) {
743-
this.setNoFunctional(noFunctional);
744-
}
745-
746-
if (noTargeting != null) {
747-
this.setNoTargeting(noTargeting);
748-
}
749-
750709
if (workspaceToken) {
751710
this.SDKConfig.workspaceToken = workspaceToken;
752711
mpInstance._timeOnSiteTimer = new ForegroundTimer(workspaceToken);

test/jest/persistence.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ describe('Persistence', () => {
6666
});
6767

6868
it('should NOT write to storage when webviewBridgeEnabled is true', () => {
69-
store.setNoFunctional(false);
7069
store.webviewBridgeEnabled = true;
7170
store.SDKConfig.useCookieStorage = true;
7271

test/jest/roktManager.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,6 @@ describe('RoktManager', () => {
310310
it('should initialize the manager with launcher options from options', () => {
311311
const launcherOptions = {
312312
integrationName: 'customName',
313-
noFunctional: true,
314-
noTargeting: true
315313
};
316314

317315
roktManager.init(

test/jest/store.flags.spec.ts

Lines changed: 0 additions & 82 deletions
This file was deleted.

test/src/tests-store.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,25 +1805,4 @@ describe('Store', () => {
18051805
});
18061806
});
18071807
});
1808-
1809-
describe('#privacy flags', () => {
1810-
it('should set noFunctional and noTargeting to false when not provided', () => {
1811-
const inst = window.mParticle.getInstance();
1812-
const store = (inst as any)._Store;
1813-
expect(store.getNoFunctional()).to.equal(false);
1814-
expect(store.getNoTargeting()).to.equal(false);
1815-
});
1816-
1817-
it('should set noFunctional and noTargeting from init config', () => {
1818-
window.mParticle.config = window.mParticle.config || {};
1819-
window.mParticle.config.launcherOptions = { noFunctional: true, noTargeting: true };
1820-
1821-
window.mParticle.init(apiKey, window.mParticle.config);
1822-
1823-
const inst = window.mParticle.getInstance();
1824-
const store = (inst as any)._Store;
1825-
expect(store.getNoFunctional()).to.equal(true);
1826-
expect(store.getNoTargeting()).to.equal(true);
1827-
});
1828-
});
18291808
});

0 commit comments

Comments
 (0)