|
| 1 | +import { IdentityApiData, MPID, UserIdentities } from '@mparticle/web-sdk'; |
| 2 | +import { |
| 3 | + IdentityCallback, |
| 4 | + IIdentityResponse, |
| 5 | +} from './identity-user-interfaces'; |
| 6 | +import { |
| 7 | + IAliasRequest, |
| 8 | + IAliasCallback, |
| 9 | + IIdentityRequest, |
| 10 | + IdentityAPIMethod, |
| 11 | + IIdentity, |
| 12 | +} from './identity.interfaces'; |
| 13 | +import { MParticleWebSDK } from './sdkRuntimeModels'; |
| 14 | + |
| 15 | +export interface IIdentityApiClient { |
| 16 | + sendAliasRequest: ( |
| 17 | + aliasRequest: IAliasRequest, |
| 18 | + aliasCallback: IAliasCallback |
| 19 | + ) => Promise<void>; |
| 20 | + sendIdentityRequest: ( |
| 21 | + identityApiRequest: IIdentityRequest, |
| 22 | + method: IdentityAPIMethod, |
| 23 | + callback: IdentityCallback, |
| 24 | + originalIdentityApiData: IdentityApiData, |
| 25 | + parseIdentityResponse: IIdentity['parseIdentityResponse'], |
| 26 | + mpid: MPID, |
| 27 | + knownIdentities: UserIdentities |
| 28 | + ) => Promise<void>; |
| 29 | + getUploadUrl: (method: IdentityAPIMethod, mpid: MPID) => string; |
| 30 | + getIdentityResponseFromFetch: ( |
| 31 | + response: Response, |
| 32 | + responseBody: string |
| 33 | + ) => IIdentityResponse; |
| 34 | + getIdentityResponseFromXHR: (response: Response) => IIdentityResponse; |
| 35 | +} |
| 36 | + |
| 37 | +// https://go.mparticle.com/work/SQDSDKS-6568 |
| 38 | +// https://go.mparticle.com/work/SQDSDKS-6679 |
| 39 | +// Combine with `sendIdentityRequest` above once module is fully migrated |
| 40 | +export type IIdentityApiClientSendAliasRequest = ( |
| 41 | + mpInstance: MParticleWebSDK, |
| 42 | + aliasRequest: IAliasRequest, |
| 43 | + aliasCallback: IAliasCallback |
| 44 | +) => Promise<void>; |
0 commit comments