digital-tools 2.0.2 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/package.json +3 -4
- package/src/define.js +267 -0
- package/src/entities/advertising.js +999 -0
- package/src/entities/ai.js +756 -0
- package/src/entities/analytics.js +1588 -0
- package/src/entities/automation.js +601 -0
- package/src/entities/communication.js +1150 -0
- package/src/entities/crm.js +1386 -0
- package/src/entities/design.js +546 -0
- package/src/entities/development.js +2212 -0
- package/src/entities/document.js +874 -0
- package/src/entities/ecommerce.js +1429 -0
- package/src/entities/experiment.js +1039 -0
- package/src/entities/finance.js +3478 -0
- package/src/entities/forms.js +1892 -0
- package/src/entities/hr.js +661 -0
- package/src/entities/identity.js +997 -0
- package/src/entities/index.js +282 -0
- package/src/entities/infrastructure.js +1153 -0
- package/src/entities/knowledge.js +1438 -0
- package/src/entities/marketing.js +1610 -0
- package/src/entities/media.js +1634 -0
- package/src/entities/notification.js +1199 -0
- package/src/entities/presentation.js +1274 -0
- package/src/entities/productivity.js +1317 -0
- package/src/entities/project-management.js +1136 -0
- package/src/entities/recruiting.js +736 -0
- package/src/entities/shipping.js +509 -0
- package/src/entities/signature.js +1102 -0
- package/src/entities/site.js +222 -0
- package/src/entities/spreadsheet.js +1341 -0
- package/src/entities/storage.js +1198 -0
- package/src/entities/support.js +1166 -0
- package/src/entities/video-conferencing.js +1750 -0
- package/src/entities/video.js +950 -0
- package/src/entities.js +1663 -0
- package/src/index.js +74 -0
- package/src/providers/analytics/index.js +17 -0
- package/src/providers/analytics/mixpanel.js +255 -0
- package/src/providers/calendar/cal-com.js +303 -0
- package/src/providers/calendar/google-calendar.js +335 -0
- package/src/providers/calendar/index.js +20 -0
- package/src/providers/crm/hubspot.js +566 -0
- package/src/providers/crm/index.js +17 -0
- package/src/providers/development/github.js +472 -0
- package/src/providers/development/index.js +17 -0
- package/src/providers/ecommerce/index.js +17 -0
- package/src/providers/ecommerce/shopify.js +378 -0
- package/src/providers/email/index.js +20 -0
- package/src/providers/email/resend.js +258 -0
- package/src/providers/email/sendgrid.js +161 -0
- package/src/providers/finance/index.js +17 -0
- package/src/providers/finance/stripe.js +549 -0
- package/src/providers/forms/index.js +17 -0
- package/src/providers/forms/typeform.js +500 -0
- package/src/providers/index.js +123 -0
- package/src/providers/knowledge/index.js +17 -0
- package/src/providers/knowledge/notion.js +389 -0
- package/src/providers/marketing/index.js +17 -0
- package/src/providers/marketing/mailchimp.js +443 -0
- package/src/providers/media/cloudinary.js +318 -0
- package/src/providers/media/index.js +17 -0
- package/src/providers/messaging/index.js +20 -0
- package/src/providers/messaging/slack.js +393 -0
- package/src/providers/messaging/twilio-sms.js +249 -0
- package/src/providers/project-management/index.js +17 -0
- package/src/providers/project-management/linear.js +575 -0
- package/src/providers/registry.js +86 -0
- package/src/providers/spreadsheet/google-sheets.js +375 -0
- package/src/providers/spreadsheet/index.js +20 -0
- package/src/providers/spreadsheet/xlsx.js +423 -0
- package/src/providers/storage/index.js +24 -0
- package/src/providers/storage/s3.js +419 -0
- package/src/providers/support/index.js +17 -0
- package/src/providers/support/zendesk.js +373 -0
- package/src/providers/tasks/index.js +17 -0
- package/src/providers/tasks/todoist.js +286 -0
- package/src/providers/types.js +9 -0
- package/src/providers/video-conferencing/google-meet.js +286 -0
- package/src/providers/video-conferencing/index.js +31 -0
- package/src/providers/video-conferencing/jitsi.js +254 -0
- package/src/providers/video-conferencing/teams.js +270 -0
- package/src/providers/video-conferencing/zoom.js +332 -0
- package/src/registry.js +128 -0
- package/src/tools/communication.js +184 -0
- package/src/tools/data.js +205 -0
- package/src/tools/index.js +11 -0
- package/src/tools/web.js +137 -0
- package/src/types.js +10 -0
- package/test/define.test.js +306 -0
- package/test/registry.test.js +357 -0
- package/test/tools.test.js +363 -0
|
@@ -0,0 +1,1150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Communication Entity Types (Nouns)
|
|
3
|
+
*
|
|
4
|
+
* Simplified single-word nouns for all communication primitives.
|
|
5
|
+
* Uses `type` property to distinguish variants rather than separate entities.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// Message
|
|
11
|
+
// =============================================================================
|
|
12
|
+
/**
|
|
13
|
+
* Message entity
|
|
14
|
+
*
|
|
15
|
+
* Universal async communication unit. The `type` property distinguishes:
|
|
16
|
+
* - email: Traditional email message
|
|
17
|
+
* - text: SMS/MMS text message
|
|
18
|
+
* - chat: Team chat message (Slack, Teams, Discord)
|
|
19
|
+
* - direct: Person-to-person direct message
|
|
20
|
+
* - voicemail: Recorded voice message
|
|
21
|
+
*/
|
|
22
|
+
export const Message = {
|
|
23
|
+
singular: 'message',
|
|
24
|
+
plural: 'messages',
|
|
25
|
+
description: 'An async communication unit (email, text, chat, direct, voicemail)',
|
|
26
|
+
properties: {
|
|
27
|
+
// Type
|
|
28
|
+
type: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'Message type: email, text, chat, direct, voicemail',
|
|
31
|
+
examples: ['email', 'text', 'chat', 'direct', 'voicemail'],
|
|
32
|
+
},
|
|
33
|
+
// Identity
|
|
34
|
+
id: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Unique message identifier',
|
|
37
|
+
},
|
|
38
|
+
// Addressing
|
|
39
|
+
from: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'Sender address (email, phone, user ID)',
|
|
42
|
+
},
|
|
43
|
+
to: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
array: true,
|
|
46
|
+
description: 'Recipient addresses',
|
|
47
|
+
},
|
|
48
|
+
cc: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
array: true,
|
|
51
|
+
optional: true,
|
|
52
|
+
description: 'Carbon copy recipients (email only)',
|
|
53
|
+
},
|
|
54
|
+
bcc: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
array: true,
|
|
57
|
+
optional: true,
|
|
58
|
+
description: 'Blind carbon copy recipients (email only)',
|
|
59
|
+
},
|
|
60
|
+
replyTo: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
optional: true,
|
|
63
|
+
description: 'Reply-to address',
|
|
64
|
+
},
|
|
65
|
+
// Content
|
|
66
|
+
subject: {
|
|
67
|
+
type: 'string',
|
|
68
|
+
optional: true,
|
|
69
|
+
description: 'Message subject (email, some chat systems)',
|
|
70
|
+
},
|
|
71
|
+
body: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
description: 'Message content (plain text)',
|
|
74
|
+
},
|
|
75
|
+
html: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
optional: true,
|
|
78
|
+
description: 'HTML content (email)',
|
|
79
|
+
},
|
|
80
|
+
mediaUrl: {
|
|
81
|
+
type: 'url',
|
|
82
|
+
optional: true,
|
|
83
|
+
description: 'Media URL (voicemail audio, MMS image)',
|
|
84
|
+
},
|
|
85
|
+
// Threading
|
|
86
|
+
threadId: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
optional: true,
|
|
89
|
+
description: 'Thread/conversation identifier',
|
|
90
|
+
},
|
|
91
|
+
parentId: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
optional: true,
|
|
94
|
+
description: 'Parent message ID (for replies)',
|
|
95
|
+
},
|
|
96
|
+
replyToId: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
optional: true,
|
|
99
|
+
description: 'Message being replied to',
|
|
100
|
+
},
|
|
101
|
+
// Channel context (for chat type)
|
|
102
|
+
channelId: {
|
|
103
|
+
type: 'string',
|
|
104
|
+
optional: true,
|
|
105
|
+
description: 'Channel identifier (chat messages)',
|
|
106
|
+
},
|
|
107
|
+
workspaceId: {
|
|
108
|
+
type: 'string',
|
|
109
|
+
optional: true,
|
|
110
|
+
description: 'Workspace identifier (chat messages)',
|
|
111
|
+
},
|
|
112
|
+
// Status
|
|
113
|
+
status: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
description: 'Message status',
|
|
116
|
+
examples: ['draft', 'queued', 'sent', 'delivered', 'read', 'failed', 'bounced'],
|
|
117
|
+
},
|
|
118
|
+
read: {
|
|
119
|
+
type: 'boolean',
|
|
120
|
+
optional: true,
|
|
121
|
+
description: 'Whether message has been read',
|
|
122
|
+
},
|
|
123
|
+
starred: {
|
|
124
|
+
type: 'boolean',
|
|
125
|
+
optional: true,
|
|
126
|
+
description: 'Whether message is starred/flagged',
|
|
127
|
+
},
|
|
128
|
+
// Voicemail specific
|
|
129
|
+
duration: {
|
|
130
|
+
type: 'number',
|
|
131
|
+
optional: true,
|
|
132
|
+
description: 'Duration in seconds (voicemail)',
|
|
133
|
+
},
|
|
134
|
+
transcription: {
|
|
135
|
+
type: 'string',
|
|
136
|
+
optional: true,
|
|
137
|
+
description: 'Transcribed text (voicemail)',
|
|
138
|
+
},
|
|
139
|
+
// Metadata
|
|
140
|
+
labels: {
|
|
141
|
+
type: 'string',
|
|
142
|
+
array: true,
|
|
143
|
+
optional: true,
|
|
144
|
+
description: 'Labels or tags',
|
|
145
|
+
},
|
|
146
|
+
priority: {
|
|
147
|
+
type: 'string',
|
|
148
|
+
optional: true,
|
|
149
|
+
description: 'Priority: low, normal, high, urgent',
|
|
150
|
+
examples: ['low', 'normal', 'high', 'urgent'],
|
|
151
|
+
},
|
|
152
|
+
metadata: {
|
|
153
|
+
type: 'json',
|
|
154
|
+
optional: true,
|
|
155
|
+
description: 'Additional metadata',
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
relationships: {
|
|
159
|
+
thread: {
|
|
160
|
+
type: 'Thread',
|
|
161
|
+
backref: 'messages',
|
|
162
|
+
required: false,
|
|
163
|
+
description: 'Thread this message belongs to',
|
|
164
|
+
},
|
|
165
|
+
sender: {
|
|
166
|
+
type: 'Contact',
|
|
167
|
+
description: 'Sender as contact',
|
|
168
|
+
},
|
|
169
|
+
recipients: {
|
|
170
|
+
type: 'Contact[]',
|
|
171
|
+
description: 'Recipients as contacts',
|
|
172
|
+
},
|
|
173
|
+
attachments: {
|
|
174
|
+
type: 'Attachment[]',
|
|
175
|
+
description: 'File attachments',
|
|
176
|
+
},
|
|
177
|
+
reactions: {
|
|
178
|
+
type: 'Reaction[]',
|
|
179
|
+
backref: 'message',
|
|
180
|
+
description: 'Emoji reactions',
|
|
181
|
+
},
|
|
182
|
+
channel: {
|
|
183
|
+
type: 'Channel',
|
|
184
|
+
required: false,
|
|
185
|
+
description: 'Channel (for chat messages)',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
actions: [
|
|
189
|
+
'send',
|
|
190
|
+
'reply',
|
|
191
|
+
'forward',
|
|
192
|
+
'edit',
|
|
193
|
+
'delete',
|
|
194
|
+
'archive',
|
|
195
|
+
'star',
|
|
196
|
+
'unstar',
|
|
197
|
+
'read',
|
|
198
|
+
'unread',
|
|
199
|
+
'label',
|
|
200
|
+
'unlabel',
|
|
201
|
+
'pin',
|
|
202
|
+
'unpin',
|
|
203
|
+
'react',
|
|
204
|
+
'transcribe',
|
|
205
|
+
'schedule',
|
|
206
|
+
],
|
|
207
|
+
events: [
|
|
208
|
+
'sent',
|
|
209
|
+
'delivered',
|
|
210
|
+
'read',
|
|
211
|
+
'failed',
|
|
212
|
+
'bounced',
|
|
213
|
+
'opened',
|
|
214
|
+
'clicked',
|
|
215
|
+
'replied',
|
|
216
|
+
'forwarded',
|
|
217
|
+
'edited',
|
|
218
|
+
'deleted',
|
|
219
|
+
'archived',
|
|
220
|
+
'starred',
|
|
221
|
+
'labeled',
|
|
222
|
+
'pinned',
|
|
223
|
+
'reacted',
|
|
224
|
+
'transcribed',
|
|
225
|
+
],
|
|
226
|
+
};
|
|
227
|
+
// =============================================================================
|
|
228
|
+
// Thread
|
|
229
|
+
// =============================================================================
|
|
230
|
+
/**
|
|
231
|
+
* Thread entity
|
|
232
|
+
*
|
|
233
|
+
* Container for related messages. Works for email threads, chat threads,
|
|
234
|
+
* SMS conversations, etc.
|
|
235
|
+
*/
|
|
236
|
+
export const Thread = {
|
|
237
|
+
singular: 'thread',
|
|
238
|
+
plural: 'threads',
|
|
239
|
+
description: 'A container for related messages (conversation)',
|
|
240
|
+
properties: {
|
|
241
|
+
// Identity
|
|
242
|
+
id: {
|
|
243
|
+
type: 'string',
|
|
244
|
+
description: 'Unique thread identifier',
|
|
245
|
+
},
|
|
246
|
+
// Type
|
|
247
|
+
type: {
|
|
248
|
+
type: 'string',
|
|
249
|
+
optional: true,
|
|
250
|
+
description: 'Thread type: email, text, chat',
|
|
251
|
+
examples: ['email', 'text', 'chat'],
|
|
252
|
+
},
|
|
253
|
+
// Content summary
|
|
254
|
+
subject: {
|
|
255
|
+
type: 'string',
|
|
256
|
+
optional: true,
|
|
257
|
+
description: 'Thread subject',
|
|
258
|
+
},
|
|
259
|
+
snippet: {
|
|
260
|
+
type: 'string',
|
|
261
|
+
optional: true,
|
|
262
|
+
description: 'Preview of latest message',
|
|
263
|
+
},
|
|
264
|
+
messageCount: {
|
|
265
|
+
type: 'number',
|
|
266
|
+
optional: true,
|
|
267
|
+
description: 'Number of messages in thread',
|
|
268
|
+
},
|
|
269
|
+
// Participants
|
|
270
|
+
participants: {
|
|
271
|
+
type: 'string',
|
|
272
|
+
array: true,
|
|
273
|
+
optional: true,
|
|
274
|
+
description: 'Participant addresses/IDs',
|
|
275
|
+
},
|
|
276
|
+
// Status
|
|
277
|
+
read: {
|
|
278
|
+
type: 'boolean',
|
|
279
|
+
optional: true,
|
|
280
|
+
description: 'Whether all messages are read',
|
|
281
|
+
},
|
|
282
|
+
unreadCount: {
|
|
283
|
+
type: 'number',
|
|
284
|
+
optional: true,
|
|
285
|
+
description: 'Number of unread messages',
|
|
286
|
+
},
|
|
287
|
+
archived: {
|
|
288
|
+
type: 'boolean',
|
|
289
|
+
optional: true,
|
|
290
|
+
description: 'Whether thread is archived',
|
|
291
|
+
},
|
|
292
|
+
muted: {
|
|
293
|
+
type: 'boolean',
|
|
294
|
+
optional: true,
|
|
295
|
+
description: 'Whether notifications are muted',
|
|
296
|
+
},
|
|
297
|
+
starred: {
|
|
298
|
+
type: 'boolean',
|
|
299
|
+
optional: true,
|
|
300
|
+
description: 'Whether thread is starred',
|
|
301
|
+
},
|
|
302
|
+
pinned: {
|
|
303
|
+
type: 'boolean',
|
|
304
|
+
optional: true,
|
|
305
|
+
description: 'Whether thread is pinned',
|
|
306
|
+
},
|
|
307
|
+
// Metadata
|
|
308
|
+
labels: {
|
|
309
|
+
type: 'string',
|
|
310
|
+
array: true,
|
|
311
|
+
optional: true,
|
|
312
|
+
description: 'Labels or tags',
|
|
313
|
+
},
|
|
314
|
+
lastMessageAt: {
|
|
315
|
+
type: 'datetime',
|
|
316
|
+
optional: true,
|
|
317
|
+
description: 'Timestamp of last message',
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
relationships: {
|
|
321
|
+
messages: {
|
|
322
|
+
type: 'Message[]',
|
|
323
|
+
backref: 'thread',
|
|
324
|
+
description: 'Messages in this thread',
|
|
325
|
+
},
|
|
326
|
+
channel: {
|
|
327
|
+
type: 'Channel',
|
|
328
|
+
required: false,
|
|
329
|
+
description: 'Channel (for chat threads)',
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
actions: [
|
|
333
|
+
'archive',
|
|
334
|
+
'unarchive',
|
|
335
|
+
'delete',
|
|
336
|
+
'read',
|
|
337
|
+
'unread',
|
|
338
|
+
'mute',
|
|
339
|
+
'unmute',
|
|
340
|
+
'star',
|
|
341
|
+
'unstar',
|
|
342
|
+
'pin',
|
|
343
|
+
'unpin',
|
|
344
|
+
'label',
|
|
345
|
+
'unlabel',
|
|
346
|
+
'move',
|
|
347
|
+
],
|
|
348
|
+
events: [
|
|
349
|
+
'created',
|
|
350
|
+
'updated',
|
|
351
|
+
'archived',
|
|
352
|
+
'deleted',
|
|
353
|
+
'read',
|
|
354
|
+
'muted',
|
|
355
|
+
'unmuted',
|
|
356
|
+
'starred',
|
|
357
|
+
'pinned',
|
|
358
|
+
'labeled',
|
|
359
|
+
'moved',
|
|
360
|
+
],
|
|
361
|
+
};
|
|
362
|
+
// =============================================================================
|
|
363
|
+
// Call
|
|
364
|
+
// =============================================================================
|
|
365
|
+
/**
|
|
366
|
+
* Call entity
|
|
367
|
+
*
|
|
368
|
+
* Real-time voice/video communication. The `type` property distinguishes:
|
|
369
|
+
* - phone: Traditional phone call
|
|
370
|
+
* - web: Browser-based call
|
|
371
|
+
* - video: Video call
|
|
372
|
+
*/
|
|
373
|
+
export const Call = {
|
|
374
|
+
singular: 'call',
|
|
375
|
+
plural: 'calls',
|
|
376
|
+
description: 'A real-time voice or video communication',
|
|
377
|
+
properties: {
|
|
378
|
+
// Type
|
|
379
|
+
type: {
|
|
380
|
+
type: 'string',
|
|
381
|
+
description: 'Call type: phone, web, video',
|
|
382
|
+
examples: ['phone', 'web', 'video'],
|
|
383
|
+
},
|
|
384
|
+
// Identity
|
|
385
|
+
id: {
|
|
386
|
+
type: 'string',
|
|
387
|
+
description: 'Unique call identifier',
|
|
388
|
+
},
|
|
389
|
+
// Direction
|
|
390
|
+
direction: {
|
|
391
|
+
type: 'string',
|
|
392
|
+
description: 'Call direction: inbound, outbound',
|
|
393
|
+
examples: ['inbound', 'outbound'],
|
|
394
|
+
},
|
|
395
|
+
// Participants
|
|
396
|
+
from: {
|
|
397
|
+
type: 'string',
|
|
398
|
+
description: 'Caller address (phone number, user ID)',
|
|
399
|
+
},
|
|
400
|
+
to: {
|
|
401
|
+
type: 'string',
|
|
402
|
+
description: 'Callee address',
|
|
403
|
+
},
|
|
404
|
+
participants: {
|
|
405
|
+
type: 'string',
|
|
406
|
+
array: true,
|
|
407
|
+
optional: true,
|
|
408
|
+
description: 'All participants (for group calls)',
|
|
409
|
+
},
|
|
410
|
+
// Status
|
|
411
|
+
status: {
|
|
412
|
+
type: 'string',
|
|
413
|
+
description: 'Call status',
|
|
414
|
+
examples: ['queued', 'ringing', 'answered', 'active', 'hold', 'ended', 'failed', 'busy', 'noanswer'],
|
|
415
|
+
},
|
|
416
|
+
// Timing
|
|
417
|
+
startedAt: {
|
|
418
|
+
type: 'datetime',
|
|
419
|
+
optional: true,
|
|
420
|
+
description: 'When call started',
|
|
421
|
+
},
|
|
422
|
+
answeredAt: {
|
|
423
|
+
type: 'datetime',
|
|
424
|
+
optional: true,
|
|
425
|
+
description: 'When call was answered',
|
|
426
|
+
},
|
|
427
|
+
endedAt: {
|
|
428
|
+
type: 'datetime',
|
|
429
|
+
optional: true,
|
|
430
|
+
description: 'When call ended',
|
|
431
|
+
},
|
|
432
|
+
duration: {
|
|
433
|
+
type: 'number',
|
|
434
|
+
optional: true,
|
|
435
|
+
description: 'Call duration in seconds',
|
|
436
|
+
},
|
|
437
|
+
// Recording
|
|
438
|
+
recorded: {
|
|
439
|
+
type: 'boolean',
|
|
440
|
+
optional: true,
|
|
441
|
+
description: 'Whether call was recorded',
|
|
442
|
+
},
|
|
443
|
+
recordingUrl: {
|
|
444
|
+
type: 'url',
|
|
445
|
+
optional: true,
|
|
446
|
+
description: 'URL to recording',
|
|
447
|
+
},
|
|
448
|
+
// Transcription
|
|
449
|
+
transcription: {
|
|
450
|
+
type: 'string',
|
|
451
|
+
optional: true,
|
|
452
|
+
description: 'Call transcription',
|
|
453
|
+
},
|
|
454
|
+
transcript: {
|
|
455
|
+
type: 'json',
|
|
456
|
+
optional: true,
|
|
457
|
+
description: 'Detailed transcript with timestamps',
|
|
458
|
+
},
|
|
459
|
+
// AI/Assistant (for voice AI calls)
|
|
460
|
+
assistantId: {
|
|
461
|
+
type: 'string',
|
|
462
|
+
optional: true,
|
|
463
|
+
description: 'AI assistant ID (for AI calls)',
|
|
464
|
+
},
|
|
465
|
+
summary: {
|
|
466
|
+
type: 'string',
|
|
467
|
+
optional: true,
|
|
468
|
+
description: 'AI-generated call summary',
|
|
469
|
+
},
|
|
470
|
+
analysis: {
|
|
471
|
+
type: 'json',
|
|
472
|
+
optional: true,
|
|
473
|
+
description: 'Call analysis/structured data',
|
|
474
|
+
},
|
|
475
|
+
// Cost
|
|
476
|
+
cost: {
|
|
477
|
+
type: 'number',
|
|
478
|
+
optional: true,
|
|
479
|
+
description: 'Call cost',
|
|
480
|
+
},
|
|
481
|
+
currency: {
|
|
482
|
+
type: 'string',
|
|
483
|
+
optional: true,
|
|
484
|
+
description: 'Currency code',
|
|
485
|
+
},
|
|
486
|
+
// Quality
|
|
487
|
+
quality: {
|
|
488
|
+
type: 'string',
|
|
489
|
+
optional: true,
|
|
490
|
+
description: 'Call quality: excellent, good, fair, poor',
|
|
491
|
+
examples: ['excellent', 'good', 'fair', 'poor'],
|
|
492
|
+
},
|
|
493
|
+
// Metadata
|
|
494
|
+
metadata: {
|
|
495
|
+
type: 'json',
|
|
496
|
+
optional: true,
|
|
497
|
+
description: 'Additional metadata',
|
|
498
|
+
},
|
|
499
|
+
},
|
|
500
|
+
relationships: {
|
|
501
|
+
caller: {
|
|
502
|
+
type: 'Contact',
|
|
503
|
+
description: 'Caller as contact',
|
|
504
|
+
},
|
|
505
|
+
callee: {
|
|
506
|
+
type: 'Contact',
|
|
507
|
+
description: 'Callee as contact',
|
|
508
|
+
},
|
|
509
|
+
messages: {
|
|
510
|
+
type: 'Message[]',
|
|
511
|
+
description: 'Related messages (voicemail if missed)',
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
actions: [
|
|
515
|
+
'initiate',
|
|
516
|
+
'answer',
|
|
517
|
+
'reject',
|
|
518
|
+
'hold',
|
|
519
|
+
'unhold',
|
|
520
|
+
'mute',
|
|
521
|
+
'unmute',
|
|
522
|
+
'transfer',
|
|
523
|
+
'merge',
|
|
524
|
+
'record',
|
|
525
|
+
'transcribe',
|
|
526
|
+
'end',
|
|
527
|
+
],
|
|
528
|
+
events: [
|
|
529
|
+
'initiated',
|
|
530
|
+
'ringing',
|
|
531
|
+
'answered',
|
|
532
|
+
'rejected',
|
|
533
|
+
'held',
|
|
534
|
+
'unheld',
|
|
535
|
+
'muted',
|
|
536
|
+
'unmuted',
|
|
537
|
+
'transferred',
|
|
538
|
+
'merged',
|
|
539
|
+
'recorded',
|
|
540
|
+
'transcribed',
|
|
541
|
+
'ended',
|
|
542
|
+
'failed',
|
|
543
|
+
],
|
|
544
|
+
};
|
|
545
|
+
// =============================================================================
|
|
546
|
+
// Channel
|
|
547
|
+
// =============================================================================
|
|
548
|
+
/**
|
|
549
|
+
* Channel entity
|
|
550
|
+
*
|
|
551
|
+
* Persistent topic-based communication space.
|
|
552
|
+
*/
|
|
553
|
+
export const Channel = {
|
|
554
|
+
singular: 'channel',
|
|
555
|
+
plural: 'channels',
|
|
556
|
+
description: 'A persistent topic-based communication space',
|
|
557
|
+
properties: {
|
|
558
|
+
// Identity
|
|
559
|
+
id: {
|
|
560
|
+
type: 'string',
|
|
561
|
+
description: 'Unique channel identifier',
|
|
562
|
+
},
|
|
563
|
+
name: {
|
|
564
|
+
type: 'string',
|
|
565
|
+
description: 'Channel name',
|
|
566
|
+
},
|
|
567
|
+
description: {
|
|
568
|
+
type: 'string',
|
|
569
|
+
optional: true,
|
|
570
|
+
description: 'Channel description/purpose',
|
|
571
|
+
},
|
|
572
|
+
topic: {
|
|
573
|
+
type: 'string',
|
|
574
|
+
optional: true,
|
|
575
|
+
description: 'Current topic',
|
|
576
|
+
},
|
|
577
|
+
// Type
|
|
578
|
+
type: {
|
|
579
|
+
type: 'string',
|
|
580
|
+
description: 'Channel type: public, private, shared',
|
|
581
|
+
examples: ['public', 'private', 'shared'],
|
|
582
|
+
},
|
|
583
|
+
// Status
|
|
584
|
+
archived: {
|
|
585
|
+
type: 'boolean',
|
|
586
|
+
optional: true,
|
|
587
|
+
description: 'Whether channel is archived',
|
|
588
|
+
},
|
|
589
|
+
muted: {
|
|
590
|
+
type: 'boolean',
|
|
591
|
+
optional: true,
|
|
592
|
+
description: 'Whether notifications are muted',
|
|
593
|
+
},
|
|
594
|
+
// Membership
|
|
595
|
+
memberCount: {
|
|
596
|
+
type: 'number',
|
|
597
|
+
optional: true,
|
|
598
|
+
description: 'Number of members',
|
|
599
|
+
},
|
|
600
|
+
// Metadata
|
|
601
|
+
createdAt: {
|
|
602
|
+
type: 'datetime',
|
|
603
|
+
description: 'Creation timestamp',
|
|
604
|
+
},
|
|
605
|
+
lastActivityAt: {
|
|
606
|
+
type: 'datetime',
|
|
607
|
+
optional: true,
|
|
608
|
+
description: 'Last activity timestamp',
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
relationships: {
|
|
612
|
+
workspace: {
|
|
613
|
+
type: 'Workspace',
|
|
614
|
+
backref: 'channels',
|
|
615
|
+
description: 'Parent workspace',
|
|
616
|
+
},
|
|
617
|
+
members: {
|
|
618
|
+
type: 'Member[]',
|
|
619
|
+
backref: 'channels',
|
|
620
|
+
description: 'Channel members',
|
|
621
|
+
},
|
|
622
|
+
messages: {
|
|
623
|
+
type: 'Message[]',
|
|
624
|
+
description: 'Messages in channel',
|
|
625
|
+
},
|
|
626
|
+
threads: {
|
|
627
|
+
type: 'Thread[]',
|
|
628
|
+
backref: 'channel',
|
|
629
|
+
description: 'Threads in channel',
|
|
630
|
+
},
|
|
631
|
+
pins: {
|
|
632
|
+
type: 'Message[]',
|
|
633
|
+
description: 'Pinned messages',
|
|
634
|
+
},
|
|
635
|
+
},
|
|
636
|
+
actions: [
|
|
637
|
+
'create',
|
|
638
|
+
'rename',
|
|
639
|
+
'setTopic',
|
|
640
|
+
'archive',
|
|
641
|
+
'unarchive',
|
|
642
|
+
'delete',
|
|
643
|
+
'join',
|
|
644
|
+
'leave',
|
|
645
|
+
'invite',
|
|
646
|
+
'kick',
|
|
647
|
+
'mute',
|
|
648
|
+
'unmute',
|
|
649
|
+
'pin',
|
|
650
|
+
'unpin',
|
|
651
|
+
],
|
|
652
|
+
events: [
|
|
653
|
+
'created',
|
|
654
|
+
'renamed',
|
|
655
|
+
'topicSet',
|
|
656
|
+
'archived',
|
|
657
|
+
'unarchived',
|
|
658
|
+
'deleted',
|
|
659
|
+
'joined',
|
|
660
|
+
'left',
|
|
661
|
+
'invited',
|
|
662
|
+
'kicked',
|
|
663
|
+
'muted',
|
|
664
|
+
'unmuted',
|
|
665
|
+
'pinned',
|
|
666
|
+
'unpinned',
|
|
667
|
+
],
|
|
668
|
+
};
|
|
669
|
+
// =============================================================================
|
|
670
|
+
// Workspace
|
|
671
|
+
// =============================================================================
|
|
672
|
+
/**
|
|
673
|
+
* Workspace entity
|
|
674
|
+
*
|
|
675
|
+
* Team/organization container for channels and members.
|
|
676
|
+
*/
|
|
677
|
+
export const Workspace = {
|
|
678
|
+
singular: 'workspace',
|
|
679
|
+
plural: 'workspaces',
|
|
680
|
+
description: 'A team or organization container',
|
|
681
|
+
properties: {
|
|
682
|
+
// Identity
|
|
683
|
+
id: {
|
|
684
|
+
type: 'string',
|
|
685
|
+
description: 'Unique workspace identifier',
|
|
686
|
+
},
|
|
687
|
+
name: {
|
|
688
|
+
type: 'string',
|
|
689
|
+
description: 'Workspace name',
|
|
690
|
+
},
|
|
691
|
+
domain: {
|
|
692
|
+
type: 'string',
|
|
693
|
+
optional: true,
|
|
694
|
+
description: 'Workspace domain/slug',
|
|
695
|
+
},
|
|
696
|
+
description: {
|
|
697
|
+
type: 'string',
|
|
698
|
+
optional: true,
|
|
699
|
+
description: 'Workspace description',
|
|
700
|
+
},
|
|
701
|
+
// Branding
|
|
702
|
+
icon: {
|
|
703
|
+
type: 'url',
|
|
704
|
+
optional: true,
|
|
705
|
+
description: 'Workspace icon URL',
|
|
706
|
+
},
|
|
707
|
+
// Status
|
|
708
|
+
plan: {
|
|
709
|
+
type: 'string',
|
|
710
|
+
optional: true,
|
|
711
|
+
description: 'Subscription plan',
|
|
712
|
+
},
|
|
713
|
+
// Counts
|
|
714
|
+
memberCount: {
|
|
715
|
+
type: 'number',
|
|
716
|
+
optional: true,
|
|
717
|
+
description: 'Number of members',
|
|
718
|
+
},
|
|
719
|
+
channelCount: {
|
|
720
|
+
type: 'number',
|
|
721
|
+
optional: true,
|
|
722
|
+
description: 'Number of channels',
|
|
723
|
+
},
|
|
724
|
+
},
|
|
725
|
+
relationships: {
|
|
726
|
+
channels: {
|
|
727
|
+
type: 'Channel[]',
|
|
728
|
+
backref: 'workspace',
|
|
729
|
+
description: 'Channels in workspace',
|
|
730
|
+
},
|
|
731
|
+
members: {
|
|
732
|
+
type: 'Member[]',
|
|
733
|
+
backref: 'workspace',
|
|
734
|
+
description: 'Workspace members',
|
|
735
|
+
},
|
|
736
|
+
owner: {
|
|
737
|
+
type: 'Contact',
|
|
738
|
+
description: 'Workspace owner',
|
|
739
|
+
},
|
|
740
|
+
},
|
|
741
|
+
actions: [
|
|
742
|
+
'create',
|
|
743
|
+
'rename',
|
|
744
|
+
'invite',
|
|
745
|
+
'remove',
|
|
746
|
+
'archive',
|
|
747
|
+
'delete',
|
|
748
|
+
'transfer',
|
|
749
|
+
],
|
|
750
|
+
events: [
|
|
751
|
+
'created',
|
|
752
|
+
'renamed',
|
|
753
|
+
'invited',
|
|
754
|
+
'removed',
|
|
755
|
+
'archived',
|
|
756
|
+
'deleted',
|
|
757
|
+
'transferred',
|
|
758
|
+
],
|
|
759
|
+
};
|
|
760
|
+
// =============================================================================
|
|
761
|
+
// Member
|
|
762
|
+
// =============================================================================
|
|
763
|
+
/**
|
|
764
|
+
* Member entity
|
|
765
|
+
*
|
|
766
|
+
* A user's membership in a workspace/channel.
|
|
767
|
+
*/
|
|
768
|
+
export const Member = {
|
|
769
|
+
singular: 'member',
|
|
770
|
+
plural: 'members',
|
|
771
|
+
description: 'A user membership in a workspace or channel',
|
|
772
|
+
properties: {
|
|
773
|
+
// Identity
|
|
774
|
+
id: {
|
|
775
|
+
type: 'string',
|
|
776
|
+
description: 'Unique member identifier',
|
|
777
|
+
},
|
|
778
|
+
userId: {
|
|
779
|
+
type: 'string',
|
|
780
|
+
description: 'User identifier',
|
|
781
|
+
},
|
|
782
|
+
// Profile
|
|
783
|
+
name: {
|
|
784
|
+
type: 'string',
|
|
785
|
+
description: 'Display name',
|
|
786
|
+
},
|
|
787
|
+
email: {
|
|
788
|
+
type: 'string',
|
|
789
|
+
optional: true,
|
|
790
|
+
description: 'Email address',
|
|
791
|
+
},
|
|
792
|
+
avatar: {
|
|
793
|
+
type: 'url',
|
|
794
|
+
optional: true,
|
|
795
|
+
description: 'Avatar URL',
|
|
796
|
+
},
|
|
797
|
+
title: {
|
|
798
|
+
type: 'string',
|
|
799
|
+
optional: true,
|
|
800
|
+
description: 'Job title',
|
|
801
|
+
},
|
|
802
|
+
// Role
|
|
803
|
+
role: {
|
|
804
|
+
type: 'string',
|
|
805
|
+
description: 'Member role: owner, admin, member, guest',
|
|
806
|
+
examples: ['owner', 'admin', 'member', 'guest'],
|
|
807
|
+
},
|
|
808
|
+
// Status
|
|
809
|
+
status: {
|
|
810
|
+
type: 'string',
|
|
811
|
+
optional: true,
|
|
812
|
+
description: 'Presence status: active, away, dnd, offline',
|
|
813
|
+
examples: ['active', 'away', 'dnd', 'offline'],
|
|
814
|
+
},
|
|
815
|
+
statusText: {
|
|
816
|
+
type: 'string',
|
|
817
|
+
optional: true,
|
|
818
|
+
description: 'Custom status text',
|
|
819
|
+
},
|
|
820
|
+
statusEmoji: {
|
|
821
|
+
type: 'string',
|
|
822
|
+
optional: true,
|
|
823
|
+
description: 'Status emoji',
|
|
824
|
+
},
|
|
825
|
+
// Activity
|
|
826
|
+
lastActiveAt: {
|
|
827
|
+
type: 'datetime',
|
|
828
|
+
optional: true,
|
|
829
|
+
description: 'Last activity timestamp',
|
|
830
|
+
},
|
|
831
|
+
joinedAt: {
|
|
832
|
+
type: 'datetime',
|
|
833
|
+
description: 'Join timestamp',
|
|
834
|
+
},
|
|
835
|
+
},
|
|
836
|
+
relationships: {
|
|
837
|
+
workspace: {
|
|
838
|
+
type: 'Workspace',
|
|
839
|
+
backref: 'members',
|
|
840
|
+
description: 'Workspace membership',
|
|
841
|
+
},
|
|
842
|
+
channels: {
|
|
843
|
+
type: 'Channel[]',
|
|
844
|
+
backref: 'members',
|
|
845
|
+
description: 'Channel memberships',
|
|
846
|
+
},
|
|
847
|
+
contact: {
|
|
848
|
+
type: 'Contact',
|
|
849
|
+
description: 'Associated contact',
|
|
850
|
+
},
|
|
851
|
+
},
|
|
852
|
+
actions: [
|
|
853
|
+
'invite',
|
|
854
|
+
'remove',
|
|
855
|
+
'promote',
|
|
856
|
+
'demote',
|
|
857
|
+
'activate',
|
|
858
|
+
'deactivate',
|
|
859
|
+
'setStatus',
|
|
860
|
+
],
|
|
861
|
+
events: [
|
|
862
|
+
'invited',
|
|
863
|
+
'joined',
|
|
864
|
+
'removed',
|
|
865
|
+
'promoted',
|
|
866
|
+
'demoted',
|
|
867
|
+
'activated',
|
|
868
|
+
'deactivated',
|
|
869
|
+
'statusChanged',
|
|
870
|
+
],
|
|
871
|
+
};
|
|
872
|
+
// =============================================================================
|
|
873
|
+
// Contact
|
|
874
|
+
// =============================================================================
|
|
875
|
+
/**
|
|
876
|
+
* Contact entity
|
|
877
|
+
*
|
|
878
|
+
* A person or entity you communicate with.
|
|
879
|
+
*/
|
|
880
|
+
export const Contact = {
|
|
881
|
+
singular: 'contact',
|
|
882
|
+
plural: 'contacts',
|
|
883
|
+
description: 'A person or entity for communication',
|
|
884
|
+
properties: {
|
|
885
|
+
// Identity
|
|
886
|
+
id: {
|
|
887
|
+
type: 'string',
|
|
888
|
+
description: 'Unique contact identifier',
|
|
889
|
+
},
|
|
890
|
+
// Name
|
|
891
|
+
name: {
|
|
892
|
+
type: 'string',
|
|
893
|
+
description: 'Full name',
|
|
894
|
+
},
|
|
895
|
+
firstName: {
|
|
896
|
+
type: 'string',
|
|
897
|
+
optional: true,
|
|
898
|
+
description: 'First name',
|
|
899
|
+
},
|
|
900
|
+
lastName: {
|
|
901
|
+
type: 'string',
|
|
902
|
+
optional: true,
|
|
903
|
+
description: 'Last name',
|
|
904
|
+
},
|
|
905
|
+
nickname: {
|
|
906
|
+
type: 'string',
|
|
907
|
+
optional: true,
|
|
908
|
+
description: 'Nickname',
|
|
909
|
+
},
|
|
910
|
+
// Contact info
|
|
911
|
+
email: {
|
|
912
|
+
type: 'string',
|
|
913
|
+
optional: true,
|
|
914
|
+
description: 'Email address',
|
|
915
|
+
},
|
|
916
|
+
phone: {
|
|
917
|
+
type: 'string',
|
|
918
|
+
optional: true,
|
|
919
|
+
description: 'Phone number',
|
|
920
|
+
},
|
|
921
|
+
avatar: {
|
|
922
|
+
type: 'url',
|
|
923
|
+
optional: true,
|
|
924
|
+
description: 'Avatar URL',
|
|
925
|
+
},
|
|
926
|
+
// Organization
|
|
927
|
+
company: {
|
|
928
|
+
type: 'string',
|
|
929
|
+
optional: true,
|
|
930
|
+
description: 'Company name',
|
|
931
|
+
},
|
|
932
|
+
title: {
|
|
933
|
+
type: 'string',
|
|
934
|
+
optional: true,
|
|
935
|
+
description: 'Job title',
|
|
936
|
+
},
|
|
937
|
+
// Address
|
|
938
|
+
address: {
|
|
939
|
+
type: 'json',
|
|
940
|
+
optional: true,
|
|
941
|
+
description: 'Address',
|
|
942
|
+
},
|
|
943
|
+
// Social
|
|
944
|
+
social: {
|
|
945
|
+
type: 'json',
|
|
946
|
+
optional: true,
|
|
947
|
+
description: 'Social media handles',
|
|
948
|
+
},
|
|
949
|
+
// Metadata
|
|
950
|
+
tags: {
|
|
951
|
+
type: 'string',
|
|
952
|
+
array: true,
|
|
953
|
+
optional: true,
|
|
954
|
+
description: 'Tags',
|
|
955
|
+
},
|
|
956
|
+
notes: {
|
|
957
|
+
type: 'string',
|
|
958
|
+
optional: true,
|
|
959
|
+
description: 'Notes',
|
|
960
|
+
},
|
|
961
|
+
metadata: {
|
|
962
|
+
type: 'json',
|
|
963
|
+
optional: true,
|
|
964
|
+
description: 'Additional metadata',
|
|
965
|
+
},
|
|
966
|
+
},
|
|
967
|
+
relationships: {
|
|
968
|
+
messages: {
|
|
969
|
+
type: 'Message[]',
|
|
970
|
+
description: 'Messages with this contact',
|
|
971
|
+
},
|
|
972
|
+
calls: {
|
|
973
|
+
type: 'Call[]',
|
|
974
|
+
description: 'Calls with this contact',
|
|
975
|
+
},
|
|
976
|
+
},
|
|
977
|
+
actions: [
|
|
978
|
+
'create',
|
|
979
|
+
'update',
|
|
980
|
+
'delete',
|
|
981
|
+
'merge',
|
|
982
|
+
'tag',
|
|
983
|
+
'untag',
|
|
984
|
+
'block',
|
|
985
|
+
'unblock',
|
|
986
|
+
],
|
|
987
|
+
events: [
|
|
988
|
+
'created',
|
|
989
|
+
'updated',
|
|
990
|
+
'deleted',
|
|
991
|
+
'merged',
|
|
992
|
+
'tagged',
|
|
993
|
+
'blocked',
|
|
994
|
+
'unblocked',
|
|
995
|
+
],
|
|
996
|
+
};
|
|
997
|
+
// =============================================================================
|
|
998
|
+
// Attachment
|
|
999
|
+
// =============================================================================
|
|
1000
|
+
/**
|
|
1001
|
+
* Attachment entity
|
|
1002
|
+
*
|
|
1003
|
+
* A file attached to a message.
|
|
1004
|
+
*/
|
|
1005
|
+
export const Attachment = {
|
|
1006
|
+
singular: 'attachment',
|
|
1007
|
+
plural: 'attachments',
|
|
1008
|
+
description: 'A file attached to a message',
|
|
1009
|
+
properties: {
|
|
1010
|
+
// Identity
|
|
1011
|
+
id: {
|
|
1012
|
+
type: 'string',
|
|
1013
|
+
description: 'Unique attachment identifier',
|
|
1014
|
+
},
|
|
1015
|
+
// File info
|
|
1016
|
+
name: {
|
|
1017
|
+
type: 'string',
|
|
1018
|
+
description: 'File name',
|
|
1019
|
+
},
|
|
1020
|
+
type: {
|
|
1021
|
+
type: 'string',
|
|
1022
|
+
description: 'MIME type',
|
|
1023
|
+
},
|
|
1024
|
+
size: {
|
|
1025
|
+
type: 'number',
|
|
1026
|
+
description: 'File size in bytes',
|
|
1027
|
+
},
|
|
1028
|
+
url: {
|
|
1029
|
+
type: 'url',
|
|
1030
|
+
description: 'Download URL',
|
|
1031
|
+
},
|
|
1032
|
+
// Preview
|
|
1033
|
+
thumbnail: {
|
|
1034
|
+
type: 'url',
|
|
1035
|
+
optional: true,
|
|
1036
|
+
description: 'Thumbnail URL',
|
|
1037
|
+
},
|
|
1038
|
+
preview: {
|
|
1039
|
+
type: 'string',
|
|
1040
|
+
optional: true,
|
|
1041
|
+
description: 'Preview content',
|
|
1042
|
+
},
|
|
1043
|
+
// Metadata
|
|
1044
|
+
metadata: {
|
|
1045
|
+
type: 'json',
|
|
1046
|
+
optional: true,
|
|
1047
|
+
description: 'File metadata',
|
|
1048
|
+
},
|
|
1049
|
+
},
|
|
1050
|
+
relationships: {
|
|
1051
|
+
message: {
|
|
1052
|
+
type: 'Message',
|
|
1053
|
+
backref: 'attachments',
|
|
1054
|
+
description: 'Parent message',
|
|
1055
|
+
},
|
|
1056
|
+
},
|
|
1057
|
+
actions: [
|
|
1058
|
+
'upload',
|
|
1059
|
+
'download',
|
|
1060
|
+
'preview',
|
|
1061
|
+
'delete',
|
|
1062
|
+
],
|
|
1063
|
+
events: [
|
|
1064
|
+
'uploaded',
|
|
1065
|
+
'downloaded',
|
|
1066
|
+
'previewed',
|
|
1067
|
+
'deleted',
|
|
1068
|
+
],
|
|
1069
|
+
};
|
|
1070
|
+
// =============================================================================
|
|
1071
|
+
// Reaction
|
|
1072
|
+
// =============================================================================
|
|
1073
|
+
/**
|
|
1074
|
+
* Reaction entity
|
|
1075
|
+
*
|
|
1076
|
+
* An emoji reaction to a message.
|
|
1077
|
+
*/
|
|
1078
|
+
export const Reaction = {
|
|
1079
|
+
singular: 'reaction',
|
|
1080
|
+
plural: 'reactions',
|
|
1081
|
+
description: 'An emoji reaction to a message',
|
|
1082
|
+
properties: {
|
|
1083
|
+
// Identity
|
|
1084
|
+
id: {
|
|
1085
|
+
type: 'string',
|
|
1086
|
+
description: 'Unique reaction identifier',
|
|
1087
|
+
},
|
|
1088
|
+
// Emoji
|
|
1089
|
+
emoji: {
|
|
1090
|
+
type: 'string',
|
|
1091
|
+
description: 'Emoji character or code',
|
|
1092
|
+
},
|
|
1093
|
+
name: {
|
|
1094
|
+
type: 'string',
|
|
1095
|
+
optional: true,
|
|
1096
|
+
description: 'Emoji name',
|
|
1097
|
+
},
|
|
1098
|
+
// Count
|
|
1099
|
+
count: {
|
|
1100
|
+
type: 'number',
|
|
1101
|
+
optional: true,
|
|
1102
|
+
description: 'Number of users who reacted',
|
|
1103
|
+
},
|
|
1104
|
+
},
|
|
1105
|
+
relationships: {
|
|
1106
|
+
message: {
|
|
1107
|
+
type: 'Message',
|
|
1108
|
+
backref: 'reactions',
|
|
1109
|
+
description: 'Message being reacted to',
|
|
1110
|
+
},
|
|
1111
|
+
user: {
|
|
1112
|
+
type: 'Contact',
|
|
1113
|
+
description: 'User who reacted',
|
|
1114
|
+
},
|
|
1115
|
+
},
|
|
1116
|
+
actions: [
|
|
1117
|
+
'add',
|
|
1118
|
+
'remove',
|
|
1119
|
+
],
|
|
1120
|
+
events: [
|
|
1121
|
+
'added',
|
|
1122
|
+
'removed',
|
|
1123
|
+
],
|
|
1124
|
+
};
|
|
1125
|
+
// =============================================================================
|
|
1126
|
+
// Export
|
|
1127
|
+
// =============================================================================
|
|
1128
|
+
/**
|
|
1129
|
+
* All communication entities
|
|
1130
|
+
*/
|
|
1131
|
+
export const CommunicationEntities = {
|
|
1132
|
+
Message,
|
|
1133
|
+
Thread,
|
|
1134
|
+
Call,
|
|
1135
|
+
Channel,
|
|
1136
|
+
Workspace,
|
|
1137
|
+
Member,
|
|
1138
|
+
Contact,
|
|
1139
|
+
Attachment,
|
|
1140
|
+
Reaction,
|
|
1141
|
+
};
|
|
1142
|
+
/**
|
|
1143
|
+
* Communication categories
|
|
1144
|
+
*/
|
|
1145
|
+
export const CommunicationCategories = {
|
|
1146
|
+
messaging: ['Message', 'Thread', 'Attachment', 'Reaction'],
|
|
1147
|
+
voice: ['Call'],
|
|
1148
|
+
team: ['Channel', 'Workspace', 'Member'],
|
|
1149
|
+
contacts: ['Contact'],
|
|
1150
|
+
};
|