|
1 | 1 | import { SDKEvent, SDKEventCustomFlags } from './sdkRuntimeModels'; |
2 | 2 | import { Dictionary } from './utils'; |
3 | | -import { IKitConfigs, IKitFilterSettings } from './configAPIClient'; |
| 3 | +import { |
| 4 | + IKitConfigs, |
| 5 | + IKitFilterSettings, |
| 6 | + IConfigResponse, |
| 7 | + IFilteringUserAttributeValue, |
| 8 | +} from './configAPIClient'; |
| 9 | +import { IForwardingStatsData } from './apiClient'; |
4 | 10 | import { IdentityApiData, IdentityType } from '@mparticle/web-sdk'; |
5 | 11 | import { Batch } from '@mparticle/event-models'; |
| 12 | +import { AsyncUploader } from './uploaders'; |
| 13 | +import { IPixelConfiguration } from './cookieSyncManager'; |
6 | 14 |
|
7 | 15 | import { |
8 | 16 | IMParticleUser, |
@@ -81,6 +89,7 @@ export interface ConfiguredKit |
81 | 89 | ): string; |
82 | 90 | onUserIdentified(user: IMParticleUser): string; |
83 | 91 | process(event: SDKEvent): string; |
| 92 | + processBatch?(batch: Batch): string; |
84 | 93 | setOptOut(isOptingOut: boolean): string; |
85 | 94 | removeUserAttribute(key: string): string; |
86 | 95 | setUserAttribute(key: string, value: string): string; |
@@ -140,3 +149,57 @@ export type forwardingStatsCallback = ( |
140 | 149 | forwarder: ConfiguredKit, |
141 | 150 | event: SDKEvent |
142 | 151 | ) => void; |
| 152 | + |
| 153 | +export interface IForwarders { |
| 154 | + forwarderStatsUploader: AsyncUploader; |
| 155 | + initForwarders( |
| 156 | + userIdentities: ISDKUserIdentity[], |
| 157 | + forwardingStatsCallback: forwardingStatsCallback |
| 158 | + ): void; |
| 159 | + isEnabledForUserAttributes( |
| 160 | + filterObject: IFilteringUserAttributeValue, |
| 161 | + user: IMParticleUser |
| 162 | + ): boolean; |
| 163 | + isEnabledForUnknownUser( |
| 164 | + excludeAnonymousUserBoolean: boolean, |
| 165 | + user: IMParticleUser |
| 166 | + ): boolean; |
| 167 | + applyToForwarders(functionName: string, functionArgs: unknown): void; |
| 168 | + sendEventToForwarders(event: SDKEvent): void; |
| 169 | + sendBatchToForwarders(batch: Batch): void; |
| 170 | + handleForwarderUserAttributes( |
| 171 | + functionNameKey: string, |
| 172 | + key: string, |
| 173 | + value: string |
| 174 | + ): void; |
| 175 | + setForwarderUserIdentities(userIdentities: ISDKUserIdentity[]): void; |
| 176 | + setForwarderOnUserIdentified(user: IMParticleUser): void; |
| 177 | + setForwarderOnIdentityComplete( |
| 178 | + user: IMParticleUser, |
| 179 | + identityMethod: string |
| 180 | + ): void; |
| 181 | + getForwarderStatsQueue(): IForwardingStatsData[]; |
| 182 | + setForwarderStatsQueue(queue: IForwardingStatsData[]): void; |
| 183 | + processForwarders( |
| 184 | + config: IConfigResponse, |
| 185 | + forwardingStatsCallback: forwardingStatsCallback |
| 186 | + ): void; |
| 187 | + processUIEnabledKits(config: IConfigResponse): void; |
| 188 | + returnKitConstructors(): Dictionary<RegisteredKit>; |
| 189 | + configureUIEnabledKit( |
| 190 | + configuration: IKitConfigs, |
| 191 | + kits: Dictionary<RegisteredKit> |
| 192 | + ): void; |
| 193 | + processSideloadedKits(mpConfig: IConfigResponse): void; |
| 194 | + configureSideloadedKit(kitConstructor: RegisteredKit): void; |
| 195 | + returnConfiguredKit( |
| 196 | + forwarder: RegisteredKit, |
| 197 | + config: Partial<IKitConfigs> |
| 198 | + ): MPForwarder; |
| 199 | + configurePixel(settings: IPixelConfiguration): void; |
| 200 | + processPixelConfigs(config: IConfigResponse): void; |
| 201 | + sendSingleForwardingStatsToServer( |
| 202 | + forwardingStatsData: IForwardingStatsData |
| 203 | + ): Promise<void>; |
| 204 | +} |
| 205 | + |
0 commit comments