-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
103 lines (86 loc) · 2.21 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* eslint-disable camelcase */
import Authentication from './services/Authentication';
export type TotalExpertAuth = InstanceType<typeof Authentication>;
// eslint-disable-next-line no-unused-vars
export type AuthenticationHook = (totalExpertAuthentication: Authentication) => Promise<void>;
export interface TotalExpertInit {
clientId: string;
clientSecret: string;
environment?: string;
accessToken?: string | null;
onAuthenticate?: AuthenticationHook;
onAuthenticateFailure?: AuthenticationHook;
}
export type TotalExpertId = string | number;
export type TotalExpertBoolean = 1 | 0;
export interface TotalExpertUser {
username?: string;
id?: string | number;
external_id?: string | number;
email?: string;
[key: string]: any;
}
export interface TotalExpertBorrower {
first_name: string;
last_name: string;
phone_cell?: string;
phone_home?: string;
phone_office?: string;
email?: string;
[key: string]: any;
}
export interface TotalExpertContactInit extends TotalExpertBorrower {
source: string;
}
export interface TotalExpertContactAdminInit extends TotalExpertContactInit {
owner: TotalExpertUser;
}
export interface TotalExpertContact extends TotalExpertContactAdminInit {
readonly id: number;
title?: string;
address?: string;
address_2?: string;
birthday?: string;
city?: string;
close_date?: string;
creation_date?: string;
[key: string]: any;
}
export interface CustomFieldContract {
value: any;
field_name: string;
description?: string;
}
export interface TotalExpertLoanInit {
external_id: string | number;
custom?: CustomFieldContract[];
borrower: TotalExpertBorrower;
[key: string]: any;
}
export interface TotalExpertLoanAdminInit extends TotalExpertLoanInit {
owner: TotalExpertUser;
}
export interface TotalExpertLoan {
readonly id: number;
}
export interface GetManyResponse<T> {
items: T[];
links: {
first: number | null;
last: number | null;
next: number | null;
prev: number | null;
}
}
export interface UpdateResponse {
readonly id: number;
existing: string;
hash?: string;
[key: string]: any;
}
export interface CreatedResponse {
readonly id: number;
created?: string;
duplicate?: string;
hash?: string;
}