@periskope/types 0.6.63 → 0.6.65

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.
@@ -1,7 +1,7 @@
1
1
  export type Json = {
2
2
  [key: string]: any;
3
3
  } | any;
4
- export interface Database {
4
+ export type Database = {
5
5
  graphql_public: {
6
6
  Tables: {
7
7
  [_ in never]: never;
@@ -739,6 +739,138 @@ export interface Database {
739
739
  }
740
740
  ];
741
741
  };
742
+ tbl_integration_hooks: {
743
+ Row: {
744
+ hook_url: string;
745
+ id: string;
746
+ integration_id: string | null;
747
+ integration_metadata: Json;
748
+ integration_name: Database["public"]["Enums"]["enum_integration_name"];
749
+ integration_type: string;
750
+ is_subscribed: boolean;
751
+ org_id: string;
752
+ subscribed_at: string;
753
+ type: string;
754
+ };
755
+ Insert: {
756
+ hook_url: string;
757
+ id?: string;
758
+ integration_id?: string | null;
759
+ integration_metadata: Json;
760
+ integration_name: Database["public"]["Enums"]["enum_integration_name"];
761
+ integration_type: string;
762
+ is_subscribed: boolean;
763
+ org_id: string;
764
+ subscribed_at?: string;
765
+ type: string;
766
+ };
767
+ Update: {
768
+ hook_url?: string;
769
+ id?: string;
770
+ integration_id?: string | null;
771
+ integration_metadata?: Json;
772
+ integration_name?: Database["public"]["Enums"]["enum_integration_name"];
773
+ integration_type?: string;
774
+ is_subscribed?: boolean;
775
+ org_id?: string;
776
+ subscribed_at?: string;
777
+ type?: string;
778
+ };
779
+ Relationships: [
780
+ {
781
+ foreignKeyName: "tbl_integration_hooks_org_id_fkey";
782
+ columns: ["org_id"];
783
+ isOneToOne: false;
784
+ referencedRelation: "tbl_org";
785
+ referencedColumns: ["org_id"];
786
+ }
787
+ ];
788
+ };
789
+ tbl_integration_logs: {
790
+ Row: {
791
+ created_at: string;
792
+ id: string;
793
+ integration_name: Database["public"]["Enums"]["enum_integration_name"];
794
+ integration_type: string;
795
+ metadata: Json;
796
+ org_id: string;
797
+ success: boolean;
798
+ type: string;
799
+ };
800
+ Insert: {
801
+ created_at?: string;
802
+ id?: string;
803
+ integration_name: Database["public"]["Enums"]["enum_integration_name"];
804
+ integration_type: string;
805
+ metadata?: Json;
806
+ org_id: string;
807
+ success?: boolean;
808
+ type: string;
809
+ };
810
+ Update: {
811
+ created_at?: string;
812
+ id?: string;
813
+ integration_name?: Database["public"]["Enums"]["enum_integration_name"];
814
+ integration_type?: string;
815
+ metadata?: Json;
816
+ org_id?: string;
817
+ success?: boolean;
818
+ type?: string;
819
+ };
820
+ Relationships: [
821
+ {
822
+ foreignKeyName: "tbl_integration_logs_org_id_fkey";
823
+ columns: ["org_id"];
824
+ isOneToOne: false;
825
+ referencedRelation: "tbl_org";
826
+ referencedColumns: ["org_id"];
827
+ }
828
+ ];
829
+ };
830
+ tbl_integration_tokens: {
831
+ Row: {
832
+ exp: string;
833
+ iat: string;
834
+ id: string;
835
+ is_revealed: boolean;
836
+ name: string;
837
+ org_id: string;
838
+ role: string;
839
+ token: string;
840
+ type: string;
841
+ };
842
+ Insert: {
843
+ exp: string;
844
+ iat: string;
845
+ id?: string;
846
+ is_revealed?: boolean;
847
+ name: string;
848
+ org_id: string;
849
+ role: string;
850
+ token: string;
851
+ type: string;
852
+ };
853
+ Update: {
854
+ exp?: string;
855
+ iat?: string;
856
+ id?: string;
857
+ is_revealed?: boolean;
858
+ name?: string;
859
+ org_id?: string;
860
+ role?: string;
861
+ token?: string;
862
+ type?: string;
863
+ };
864
+ Relationships: [
865
+ {
866
+ foreignKeyName: "public_tbl_integration_tokens_org_id_fkey";
867
+ columns: ["org_id"];
868
+ isOneToOne: false;
869
+ referencedRelation: "tbl_org";
870
+ referencedColumns: ["org_id"];
871
+ }
872
+ ];
873
+ };
742
874
  tbl_org: {
743
875
  Row: {
744
876
  created_at: string;
@@ -873,6 +1005,7 @@ export interface Database {
873
1005
  tbl_org_phones: {
874
1006
  Row: {
875
1007
  created_at: string;
1008
+ first_connected_at: string | null;
876
1009
  is_ready: boolean | null;
877
1010
  org_id: string;
878
1011
  org_phone: string | null;
@@ -886,6 +1019,7 @@ export interface Database {
886
1019
  };
887
1020
  Insert: {
888
1021
  created_at?: string;
1022
+ first_connected_at?: string | null;
889
1023
  is_ready?: boolean | null;
890
1024
  org_id: string;
891
1025
  org_phone?: string | null;
@@ -899,6 +1033,7 @@ export interface Database {
899
1033
  };
900
1034
  Update: {
901
1035
  created_at?: string;
1036
+ first_connected_at?: string | null;
902
1037
  is_ready?: boolean | null;
903
1038
  org_id?: string;
904
1039
  org_phone?: string | null;
@@ -990,6 +1125,7 @@ export interface Database {
990
1125
  chat_name: string | null;
991
1126
  chat_org_phones: string[] | null;
992
1127
  chat_type: string | null;
1128
+ created_at: string | null;
993
1129
  custom_properties: Json | null;
994
1130
  group_description: string | null;
995
1131
  has_access: boolean | null;
@@ -1031,6 +1167,14 @@ export interface Database {
1031
1167
  };
1032
1168
  Returns: string;
1033
1169
  };
1170
+ generate_access_token: {
1171
+ Args: {
1172
+ name_input?: string;
1173
+ type_input?: string;
1174
+ org_id_input?: string;
1175
+ };
1176
+ Returns: Json;
1177
+ };
1034
1178
  get_broadcast_id: {
1035
1179
  Args: {
1036
1180
  broadcast_id_input: string;
@@ -1043,7 +1187,7 @@ export interface Database {
1043
1187
  org_id_input: string;
1044
1188
  chat_ids_input?: string[];
1045
1189
  };
1046
- Returns: unknown;
1190
+ Returns: Json[];
1047
1191
  };
1048
1192
  get_chats: {
1049
1193
  Args: {
@@ -1093,9 +1237,18 @@ export interface Database {
1093
1237
  };
1094
1238
  Returns: Json;
1095
1239
  };
1240
+ get_ticket_info: {
1241
+ Args: {
1242
+ ticket_id_input?: string;
1243
+ org_id_input?: string;
1244
+ chat_id_input?: string;
1245
+ unique_message_id_input?: string;
1246
+ };
1247
+ Returns: Json;
1248
+ };
1096
1249
  list_org_from_user: {
1097
1250
  Args: Record<PropertyKey, never>;
1098
- Returns: unknown;
1251
+ Returns: string[];
1099
1252
  };
1100
1253
  list_role_from_user: {
1101
1254
  Args: Record<PropertyKey, never>;
@@ -1115,6 +1268,7 @@ export interface Database {
1115
1268
  Enums: {
1116
1269
  enum_chat_colors: "#B4876E" | "#A5B337" | "#06CF9C" | "#25D366" | "#02A698" | "#7D9EF1" | "#007BFC" | "#5E47DE" | "#7F66FF" | "#9333EA" | "#FA6533" | "#C4532D" | "#DC2626" | "#FF2E74" | "#DB2777";
1117
1270
  enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived";
1271
+ enum_integration_name: "new_ticket";
1118
1272
  enum_member_role: "admin" | "member";
1119
1273
  };
1120
1274
  CompositeTypes: {
@@ -1263,7 +1417,7 @@ export interface Database {
1263
1417
  Args: {
1264
1418
  name: string;
1265
1419
  };
1266
- Returns: unknown;
1420
+ Returns: string[];
1267
1421
  };
1268
1422
  get_size_by_bucket: {
1269
1423
  Args: Record<PropertyKey, never>;
@@ -1300,8 +1454,9 @@ export interface Database {
1300
1454
  [_ in never]: never;
1301
1455
  };
1302
1456
  };
1303
- }
1304
- export type Tables<PublicTableNameOrOptions extends keyof (Database["public"]["Tables"] & Database["public"]["Views"]) | {
1457
+ };
1458
+ type PublicSchema = Database[Extract<keyof Database, "public">];
1459
+ export type Tables<PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & PublicSchema["Views"]) | {
1305
1460
  schema: keyof Database;
1306
1461
  }, TableName extends PublicTableNameOrOptions extends {
1307
1462
  schema: keyof Database;
@@ -1309,10 +1464,10 @@ export type Tables<PublicTableNameOrOptions extends keyof (Database["public"]["T
1309
1464
  schema: keyof Database;
1310
1465
  } ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] & Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
1311
1466
  Row: infer R;
1312
- } ? R : never : PublicTableNameOrOptions extends keyof (Database["public"]["Tables"] & Database["public"]["Views"]) ? (Database["public"]["Tables"] & Database["public"]["Views"])[PublicTableNameOrOptions] extends {
1467
+ } ? R : never : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & PublicSchema["Views"]) ? (PublicSchema["Tables"] & PublicSchema["Views"])[PublicTableNameOrOptions] extends {
1313
1468
  Row: infer R;
1314
1469
  } ? R : never : never;
1315
- export type TablesInsert<PublicTableNameOrOptions extends keyof Database["public"]["Tables"] | {
1470
+ export type TablesInsert<PublicTableNameOrOptions extends keyof PublicSchema["Tables"] | {
1316
1471
  schema: keyof Database;
1317
1472
  }, TableName extends PublicTableNameOrOptions extends {
1318
1473
  schema: keyof Database;
@@ -1320,10 +1475,10 @@ export type TablesInsert<PublicTableNameOrOptions extends keyof Database["public
1320
1475
  schema: keyof Database;
1321
1476
  } ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1322
1477
  Insert: infer I;
1323
- } ? I : never : PublicTableNameOrOptions extends keyof Database["public"]["Tables"] ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1478
+ } ? I : never : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
1324
1479
  Insert: infer I;
1325
1480
  } ? I : never : never;
1326
- export type TablesUpdate<PublicTableNameOrOptions extends keyof Database["public"]["Tables"] | {
1481
+ export type TablesUpdate<PublicTableNameOrOptions extends keyof PublicSchema["Tables"] | {
1327
1482
  schema: keyof Database;
1328
1483
  }, TableName extends PublicTableNameOrOptions extends {
1329
1484
  schema: keyof Database;
@@ -1331,13 +1486,14 @@ export type TablesUpdate<PublicTableNameOrOptions extends keyof Database["public
1331
1486
  schema: keyof Database;
1332
1487
  } ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
1333
1488
  Update: infer U;
1334
- } ? U : never : PublicTableNameOrOptions extends keyof Database["public"]["Tables"] ? Database["public"]["Tables"][PublicTableNameOrOptions] extends {
1489
+ } ? U : never : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
1335
1490
  Update: infer U;
1336
1491
  } ? U : never : never;
1337
- export type Enums<PublicEnumNameOrOptions extends keyof Database["public"]["Enums"] | {
1492
+ export type Enums<PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] | {
1338
1493
  schema: keyof Database;
1339
1494
  }, EnumName extends PublicEnumNameOrOptions extends {
1340
1495
  schema: keyof Database;
1341
1496
  } ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"] : never = never> = PublicEnumNameOrOptions extends {
1342
1497
  schema: keyof Database;
1343
- } ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] : PublicEnumNameOrOptions extends keyof Database["public"]["Enums"] ? Database["public"]["Enums"][PublicEnumNameOrOptions] : never;
1498
+ } ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] ? PublicSchema["Enums"][PublicEnumNameOrOptions] : never;
1499
+ export {};
package/dist/types.d.ts CHANGED
@@ -154,3 +154,14 @@ export type PhoneRealtimeChannel = {
154
154
  error?: string;
155
155
  presence_ref?: string;
156
156
  };
157
+ export type TicketLogType = OverrideProperties<Tables<'tbl_integration_logs'>, {
158
+ integration_name: IntegrationLogType.NEW_TICKET;
159
+ metadata: {
160
+ ticket_id: string;
161
+ };
162
+ }>;
163
+ export type IntegrationLogDetailsType = TicketLogType;
164
+ export declare enum IntegrationLogType {
165
+ NEW_TICKET = "new_ticket"
166
+ }
167
+ export type LogTypeMap<T extends IntegrationLogType> = T extends IntegrationLogType.NEW_TICKET ? TicketLogType : Tables<'tbl_integration_logs'>;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SUPPORTED_TYPES = exports.enumChatColors = exports.labelColors = exports.AllPlans = void 0;
3
+ exports.IntegrationLogType = exports.SUPPORTED_TYPES = exports.enumChatColors = exports.labelColors = exports.AllPlans = void 0;
4
4
  /* ------------------------------ PERISKOPE TYPES ------------------------------ */
5
5
  var AllPlans;
6
6
  (function (AllPlans) {
@@ -49,3 +49,7 @@ exports.SUPPORTED_TYPES = [
49
49
  'ptt',
50
50
  'poll_creation',
51
51
  ];
52
+ var IntegrationLogType;
53
+ (function (IntegrationLogType) {
54
+ IntegrationLogType["NEW_TICKET"] = "new_ticket";
55
+ })(IntegrationLogType || (exports.IntegrationLogType = IntegrationLogType = {}));
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
- "name": "@periskope/types",
3
- "version": "0.6.63",
4
- "private": false,
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "dependencies": {
8
- "@periskope/whatsapp-web.js": "^1.23.1-alpha.5.8",
9
- "@types/pg": "8.11.2",
10
- "pg": "^8.11.3",
11
- "stripe": "^14.19.0",
12
- "ts-node": "^10.9.2",
13
- "type-fest": "^4.8.3"
14
- },
15
- "scripts": {
16
- "update-package": "tsc && npm publish --access public"
17
- }
2
+ "name": "@periskope/types",
3
+ "version": "0.6.65",
4
+ "private": false,
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "dependencies": {
8
+ "@periskope/whatsapp-web.js": "^1.23.1-alpha.5.8",
9
+ "@types/pg": "8.11.2",
10
+ "pg": "^8.11.3",
11
+ "stripe": "^14.19.0",
12
+ "ts-node": "^10.9.2",
13
+ "type-fest": "^4.8.3"
14
+ },
15
+ "scripts": {
16
+ "update-package": "tsc \u0026\u0026 npm publish --access public"
17
+ }
18
18
  }