diff --git a/src/consent.ts b/src/consent.ts index 81ae944cd..1a0059ee6 100644 --- a/src/consent.ts +++ b/src/consent.ts @@ -97,11 +97,6 @@ export interface IConsentRules { values: IConsentRulesValues[]; } -// TODO: Remove this if we can safely deprecate `removeCCPAState` -export interface IConsentState extends ConsentState { - removeCCPAState: () => ConsentState; -} - // Represents Actual Interface for Consent Module // TODO: Should eventually consolidate with SDKConsentStateApi export interface IConsent { @@ -325,7 +320,7 @@ export default function Consent(this: IConsent, mpInstance: IMParticleWebSDKInst this.createConsentState = function( this: ConsentState, consentState?: ConsentState - ): IConsentState { + ): ConsentState { let gdpr = {}; let ccpa = {}; @@ -338,8 +333,7 @@ export default function Consent(this: IConsent, mpInstance: IMParticleWebSDKInst consentState.getCCPAConsentState() ); - // TODO: Remove casting once `removeCCPAState` is removed; - return consentStateCopy as IConsentState; + return consentStateCopy; } function canonicalizeForDeduplication(purpose: string): string { @@ -503,15 +497,6 @@ export default function Consent(this: IConsent, mpInstance: IMParticleWebSDKInst return this; } - // TODO: Can we remove this? It is deprecated. - function removeCCPAState(this: ConsentState) { - mpInstance.Logger.warning( - 'removeCCPAState is deprecated and will be removed in a future release; use removeCCPAConsentState instead' - ); - // @ts-ignore - return removeCCPAConsentState(); - } - return { setGDPRConsentState, addGDPRConsentState, @@ -519,7 +504,6 @@ export default function Consent(this: IConsent, mpInstance: IMParticleWebSDKInst getCCPAConsentState, getGDPRConsentState, removeGDPRConsentState, - removeCCPAState, // TODO: Can we remove? This is deprecated removeCCPAConsentState, }; }; diff --git a/test/src/tests-consent.ts b/test/src/tests-consent.ts index ad76e2ebe..c0e7d0bc9 100644 --- a/test/src/tests-consent.ts +++ b/test/src/tests-consent.ts @@ -660,39 +660,4 @@ describe('Consent', function() { testEvent.consent_state.gdpr['test purpose'].should.have.property('hardware_id', 'hardware'); }); - // TODO: Deprecate in next major version - it('Should log deprecated message when using removeCCPAState', () => { - const bond = sinon.spy(mParticle.getInstance().Logger, 'warning'); - const consentState = mParticle - .getInstance() - .Consent.createConsentState(); - expect(consentState).to.be.ok; - - consentState.setCCPAConsentState( - mParticle.Consent.createCCPAConsent(false) - ); - - expect(consentState.getCCPAConsentState()).to.have.property( - 'Consented' - ); - expect(consentState.getCCPAConsentState()).to.have.property( - 'ConsentDocument' - ); - expect(consentState.getCCPAConsentState()).to.have.property( - 'HardwareId' - ); - expect(consentState.getCCPAConsentState()).to.have.property('Location'); - expect(consentState.getCCPAConsentState()).to.have.property( - 'Timestamp' - ); - - // FIXME: Remove when deprecating removeCCPAState - ((consentState as unknown) as any).removeCCPAState(); - (consentState.getCCPAConsentState() === undefined).should.equal(true); - - bond.called.should.eql(true); - bond.getCalls()[0].args[0].should.eql( - 'removeCCPAState is deprecated and will be removed in a future release; use removeCCPAConsentState instead' - ); - }); }); \ No newline at end of file