@periskope/types 0.6.39 → 0.6.40
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/supabase.types.d.ts +116 -22
- package/dist/types.d.ts +12 -6
- package/dist/types.js +14 -1
- package/package.json +1 -1
- package/supabase.types.ts +1419 -1325
- package/types.ts +25 -15
package/dist/supabase.types.d.ts
CHANGED
|
@@ -107,6 +107,7 @@ export interface Database {
|
|
|
107
107
|
};
|
|
108
108
|
tbl_chat_access: {
|
|
109
109
|
Row: {
|
|
110
|
+
active_phone: string | null;
|
|
110
111
|
chat_id: string;
|
|
111
112
|
email: string;
|
|
112
113
|
has_access: boolean | null;
|
|
@@ -114,6 +115,7 @@ export interface Database {
|
|
|
114
115
|
org_id: string;
|
|
115
116
|
};
|
|
116
117
|
Insert: {
|
|
118
|
+
active_phone?: string | null;
|
|
117
119
|
chat_id: string;
|
|
118
120
|
email: string;
|
|
119
121
|
has_access?: boolean | null;
|
|
@@ -121,6 +123,7 @@ export interface Database {
|
|
|
121
123
|
org_id?: string;
|
|
122
124
|
};
|
|
123
125
|
Update: {
|
|
126
|
+
active_phone?: string | null;
|
|
124
127
|
chat_id?: string;
|
|
125
128
|
email?: string;
|
|
126
129
|
has_access?: boolean | null;
|
|
@@ -285,10 +288,10 @@ export interface Database {
|
|
|
285
288
|
Relationships: [
|
|
286
289
|
{
|
|
287
290
|
foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones";
|
|
288
|
-
columns: ["
|
|
291
|
+
columns: ["org_phone", "org_id"];
|
|
289
292
|
isOneToOne: false;
|
|
290
293
|
referencedRelation: "tbl_org_phones";
|
|
291
|
-
referencedColumns: ["
|
|
294
|
+
referencedColumns: ["org_phone", "org_id"];
|
|
292
295
|
}
|
|
293
296
|
];
|
|
294
297
|
};
|
|
@@ -678,6 +681,7 @@ export interface Database {
|
|
|
678
681
|
org_image: string | null;
|
|
679
682
|
org_metadata: Json | null;
|
|
680
683
|
org_name: string | null;
|
|
684
|
+
org_plan: Json | null;
|
|
681
685
|
support_link: string | null;
|
|
682
686
|
};
|
|
683
687
|
Insert: {
|
|
@@ -686,6 +690,7 @@ export interface Database {
|
|
|
686
690
|
org_image?: string | null;
|
|
687
691
|
org_metadata?: Json | null;
|
|
688
692
|
org_name?: string | null;
|
|
693
|
+
org_plan?: Json | null;
|
|
689
694
|
support_link?: string | null;
|
|
690
695
|
};
|
|
691
696
|
Update: {
|
|
@@ -694,6 +699,7 @@ export interface Database {
|
|
|
694
699
|
org_image?: string | null;
|
|
695
700
|
org_metadata?: Json | null;
|
|
696
701
|
org_name?: string | null;
|
|
702
|
+
org_plan?: Json | null;
|
|
697
703
|
support_link?: string | null;
|
|
698
704
|
};
|
|
699
705
|
Relationships: [];
|
|
@@ -804,7 +810,7 @@ export interface Database {
|
|
|
804
810
|
Insert: {
|
|
805
811
|
created_at?: string;
|
|
806
812
|
is_ready?: boolean | null;
|
|
807
|
-
org_id
|
|
813
|
+
org_id?: string;
|
|
808
814
|
org_phone?: string | null;
|
|
809
815
|
phone_id?: string;
|
|
810
816
|
phone_image?: string | null;
|
|
@@ -834,6 +840,13 @@ export interface Database {
|
|
|
834
840
|
isOneToOne: false;
|
|
835
841
|
referencedRelation: "tbl_org";
|
|
836
842
|
referencedColumns: ["org_id"];
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
foreignKeyName: "tbl_org_phones_org_id_fkey";
|
|
846
|
+
columns: ["org_id"];
|
|
847
|
+
isOneToOne: false;
|
|
848
|
+
referencedRelation: "tbl_org";
|
|
849
|
+
referencedColumns: ["org_id"];
|
|
837
850
|
}
|
|
838
851
|
];
|
|
839
852
|
};
|
|
@@ -867,34 +880,122 @@ export interface Database {
|
|
|
867
880
|
}
|
|
868
881
|
];
|
|
869
882
|
};
|
|
883
|
+
view_chat_messages: {
|
|
884
|
+
Row: {
|
|
885
|
+
ack: string | null;
|
|
886
|
+
author: string | null;
|
|
887
|
+
body: string | null;
|
|
888
|
+
broadcast_id: string | null;
|
|
889
|
+
chat_id: string | null;
|
|
890
|
+
delivery_info: Json | null;
|
|
891
|
+
from_me: boolean | null;
|
|
892
|
+
invite_v4: Json | null;
|
|
893
|
+
is_deleted: boolean | null;
|
|
894
|
+
links: Json | null;
|
|
895
|
+
location: Json | null;
|
|
896
|
+
media: Json | null;
|
|
897
|
+
mentioned_ids: string[] | null;
|
|
898
|
+
message_id: string | null;
|
|
899
|
+
message_ticket_id: string | null;
|
|
900
|
+
message_type: string | null;
|
|
901
|
+
org_id: string | null;
|
|
902
|
+
org_phone: string | null;
|
|
903
|
+
performed_by: string | null;
|
|
904
|
+
prev_body: string | null;
|
|
905
|
+
quoted_message_id: string | null;
|
|
906
|
+
sender_phone: string | null;
|
|
907
|
+
sent_message_id: string | null;
|
|
908
|
+
timestamp: string | null;
|
|
909
|
+
unique_id: string | null;
|
|
910
|
+
updated_at: string | null;
|
|
911
|
+
vcards: string[] | null;
|
|
912
|
+
};
|
|
913
|
+
Insert: {
|
|
914
|
+
ack?: string | null;
|
|
915
|
+
author?: string | null;
|
|
916
|
+
body?: string | null;
|
|
917
|
+
broadcast_id?: string | null;
|
|
918
|
+
chat_id?: string | null;
|
|
919
|
+
delivery_info?: Json | null;
|
|
920
|
+
from_me?: boolean | null;
|
|
921
|
+
invite_v4?: Json | null;
|
|
922
|
+
is_deleted?: boolean | null;
|
|
923
|
+
links?: Json | null;
|
|
924
|
+
location?: Json | null;
|
|
925
|
+
media?: Json | null;
|
|
926
|
+
mentioned_ids?: string[] | null;
|
|
927
|
+
message_id?: string | null;
|
|
928
|
+
message_ticket_id?: string | null;
|
|
929
|
+
message_type?: string | null;
|
|
930
|
+
org_id?: string | null;
|
|
931
|
+
org_phone?: string | null;
|
|
932
|
+
performed_by?: string | null;
|
|
933
|
+
prev_body?: string | null;
|
|
934
|
+
quoted_message_id?: string | null;
|
|
935
|
+
sender_phone?: string | null;
|
|
936
|
+
sent_message_id?: string | null;
|
|
937
|
+
timestamp?: string | null;
|
|
938
|
+
unique_id?: string | null;
|
|
939
|
+
updated_at?: string | null;
|
|
940
|
+
vcards?: string[] | null;
|
|
941
|
+
};
|
|
942
|
+
Update: {
|
|
943
|
+
ack?: string | null;
|
|
944
|
+
author?: string | null;
|
|
945
|
+
body?: string | null;
|
|
946
|
+
broadcast_id?: string | null;
|
|
947
|
+
chat_id?: string | null;
|
|
948
|
+
delivery_info?: Json | null;
|
|
949
|
+
from_me?: boolean | null;
|
|
950
|
+
invite_v4?: Json | null;
|
|
951
|
+
is_deleted?: boolean | null;
|
|
952
|
+
links?: Json | null;
|
|
953
|
+
location?: Json | null;
|
|
954
|
+
media?: Json | null;
|
|
955
|
+
mentioned_ids?: string[] | null;
|
|
956
|
+
message_id?: string | null;
|
|
957
|
+
message_ticket_id?: string | null;
|
|
958
|
+
message_type?: string | null;
|
|
959
|
+
org_id?: string | null;
|
|
960
|
+
org_phone?: string | null;
|
|
961
|
+
performed_by?: string | null;
|
|
962
|
+
prev_body?: string | null;
|
|
963
|
+
quoted_message_id?: string | null;
|
|
964
|
+
sender_phone?: string | null;
|
|
965
|
+
sent_message_id?: string | null;
|
|
966
|
+
timestamp?: string | null;
|
|
967
|
+
unique_id?: string | null;
|
|
968
|
+
updated_at?: string | null;
|
|
969
|
+
vcards?: string[] | null;
|
|
970
|
+
};
|
|
971
|
+
Relationships: [
|
|
972
|
+
{
|
|
973
|
+
foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones";
|
|
974
|
+
columns: ["org_phone", "org_id"];
|
|
975
|
+
isOneToOne: false;
|
|
976
|
+
referencedRelation: "tbl_org_phones";
|
|
977
|
+
referencedColumns: ["org_phone", "org_id"];
|
|
978
|
+
}
|
|
979
|
+
];
|
|
980
|
+
};
|
|
870
981
|
view_chats: {
|
|
871
982
|
Row: {
|
|
872
|
-
|
|
983
|
+
active_phone: string | null;
|
|
873
984
|
chat_access: Json | null;
|
|
874
985
|
chat_id: string | null;
|
|
875
986
|
chat_image: string | null;
|
|
876
987
|
chat_name: string | null;
|
|
877
988
|
chat_org_phones: string[] | null;
|
|
878
989
|
chat_type: string | null;
|
|
879
|
-
group_metadata: Json | null;
|
|
880
990
|
has_access: boolean | null;
|
|
881
|
-
id: Json | null;
|
|
882
991
|
invite_link: string | null;
|
|
883
|
-
is_group: boolean | null;
|
|
884
|
-
is_muted: boolean | null;
|
|
885
|
-
is_read_only: boolean | null;
|
|
886
992
|
label_ids: Json | null;
|
|
887
993
|
last_read_timestamp: string | null;
|
|
888
994
|
latest_message: Json | null;
|
|
889
995
|
member_count: number | null;
|
|
890
996
|
message_unread_count: number | null;
|
|
891
|
-
mute_expiration: number | null;
|
|
892
|
-
name: string | null;
|
|
893
997
|
org_id: string | null;
|
|
894
998
|
org_phone: string | null;
|
|
895
|
-
pinned: boolean | null;
|
|
896
|
-
timestamp: string | null;
|
|
897
|
-
unread_count: number | null;
|
|
898
999
|
updated_at: string | null;
|
|
899
1000
|
};
|
|
900
1001
|
Relationships: [
|
|
@@ -911,7 +1012,6 @@ export interface Database {
|
|
|
911
1012
|
Row: {
|
|
912
1013
|
business_profile: Json | null;
|
|
913
1014
|
chat_count: number | null;
|
|
914
|
-
chat_ids: string[] | null;
|
|
915
1015
|
contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null;
|
|
916
1016
|
contact_id: string | null;
|
|
917
1017
|
contact_image: string | null;
|
|
@@ -1005,13 +1105,6 @@ export interface Database {
|
|
|
1005
1105
|
};
|
|
1006
1106
|
Returns: Json;
|
|
1007
1107
|
};
|
|
1008
|
-
get_media: {
|
|
1009
|
-
Args: {
|
|
1010
|
-
filters?: Json;
|
|
1011
|
-
page_num?: number;
|
|
1012
|
-
};
|
|
1013
|
-
Returns: Json;
|
|
1014
|
-
};
|
|
1015
1108
|
get_org: {
|
|
1016
1109
|
Args: {
|
|
1017
1110
|
org_id_input?: string;
|
|
@@ -1031,6 +1124,7 @@ export interface Database {
|
|
|
1031
1124
|
tbl_type: string;
|
|
1032
1125
|
label_ids_input: Json;
|
|
1033
1126
|
row_id_input: string[];
|
|
1127
|
+
replace_labels?: boolean;
|
|
1034
1128
|
};
|
|
1035
1129
|
Returns: undefined;
|
|
1036
1130
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Merge, OverrideProperties } from 'type-fest';
|
|
2
|
-
import { Chat, Location, MessageInfo
|
|
2
|
+
import { Chat, Location, MessageInfo } from 'whatsapp-web.js';
|
|
3
3
|
import { Tables } from './supabase.types';
|
|
4
4
|
export type WhatsappChat = Chat & {
|
|
5
5
|
groupMetadata?: any;
|
|
@@ -18,10 +18,10 @@ export type ChatType = Merge<Tables<'view_chats'>, {
|
|
|
18
18
|
latest_message: MessageType | null;
|
|
19
19
|
members: Record<string, ChatMemberType> | null;
|
|
20
20
|
chat_type: 'user' | 'group' | 'business' | 'unknown';
|
|
21
|
-
active_phone?: string;
|
|
22
21
|
chat_access: Record<string, boolean>;
|
|
23
22
|
label_ids: Record<string, boolean>;
|
|
24
23
|
chat_org_phones?: string[];
|
|
24
|
+
message_unread_count: number | null;
|
|
25
25
|
}>;
|
|
26
26
|
export type MediaType = {
|
|
27
27
|
path: string;
|
|
@@ -33,8 +33,12 @@ export type MediaType = {
|
|
|
33
33
|
ar: number;
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
export type MessageType = OverrideProperties<Tables<'
|
|
37
|
-
|
|
36
|
+
export type MessageType = OverrideProperties<Tables<'view_chat_messages'>, {
|
|
37
|
+
message_id: string;
|
|
38
|
+
org_id: string;
|
|
39
|
+
org_phone: string;
|
|
40
|
+
chat_id: string;
|
|
41
|
+
message_type: typeof SUPPORTED_TYPES[number];
|
|
38
42
|
media: MediaType | null;
|
|
39
43
|
}>;
|
|
40
44
|
export type TicketType = OverrideProperties<Tables<'tbl_chat_tickets'>, {
|
|
@@ -43,13 +47,15 @@ export type TicketType = OverrideProperties<Tables<'tbl_chat_tickets'>, {
|
|
|
43
47
|
export type ContactType = Merge<Tables<'tbl_contacts'>, {
|
|
44
48
|
chats: ChatType[] | null;
|
|
45
49
|
chat_count: number | null;
|
|
46
|
-
chat_ids: string[] | null;
|
|
47
50
|
}>;
|
|
51
|
+
export type ReactionType = Tables<'tbl_chat_reactions'>;
|
|
52
|
+
export type NotificationType = Tables<'tbl_chat_notifications'>;
|
|
48
53
|
export type ChatAccessType = Merge<Partial<Tables<'tbl_chat_access'>>, Tables<'tbl_org_members'>>;
|
|
49
54
|
export declare const labelColors: string[];
|
|
50
55
|
export declare const enumChatColors: readonly ["#B4876E", "#A5B337", "#06CF9C", "#25D366", "#02A698", "#7D9EF1", "#007BFC", "#5E47DE", "#7F66FF", "#9333EA", "#FA6533", "#C4532D", "#DC2626", "#FF2E74", "#DB2777"];
|
|
56
|
+
export declare const SUPPORTED_TYPES: readonly ["chat", "sticker", "image", "video", "document", "vcard", "multi_vcard", "audio", "ptt", "poll_creation"];
|
|
51
57
|
export type SendMessageContent = {
|
|
52
|
-
message_type?:
|
|
58
|
+
message_type?: typeof SUPPORTED_TYPES[number];
|
|
53
59
|
body?: string;
|
|
54
60
|
media?: MediaType;
|
|
55
61
|
contact_ids?: string[];
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.enumChatColors = exports.labelColors = void 0;
|
|
3
|
+
exports.SUPPORTED_TYPES = exports.enumChatColors = exports.labelColors = void 0;
|
|
4
4
|
/* -------------------------------- CONSTANTS ------------------------------- */
|
|
5
5
|
exports.labelColors = [
|
|
6
6
|
'#9333EA',
|
|
@@ -26,3 +26,16 @@ exports.enumChatColors = [
|
|
|
26
26
|
'#FF2E74',
|
|
27
27
|
'#DB2777',
|
|
28
28
|
];
|
|
29
|
+
/* -------------------------- SEND MESSAGE PAYLOAD -------------------------- */
|
|
30
|
+
exports.SUPPORTED_TYPES = [
|
|
31
|
+
'chat',
|
|
32
|
+
'sticker',
|
|
33
|
+
'image',
|
|
34
|
+
'video',
|
|
35
|
+
'document',
|
|
36
|
+
'vcard',
|
|
37
|
+
'multi_vcard',
|
|
38
|
+
'audio',
|
|
39
|
+
'ptt',
|
|
40
|
+
'poll_creation',
|
|
41
|
+
];
|