1- import { SDKEvent , SDKEventCustomFlags } from './sdkRuntimeModels' ;
1+ import { SDKEvent , SDKEventCustomFlags , SDKInitConfig } from './sdkRuntimeModels' ;
22import { Dictionary } from './utils' ;
33import { IKitConfigs , IKitFilterSettings } from './configAPIClient' ;
44import { IdentityApiData } from '@mparticle/web-sdk' ;
5+ import { IFilteringConsentRuleValues , IFilteringEventAttributeValue , IFilteringUserAttributeValue , IKitConfigs , IKitFilterSettings } from './configAPIClient' ;
6+ import { Callback , IdentityApiData , Logger , UserIdentities } from '@mparticle/web-sdk' ;
57import {
68 IMParticleUser ,
9+ ISDKUserAttributes ,
710 ISDKUserIdentity ,
811 UserAttributes ,
912} from './identity-user-interfaces' ;
10-
11- // TODO: https://go.mparticle.com/work/SQDSDKS-4475
12- export type MPForwarder = Dictionary ;
13+ import { IForwardingStatsData } from './apiClient' ;
14+ import { IPixelConfiguration } from './cookieSyncManager' ;
15+ import { IdentityAPIMethod } from './identity.interfaces' ;
16+ import { AsyncUploader } from './uploaders' ;
17+ import { IdentityType } from './types' ;
1318
1419// The state of the kit when accessed via window.KitName via CDN
1520// or imported as an NPM package
@@ -86,3 +91,103 @@ export type forwardingStatsCallback = (
8691 forwarder : ConfiguredKit ,
8792 event : SDKEvent
8893) => void ;
94+
95+
96+ export type UserIdentityFilters = typeof IdentityType [ ] ;
97+ export type UserAttributeFilters = number [ ] ;
98+
99+ // FIXME: Remove in favor of IKitConfigs.settings
100+ // https://go.mparticle.com/work/SQDSDKS-7113
101+ interface ForwarderSettings {
102+ PriorityValue ?: number ;
103+ }
104+
105+ export interface IMPForwarder {
106+ // @deprecated
107+ setForwarderUserIdentities : ( userIdentities : UserIdentities ) => void ;
108+
109+ setForwarderOnUserIdentified : ( user : IMParticleUser ) => void ;
110+ setForwarderOnIdentityComplete : ( user : IMParticleUser , identityMethod : IdentityAPIMethod ) => void ;
111+ handleForwarderUserAttributes : ( functionNameKey : string , key : string , value : string | string [ ] ) => void ;
112+ id : number ;
113+ settings : ForwarderSettings ;
114+ forwarderStatsUploader : AsyncUploader ;
115+ isInitialized : boolean ;
116+ filteringConsentRuleValues : IFilteringConsentRuleValues ;
117+ filteringUserAttributeValue : IFilteringUserAttributeValue ;
118+ filteringEventAttributeValue : IFilteringEventAttributeValue ;
119+ excludeAnonymousUser : boolean ;
120+ userIdentityFilters : UserIdentityFilters ;
121+ userAttributeFilters : UserAttributeFilters ;
122+ initialized : boolean ;
123+ logger : Logger ;
124+
125+ suffix ?: string ;
126+
127+ eventSubscriptionId : number ;
128+
129+ eventNameFilters : number [ ] ;
130+ eventTypeFilters : number [ ] ;
131+ attributeFilters : number [ ] ;
132+
133+ screenNameFilters : number [ ] ;
134+ screenAttributeFilters : number [ ] ;
135+
136+
137+ // Side loaded kit functionality in Forwarder methods
138+ kitInstance : UnregisteredKit ;
139+
140+ // https://go.mparticle.com/work/SQDSDKS-5156
141+ isSandbox ?: boolean ;
142+ hasSandbox ?: boolean ;
143+ isVisible ?: boolean ;
144+
145+ configureSideloadedKit : ( kitConstructor : RegisteredKit ) => void ;
146+
147+ sendSingleForwardingStatsToServer : ( forwardingStatsData : IForwardingStatsData ) => void ;
148+ applyToForwarders : ( functionName : string , functionArgs : any [ ] ) => void ;
149+ sendEventToForwarders : ( event : SDKEvent ) => void ;
150+ processPixelConfigs : ( pixelConfigs : SDKInitConfig ) => void ;
151+ configurePixel : ( pixelConfig : IPixelConfiguration ) => void ;
152+ returnConfiguredKit : ( forwarder : RegisteredKit , config : IKitConfigs ) => IMPForwarder ;
153+
154+ processSideloadedKits : ( mpConfig : SDKInitConfig ) => void ;
155+
156+ init : (
157+ setting : ForwarderSettings ,
158+ forwarderSettingsCallback : Callback ,
159+ testMode : boolean ,
160+ trackerId : string | number | null ,
161+ filteredUserAttributes : ISDKUserAttributes ,
162+ filteredUserIdentities : ISDKUserIdentity [ ] ,
163+ appVersion : string ,
164+ appName : string ,
165+ customFlags : SDKEventCustomFlags ,
166+ clientId : string
167+ ) => void ;
168+
169+ initForwarders : ( userIdentities : UserIdentities , forwarderStatsCallback : Callback ) => void ;
170+ isEnabledForUserAttributes : ( filterObject ?: IFilteringUserAttributeValue , user ?: IMParticleUser ) => boolean ;
171+ isEnabledForUnknownUser : ( excludeAnonymousUserBoolean : boolean , user : IMParticleUser ) => boolean ;
172+
173+ name ?: string ;
174+
175+ // Techically these do not return a value, but we sometimes use a string as a debug message
176+ onUserIdentified ?: ( user : IMParticleUser , identityApiData ?: IdentityApiData ) => string ;
177+ onIdentifyComplete ?: ( user : IMParticleUser , identityApiData : IdentityApiData ) => string ;
178+ onLoginComplete ?: ( user : IMParticleUser , identityApiData : IdentityApiData ) => string ;
179+ onLogoutComplete ?: ( user : IMParticleUser , identityApiData : IdentityApiData ) => string ;
180+ onModifyComplete ?: ( user : IMParticleUser , identityApiData : IdentityApiData ) => string ;
181+ setOptOut : ( optOut : boolean ) => string ;
182+ setUserAttribute ?: ( key : string , value : string | string [ ] ) => string ;
183+ removeUserAttribute ?: ( key : string ) => string ;
184+ process ?: ( event : SDKEvent ) => string ;
185+ setUserIdentity ?: ( identity : string , type : number ) => string ;
186+
187+ getForwarderStatsQueue : ( ) => IForwardingStatsData [ ] ;
188+ setForwarderStatsQueue : ( queue : IForwardingStatsData [ ] ) => void ;
189+ processForwarders : ( config : SDKInitConfig , forwardingStatsCallback : Callback ) => void ;
190+ processUIEnabledKits : ( config : SDKInitConfig ) => void ;
191+ returnKitConstructors : ( ) => Dictionary < RegisteredKit > ;
192+ configureUIEnabledKit : ( config : IKitConfigs , kitConstructor : Dictionary < RegisteredKit > ) => void ;
193+ }
0 commit comments