PluginProbe
Leadpages / 1.1.2
Leadpages v1.1.2
1.3.0 1.2.1 1.2.2 1.2.3 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0
leadpages / src / types / api.ts

api.ts in Leadpages 1.1.2, at src/types/api.ts

67 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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