| 1 |
import type { Direction, OrderBy, Status } from './table'; |
| 2 |
|
| 3 |
export interface MetaData { |
| 4 |
total: number; |
| 5 |
page: number; |
| 6 |
perPage: number; |
| 7 |
} |
| 8 |
|
| 9 |
export interface LandingPage { |
| 10 |
id: number; |
| 11 |
name: string; |
| 12 |
visitors: number; |
| 13 |
conversion_rate: number; |
| 14 |
last_published: string; |
| 15 |
published_url: string; |
| 16 |
uuid: string; |
| 17 |
wp_slug: string; |
| 18 |
lp_slug: string; |
| 19 |
kind: 'LeadpageV3' | 'LeadpageSplitTestV2'; |
| 20 |
} |
| 21 |
|
| 22 |
export interface LandingPageResponse { |
| 23 |
data: LandingPage[]; |
| 24 |
meta: MetaData; |
| 25 |
} |
| 26 |
|
| 27 |
export interface QueryState { |
| 28 |
orderBy: OrderBy; |
| 29 |
direction: Direction; |
| 30 |
status: Status; |
| 31 |
page: number; |
| 32 |
perPage: number; |
| 33 |
search: string; |
| 34 |
} |
| 35 |
|
| 36 |
export interface LoginStatusResponse { |
| 37 |
isLoggedIn: boolean; |
| 38 |
} |
| 39 |
|
| 40 |
/** |
| 41 |
* This is not an exhaustive list of possible error codes that could be returned from the server |
| 42 |
* or the perfect typing of the error response format. Be smart. Inspect the response object |
| 43 |
* and use this just to make TypeScript happy |
| 44 |
*/ |
| 45 |
|
| 46 |
export type ErrorCodes = 'name_conflict' | 'lp_sync_error' | 'lp_error' | 'lp_wp_error' | 'rest_invalid_param'; |
| 47 |
|
| 48 |
export interface WPResponseError { |
| 49 |
code: ErrorCodes; |
| 50 |
message: string; |
| 51 |
data: { |
| 52 |
status: number; |
| 53 |
params: { |
| 54 |
[key: string]: string; |
| 55 |
}; |
| 56 |
details: { |
| 57 |
[key: string]: { |
| 58 |
code: ErrorCodes; |
| 59 |
message: string; |
| 60 |
data: { |
| 61 |
status: number; |
| 62 |
}; |
| 63 |
}; |
| 64 |
}; |
| 65 |
}; |
| 66 |
} |
| 67 |
|