-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathintegration.ts
More file actions
263 lines (230 loc) · 5.63 KB
/
integration.ts
File metadata and controls
263 lines (230 loc) · 5.63 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
import { cursorParams } from '@/inbox/graphql/schemas/conversation';
export const types = `
input InputRule {
_id : String!,
kind: String!,
text: String!,
condition: String!,
value: String,
}
type CloudflareCallDataDepartment {
_id: String
name: String
operators: JSON
}
type CloudflareCallsData {
header: String
description: String
secondPageHeader: String
secondPageDescription: String
departments: [CloudflareCallDataDepartment]
isReceiveWebCall: Boolean
}
type Form {
_id: String
title: String
code: String
}
type Integration @key(fields: "_id") {
_id: String!
kind: String!
name: String!
brandId: String!
languageCode: String
code: String
formId: String
tagIds: [String]
createdAt: Date
tags: [Tag]
leadData: JSON
messengerData: JSON
ticketData: JSON
uiOptions: JSON
isActive: Boolean
isConnected: Boolean
webhookData: JSON
brand: Brand
facebookPage: JSON
channels: [Channel]
healthStatus: JSON
form : Form
visibility: String
departmentIds: [String]
details: JSON
callData: CloudflareCallsData
}
type IntegrationRespone {
list: [Integration],
pageInfo: PageInfo
totalCount: Int,
}
type integrationsTotalCount {
total: Int
byTag: JSON
byChannel: JSON
byBrand: JSON
byKind: JSON
byStatus: JSON
}
type integrationsGetUsedTypes {
_id: String
name: String
}
input BotPersistentMenuTypeMessenger {
_id: String
type: String
text: String
link: String
isEditing: Boolean
}
input MessengerOnlineHoursSchema {
_id: String
day: String
from: String
to: String
}
input IntegrationLinks {
twitter: String
facebook: String
instagram:String
youtube: String
}
input IntegrationExternalLinks {
url: String
}
input IntegrationMessengerData {
_id: String
notifyCustomer: Boolean
botEndpointUrl: String
skillData: JSON
botShowInitialMessage: Boolean
botCheck: Boolean
botGreetMessage: String
getStarted: Boolean
persistentMenus: [BotPersistentMenuTypeMessenger]
availabilityMethod: String
isOnline: Boolean,
onlineHours: [MessengerOnlineHoursSchema]
timezone: String
responseRate: String
showTimezone: Boolean
messages: JSON
knowledgeBaseTopicId: String
links: IntegrationLinks
externalLinks: [IntegrationExternalLinks]
supporterIds: [String]
requireAuth: Boolean
showChat: Boolean
showLauncher: Boolean
forceLogoutWhenResolve: Boolean
showVideoCallRequest: Boolean
hideWhenOffline: Boolean
}
input MessengerUiOptions {
color: String
wallpaper: String
logo: String
textColor: String
}
input OperatorInput {
_id: String
userId: String
name: String
}
input DepartmentInput {
_id: String
name: String
operators: [OperatorInput]
}
input IntegrationCallData {
header: String
description: String
secondPageHeader: String
secondPageDescription: String
departments: [DepartmentInput]
isReceiveWebCall: Boolean
}
`;
export const queries = `
integrations(
${cursorParams},
page: Int,
perPage: Int,
kind: String,
searchValue: String,
channelId: String,
brandId: String,
tag: String,
status: String,
formLoadType: String,
sortField: String
sortDirection: Int
): IntegrationRespone
allLeadIntegrations: [Integration]
integrationsGetUsedTypes: [integrationsGetUsedTypes]
integrationGetLineWebhookUrl(_id: String!): String
integrationDetail(_id: String!): Integration
integrationsTotalCount(kind: String, brandId: String, tag: String, channelId: String, status: String, formLoadType: String): integrationsTotalCount
`;
export const mutations = `
integrationsCreateMessengerOnboarding(
brandName: String!,
languageCode: String
color: String
logo:String
): Integration
integrationsEditMessengerOnboarding(
_id: String!,
brandId: String!,
brandName: String!,
languageCode: String
color: String
logo:String
): Integration
integrationsCreateMessengerIntegration(
name: String!,
brandId: String!,
languageCode: String
channelIds: [String]
): Integration
integrationsEditMessengerIntegration(
_id: String!,
name: String!,
brandId: String!,
languageCode: String
channelIds: [String]
): Integration
integrationsSaveMessengerAppearanceData(
_id: String!,
uiOptions: MessengerUiOptions): Integration
integrationsSaveMessengerConfigs(
_id: String!,
messengerData: IntegrationMessengerData,
callData: IntegrationCallData
): Integration
integrationsCreateExternalIntegration(
kind: String!,
name: String!,
brandId: String!,
accountId: String,
channelIds: [String]
data: JSON): Integration
integrationsEditCommonFields(_id: String!, name: String!, brandId: String!, channelIds: [String], details: JSON): Integration
integrationsRemove(_id: String!): JSON
integrationsRemoveAccount(_id: String!, kind: String): JSON
integrationsRepair(_id: String!, kind: String!): JSON
integrationsArchive(_id: String!, status: Boolean!): Integration
integrationsSendSms(integrationId: String!, content: String!, to: String!): JSON
integrationsCreateLeadIntegration(
name: String!,
brandId: String!,
channelIds: [String]
): Integration
integrationsEditLeadIntegration(
_id: String!
name: String!,
brandId: String!,
channelIds: [String]
): Integration
integrationsCopyLeadIntegration(_id: String!): Integration
`;