@periskope/types 0.6.73 → 0.6.74
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 +184 -0
- package/dist/types.d.ts +23 -7
- package/dist/types.js +1 -1
- package/package.json +1 -1
- package/supabase.types.ts +184 -0
- package/types.ts +15 -9
package/dist/supabase.types.d.ts
CHANGED
|
@@ -93,6 +93,13 @@ export type Database = {
|
|
|
93
93
|
isOneToOne: false;
|
|
94
94
|
referencedRelation: "tbl_org";
|
|
95
95
|
referencedColumns: ["org_id"];
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
foreignKeyName: "tbl_broadcast_logs_org_id_fkey";
|
|
99
|
+
columns: ["org_id"];
|
|
100
|
+
isOneToOne: false;
|
|
101
|
+
referencedRelation: "view_org";
|
|
102
|
+
referencedColumns: ["org_id"];
|
|
96
103
|
}
|
|
97
104
|
];
|
|
98
105
|
};
|
|
@@ -134,6 +141,13 @@ export type Database = {
|
|
|
134
141
|
isOneToOne: false;
|
|
135
142
|
referencedRelation: "tbl_org";
|
|
136
143
|
referencedColumns: ["org_id"];
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
foreignKeyName: "tbl_broadcast_messages_org_id_fkey";
|
|
147
|
+
columns: ["org_id"];
|
|
148
|
+
isOneToOne: false;
|
|
149
|
+
referencedRelation: "view_org";
|
|
150
|
+
referencedColumns: ["org_id"];
|
|
137
151
|
}
|
|
138
152
|
];
|
|
139
153
|
};
|
|
@@ -169,6 +183,13 @@ export type Database = {
|
|
|
169
183
|
isOneToOne: false;
|
|
170
184
|
referencedRelation: "tbl_org";
|
|
171
185
|
referencedColumns: ["org_id"];
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
foreignKeyName: "tbl_broadcast_templates_org_id_fkey";
|
|
189
|
+
columns: ["org_id"];
|
|
190
|
+
isOneToOne: false;
|
|
191
|
+
referencedRelation: "view_org";
|
|
192
|
+
referencedColumns: ["org_id"];
|
|
172
193
|
}
|
|
173
194
|
];
|
|
174
195
|
};
|
|
@@ -595,6 +616,13 @@ export type Database = {
|
|
|
595
616
|
isOneToOne: false;
|
|
596
617
|
referencedRelation: "tbl_org";
|
|
597
618
|
referencedColumns: ["org_id"];
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
foreignKeyName: "tbl_chat_tickets_org_id_fkey";
|
|
622
|
+
columns: ["org_id"];
|
|
623
|
+
isOneToOne: false;
|
|
624
|
+
referencedRelation: "view_org";
|
|
625
|
+
referencedColumns: ["org_id"];
|
|
598
626
|
}
|
|
599
627
|
];
|
|
600
628
|
};
|
|
@@ -605,6 +633,7 @@ export type Database = {
|
|
|
605
633
|
chat_image: string | null;
|
|
606
634
|
chat_name: string | null;
|
|
607
635
|
chat_type: string | null;
|
|
636
|
+
created_at: string;
|
|
608
637
|
group_metadata: Json | null;
|
|
609
638
|
id: Json | null;
|
|
610
639
|
invite_link: string | null;
|
|
@@ -628,6 +657,7 @@ export type Database = {
|
|
|
628
657
|
chat_image?: string | null;
|
|
629
658
|
chat_name?: string | null;
|
|
630
659
|
chat_type?: string | null;
|
|
660
|
+
created_at?: string;
|
|
631
661
|
group_metadata?: Json | null;
|
|
632
662
|
id?: Json | null;
|
|
633
663
|
invite_link?: string | null;
|
|
@@ -651,6 +681,7 @@ export type Database = {
|
|
|
651
681
|
chat_image?: string | null;
|
|
652
682
|
chat_name?: string | null;
|
|
653
683
|
chat_type?: string | null;
|
|
684
|
+
created_at?: string;
|
|
654
685
|
group_metadata?: Json | null;
|
|
655
686
|
id?: Json | null;
|
|
656
687
|
invite_link?: string | null;
|
|
@@ -767,6 +798,13 @@ export type Database = {
|
|
|
767
798
|
isOneToOne: false;
|
|
768
799
|
referencedRelation: "tbl_org";
|
|
769
800
|
referencedColumns: ["org_id"];
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
foreignKeyName: "tbl_contacts_org_id_fkey";
|
|
804
|
+
columns: ["org_id"];
|
|
805
|
+
isOneToOne: false;
|
|
806
|
+
referencedRelation: "view_org";
|
|
807
|
+
referencedColumns: ["org_id"];
|
|
770
808
|
}
|
|
771
809
|
];
|
|
772
810
|
};
|
|
@@ -808,6 +846,13 @@ export type Database = {
|
|
|
808
846
|
isOneToOne: false;
|
|
809
847
|
referencedRelation: "tbl_org";
|
|
810
848
|
referencedColumns: ["org_id"];
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
foreignKeyName: "tbl_custom_properties_org_id_fkey";
|
|
852
|
+
columns: ["org_id"];
|
|
853
|
+
isOneToOne: false;
|
|
854
|
+
referencedRelation: "view_org";
|
|
855
|
+
referencedColumns: ["org_id"];
|
|
811
856
|
}
|
|
812
857
|
];
|
|
813
858
|
};
|
|
@@ -843,6 +888,13 @@ export type Database = {
|
|
|
843
888
|
isOneToOne: false;
|
|
844
889
|
referencedRelation: "tbl_org";
|
|
845
890
|
referencedColumns: ["org_id"];
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
foreignKeyName: "tbl_flagged_messages_org_id_fkey";
|
|
894
|
+
columns: ["org_id"];
|
|
895
|
+
isOneToOne: false;
|
|
896
|
+
referencedRelation: "view_org";
|
|
897
|
+
referencedColumns: ["org_id"];
|
|
846
898
|
}
|
|
847
899
|
];
|
|
848
900
|
};
|
|
@@ -890,6 +942,13 @@ export type Database = {
|
|
|
890
942
|
isOneToOne: false;
|
|
891
943
|
referencedRelation: "tbl_org";
|
|
892
944
|
referencedColumns: ["org_id"];
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
foreignKeyName: "tbl_integration_hooks_org_id_fkey";
|
|
948
|
+
columns: ["org_id"];
|
|
949
|
+
isOneToOne: false;
|
|
950
|
+
referencedRelation: "view_org";
|
|
951
|
+
referencedColumns: ["org_id"];
|
|
893
952
|
}
|
|
894
953
|
];
|
|
895
954
|
};
|
|
@@ -931,6 +990,13 @@ export type Database = {
|
|
|
931
990
|
isOneToOne: false;
|
|
932
991
|
referencedRelation: "tbl_org";
|
|
933
992
|
referencedColumns: ["org_id"];
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
foreignKeyName: "tbl_integration_logs_org_id_fkey";
|
|
996
|
+
columns: ["org_id"];
|
|
997
|
+
isOneToOne: false;
|
|
998
|
+
referencedRelation: "view_org";
|
|
999
|
+
referencedColumns: ["org_id"];
|
|
934
1000
|
}
|
|
935
1001
|
];
|
|
936
1002
|
};
|
|
@@ -975,6 +1041,13 @@ export type Database = {
|
|
|
975
1041
|
isOneToOne: false;
|
|
976
1042
|
referencedRelation: "tbl_org";
|
|
977
1043
|
referencedColumns: ["org_id"];
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
foreignKeyName: "public_tbl_integration_tokens_org_id_fkey";
|
|
1047
|
+
columns: ["org_id"];
|
|
1048
|
+
isOneToOne: false;
|
|
1049
|
+
referencedRelation: "view_org";
|
|
1050
|
+
referencedColumns: ["org_id"];
|
|
978
1051
|
}
|
|
979
1052
|
];
|
|
980
1053
|
};
|
|
@@ -1049,6 +1122,13 @@ export type Database = {
|
|
|
1049
1122
|
isOneToOne: false;
|
|
1050
1123
|
referencedRelation: "tbl_org";
|
|
1051
1124
|
referencedColumns: ["org_id"];
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
foreignKeyName: "tbl_org_labels_org_id_fkey";
|
|
1128
|
+
columns: ["org_id"];
|
|
1129
|
+
isOneToOne: false;
|
|
1130
|
+
referencedRelation: "view_org";
|
|
1131
|
+
referencedColumns: ["org_id"];
|
|
1052
1132
|
}
|
|
1053
1133
|
];
|
|
1054
1134
|
};
|
|
@@ -1115,6 +1195,13 @@ export type Database = {
|
|
|
1115
1195
|
isOneToOne: false;
|
|
1116
1196
|
referencedRelation: "tbl_org";
|
|
1117
1197
|
referencedColumns: ["org_id"];
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
foreignKeyName: "tbl_org_members_fkey_tbl_org";
|
|
1201
|
+
columns: ["org_id"];
|
|
1202
|
+
isOneToOne: false;
|
|
1203
|
+
referencedRelation: "view_org";
|
|
1204
|
+
referencedColumns: ["org_id"];
|
|
1118
1205
|
}
|
|
1119
1206
|
];
|
|
1120
1207
|
};
|
|
@@ -1175,12 +1262,26 @@ export type Database = {
|
|
|
1175
1262
|
referencedRelation: "tbl_org";
|
|
1176
1263
|
referencedColumns: ["org_id"];
|
|
1177
1264
|
},
|
|
1265
|
+
{
|
|
1266
|
+
foreignKeyName: "tbl_org_phones_fkey_tbl_org";
|
|
1267
|
+
columns: ["org_id"];
|
|
1268
|
+
isOneToOne: false;
|
|
1269
|
+
referencedRelation: "view_org";
|
|
1270
|
+
referencedColumns: ["org_id"];
|
|
1271
|
+
},
|
|
1178
1272
|
{
|
|
1179
1273
|
foreignKeyName: "tbl_org_phones_org_id_fkey";
|
|
1180
1274
|
columns: ["org_id"];
|
|
1181
1275
|
isOneToOne: false;
|
|
1182
1276
|
referencedRelation: "tbl_org";
|
|
1183
1277
|
referencedColumns: ["org_id"];
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
foreignKeyName: "tbl_org_phones_org_id_fkey";
|
|
1281
|
+
columns: ["org_id"];
|
|
1282
|
+
isOneToOne: false;
|
|
1283
|
+
referencedRelation: "view_org";
|
|
1284
|
+
referencedColumns: ["org_id"];
|
|
1184
1285
|
}
|
|
1185
1286
|
];
|
|
1186
1287
|
};
|
|
@@ -1213,6 +1314,13 @@ export type Database = {
|
|
|
1213
1314
|
isOneToOne: false;
|
|
1214
1315
|
referencedRelation: "tbl_org";
|
|
1215
1316
|
referencedColumns: ["org_id"];
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
foreignKeyName: "tbl_quick_replies_org_id_fkey";
|
|
1320
|
+
columns: ["org_id"];
|
|
1321
|
+
isOneToOne: false;
|
|
1322
|
+
referencedRelation: "view_org";
|
|
1323
|
+
referencedColumns: ["org_id"];
|
|
1216
1324
|
}
|
|
1217
1325
|
];
|
|
1218
1326
|
};
|
|
@@ -1268,6 +1376,13 @@ export type Database = {
|
|
|
1268
1376
|
isOneToOne: false;
|
|
1269
1377
|
referencedRelation: "tbl_org";
|
|
1270
1378
|
referencedColumns: ["org_id"];
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
foreignKeyName: "tbl_broadcast_messages_org_id_fkey";
|
|
1382
|
+
columns: ["org_id"];
|
|
1383
|
+
isOneToOne: false;
|
|
1384
|
+
referencedRelation: "view_org";
|
|
1385
|
+
referencedColumns: ["org_id"];
|
|
1271
1386
|
}
|
|
1272
1387
|
];
|
|
1273
1388
|
};
|
|
@@ -1296,6 +1411,66 @@ export type Database = {
|
|
|
1296
1411
|
};
|
|
1297
1412
|
Relationships: [];
|
|
1298
1413
|
};
|
|
1414
|
+
view_org: {
|
|
1415
|
+
Row: {
|
|
1416
|
+
created_at: string | null;
|
|
1417
|
+
is_enterprise: boolean | null;
|
|
1418
|
+
is_free_trial: boolean | null;
|
|
1419
|
+
org_id: string | null;
|
|
1420
|
+
org_image: string | null;
|
|
1421
|
+
org_metadata: Json | null;
|
|
1422
|
+
org_name: string | null;
|
|
1423
|
+
org_plan: Json | null;
|
|
1424
|
+
pending_days: number | null;
|
|
1425
|
+
phone_limit: string | null;
|
|
1426
|
+
plan_id: string | null;
|
|
1427
|
+
stripe_customer_details: Json | null;
|
|
1428
|
+
stripe_customer_id: string | null;
|
|
1429
|
+
stripe_subscription_details: Json | null;
|
|
1430
|
+
subscription_status: string | null;
|
|
1431
|
+
support_link: string | null;
|
|
1432
|
+
user_limit: string | null;
|
|
1433
|
+
};
|
|
1434
|
+
Insert: {
|
|
1435
|
+
created_at?: string | null;
|
|
1436
|
+
is_enterprise?: never;
|
|
1437
|
+
is_free_trial?: never;
|
|
1438
|
+
org_id?: string | null;
|
|
1439
|
+
org_image?: string | null;
|
|
1440
|
+
org_metadata?: Json | null;
|
|
1441
|
+
org_name?: string | null;
|
|
1442
|
+
org_plan?: Json | null;
|
|
1443
|
+
pending_days?: never;
|
|
1444
|
+
phone_limit?: never;
|
|
1445
|
+
plan_id?: never;
|
|
1446
|
+
stripe_customer_details?: Json | null;
|
|
1447
|
+
stripe_customer_id?: string | null;
|
|
1448
|
+
stripe_subscription_details?: Json | null;
|
|
1449
|
+
subscription_status?: never;
|
|
1450
|
+
support_link?: string | null;
|
|
1451
|
+
user_limit?: never;
|
|
1452
|
+
};
|
|
1453
|
+
Update: {
|
|
1454
|
+
created_at?: string | null;
|
|
1455
|
+
is_enterprise?: never;
|
|
1456
|
+
is_free_trial?: never;
|
|
1457
|
+
org_id?: string | null;
|
|
1458
|
+
org_image?: string | null;
|
|
1459
|
+
org_metadata?: Json | null;
|
|
1460
|
+
org_name?: string | null;
|
|
1461
|
+
org_plan?: Json | null;
|
|
1462
|
+
pending_days?: never;
|
|
1463
|
+
phone_limit?: never;
|
|
1464
|
+
plan_id?: never;
|
|
1465
|
+
stripe_customer_details?: Json | null;
|
|
1466
|
+
stripe_customer_id?: string | null;
|
|
1467
|
+
stripe_subscription_details?: Json | null;
|
|
1468
|
+
subscription_status?: never;
|
|
1469
|
+
support_link?: string | null;
|
|
1470
|
+
user_limit?: never;
|
|
1471
|
+
};
|
|
1472
|
+
Relationships: [];
|
|
1473
|
+
};
|
|
1299
1474
|
};
|
|
1300
1475
|
Functions: {
|
|
1301
1476
|
gen_id: {
|
|
@@ -1320,6 +1495,15 @@ export type Database = {
|
|
|
1320
1495
|
};
|
|
1321
1496
|
Returns: Json;
|
|
1322
1497
|
};
|
|
1498
|
+
get_api_auth_details: {
|
|
1499
|
+
Args: {
|
|
1500
|
+
org_id_input?: string;
|
|
1501
|
+
org_phone_input?: string;
|
|
1502
|
+
token_id_input?: string;
|
|
1503
|
+
token_type_input?: string;
|
|
1504
|
+
};
|
|
1505
|
+
Returns: Json;
|
|
1506
|
+
};
|
|
1323
1507
|
get_chat_labels_data: {
|
|
1324
1508
|
Args: {
|
|
1325
1509
|
org_id_input: string;
|
package/dist/types.d.ts
CHANGED
|
@@ -54,13 +54,18 @@ export type ChatMemberType = Merge<Tables<'tbl_chat_participants'>, Tables<'tbl_
|
|
|
54
54
|
export type ChatType = Merge<Tables<'view_chats'>, {
|
|
55
55
|
chat_id: string;
|
|
56
56
|
latest_message: MessageType | null;
|
|
57
|
-
members:
|
|
57
|
+
members: {
|
|
58
|
+
[key: string]: ChatMemberType;
|
|
59
|
+
} | null;
|
|
58
60
|
chat_type: 'user' | 'group' | 'business' | 'unknown';
|
|
59
|
-
chat_access:
|
|
60
|
-
|
|
61
|
+
chat_access: {
|
|
62
|
+
[key: string]: boolean;
|
|
63
|
+
};
|
|
64
|
+
label_ids: {
|
|
65
|
+
[key: string]: boolean;
|
|
66
|
+
};
|
|
61
67
|
chat_org_phones?: string[];
|
|
62
68
|
message_unread_count: number | null;
|
|
63
|
-
is_open?: boolean;
|
|
64
69
|
}>;
|
|
65
70
|
export type MediaType = {
|
|
66
71
|
path: string;
|
|
@@ -83,7 +88,9 @@ export type MessageType = OverrideProperties<Tables<'tbl_chat_messages'>, {
|
|
|
83
88
|
media: MediaType | null;
|
|
84
89
|
}>;
|
|
85
90
|
export type TicketType = OverrideProperties<Tables<'tbl_chat_tickets'>, {
|
|
86
|
-
label_ids:
|
|
91
|
+
label_ids: {
|
|
92
|
+
[key: string]: boolean;
|
|
93
|
+
};
|
|
87
94
|
}>;
|
|
88
95
|
export type ContactType = Merge<Tables<'tbl_contacts'>, {
|
|
89
96
|
chats: ChatType[] | null;
|
|
@@ -104,10 +111,14 @@ export type SendMessageContent = {
|
|
|
104
111
|
quoted_message_type?: 'reply' | 'forward' | 'reply_private';
|
|
105
112
|
broadcast_id?: string;
|
|
106
113
|
performed_by?: string;
|
|
107
|
-
variables?:
|
|
114
|
+
variables?: {
|
|
115
|
+
[key: string]: VariableType;
|
|
116
|
+
};
|
|
108
117
|
};
|
|
109
118
|
export type QuickReplyContent = Omit<SendMessageContent, 'broadcast_id' | 'variables'>;
|
|
110
|
-
export type VariableType =
|
|
119
|
+
export type VariableType = {
|
|
120
|
+
[key: string]: string;
|
|
121
|
+
};
|
|
111
122
|
export type BroadcastMessagePayload = SendMessageContent & {
|
|
112
123
|
chat_ids: string[];
|
|
113
124
|
broadcast_id?: string;
|
|
@@ -163,3 +174,8 @@ export declare enum IntegrationLogType {
|
|
|
163
174
|
NEW_TICKET = "ticket.created"
|
|
164
175
|
}
|
|
165
176
|
export type LogTypeMap<T extends IntegrationLogType> = T extends IntegrationLogType.NEW_TICKET ? TicketLogType : Tables<'tbl_integration_logs'>;
|
|
177
|
+
export type APIAuthDetails = {
|
|
178
|
+
org_details: Tables<'view_org'> | null;
|
|
179
|
+
phone_details: Tables<'tbl_org_phones'> | null;
|
|
180
|
+
token_details: Tables<'tbl_integration_tokens'> | null;
|
|
181
|
+
};
|
package/dist/types.js
CHANGED
package/package.json
CHANGED
package/supabase.types.ts
CHANGED
|
@@ -93,6 +93,13 @@ export type Database = {
|
|
|
93
93
|
referencedRelation: "tbl_org"
|
|
94
94
|
referencedColumns: ["org_id"]
|
|
95
95
|
},
|
|
96
|
+
{
|
|
97
|
+
foreignKeyName: "tbl_broadcast_logs_org_id_fkey"
|
|
98
|
+
columns: ["org_id"]
|
|
99
|
+
isOneToOne: false
|
|
100
|
+
referencedRelation: "view_org"
|
|
101
|
+
referencedColumns: ["org_id"]
|
|
102
|
+
},
|
|
96
103
|
]
|
|
97
104
|
}
|
|
98
105
|
tbl_broadcast_messages: {
|
|
@@ -134,6 +141,13 @@ export type Database = {
|
|
|
134
141
|
referencedRelation: "tbl_org"
|
|
135
142
|
referencedColumns: ["org_id"]
|
|
136
143
|
},
|
|
144
|
+
{
|
|
145
|
+
foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
|
|
146
|
+
columns: ["org_id"]
|
|
147
|
+
isOneToOne: false
|
|
148
|
+
referencedRelation: "view_org"
|
|
149
|
+
referencedColumns: ["org_id"]
|
|
150
|
+
},
|
|
137
151
|
]
|
|
138
152
|
}
|
|
139
153
|
tbl_broadcast_templates: {
|
|
@@ -169,6 +183,13 @@ export type Database = {
|
|
|
169
183
|
referencedRelation: "tbl_org"
|
|
170
184
|
referencedColumns: ["org_id"]
|
|
171
185
|
},
|
|
186
|
+
{
|
|
187
|
+
foreignKeyName: "tbl_broadcast_templates_org_id_fkey"
|
|
188
|
+
columns: ["org_id"]
|
|
189
|
+
isOneToOne: false
|
|
190
|
+
referencedRelation: "view_org"
|
|
191
|
+
referencedColumns: ["org_id"]
|
|
192
|
+
},
|
|
172
193
|
]
|
|
173
194
|
}
|
|
174
195
|
tbl_chat_access: {
|
|
@@ -599,6 +620,13 @@ export type Database = {
|
|
|
599
620
|
referencedRelation: "tbl_org"
|
|
600
621
|
referencedColumns: ["org_id"]
|
|
601
622
|
},
|
|
623
|
+
{
|
|
624
|
+
foreignKeyName: "tbl_chat_tickets_org_id_fkey"
|
|
625
|
+
columns: ["org_id"]
|
|
626
|
+
isOneToOne: false
|
|
627
|
+
referencedRelation: "view_org"
|
|
628
|
+
referencedColumns: ["org_id"]
|
|
629
|
+
},
|
|
602
630
|
]
|
|
603
631
|
}
|
|
604
632
|
tbl_chats: {
|
|
@@ -608,6 +636,7 @@ export type Database = {
|
|
|
608
636
|
chat_image: string | null
|
|
609
637
|
chat_name: string | null
|
|
610
638
|
chat_type: string | null
|
|
639
|
+
created_at: string
|
|
611
640
|
group_metadata: Json | null
|
|
612
641
|
id: Json | null
|
|
613
642
|
invite_link: string | null
|
|
@@ -631,6 +660,7 @@ export type Database = {
|
|
|
631
660
|
chat_image?: string | null
|
|
632
661
|
chat_name?: string | null
|
|
633
662
|
chat_type?: string | null
|
|
663
|
+
created_at?: string
|
|
634
664
|
group_metadata?: Json | null
|
|
635
665
|
id?: Json | null
|
|
636
666
|
invite_link?: string | null
|
|
@@ -654,6 +684,7 @@ export type Database = {
|
|
|
654
684
|
chat_image?: string | null
|
|
655
685
|
chat_name?: string | null
|
|
656
686
|
chat_type?: string | null
|
|
687
|
+
created_at?: string
|
|
657
688
|
group_metadata?: Json | null
|
|
658
689
|
id?: Json | null
|
|
659
690
|
invite_link?: string | null
|
|
@@ -771,6 +802,13 @@ export type Database = {
|
|
|
771
802
|
referencedRelation: "tbl_org"
|
|
772
803
|
referencedColumns: ["org_id"]
|
|
773
804
|
},
|
|
805
|
+
{
|
|
806
|
+
foreignKeyName: "tbl_contacts_org_id_fkey"
|
|
807
|
+
columns: ["org_id"]
|
|
808
|
+
isOneToOne: false
|
|
809
|
+
referencedRelation: "view_org"
|
|
810
|
+
referencedColumns: ["org_id"]
|
|
811
|
+
},
|
|
774
812
|
]
|
|
775
813
|
}
|
|
776
814
|
tbl_custom_properties: {
|
|
@@ -812,6 +850,13 @@ export type Database = {
|
|
|
812
850
|
referencedRelation: "tbl_org"
|
|
813
851
|
referencedColumns: ["org_id"]
|
|
814
852
|
},
|
|
853
|
+
{
|
|
854
|
+
foreignKeyName: "tbl_custom_properties_org_id_fkey"
|
|
855
|
+
columns: ["org_id"]
|
|
856
|
+
isOneToOne: false
|
|
857
|
+
referencedRelation: "view_org"
|
|
858
|
+
referencedColumns: ["org_id"]
|
|
859
|
+
},
|
|
815
860
|
]
|
|
816
861
|
}
|
|
817
862
|
tbl_flagged_messages: {
|
|
@@ -847,6 +892,13 @@ export type Database = {
|
|
|
847
892
|
referencedRelation: "tbl_org"
|
|
848
893
|
referencedColumns: ["org_id"]
|
|
849
894
|
},
|
|
895
|
+
{
|
|
896
|
+
foreignKeyName: "tbl_flagged_messages_org_id_fkey"
|
|
897
|
+
columns: ["org_id"]
|
|
898
|
+
isOneToOne: false
|
|
899
|
+
referencedRelation: "view_org"
|
|
900
|
+
referencedColumns: ["org_id"]
|
|
901
|
+
},
|
|
850
902
|
]
|
|
851
903
|
}
|
|
852
904
|
tbl_integration_hooks: {
|
|
@@ -894,6 +946,13 @@ export type Database = {
|
|
|
894
946
|
referencedRelation: "tbl_org"
|
|
895
947
|
referencedColumns: ["org_id"]
|
|
896
948
|
},
|
|
949
|
+
{
|
|
950
|
+
foreignKeyName: "tbl_integration_hooks_org_id_fkey"
|
|
951
|
+
columns: ["org_id"]
|
|
952
|
+
isOneToOne: false
|
|
953
|
+
referencedRelation: "view_org"
|
|
954
|
+
referencedColumns: ["org_id"]
|
|
955
|
+
},
|
|
897
956
|
]
|
|
898
957
|
}
|
|
899
958
|
tbl_integration_logs: {
|
|
@@ -935,6 +994,13 @@ export type Database = {
|
|
|
935
994
|
referencedRelation: "tbl_org"
|
|
936
995
|
referencedColumns: ["org_id"]
|
|
937
996
|
},
|
|
997
|
+
{
|
|
998
|
+
foreignKeyName: "tbl_integration_logs_org_id_fkey"
|
|
999
|
+
columns: ["org_id"]
|
|
1000
|
+
isOneToOne: false
|
|
1001
|
+
referencedRelation: "view_org"
|
|
1002
|
+
referencedColumns: ["org_id"]
|
|
1003
|
+
},
|
|
938
1004
|
]
|
|
939
1005
|
}
|
|
940
1006
|
tbl_integration_tokens: {
|
|
@@ -979,6 +1045,13 @@ export type Database = {
|
|
|
979
1045
|
referencedRelation: "tbl_org"
|
|
980
1046
|
referencedColumns: ["org_id"]
|
|
981
1047
|
},
|
|
1048
|
+
{
|
|
1049
|
+
foreignKeyName: "public_tbl_integration_tokens_org_id_fkey"
|
|
1050
|
+
columns: ["org_id"]
|
|
1051
|
+
isOneToOne: false
|
|
1052
|
+
referencedRelation: "view_org"
|
|
1053
|
+
referencedColumns: ["org_id"]
|
|
1054
|
+
},
|
|
982
1055
|
]
|
|
983
1056
|
}
|
|
984
1057
|
tbl_org: {
|
|
@@ -1053,6 +1126,13 @@ export type Database = {
|
|
|
1053
1126
|
referencedRelation: "tbl_org"
|
|
1054
1127
|
referencedColumns: ["org_id"]
|
|
1055
1128
|
},
|
|
1129
|
+
{
|
|
1130
|
+
foreignKeyName: "tbl_org_labels_org_id_fkey"
|
|
1131
|
+
columns: ["org_id"]
|
|
1132
|
+
isOneToOne: false
|
|
1133
|
+
referencedRelation: "view_org"
|
|
1134
|
+
referencedColumns: ["org_id"]
|
|
1135
|
+
},
|
|
1056
1136
|
]
|
|
1057
1137
|
}
|
|
1058
1138
|
tbl_org_members: {
|
|
@@ -1119,6 +1199,13 @@ export type Database = {
|
|
|
1119
1199
|
referencedRelation: "tbl_org"
|
|
1120
1200
|
referencedColumns: ["org_id"]
|
|
1121
1201
|
},
|
|
1202
|
+
{
|
|
1203
|
+
foreignKeyName: "tbl_org_members_fkey_tbl_org"
|
|
1204
|
+
columns: ["org_id"]
|
|
1205
|
+
isOneToOne: false
|
|
1206
|
+
referencedRelation: "view_org"
|
|
1207
|
+
referencedColumns: ["org_id"]
|
|
1208
|
+
},
|
|
1122
1209
|
]
|
|
1123
1210
|
}
|
|
1124
1211
|
tbl_org_phones: {
|
|
@@ -1178,6 +1265,13 @@ export type Database = {
|
|
|
1178
1265
|
referencedRelation: "tbl_org"
|
|
1179
1266
|
referencedColumns: ["org_id"]
|
|
1180
1267
|
},
|
|
1268
|
+
{
|
|
1269
|
+
foreignKeyName: "tbl_org_phones_fkey_tbl_org"
|
|
1270
|
+
columns: ["org_id"]
|
|
1271
|
+
isOneToOne: false
|
|
1272
|
+
referencedRelation: "view_org"
|
|
1273
|
+
referencedColumns: ["org_id"]
|
|
1274
|
+
},
|
|
1181
1275
|
{
|
|
1182
1276
|
foreignKeyName: "tbl_org_phones_org_id_fkey"
|
|
1183
1277
|
columns: ["org_id"]
|
|
@@ -1185,6 +1279,13 @@ export type Database = {
|
|
|
1185
1279
|
referencedRelation: "tbl_org"
|
|
1186
1280
|
referencedColumns: ["org_id"]
|
|
1187
1281
|
},
|
|
1282
|
+
{
|
|
1283
|
+
foreignKeyName: "tbl_org_phones_org_id_fkey"
|
|
1284
|
+
columns: ["org_id"]
|
|
1285
|
+
isOneToOne: false
|
|
1286
|
+
referencedRelation: "view_org"
|
|
1287
|
+
referencedColumns: ["org_id"]
|
|
1288
|
+
},
|
|
1188
1289
|
]
|
|
1189
1290
|
}
|
|
1190
1291
|
tbl_quick_replies: {
|
|
@@ -1217,6 +1318,13 @@ export type Database = {
|
|
|
1217
1318
|
referencedRelation: "tbl_org"
|
|
1218
1319
|
referencedColumns: ["org_id"]
|
|
1219
1320
|
},
|
|
1321
|
+
{
|
|
1322
|
+
foreignKeyName: "tbl_quick_replies_org_id_fkey"
|
|
1323
|
+
columns: ["org_id"]
|
|
1324
|
+
isOneToOne: false
|
|
1325
|
+
referencedRelation: "view_org"
|
|
1326
|
+
referencedColumns: ["org_id"]
|
|
1327
|
+
},
|
|
1220
1328
|
]
|
|
1221
1329
|
}
|
|
1222
1330
|
tbl_tools_whatsapp_links: {
|
|
@@ -1272,6 +1380,13 @@ export type Database = {
|
|
|
1272
1380
|
referencedRelation: "tbl_org"
|
|
1273
1381
|
referencedColumns: ["org_id"]
|
|
1274
1382
|
},
|
|
1383
|
+
{
|
|
1384
|
+
foreignKeyName: "tbl_broadcast_messages_org_id_fkey"
|
|
1385
|
+
columns: ["org_id"]
|
|
1386
|
+
isOneToOne: false
|
|
1387
|
+
referencedRelation: "view_org"
|
|
1388
|
+
referencedColumns: ["org_id"]
|
|
1389
|
+
},
|
|
1275
1390
|
]
|
|
1276
1391
|
}
|
|
1277
1392
|
view_chats: {
|
|
@@ -1299,6 +1414,66 @@ export type Database = {
|
|
|
1299
1414
|
}
|
|
1300
1415
|
Relationships: []
|
|
1301
1416
|
}
|
|
1417
|
+
view_org: {
|
|
1418
|
+
Row: {
|
|
1419
|
+
created_at: string | null
|
|
1420
|
+
is_enterprise: boolean | null
|
|
1421
|
+
is_free_trial: boolean | null
|
|
1422
|
+
org_id: string | null
|
|
1423
|
+
org_image: string | null
|
|
1424
|
+
org_metadata: Json | null
|
|
1425
|
+
org_name: string | null
|
|
1426
|
+
org_plan: Json | null
|
|
1427
|
+
pending_days: number | null
|
|
1428
|
+
phone_limit: string | null
|
|
1429
|
+
plan_id: string | null
|
|
1430
|
+
stripe_customer_details: Json | null
|
|
1431
|
+
stripe_customer_id: string | null
|
|
1432
|
+
stripe_subscription_details: Json | null
|
|
1433
|
+
subscription_status: string | null
|
|
1434
|
+
support_link: string | null
|
|
1435
|
+
user_limit: string | null
|
|
1436
|
+
}
|
|
1437
|
+
Insert: {
|
|
1438
|
+
created_at?: string | null
|
|
1439
|
+
is_enterprise?: never
|
|
1440
|
+
is_free_trial?: never
|
|
1441
|
+
org_id?: string | null
|
|
1442
|
+
org_image?: string | null
|
|
1443
|
+
org_metadata?: Json | null
|
|
1444
|
+
org_name?: string | null
|
|
1445
|
+
org_plan?: Json | null
|
|
1446
|
+
pending_days?: never
|
|
1447
|
+
phone_limit?: never
|
|
1448
|
+
plan_id?: never
|
|
1449
|
+
stripe_customer_details?: Json | null
|
|
1450
|
+
stripe_customer_id?: string | null
|
|
1451
|
+
stripe_subscription_details?: Json | null
|
|
1452
|
+
subscription_status?: never
|
|
1453
|
+
support_link?: string | null
|
|
1454
|
+
user_limit?: never
|
|
1455
|
+
}
|
|
1456
|
+
Update: {
|
|
1457
|
+
created_at?: string | null
|
|
1458
|
+
is_enterprise?: never
|
|
1459
|
+
is_free_trial?: never
|
|
1460
|
+
org_id?: string | null
|
|
1461
|
+
org_image?: string | null
|
|
1462
|
+
org_metadata?: Json | null
|
|
1463
|
+
org_name?: string | null
|
|
1464
|
+
org_plan?: Json | null
|
|
1465
|
+
pending_days?: never
|
|
1466
|
+
phone_limit?: never
|
|
1467
|
+
plan_id?: never
|
|
1468
|
+
stripe_customer_details?: Json | null
|
|
1469
|
+
stripe_customer_id?: string | null
|
|
1470
|
+
stripe_subscription_details?: Json | null
|
|
1471
|
+
subscription_status?: never
|
|
1472
|
+
support_link?: string | null
|
|
1473
|
+
user_limit?: never
|
|
1474
|
+
}
|
|
1475
|
+
Relationships: []
|
|
1476
|
+
}
|
|
1302
1477
|
}
|
|
1303
1478
|
Functions: {
|
|
1304
1479
|
gen_id: {
|
|
@@ -1323,6 +1498,15 @@ export type Database = {
|
|
|
1323
1498
|
}
|
|
1324
1499
|
Returns: Json
|
|
1325
1500
|
}
|
|
1501
|
+
get_api_auth_details: {
|
|
1502
|
+
Args: {
|
|
1503
|
+
org_id_input?: string
|
|
1504
|
+
org_phone_input?: string
|
|
1505
|
+
token_id_input?: string
|
|
1506
|
+
token_type_input?: string
|
|
1507
|
+
}
|
|
1508
|
+
Returns: Json
|
|
1509
|
+
}
|
|
1326
1510
|
get_chat_labels_data: {
|
|
1327
1511
|
Args: {
|
|
1328
1512
|
org_id_input: string
|
package/types.ts
CHANGED
|
@@ -62,7 +62,7 @@ export type OrgType = OverrideProperties<
|
|
|
62
62
|
labels: Tables<'tbl_org_labels'>[];
|
|
63
63
|
quick_replies: Tables<'tbl_quick_replies'>[];
|
|
64
64
|
custom_properties: Tables<'tbl_custom_properties'>[];
|
|
65
|
-
subscription_status: 'active' | 'inactive' | 'unpaid'
|
|
65
|
+
subscription_status: 'active' | 'inactive' | 'unpaid';
|
|
66
66
|
is_enterprise: boolean;
|
|
67
67
|
is_free_trial: boolean;
|
|
68
68
|
}
|
|
@@ -85,13 +85,13 @@ export type ChatType = Merge<
|
|
|
85
85
|
{
|
|
86
86
|
chat_id: string;
|
|
87
87
|
latest_message: MessageType | null;
|
|
88
|
-
members:
|
|
88
|
+
members: { [key: string]: ChatMemberType } | null;
|
|
89
89
|
chat_type: 'user' | 'group' | 'business' | 'unknown';
|
|
90
|
-
chat_access:
|
|
91
|
-
label_ids:
|
|
90
|
+
chat_access: { [key: string]: boolean };
|
|
91
|
+
label_ids: { [key: string]: boolean };
|
|
92
92
|
chat_org_phones?: string[];
|
|
93
93
|
message_unread_count: number | null;
|
|
94
|
-
is_open?: boolean;
|
|
94
|
+
// is_open?: boolean;
|
|
95
95
|
}
|
|
96
96
|
>;
|
|
97
97
|
|
|
@@ -118,7 +118,7 @@ export type MessageType = OverrideProperties<
|
|
|
118
118
|
export type TicketType = OverrideProperties<
|
|
119
119
|
Tables<'tbl_chat_tickets'>,
|
|
120
120
|
{
|
|
121
|
-
label_ids:
|
|
121
|
+
label_ids: { [key: string]: boolean };
|
|
122
122
|
}
|
|
123
123
|
>;
|
|
124
124
|
export type ContactType = Merge<
|
|
@@ -177,7 +177,7 @@ export const SUPPORTED_TYPES = [
|
|
|
177
177
|
'audio',
|
|
178
178
|
'ptt',
|
|
179
179
|
'poll_creation',
|
|
180
|
-
'location'
|
|
180
|
+
'location',
|
|
181
181
|
] as const;
|
|
182
182
|
|
|
183
183
|
export type SendMessageContent = {
|
|
@@ -190,7 +190,7 @@ export type SendMessageContent = {
|
|
|
190
190
|
quoted_message_type?: 'reply' | 'forward' | 'reply_private';
|
|
191
191
|
broadcast_id?: string;
|
|
192
192
|
performed_by?: string;
|
|
193
|
-
variables?:
|
|
193
|
+
variables?: { [key: string]: VariableType };
|
|
194
194
|
};
|
|
195
195
|
|
|
196
196
|
export type QuickReplyContent = Omit<
|
|
@@ -198,7 +198,7 @@ export type QuickReplyContent = Omit<
|
|
|
198
198
|
'broadcast_id' | 'variables'
|
|
199
199
|
>;
|
|
200
200
|
|
|
201
|
-
export type VariableType =
|
|
201
|
+
export type VariableType = { [key: string]: string };
|
|
202
202
|
|
|
203
203
|
export type BroadcastMessagePayload = SendMessageContent & {
|
|
204
204
|
chat_ids: string[];
|
|
@@ -289,3 +289,9 @@ export type LogTypeMap<T extends IntegrationLogType> =
|
|
|
289
289
|
T extends IntegrationLogType.NEW_TICKET
|
|
290
290
|
? TicketLogType
|
|
291
291
|
: Tables<'tbl_integration_logs'>;
|
|
292
|
+
|
|
293
|
+
export type APIAuthDetails = {
|
|
294
|
+
org_details: Tables<'view_org'> | null;
|
|
295
|
+
phone_details: Tables<'tbl_org_phones'> | null;
|
|
296
|
+
token_details: Tables<'tbl_integration_tokens'> | null;
|
|
297
|
+
};
|