@periskope/types 0.6.156 → 0.6.158
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/rules.types.d.ts +7 -1
- package/dist/rules.types.js +30 -36
- package/dist/supabase.types.d.ts +5 -1
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
- package/rules.types.ts +39 -37
- package/supabase.types.ts +2660 -2655
- package/types.ts +2 -1
package/dist/rules.types.d.ts
CHANGED
|
@@ -243,7 +243,13 @@ export type UpdateCustomPropertyAction = {
|
|
|
243
243
|
value: string;
|
|
244
244
|
};
|
|
245
245
|
};
|
|
246
|
-
export type
|
|
246
|
+
export type DeleteMessageAction = {
|
|
247
|
+
id: string;
|
|
248
|
+
type: 'delete_message';
|
|
249
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
250
|
+
metadata: {};
|
|
251
|
+
};
|
|
252
|
+
export type Action = SendMessageAction | NotifyHttpAction | CreateTicketAction | FlagMessageAction | AssignTicketAction | CloseTicketAction | AddChatLabelAction | AddTicketLabelAction | AssignChatAction | ForwardMessageAction | SendEmailAction | ReplyToMessageAction | UpdateCustomPropertyAction | DeleteMessageAction;
|
|
247
253
|
export declare const isSendMessageOrReplyToMessageAction: (action: Action) => action is SendMessageAction | ReplyToMessageAction;
|
|
248
254
|
export type Rule = OverrideProperties<Tables<'tbl_automation_rules'>, {
|
|
249
255
|
actions: Action[];
|
package/dist/rules.types.js
CHANGED
|
@@ -177,18 +177,6 @@ exports.MessageVariableNameMap = {
|
|
|
177
177
|
},
|
|
178
178
|
};
|
|
179
179
|
exports.SenderVariableNameMap = {
|
|
180
|
-
'sender.is_business': {
|
|
181
|
-
text: 'Sender is business',
|
|
182
|
-
type: 'boolean',
|
|
183
|
-
filters: ['IS'],
|
|
184
|
-
variable_type: 'boolean',
|
|
185
|
-
},
|
|
186
|
-
'sender.is_enterprise': {
|
|
187
|
-
text: 'Sender is enterprise',
|
|
188
|
-
type: 'boolean',
|
|
189
|
-
filters: ['IS'],
|
|
190
|
-
variable_type: 'boolean',
|
|
191
|
-
},
|
|
192
180
|
'sender.is_internal': {
|
|
193
181
|
text: 'Sender is internal',
|
|
194
182
|
type: 'boolean',
|
|
@@ -345,24 +333,6 @@ exports.ChatVariableNameMap = {
|
|
|
345
333
|
],
|
|
346
334
|
variable_type: 'boolean',
|
|
347
335
|
},
|
|
348
|
-
'chat.is_muted': {
|
|
349
|
-
text: 'Chat is muted',
|
|
350
|
-
type: 'boolean',
|
|
351
|
-
filters: ['EQ', 'NEQ'],
|
|
352
|
-
value: [
|
|
353
|
-
{
|
|
354
|
-
id: 'true',
|
|
355
|
-
value: 'true',
|
|
356
|
-
label: 'True',
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
id: 'false',
|
|
360
|
-
value: 'false',
|
|
361
|
-
label: 'False',
|
|
362
|
-
},
|
|
363
|
-
],
|
|
364
|
-
variable_type: 'boolean',
|
|
365
|
-
},
|
|
366
336
|
'chat.info_admins_only': {
|
|
367
337
|
text: 'Chat Info Admins Only',
|
|
368
338
|
type: 'boolean',
|
|
@@ -765,6 +735,17 @@ exports.ActionNameMap = {
|
|
|
765
735
|
'message.flagged',
|
|
766
736
|
],
|
|
767
737
|
},
|
|
738
|
+
delete_message: {
|
|
739
|
+
title: 'Delete Message',
|
|
740
|
+
description: 'Delete a message',
|
|
741
|
+
inputs: {},
|
|
742
|
+
validTriggers: [
|
|
743
|
+
'message.created',
|
|
744
|
+
'message.updated',
|
|
745
|
+
'reaction.added',
|
|
746
|
+
'message.flagged',
|
|
747
|
+
],
|
|
748
|
+
},
|
|
768
749
|
notify_http: {
|
|
769
750
|
title: 'Notify HTTP',
|
|
770
751
|
description: 'Notify an HTTP endpoint',
|
|
@@ -847,7 +828,12 @@ exports.ActionNameMap = {
|
|
|
847
828
|
required: true,
|
|
848
829
|
},
|
|
849
830
|
},
|
|
850
|
-
validTriggers: [
|
|
831
|
+
validTriggers: [
|
|
832
|
+
'message.created',
|
|
833
|
+
'message.updated',
|
|
834
|
+
'reaction.added',
|
|
835
|
+
'message.flagged',
|
|
836
|
+
],
|
|
851
837
|
},
|
|
852
838
|
assign_ticket: {
|
|
853
839
|
title: 'Assign Ticket',
|
|
@@ -913,6 +899,7 @@ exports.ActionNameMap = {
|
|
|
913
899
|
'ticket.created',
|
|
914
900
|
'reaction.added',
|
|
915
901
|
'chat.label.updated',
|
|
902
|
+
'message.flagged',
|
|
916
903
|
],
|
|
917
904
|
},
|
|
918
905
|
add_ticket_label: {
|
|
@@ -941,6 +928,7 @@ exports.ActionNameMap = {
|
|
|
941
928
|
'ticket.created',
|
|
942
929
|
'reaction.added',
|
|
943
930
|
'message.flagged',
|
|
931
|
+
'chat.label.updated',
|
|
944
932
|
],
|
|
945
933
|
inputs: {
|
|
946
934
|
property_id: {
|
|
@@ -994,6 +982,7 @@ exports.ActionNameMap = {
|
|
|
994
982
|
'ticket.created',
|
|
995
983
|
'reaction.added',
|
|
996
984
|
'chat.label.updated',
|
|
985
|
+
'message.flagged',
|
|
997
986
|
],
|
|
998
987
|
},
|
|
999
988
|
forward_message: {
|
|
@@ -1069,7 +1058,7 @@ exports.editorVariables = [
|
|
|
1069
1058
|
'reaction.added',
|
|
1070
1059
|
'message.flagged',
|
|
1071
1060
|
'ticket.created',
|
|
1072
|
-
'ticket.updated'
|
|
1061
|
+
'ticket.updated',
|
|
1073
1062
|
],
|
|
1074
1063
|
},
|
|
1075
1064
|
{
|
|
@@ -1081,7 +1070,7 @@ exports.editorVariables = [
|
|
|
1081
1070
|
'reaction.added',
|
|
1082
1071
|
'message.flagged',
|
|
1083
1072
|
'ticket.created',
|
|
1084
|
-
'ticket.updated'
|
|
1073
|
+
'ticket.updated',
|
|
1085
1074
|
],
|
|
1086
1075
|
},
|
|
1087
1076
|
{
|
|
@@ -1095,7 +1084,7 @@ exports.editorVariables = [
|
|
|
1095
1084
|
'chat.created',
|
|
1096
1085
|
'chat.label.updated',
|
|
1097
1086
|
'ticket.created',
|
|
1098
|
-
'ticket.updated'
|
|
1087
|
+
'ticket.updated',
|
|
1099
1088
|
],
|
|
1100
1089
|
},
|
|
1101
1090
|
{
|
|
@@ -1106,14 +1095,19 @@ exports.editorVariables = [
|
|
|
1106
1095
|
];
|
|
1107
1096
|
exports.variablesExclusionList = {
|
|
1108
1097
|
'ticket.created': ['ticket.is_deleted'],
|
|
1109
|
-
'chat.created': [
|
|
1098
|
+
'chat.created': [
|
|
1099
|
+
'chat.chat_id',
|
|
1100
|
+
'chat.labels',
|
|
1101
|
+
'chat.has_flagged_messages',
|
|
1102
|
+
'chat.assigned_to',
|
|
1103
|
+
],
|
|
1110
1104
|
'message.created': [
|
|
1111
1105
|
'message.author',
|
|
1112
1106
|
'message.performed_by',
|
|
1113
1107
|
'message.flag_status',
|
|
1114
1108
|
'sender.is_internal',
|
|
1115
1109
|
],
|
|
1116
|
-
'ticket.updated': [],
|
|
1110
|
+
'ticket.updated': ['ticket.is_deleted'],
|
|
1117
1111
|
'reaction.added': [],
|
|
1118
1112
|
'message.updated': [],
|
|
1119
1113
|
'message.flagged': [],
|
package/dist/supabase.types.d.ts
CHANGED
|
@@ -939,6 +939,7 @@ export type Database = {
|
|
|
939
939
|
chat_name: string | null;
|
|
940
940
|
chat_type: string | null;
|
|
941
941
|
created_at: string;
|
|
942
|
+
created_by: string | null;
|
|
942
943
|
group_metadata: Json | null;
|
|
943
944
|
id: Json | null;
|
|
944
945
|
invite_link: string | null;
|
|
@@ -964,6 +965,7 @@ export type Database = {
|
|
|
964
965
|
chat_name?: string | null;
|
|
965
966
|
chat_type?: string | null;
|
|
966
967
|
created_at?: string;
|
|
968
|
+
created_by?: string | null;
|
|
967
969
|
group_metadata?: Json | null;
|
|
968
970
|
id?: Json | null;
|
|
969
971
|
invite_link?: string | null;
|
|
@@ -989,6 +991,7 @@ export type Database = {
|
|
|
989
991
|
chat_name?: string | null;
|
|
990
992
|
chat_type?: string | null;
|
|
991
993
|
created_at?: string;
|
|
994
|
+
created_by?: string | null;
|
|
992
995
|
group_metadata?: Json | null;
|
|
993
996
|
id?: Json | null;
|
|
994
997
|
invite_link?: string | null;
|
|
@@ -1820,6 +1823,7 @@ export type Database = {
|
|
|
1820
1823
|
chat_name: string | null;
|
|
1821
1824
|
chat_org_phones: string[] | null;
|
|
1822
1825
|
chat_type: string | null;
|
|
1826
|
+
closed_at: number | null;
|
|
1823
1827
|
created_at: string | null;
|
|
1824
1828
|
custom_properties: Json | null;
|
|
1825
1829
|
flag_count_map: Json | null;
|
|
@@ -2193,7 +2197,7 @@ export type Database = {
|
|
|
2193
2197
|
enum_chat_colors: "#B4876E" | "#A5B337" | "#06CF9C" | "#25D366" | "#02A698" | "#7D9EF1" | "#007BFC" | "#5E47DE" | "#7F66FF" | "#9333EA" | "#FA6533" | "#C4532D" | "#DC2626" | "#FF2E74" | "#DB2777";
|
|
2194
2198
|
enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived";
|
|
2195
2199
|
enum_credit_transaction_type: "credit" | "debit";
|
|
2196
|
-
enum_integration_name: "org.created" | "org.updated" | "org.member.created" | "org.member.updated" | "org.phone.created" | "org.phone.connected" | "org.phone.disconnected" | "org.subscription.trial_will_end" | "chat.created" | "chat.updated" | "chat.notification.created" | "message.created" | "message.updated" | "message.deleted" | "message.ack.updated" | "reaction.created" | "reaction.updated" | "ticket.created" | "ticket.updated" | "ticket.deleted" | "org.integrations.updated" | "message.flagged" | "message.unflagged" | "chat.label.updated" | "reaction.added";
|
|
2200
|
+
enum_integration_name: "org.created" | "org.updated" | "org.member.created" | "org.member.updated" | "org.phone.created" | "org.phone.connected" | "org.phone.disconnected" | "org.subscription.trial_will_end" | "chat.created" | "chat.updated" | "chat.notification.created" | "message.created" | "message.updated" | "message.deleted" | "message.ack.updated" | "reaction.created" | "reaction.updated" | "ticket.created" | "ticket.updated" | "ticket.deleted" | "org.integrations.updated" | "message.flagged" | "message.unflagged" | "chat.label.updated" | "reaction.added" | "message.ticket.attached";
|
|
2197
2201
|
enum_integration_type: "zapier" | "pabbly" | "api" | "webhook" | "hubspot" | "freshdesk" | "slack" | "jira" | "salesforce" | "zohodesk" | "gsheets";
|
|
2198
2202
|
enum_member_role: "admin" | "member";
|
|
2199
2203
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -452,7 +452,7 @@ export type OrgCreditsType = {
|
|
|
452
452
|
total_credits_used: number;
|
|
453
453
|
next_renewal_date: string;
|
|
454
454
|
};
|
|
455
|
-
export type ChatRuleInfoType = Merge<Pick<Tables<'view_chats'>, 'assigned_to' | 'chat_id' | 'chat_name' | 'chat_type' | 'created_at' | 'group_description' | 'info_admins_only' | '
|
|
455
|
+
export type ChatRuleInfoType = Merge<Pick<Tables<'view_chats'>, 'assigned_to' | 'chat_id' | 'chat_name' | 'chat_type' | 'created_at' | 'group_description' | 'info_admins_only' | 'org_id' | 'org_phone' | 'chat_org_phones' | 'messages_admins_only' | 'custom_properties'>, {
|
|
456
456
|
has_flagged_messages: boolean;
|
|
457
457
|
labels: string[];
|
|
458
458
|
members: string[];
|
|
@@ -460,7 +460,7 @@ export type ChatRuleInfoType = Merge<Pick<Tables<'view_chats'>, 'assigned_to' |
|
|
|
460
460
|
[key: string]: string;
|
|
461
461
|
} | null;
|
|
462
462
|
}>;
|
|
463
|
-
export type SenderRuleInfoType = Merge<Omit<Merge<Tables<'tbl_contacts'>, Tables<'tbl_chat_participants'>>, 'verified_name' | 'verified_level' | 'updated_at' | 'short_name' | 'pushname' | 'periskope_name' | 'org_phone' | 'number' | 'name' | 'label_ids' | 'is_wa_contact' | 'is_user' | 'is_my_contact' | 'is_me' | 'is_imported' | 'is_group' | 'is_blocked' | 'contact_color' | 'business_profile' | 'id' | 'contact_image' | 'contact_type' | 'chat_id'>, {
|
|
463
|
+
export type SenderRuleInfoType = Merge<Omit<Merge<Tables<'tbl_contacts'>, Tables<'tbl_chat_participants'>>, 'verified_name' | 'verified_level' | 'updated_at' | 'short_name' | 'pushname' | 'periskope_name' | 'org_phone' | 'number' | 'name' | 'label_ids' | 'is_wa_contact' | 'is_user' | 'is_my_contact' | 'is_me' | 'is_imported' | 'is_group' | 'is_blocked' | 'contact_color' | 'business_profile' | 'id' | 'contact_image' | 'contact_type' | 'chat_id' | 'is_business' | 'is_enterprise'>, {
|
|
464
464
|
is_internal: boolean;
|
|
465
465
|
labels: string[] | null;
|
|
466
466
|
}>;
|
package/package.json
CHANGED
package/rules.types.ts
CHANGED
|
@@ -343,18 +343,6 @@ export const SenderVariableNameMap: Record<
|
|
|
343
343
|
keyof AppendTypes<{ sender: SenderVariablesType }, '.'>,
|
|
344
344
|
VariableNameValueType
|
|
345
345
|
> = {
|
|
346
|
-
'sender.is_business': {
|
|
347
|
-
text: 'Sender is business',
|
|
348
|
-
type: 'boolean',
|
|
349
|
-
filters: ['IS'],
|
|
350
|
-
variable_type: 'boolean',
|
|
351
|
-
},
|
|
352
|
-
'sender.is_enterprise': {
|
|
353
|
-
text: 'Sender is enterprise',
|
|
354
|
-
type: 'boolean',
|
|
355
|
-
filters: ['IS'],
|
|
356
|
-
variable_type: 'boolean',
|
|
357
|
-
},
|
|
358
346
|
'sender.is_internal': {
|
|
359
347
|
text: 'Sender is internal',
|
|
360
348
|
type: 'boolean',
|
|
@@ -515,24 +503,6 @@ export const ChatVariableNameMap: Record<
|
|
|
515
503
|
],
|
|
516
504
|
variable_type: 'boolean',
|
|
517
505
|
},
|
|
518
|
-
'chat.is_muted': {
|
|
519
|
-
text: 'Chat is muted',
|
|
520
|
-
type: 'boolean',
|
|
521
|
-
filters: ['EQ', 'NEQ'],
|
|
522
|
-
value: [
|
|
523
|
-
{
|
|
524
|
-
id: 'true',
|
|
525
|
-
value: 'true',
|
|
526
|
-
label: 'True',
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
id: 'false',
|
|
530
|
-
value: 'false',
|
|
531
|
-
label: 'False',
|
|
532
|
-
},
|
|
533
|
-
],
|
|
534
|
-
variable_type: 'boolean',
|
|
535
|
-
},
|
|
536
506
|
'chat.info_admins_only': {
|
|
537
507
|
text: 'Chat Info Admins Only',
|
|
538
508
|
type: 'boolean',
|
|
@@ -949,6 +919,13 @@ export type UpdateCustomPropertyAction = {
|
|
|
949
919
|
};
|
|
950
920
|
};
|
|
951
921
|
|
|
922
|
+
export type DeleteMessageAction = {
|
|
923
|
+
id: string;
|
|
924
|
+
type: 'delete_message';
|
|
925
|
+
delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
|
|
926
|
+
metadata: {};
|
|
927
|
+
};
|
|
928
|
+
|
|
952
929
|
export type Action =
|
|
953
930
|
| SendMessageAction
|
|
954
931
|
| NotifyHttpAction
|
|
@@ -962,7 +939,8 @@ export type Action =
|
|
|
962
939
|
| ForwardMessageAction
|
|
963
940
|
| SendEmailAction
|
|
964
941
|
| ReplyToMessageAction
|
|
965
|
-
| UpdateCustomPropertyAction
|
|
942
|
+
| UpdateCustomPropertyAction
|
|
943
|
+
| DeleteMessageAction;
|
|
966
944
|
|
|
967
945
|
export const isSendMessageOrReplyToMessageAction = (
|
|
968
946
|
action: Action
|
|
@@ -1176,6 +1154,17 @@ export const ActionNameMap: Record<
|
|
|
1176
1154
|
'message.flagged',
|
|
1177
1155
|
],
|
|
1178
1156
|
},
|
|
1157
|
+
delete_message: {
|
|
1158
|
+
title: 'Delete Message',
|
|
1159
|
+
description: 'Delete a message',
|
|
1160
|
+
inputs: {},
|
|
1161
|
+
validTriggers: [
|
|
1162
|
+
'message.created',
|
|
1163
|
+
'message.updated',
|
|
1164
|
+
'reaction.added',
|
|
1165
|
+
'message.flagged',
|
|
1166
|
+
],
|
|
1167
|
+
},
|
|
1179
1168
|
notify_http: {
|
|
1180
1169
|
title: 'Notify HTTP',
|
|
1181
1170
|
description: 'Notify an HTTP endpoint',
|
|
@@ -1258,7 +1247,12 @@ export const ActionNameMap: Record<
|
|
|
1258
1247
|
required: true,
|
|
1259
1248
|
},
|
|
1260
1249
|
},
|
|
1261
|
-
validTriggers: [
|
|
1250
|
+
validTriggers: [
|
|
1251
|
+
'message.created',
|
|
1252
|
+
'message.updated',
|
|
1253
|
+
'reaction.added',
|
|
1254
|
+
'message.flagged',
|
|
1255
|
+
],
|
|
1262
1256
|
},
|
|
1263
1257
|
assign_ticket: {
|
|
1264
1258
|
title: 'Assign Ticket',
|
|
@@ -1324,6 +1318,7 @@ export const ActionNameMap: Record<
|
|
|
1324
1318
|
'ticket.created',
|
|
1325
1319
|
'reaction.added',
|
|
1326
1320
|
'chat.label.updated',
|
|
1321
|
+
'message.flagged',
|
|
1327
1322
|
],
|
|
1328
1323
|
},
|
|
1329
1324
|
add_ticket_label: {
|
|
@@ -1352,6 +1347,7 @@ export const ActionNameMap: Record<
|
|
|
1352
1347
|
'ticket.created',
|
|
1353
1348
|
'reaction.added',
|
|
1354
1349
|
'message.flagged',
|
|
1350
|
+
'chat.label.updated',
|
|
1355
1351
|
],
|
|
1356
1352
|
inputs: {
|
|
1357
1353
|
property_id: {
|
|
@@ -1405,6 +1401,7 @@ export const ActionNameMap: Record<
|
|
|
1405
1401
|
'ticket.created',
|
|
1406
1402
|
'reaction.added',
|
|
1407
1403
|
'chat.label.updated',
|
|
1404
|
+
'message.flagged',
|
|
1408
1405
|
],
|
|
1409
1406
|
},
|
|
1410
1407
|
forward_message: {
|
|
@@ -1485,7 +1482,7 @@ export const editorVariables: Array<{
|
|
|
1485
1482
|
'reaction.added',
|
|
1486
1483
|
'message.flagged',
|
|
1487
1484
|
'ticket.created',
|
|
1488
|
-
'ticket.updated'
|
|
1485
|
+
'ticket.updated',
|
|
1489
1486
|
],
|
|
1490
1487
|
},
|
|
1491
1488
|
{
|
|
@@ -1497,7 +1494,7 @@ export const editorVariables: Array<{
|
|
|
1497
1494
|
'reaction.added',
|
|
1498
1495
|
'message.flagged',
|
|
1499
1496
|
'ticket.created',
|
|
1500
|
-
'ticket.updated'
|
|
1497
|
+
'ticket.updated',
|
|
1501
1498
|
],
|
|
1502
1499
|
},
|
|
1503
1500
|
{
|
|
@@ -1511,7 +1508,7 @@ export const editorVariables: Array<{
|
|
|
1511
1508
|
'chat.created',
|
|
1512
1509
|
'chat.label.updated',
|
|
1513
1510
|
'ticket.created',
|
|
1514
|
-
'ticket.updated'
|
|
1511
|
+
'ticket.updated',
|
|
1515
1512
|
],
|
|
1516
1513
|
},
|
|
1517
1514
|
{
|
|
@@ -1532,14 +1529,19 @@ export const variablesExclusionList: Record<
|
|
|
1532
1529
|
>
|
|
1533
1530
|
> = {
|
|
1534
1531
|
'ticket.created': ['ticket.is_deleted'],
|
|
1535
|
-
'chat.created': [
|
|
1532
|
+
'chat.created': [
|
|
1533
|
+
'chat.chat_id',
|
|
1534
|
+
'chat.labels',
|
|
1535
|
+
'chat.has_flagged_messages',
|
|
1536
|
+
'chat.assigned_to',
|
|
1537
|
+
],
|
|
1536
1538
|
'message.created': [
|
|
1537
1539
|
'message.author',
|
|
1538
1540
|
'message.performed_by',
|
|
1539
1541
|
'message.flag_status',
|
|
1540
1542
|
'sender.is_internal',
|
|
1541
1543
|
],
|
|
1542
|
-
'ticket.updated': [],
|
|
1544
|
+
'ticket.updated': ['ticket.is_deleted'],
|
|
1543
1545
|
'reaction.added': [],
|
|
1544
1546
|
'message.updated': [],
|
|
1545
1547
|
'message.flagged': [],
|