|
1 | 1 | import { Batch } from '@mparticle/event-models'; |
2 | | - |
3 | | -export type Dictionary<V = any> = Record<string, V>; |
| 2 | +import type { IdentityCallback } from './identity-user-interfaces'; |
| 3 | +import type { DataPlanConfig } from './sdkRuntimeModels'; |
| 4 | +import type { Dictionary } from './utils'; |
4 | 5 |
|
5 | 6 | export type MPID = string; |
6 | 7 |
|
@@ -30,44 +31,6 @@ export interface Logger { |
30 | 31 | verbose?: (message: string) => void; |
31 | 32 | } |
32 | 33 |
|
33 | | -export interface DataPlanResult { |
34 | | - dtpn?: { |
35 | | - vers: DataPlanVersion; |
36 | | - blok: { |
37 | | - ev: boolean; |
38 | | - ea: boolean; |
39 | | - ua: boolean; |
40 | | - id: boolean; |
41 | | - }; |
42 | | - }; |
43 | | - error_message?: string; |
44 | | -} |
45 | | - |
46 | | -export interface DataPlanVersion { |
47 | | - version?: number; |
48 | | - data_plan_id?: string; |
49 | | - last_modified_on?: string; |
50 | | - version_document?: Dictionary; |
51 | | -} |
52 | | - |
53 | | -export interface DataPlanConfig { |
54 | | - planId?: string; |
55 | | - planVersion?: number; |
56 | | - document?: DataPlanResult; |
57 | | -} |
58 | | - |
59 | | -export interface KitBlockerOptions { |
60 | | - dataPlanVersion: DataPlanVersion; |
61 | | - blockUserAttributes: boolean; |
62 | | - blockEventAttributes: boolean; |
63 | | - blockEvents: boolean; |
64 | | - blockUserIdentities: boolean; |
65 | | -} |
66 | | - |
67 | | -export interface KitBlockerDataPlan { |
68 | | - document: DataPlanResult; |
69 | | -} |
70 | | - |
71 | 34 | export type MPForwarder = Dictionary; |
72 | 35 |
|
73 | 36 | export type OnUserAlias = (previousUser: User, newUser: User) => void; |
@@ -223,44 +186,6 @@ export interface User { |
223 | 186 | getUserAudiences?(callback?: IdentityCallback): void; |
224 | 187 | } |
225 | 188 |
|
226 | | -export interface IdentityResultBody { |
227 | | - context: string | null; |
228 | | - is_ephemeral: boolean; |
229 | | - is_logged_in: boolean; |
230 | | - matched_identities: Record<string, unknown>; |
231 | | - mpid?: MPID; |
232 | | -} |
233 | | - |
234 | | -export interface IdentityModifyResultBody { |
235 | | - change_results?: { |
236 | | - identity_type: string; |
237 | | - modified_mpid: MPID; |
238 | | - }; |
239 | | -} |
240 | | - |
241 | | -export type IdentityHTTPCode = |
242 | | - | -1 // noHttpCoverage |
243 | | - | -2 // activeIdentityRequest |
244 | | - | -3 // activeSession |
245 | | - | -4 // validationIssue |
246 | | - | -5 // nativeIdentityRequest |
247 | | - | -6 // loggingDisabledOrMissingAPIKey |
248 | | - | 200 |
249 | | - | 202 |
250 | | - | 400 |
251 | | - | 429; |
252 | | - |
253 | | -export interface IdentityResult { |
254 | | - httpCode: IdentityHTTPCode; |
255 | | - getPreviousUser(): User; |
256 | | - getUser(): User; |
257 | | - body: IdentityResultBody | IdentityModifyResultBody; |
258 | | -} |
259 | | - |
260 | | -export interface IdentityCallback { |
261 | | - (result: IdentityResult): void; |
262 | | -} |
263 | | - |
264 | 189 | export type AliasRequestScope = 'device' | 'mpid'; |
265 | 190 |
|
266 | 191 | export interface UserAliasRequest { |
|
0 commit comments