@periskope/types 0.6.38 → 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.
@@ -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: ["org_id", "org_phone"];
291
+ columns: ["org_phone", "org_id"];
289
292
  isOneToOne: false;
290
293
  referencedRelation: "tbl_org_phones";
291
- referencedColumns: ["org_id", "org_phone"];
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: string;
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
- archived: boolean | null;
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;
@@ -992,7 +1092,9 @@ export interface Database {
992
1092
  };
993
1093
  get_dashboard_statistics: {
994
1094
  Args: {
995
- org_id_input?: string;
1095
+ org_id_input: string;
1096
+ type_input?: string;
1097
+ interval_input?: unknown;
996
1098
  };
997
1099
  Returns: Json;
998
1100
  };
@@ -1003,13 +1105,6 @@ export interface Database {
1003
1105
  };
1004
1106
  Returns: Json;
1005
1107
  };
1006
- get_media: {
1007
- Args: {
1008
- filters?: Json;
1009
- page_num?: number;
1010
- };
1011
- Returns: Json;
1012
- };
1013
1108
  get_org: {
1014
1109
  Args: {
1015
1110
  org_id_input?: string;
@@ -1029,6 +1124,7 @@ export interface Database {
1029
1124
  tbl_type: string;
1030
1125
  label_ids_input: Json;
1031
1126
  row_id_input: string[];
1127
+ replace_labels?: boolean;
1032
1128
  };
1033
1129
  Returns: undefined;
1034
1130
  };
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Merge, OverrideProperties } from 'type-fest';
2
- import { Chat, Location, MessageInfo, MessageTypes } from 'whatsapp-web.js';
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,18 +18,27 @@ 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;
28
28
  mimetype?: string;
29
29
  filename?: string;
30
+ dimensions?: {
31
+ width: number;
32
+ height: number;
33
+ ar: number;
34
+ };
30
35
  };
31
- export type MessageType = OverrideProperties<Tables<'tbl_chat_messages'>, {
32
- message_type: MessageTypes;
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];
33
42
  media: MediaType | null;
34
43
  }>;
35
44
  export type TicketType = OverrideProperties<Tables<'tbl_chat_tickets'>, {
@@ -38,13 +47,15 @@ export type TicketType = OverrideProperties<Tables<'tbl_chat_tickets'>, {
38
47
  export type ContactType = Merge<Tables<'tbl_contacts'>, {
39
48
  chats: ChatType[] | null;
40
49
  chat_count: number | null;
41
- chat_ids: string[] | null;
42
50
  }>;
51
+ export type ReactionType = Tables<'tbl_chat_reactions'>;
52
+ export type NotificationType = Tables<'tbl_chat_notifications'>;
43
53
  export type ChatAccessType = Merge<Partial<Tables<'tbl_chat_access'>>, Tables<'tbl_org_members'>>;
44
54
  export declare const labelColors: string[];
45
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"];
46
57
  export type SendMessageContent = {
47
- message_type?: 'chat' | 'audio' | 'ptt' | 'image' | 'video' | 'document' | 'sticker' | 'location' | 'vcard';
58
+ message_type?: typeof SUPPORTED_TYPES[number];
48
59
  body?: string;
49
60
  media?: MediaType;
50
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
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@periskope/types",
3
- "version": "0.6.38",
3
+ "version": "0.6.40",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",