@@ -21,6 +21,10 @@ import type { IUserIdentities } from '@mparticle/web-sdk';
2121
2222// BaseEvent not re-exported from @mparticle/web-sdk/internal, so we import directly from @mparticle/event-models.
2323import { BaseEvent } from '@mparticle/event-models' ;
24+ import {
25+ isSelectPlacementsAttributePersistenceDenied ,
26+ removeSelectPlacementsAttributePersistenceDeniedAttributes ,
27+ } from './selectPlacementsAttributePersistence' ;
2428
2529interface RoktKitSettings {
2630 accountId : string ;
@@ -240,32 +244,6 @@ const ROKT_THANK_YOU_JOURNEY_EXTENSION = 'ThankYouPageJourney';
240244const ROKT_INTEGRATION_SCRIPT_ID = 'rokt-launcher' ;
241245const ROKT_THANK_YOU_ELEMENT_SCRIPT_ID = 'rokt-thank-you-element' ;
242246const USER_IDENTIFIED_IN_WORKSPACE_KEY = 'userIdentifiedInWorkspace' ;
243- const SELECT_PLACEMENTS_ATTRIBUTE_PERSISTENCE_DENY_LIST = [
244- 'billingaddress1' ,
245- 'billingaddress2' ,
246- 'billingcity' ,
247- 'billingstate' ,
248- 'billingzipcode' ,
249- 'cartitems' ,
250- 'ccbin' ,
251- 'confirmationref' ,
252- 'conversiontype' ,
253- 'country' ,
254- 'couponcode' ,
255- 'currency' ,
256- 'language' ,
257- 'paymentserviceprovider' ,
258- 'paymentserviceproviderattribute' ,
259- 'paymenttype' ,
260- 'shippingaddress1' ,
261- 'shippingcity' ,
262- 'shippingcountry' ,
263- 'shippingmethod' ,
264- 'shippingstate' ,
265- 'shippingzipcode' ,
266- 'totalprice' ,
267- ] ;
268- const SELECT_PLACEMENTS_ATTRIBUTE_PERSISTENCE_DENY_SET = new Set ( SELECT_PLACEMENTS_ATTRIBUTE_PERSISTENCE_DENY_LIST ) ;
269247
270248// Bound on how long selectPlacements will wait for an in-flight Workspace
271249// IDSync search before proceeding without the userIdentifiedInWorkspace flag.
@@ -462,27 +440,6 @@ function isString(value: unknown): value is string {
462440 return typeof value === 'string' ;
463441}
464442
465- export function isSelectPlacementsAttributePersistenceDenied ( key : string ) : boolean {
466- return SELECT_PLACEMENTS_ATTRIBUTE_PERSISTENCE_DENY_SET . has ( key . toLowerCase ( ) ) ;
467- }
468-
469- export function removeSelectPlacementsAttributePersistenceDeniedAttributes (
470- attributes : Record < string , unknown > | null | undefined ,
471- ) : Record < string , unknown > {
472- const filteredAttributes : Record < string , unknown > = { } ;
473- const sourceAttributes = attributes || { } ;
474- const attributeKeys = Object . keys ( sourceAttributes ) ;
475-
476- for ( let i = 0 ; i < attributeKeys . length ; i ++ ) {
477- const key = attributeKeys [ i ] ;
478- if ( ! isSelectPlacementsAttributePersistenceDenied ( key ) ) {
479- filteredAttributes [ key ] = sourceAttributes [ key ] ;
480- }
481- }
482-
483- return filteredAttributes ;
484- }
485-
486443function generateIntegrationName ( customIntegrationName ?: string ) : string {
487444 const coreSdkVersion = mp ( ) . getVersion ( ) ;
488445 const kitVersion = process . env . PACKAGE_VERSION ;
0 commit comments