-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathtypes.ts
82 lines (76 loc) · 1.71 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
export type CustomerMetadata = {
name?: string;
email?: string;
external_id?: string;
metadata?: {[key: string]: any};
// TODO: include browser info
host?: string;
pathname?: string;
current_url?: string;
browser?: string;
os?: string;
ip?: string;
time_zone?: string;
};
export type Account = {
id: string;
company_name: string;
current_minutes_since_midnight: number;
is_outside_working_hours?: boolean;
subscription_plan?: string;
time_zone?: string;
};
export type User = {
id: number;
email: string;
display_name?: string;
full_name?: string;
profile_photo_url?: string;
};
export type Message = {
id?: string;
body: string;
sent_at?: string;
seen_at?: string;
created_at?: string;
customer_id?: string;
conversation_id?: string;
user_id?: number;
user?: User;
type?: 'bot' | 'agent' | 'customer';
file_ids?: Array<string>;
attachments?: Array<Attachment>;
quick_replies?: Array<any>;
metadata?: any;
};
export type Attachment = {
id: string;
filename: string;
file_url: string;
content_type: string;
};
export type WidgetSettings = {
id?: string;
subtitle?: string;
title?: string;
base_url?: string;
color?: string;
greeting?: string;
new_message_placeholder?: string;
email_input_placeholder?: string;
new_messages_notification_text?: string;
is_branding_hidden?: boolean;
show_agent_availability?: boolean;
agent_available_text?: string;
agent_unavailable_text?: string;
require_email_upfront?: boolean;
is_open_by_default?: boolean;
custom_icon_url?: string;
iframe_url_override?: string;
icon_variant?: 'outlined' | 'filled';
account?: Account;
};
export type QuickReply = {
text: string;
action: string;
};