@periskope/types 0.6.236 → 0.6.238
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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/object.types.d.ts +347 -0
- package/dist/object.types.d.ts.map +1 -0
- package/dist/object.types.js +2 -0
- package/dist/rules.types.d.ts +3 -0
- package/dist/rules.types.d.ts.map +1 -1
- package/dist/rules.types.js +78 -0
- package/dist/supabase.types.d.ts +1 -0
- package/dist/supabase.types.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/index.ts +1 -0
- package/src/object.types.ts +362 -0
- package/src/rules.types.ts +93 -0
- package/src/supabase.types.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
export type ObjChatType = {
|
|
2
|
+
org_id: string;
|
|
3
|
+
chat_id: string;
|
|
4
|
+
is_muted: boolean;
|
|
5
|
+
chat_name: string;
|
|
6
|
+
chat_type: string;
|
|
7
|
+
closed_at: string | null;
|
|
8
|
+
is_exited: boolean;
|
|
9
|
+
org_phone: string;
|
|
10
|
+
chat_image: string;
|
|
11
|
+
created_at: string;
|
|
12
|
+
updated_at: string;
|
|
13
|
+
assigned_to: string;
|
|
14
|
+
invite_link: string;
|
|
15
|
+
member_count: number;
|
|
16
|
+
flag_count_map: any; // change to appropriate type if known
|
|
17
|
+
info_admins_only: boolean | null;
|
|
18
|
+
message_unread_count: number | null;
|
|
19
|
+
messages_admins_only: boolean | null;
|
|
20
|
+
add_members_admins_only: boolean | null;
|
|
21
|
+
group_description: string | null;
|
|
22
|
+
|
|
23
|
+
labels: string[];
|
|
24
|
+
label_ids: Record<string, boolean>;
|
|
25
|
+
chat_access: Record<string, boolean>;
|
|
26
|
+
custom_properties: Record<string, string>;
|
|
27
|
+
|
|
28
|
+
members: Record<
|
|
29
|
+
string,
|
|
30
|
+
{
|
|
31
|
+
org_id: string;
|
|
32
|
+
chat_id: string;
|
|
33
|
+
is_admin: boolean;
|
|
34
|
+
org_phone: string;
|
|
35
|
+
contact_id: string;
|
|
36
|
+
is_internal: boolean;
|
|
37
|
+
contact_name: string;
|
|
38
|
+
contact_color: string;
|
|
39
|
+
contact_image: string;
|
|
40
|
+
is_super_admin: boolean;
|
|
41
|
+
}
|
|
42
|
+
>;
|
|
43
|
+
|
|
44
|
+
latest_message: {
|
|
45
|
+
id: {
|
|
46
|
+
id: string;
|
|
47
|
+
remote: string;
|
|
48
|
+
from_me: boolean;
|
|
49
|
+
serialized: string;
|
|
50
|
+
};
|
|
51
|
+
to: string | null;
|
|
52
|
+
ack: string;
|
|
53
|
+
fts: string;
|
|
54
|
+
body: string;
|
|
55
|
+
from: string | null;
|
|
56
|
+
links: any; // change to appropriate type if known
|
|
57
|
+
media: any; // change to appropriate type if known
|
|
58
|
+
token: string | null;
|
|
59
|
+
author: string | null;
|
|
60
|
+
is_gif: boolean | null;
|
|
61
|
+
org_id: string;
|
|
62
|
+
vcards: any; // change to appropriate type if known
|
|
63
|
+
chat_id: string;
|
|
64
|
+
from_me: boolean;
|
|
65
|
+
duration: number | null;
|
|
66
|
+
location: any; // change to appropriate type if known
|
|
67
|
+
order_id: string | null;
|
|
68
|
+
raw_data: any; // change to appropriate type if known
|
|
69
|
+
broadcast: boolean | null;
|
|
70
|
+
has_media: boolean | null;
|
|
71
|
+
invite_v4: any; // change to appropriate type if known
|
|
72
|
+
is_status: boolean | null;
|
|
73
|
+
media_key: string | null;
|
|
74
|
+
org_phone: string;
|
|
75
|
+
poll_info: any; // change to appropriate type if known
|
|
76
|
+
prev_body: string | null;
|
|
77
|
+
timestamp: string;
|
|
78
|
+
unique_id: string;
|
|
79
|
+
is_deleted: boolean | null;
|
|
80
|
+
is_starred: boolean | null;
|
|
81
|
+
message_id: string;
|
|
82
|
+
updated_at: string;
|
|
83
|
+
device_type: string | null;
|
|
84
|
+
flag_status: string | null;
|
|
85
|
+
broadcast_id: string | null;
|
|
86
|
+
has_reaction: boolean | null;
|
|
87
|
+
is_ephemeral: boolean | null;
|
|
88
|
+
is_forwarded: boolean | null;
|
|
89
|
+
message_type: string;
|
|
90
|
+
performed_by: string | null;
|
|
91
|
+
poll_results: any; // change to appropriate type if known
|
|
92
|
+
sender_phone: string;
|
|
93
|
+
delivery_info: {
|
|
94
|
+
read: Record<string, number>;
|
|
95
|
+
pending: any[]; // or string[] if known
|
|
96
|
+
delivered: Record<string, number>;
|
|
97
|
+
read_count: number;
|
|
98
|
+
delivered_count: number;
|
|
99
|
+
};
|
|
100
|
+
flag_metadata: any; // change to appropriate type if known
|
|
101
|
+
mentioned_ids: string[];
|
|
102
|
+
has_quoted_msg: boolean | null;
|
|
103
|
+
sent_message_id: string;
|
|
104
|
+
forwarding_score: number | null;
|
|
105
|
+
message_ticket_id: string | null;
|
|
106
|
+
quoted_message_id: string | null;
|
|
107
|
+
flag_response_time: number | null;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export type ObjChatNotificationType = {
|
|
112
|
+
org_id: string;
|
|
113
|
+
notification_id: string;
|
|
114
|
+
chat_id: string;
|
|
115
|
+
author: string;
|
|
116
|
+
body: string | null;
|
|
117
|
+
id: {
|
|
118
|
+
id: string;
|
|
119
|
+
fromMe: boolean;
|
|
120
|
+
remote: string;
|
|
121
|
+
serialized: string;
|
|
122
|
+
};
|
|
123
|
+
recipientids: string[];
|
|
124
|
+
type: 'remove' | string; // you can union other types if known
|
|
125
|
+
timestamp: string;
|
|
126
|
+
org_phone: string;
|
|
127
|
+
unique_id: string;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export type ObjMessageType = {
|
|
131
|
+
message_id: string;
|
|
132
|
+
org_id: string;
|
|
133
|
+
ack: string;
|
|
134
|
+
author: string;
|
|
135
|
+
body: string | null;
|
|
136
|
+
broadcast: string | null;
|
|
137
|
+
device_type: 'android' | 'ios' | string | null;
|
|
138
|
+
flag_status: boolean | null;
|
|
139
|
+
duration: number | null;
|
|
140
|
+
forwarding_score: string;
|
|
141
|
+
from: string;
|
|
142
|
+
from_me: boolean;
|
|
143
|
+
has_media: boolean;
|
|
144
|
+
has_quoted_msg: boolean;
|
|
145
|
+
has_reaction: boolean;
|
|
146
|
+
id: {
|
|
147
|
+
id: string;
|
|
148
|
+
fromMe: boolean;
|
|
149
|
+
remote: string;
|
|
150
|
+
_serialized: string;
|
|
151
|
+
};
|
|
152
|
+
invite_v4: any | null;
|
|
153
|
+
is_ephemeral: boolean | null;
|
|
154
|
+
is_forwarded: boolean;
|
|
155
|
+
is_gif: boolean;
|
|
156
|
+
is_starred: boolean;
|
|
157
|
+
is_status: boolean;
|
|
158
|
+
links: string | null; // or JSON-parsed structure if applicable
|
|
159
|
+
location: any | null;
|
|
160
|
+
media_key: string | null;
|
|
161
|
+
mentioned_ids: string[];
|
|
162
|
+
order_id: string | null;
|
|
163
|
+
raw_data: any | null;
|
|
164
|
+
to: string;
|
|
165
|
+
token: string | null;
|
|
166
|
+
message_type: string;
|
|
167
|
+
vcards: any[];
|
|
168
|
+
chat_id: string;
|
|
169
|
+
timestamp: string;
|
|
170
|
+
org_phone: string;
|
|
171
|
+
broadcast_id: string | null;
|
|
172
|
+
is_deleted: boolean | null;
|
|
173
|
+
media: {
|
|
174
|
+
path: string;
|
|
175
|
+
size: number;
|
|
176
|
+
filename: string;
|
|
177
|
+
mimetype: string;
|
|
178
|
+
dimensions: {
|
|
179
|
+
ar: number;
|
|
180
|
+
width: number;
|
|
181
|
+
height: number;
|
|
182
|
+
};
|
|
183
|
+
} | null;
|
|
184
|
+
performed_by: string;
|
|
185
|
+
prev_body: string | null;
|
|
186
|
+
quoted_message_id: string | null;
|
|
187
|
+
sender_phone: string;
|
|
188
|
+
sent_message_id: string;
|
|
189
|
+
delivery_info: {
|
|
190
|
+
read: Record<string, number>;
|
|
191
|
+
pending: string[];
|
|
192
|
+
delivered: Record<string, number>;
|
|
193
|
+
read_count: number;
|
|
194
|
+
delivered_count: number;
|
|
195
|
+
};
|
|
196
|
+
flag_metadata: {
|
|
197
|
+
status: boolean;
|
|
198
|
+
response_id: string;
|
|
199
|
+
response_type: string;
|
|
200
|
+
response_email: string;
|
|
201
|
+
response_timestamp: string;
|
|
202
|
+
} | null;
|
|
203
|
+
poll_info: {
|
|
204
|
+
options: {
|
|
205
|
+
allowMultipleAnswers: boolean;
|
|
206
|
+
};
|
|
207
|
+
pollName: string;
|
|
208
|
+
pollOptions: string[];
|
|
209
|
+
} | null;
|
|
210
|
+
poll_results: Record<string, Record<string, string>>;
|
|
211
|
+
updated_at: string;
|
|
212
|
+
message_ticket_id: string | null;
|
|
213
|
+
unique_id: string;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
export type ObjReactionType = {
|
|
217
|
+
org_id: string;
|
|
218
|
+
message_id: string;
|
|
219
|
+
ack: string;
|
|
220
|
+
id: {
|
|
221
|
+
id: string;
|
|
222
|
+
fromMe: boolean;
|
|
223
|
+
remote: string;
|
|
224
|
+
_serialized: string;
|
|
225
|
+
};
|
|
226
|
+
orphan: string;
|
|
227
|
+
reaction: string;
|
|
228
|
+
read: boolean;
|
|
229
|
+
reaction_id: string;
|
|
230
|
+
timestamp: string;
|
|
231
|
+
msg_id: {
|
|
232
|
+
id: string;
|
|
233
|
+
fromMe: boolean;
|
|
234
|
+
remote: string;
|
|
235
|
+
_serialized: string;
|
|
236
|
+
};
|
|
237
|
+
orphan_reason: string | null;
|
|
238
|
+
sender_id: string;
|
|
239
|
+
org_phone: string;
|
|
240
|
+
chat_id: string;
|
|
241
|
+
unique_id: string;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export type ObjTicketType = {
|
|
245
|
+
chat: {
|
|
246
|
+
org_id: string;
|
|
247
|
+
org_phone: string;
|
|
248
|
+
chat_id: string;
|
|
249
|
+
members: Record<
|
|
250
|
+
string,
|
|
251
|
+
{
|
|
252
|
+
org_id: string;
|
|
253
|
+
chat_id: string;
|
|
254
|
+
is_admin: boolean;
|
|
255
|
+
org_phone: string;
|
|
256
|
+
contact_id: string;
|
|
257
|
+
is_internal: boolean;
|
|
258
|
+
contact_name: string;
|
|
259
|
+
contact_color: string;
|
|
260
|
+
contact_image: string;
|
|
261
|
+
is_super_admin: boolean;
|
|
262
|
+
}
|
|
263
|
+
>;
|
|
264
|
+
is_muted: boolean;
|
|
265
|
+
chat_name: string;
|
|
266
|
+
chat_type: string;
|
|
267
|
+
chat_image: string;
|
|
268
|
+
created_at: string;
|
|
269
|
+
chat_labels: string;
|
|
270
|
+
invite_link: string;
|
|
271
|
+
custom_properties: Record<string, string>;
|
|
272
|
+
group_description: string | null;
|
|
273
|
+
};
|
|
274
|
+
message: {
|
|
275
|
+
body: string;
|
|
276
|
+
chat_id: string;
|
|
277
|
+
org_phone: string;
|
|
278
|
+
timestamp: string;
|
|
279
|
+
media_path: string;
|
|
280
|
+
message_id: string;
|
|
281
|
+
sender_name: string;
|
|
282
|
+
performed_by: string;
|
|
283
|
+
sender_phone: string;
|
|
284
|
+
};
|
|
285
|
+
ticket: {
|
|
286
|
+
org_id: string;
|
|
287
|
+
status: string;
|
|
288
|
+
subject: string;
|
|
289
|
+
assignee: string;
|
|
290
|
+
due_date: string;
|
|
291
|
+
priority: number;
|
|
292
|
+
closed_at: string;
|
|
293
|
+
closed_by: string;
|
|
294
|
+
raised_by: string;
|
|
295
|
+
ticket_id: string;
|
|
296
|
+
created_at: string;
|
|
297
|
+
is_deleted: boolean;
|
|
298
|
+
assigned_by: string;
|
|
299
|
+
ticket_labels: string;
|
|
300
|
+
quoted_message_id: string;
|
|
301
|
+
ticket_custom_properties: Record<string, string>;
|
|
302
|
+
};
|
|
303
|
+
attached_messages: Array<{
|
|
304
|
+
body: string;
|
|
305
|
+
chat_id: string;
|
|
306
|
+
org_phone: string;
|
|
307
|
+
timestamp: string;
|
|
308
|
+
media_path: string;
|
|
309
|
+
message_id: string;
|
|
310
|
+
sender_name: string;
|
|
311
|
+
performed_by: string;
|
|
312
|
+
sender_phone: string;
|
|
313
|
+
}>;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
export type ObjContactType = {
|
|
317
|
+
chat_ids: string[];
|
|
318
|
+
contact_color: string;
|
|
319
|
+
contact_id: string;
|
|
320
|
+
contact_image: string;
|
|
321
|
+
contact_name: string;
|
|
322
|
+
contact_type: string;
|
|
323
|
+
is_imported: boolean | null;
|
|
324
|
+
is_internal: boolean;
|
|
325
|
+
is_my_contact: boolean | null;
|
|
326
|
+
is_wa_contact: boolean;
|
|
327
|
+
labels: string[];
|
|
328
|
+
org_id: string;
|
|
329
|
+
updated_at: string;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export type ObjPhoneType = {
|
|
333
|
+
org_id: string;
|
|
334
|
+
org_phone: string;
|
|
335
|
+
created_at: string;
|
|
336
|
+
updated_at: string;
|
|
337
|
+
wa_state: string;
|
|
338
|
+
phone_id: string;
|
|
339
|
+
qr_code: string | null;
|
|
340
|
+
phone_image: string;
|
|
341
|
+
phone_name: string;
|
|
342
|
+
first_connected_at: string;
|
|
343
|
+
is_ready: boolean;
|
|
344
|
+
label_ids: Record<string, boolean>;
|
|
345
|
+
labels: string[];
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
export type ObjMessageJobType = {
|
|
349
|
+
addedTimestamp: number;
|
|
350
|
+
attemptsMade: number;
|
|
351
|
+
attemptsStarted: number;
|
|
352
|
+
data: {
|
|
353
|
+
body: string;
|
|
354
|
+
chat_id: string;
|
|
355
|
+
};
|
|
356
|
+
finishedTimestamp: number;
|
|
357
|
+
id: string;
|
|
358
|
+
message_id: string;
|
|
359
|
+
processedTimestamp: number;
|
|
360
|
+
stacktrace: string[];
|
|
361
|
+
status: string;
|
|
362
|
+
};
|
package/src/rules.types.ts
CHANGED
|
@@ -819,6 +819,11 @@ export type CreateTicketAction = {
|
|
|
819
819
|
append_to_latest_ticket?: 'true' | 'false';
|
|
820
820
|
round_robin?: 'true' | 'false';
|
|
821
821
|
assignee?: string;
|
|
822
|
+
rr_check_for?:
|
|
823
|
+
| 'shift_time'
|
|
824
|
+
| 'user_status'
|
|
825
|
+
| 'shift_time user_status'
|
|
826
|
+
| 'none';
|
|
822
827
|
};
|
|
823
828
|
};
|
|
824
829
|
|
|
@@ -838,6 +843,11 @@ export type AssignTicketAction = {
|
|
|
838
843
|
metadata: {
|
|
839
844
|
assignee: string;
|
|
840
845
|
round_robin: 'true' | 'false';
|
|
846
|
+
rr_check_for?:
|
|
847
|
+
| 'shift_time'
|
|
848
|
+
| 'user_status'
|
|
849
|
+
| 'shift_time user_status'
|
|
850
|
+
| 'none';
|
|
841
851
|
};
|
|
842
852
|
};
|
|
843
853
|
|
|
@@ -875,6 +885,11 @@ export type AssignChatAction = {
|
|
|
875
885
|
metadata: {
|
|
876
886
|
assignee: string;
|
|
877
887
|
round_robin: 'true' | 'false';
|
|
888
|
+
rr_check_for?:
|
|
889
|
+
| 'shift_time'
|
|
890
|
+
| 'user_status'
|
|
891
|
+
| 'shift_time user_status'
|
|
892
|
+
| 'none';
|
|
878
893
|
};
|
|
879
894
|
};
|
|
880
895
|
|
|
@@ -1384,6 +1399,32 @@ export const ActionNameMap: Record<
|
|
|
1384
1399
|
info: "If round robin is enabled, the ticket will be assigned to the next available agent in the list else it'll be assigned to the selected agent",
|
|
1385
1400
|
required: false,
|
|
1386
1401
|
},
|
|
1402
|
+
rr_check_for: {
|
|
1403
|
+
id: 'rr_check_for',
|
|
1404
|
+
type: 'dropdown',
|
|
1405
|
+
value: [
|
|
1406
|
+
{ id: 'none', value: 'none', label: 'None' },
|
|
1407
|
+
{
|
|
1408
|
+
id: 'shift_time',
|
|
1409
|
+
value: 'shift_time',
|
|
1410
|
+
label: 'Consider shift times',
|
|
1411
|
+
},
|
|
1412
|
+
{
|
|
1413
|
+
id: 'user_status',
|
|
1414
|
+
value: 'user_status',
|
|
1415
|
+
label: 'Consider online/offline status',
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
id: 'shift_time user_status',
|
|
1419
|
+
value: 'shift_time user_status',
|
|
1420
|
+
label: 'Consider both shift and status',
|
|
1421
|
+
},
|
|
1422
|
+
],
|
|
1423
|
+
label: 'Round Robin Config',
|
|
1424
|
+
placeholder: 'Select...',
|
|
1425
|
+
info: 'Criteria for assigning the next available agent',
|
|
1426
|
+
required: false,
|
|
1427
|
+
},
|
|
1387
1428
|
},
|
|
1388
1429
|
validTriggers: [
|
|
1389
1430
|
'message.created',
|
|
@@ -1442,6 +1483,32 @@ export const ActionNameMap: Record<
|
|
|
1442
1483
|
info: "If round robin is enabled, the ticket will be assigned to the next available agent in the list else it'll be assigned to the selected agent",
|
|
1443
1484
|
required: true,
|
|
1444
1485
|
},
|
|
1486
|
+
rr_check_for: {
|
|
1487
|
+
id: 'rr_check_for',
|
|
1488
|
+
type: 'dropdown',
|
|
1489
|
+
value: [
|
|
1490
|
+
{ id: 'none', value: 'none', label: 'None' },
|
|
1491
|
+
{
|
|
1492
|
+
id: 'shift_time',
|
|
1493
|
+
value: 'shift_time',
|
|
1494
|
+
label: 'Consider shift times',
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
id: 'user_status',
|
|
1498
|
+
value: 'user_status',
|
|
1499
|
+
label: 'Consider online/offline status',
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
id: 'shift_time user_status',
|
|
1503
|
+
value: 'shift_time user_status',
|
|
1504
|
+
label: 'Consider both shift and status',
|
|
1505
|
+
},
|
|
1506
|
+
],
|
|
1507
|
+
label: 'Round Robin Config',
|
|
1508
|
+
placeholder: 'Select...',
|
|
1509
|
+
info: 'Criteria for assigning the next available agent',
|
|
1510
|
+
required: false,
|
|
1511
|
+
},
|
|
1445
1512
|
},
|
|
1446
1513
|
validTriggers: ['ticket.updated', 'ticket.created'],
|
|
1447
1514
|
},
|
|
@@ -1556,6 +1623,32 @@ export const ActionNameMap: Record<
|
|
|
1556
1623
|
placeholder: 'Select assignee',
|
|
1557
1624
|
required: true,
|
|
1558
1625
|
},
|
|
1626
|
+
rr_check_for: {
|
|
1627
|
+
id: 'rr_check_for',
|
|
1628
|
+
type: 'dropdown',
|
|
1629
|
+
value: [
|
|
1630
|
+
{ id: 'none', value: 'none', label: 'None' },
|
|
1631
|
+
{
|
|
1632
|
+
id: 'shift_time',
|
|
1633
|
+
value: 'shift_time',
|
|
1634
|
+
label: 'Consider shift times',
|
|
1635
|
+
},
|
|
1636
|
+
{
|
|
1637
|
+
id: 'user_status',
|
|
1638
|
+
value: 'user_status',
|
|
1639
|
+
label: 'Consider online/offline status',
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
id: 'shift_time user_status',
|
|
1643
|
+
value: 'shift_time user_status',
|
|
1644
|
+
label: 'Consider both shift and status',
|
|
1645
|
+
},
|
|
1646
|
+
],
|
|
1647
|
+
label: 'Round Robin Config',
|
|
1648
|
+
placeholder: 'Select...',
|
|
1649
|
+
info: 'Criteria for assigning the next available agent',
|
|
1650
|
+
required: false,
|
|
1651
|
+
},
|
|
1559
1652
|
},
|
|
1560
1653
|
validTriggers: [
|
|
1561
1654
|
'message.created',
|