@periskope/types 0.6.464 → 0.6.466

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.
@@ -832,6 +832,73 @@ export type Database = {
832
832
  };
833
833
  Relationships: [];
834
834
  };
835
+ tbl_api_tokens: {
836
+ Row: {
837
+ exp: string;
838
+ iat: string;
839
+ id: string;
840
+ is_revealed: boolean;
841
+ name: string;
842
+ org_id: string;
843
+ refresh_token_hash: string | null;
844
+ role: string;
845
+ token: string;
846
+ token_hash: string;
847
+ token_metadata: Json;
848
+ type: string;
849
+ };
850
+ Insert: {
851
+ exp: string;
852
+ iat: string;
853
+ id: string;
854
+ is_revealed?: boolean;
855
+ name: string;
856
+ org_id: string;
857
+ refresh_token_hash?: string | null;
858
+ role: string;
859
+ token: string;
860
+ token_hash: string;
861
+ token_metadata?: Json;
862
+ type: string;
863
+ };
864
+ Update: {
865
+ exp?: string;
866
+ iat?: string;
867
+ id?: string;
868
+ is_revealed?: boolean;
869
+ name?: string;
870
+ org_id?: string;
871
+ refresh_token_hash?: string | null;
872
+ role?: string;
873
+ token?: string;
874
+ token_hash?: string;
875
+ token_metadata?: Json;
876
+ type?: string;
877
+ };
878
+ Relationships: [
879
+ {
880
+ foreignKeyName: "tbl_api_tokens_org_id_fkey";
881
+ columns: ["org_id"];
882
+ isOneToOne: false;
883
+ referencedRelation: "tbl_org";
884
+ referencedColumns: ["org_id"];
885
+ },
886
+ {
887
+ foreignKeyName: "tbl_api_tokens_org_id_fkey";
888
+ columns: ["org_id"];
889
+ isOneToOne: false;
890
+ referencedRelation: "view_org";
891
+ referencedColumns: ["org_id"];
892
+ },
893
+ {
894
+ foreignKeyName: "tbl_api_tokens_org_id_fkey";
895
+ columns: ["org_id"];
896
+ isOneToOne: false;
897
+ referencedRelation: "view_org_all";
898
+ referencedColumns: ["org_id"];
899
+ }
900
+ ];
901
+ };
835
902
  tbl_automation_rules: {
836
903
  Row: {
837
904
  actions: Json;
@@ -897,29 +964,29 @@ export type Database = {
897
964
  Row: {
898
965
  chat_ids: string[];
899
966
  created_at: string;
900
- updated_at: string | null;
901
967
  created_by: string | null;
902
968
  org_id: string;
903
969
  template_id: string;
904
970
  template_name: string;
971
+ updated_at: string | null;
905
972
  };
906
973
  Insert: {
907
974
  chat_ids?: string[];
908
975
  created_at?: string;
909
- updated_at?: string | null;
910
976
  created_by?: string | null;
911
977
  org_id: string;
912
978
  template_id?: string;
913
979
  template_name: string;
980
+ updated_at?: string | null;
914
981
  };
915
982
  Update: {
916
983
  chat_ids?: string[];
917
984
  created_at?: string;
918
- updated_at?: string | null;
919
985
  created_by?: string | null;
920
986
  org_id?: string;
921
987
  template_id?: string;
922
988
  template_name?: string;
989
+ updated_at?: string | null;
923
990
  };
924
991
  Relationships: [
925
992
  {
@@ -958,9 +1025,9 @@ export type Database = {
958
1025
  message_id: string | null;
959
1026
  org_id: string;
960
1027
  org_phone: string | null;
1028
+ poll_results: Json | null;
961
1029
  read_count: number | null;
962
1030
  remarks: string | null;
963
- poll_results: Json | null;
964
1031
  };
965
1032
  Insert: {
966
1033
  broadcast_id: string;
@@ -974,9 +1041,9 @@ export type Database = {
974
1041
  message_id?: string | null;
975
1042
  org_id: string;
976
1043
  org_phone?: string | null;
1044
+ poll_results?: Json | null;
977
1045
  read_count?: number | null;
978
1046
  remarks?: string | null;
979
- poll_results?: Json | null;
980
1047
  };
981
1048
  Update: {
982
1049
  broadcast_id?: string;
@@ -990,9 +1057,9 @@ export type Database = {
990
1057
  message_id?: string | null;
991
1058
  org_id?: string;
992
1059
  org_phone?: string | null;
1060
+ poll_results?: Json | null;
993
1061
  read_count?: number | null;
994
1062
  remarks?: string | null;
995
- poll_results?: Json | null;
996
1063
  };
997
1064
  Relationships: [
998
1065
  {
@@ -1163,6 +1230,42 @@ export type Database = {
1163
1230
  }
1164
1231
  ];
1165
1232
  };
1233
+ tbl_chat_audit_logs: {
1234
+ Row: {
1235
+ action: string | null;
1236
+ chat_id: string | null;
1237
+ log_id: string;
1238
+ new_record: Json | null;
1239
+ old_record: Json | null;
1240
+ org_id: string | null;
1241
+ performed_by: string | null;
1242
+ timestamp: string;
1243
+ type: string | null;
1244
+ };
1245
+ Insert: {
1246
+ action?: string | null;
1247
+ chat_id?: string | null;
1248
+ log_id?: string;
1249
+ new_record?: Json | null;
1250
+ old_record?: Json | null;
1251
+ org_id?: string | null;
1252
+ performed_by?: string | null;
1253
+ timestamp?: string;
1254
+ type?: string | null;
1255
+ };
1256
+ Update: {
1257
+ action?: string | null;
1258
+ chat_id?: string | null;
1259
+ log_id?: string;
1260
+ new_record?: Json | null;
1261
+ old_record?: Json | null;
1262
+ org_id?: string | null;
1263
+ performed_by?: string | null;
1264
+ timestamp?: string;
1265
+ type?: string | null;
1266
+ };
1267
+ Relationships: [];
1268
+ };
1166
1269
  tbl_chat_logs: {
1167
1270
  Row: {
1168
1271
  action: string | null;
@@ -1803,6 +1906,7 @@ export type Database = {
1803
1906
  is_read_only: boolean | null;
1804
1907
  latest_mention_at: string | null;
1805
1908
  latest_message: Json | null;
1909
+ latest_message_timestamp: string | null;
1806
1910
  member_count: number | null;
1807
1911
  member_unread_count: Json | null;
1808
1912
  mute_expiration: number | null;
@@ -1834,6 +1938,7 @@ export type Database = {
1834
1938
  is_read_only?: boolean | null;
1835
1939
  latest_mention_at?: string | null;
1836
1940
  latest_message?: Json | null;
1941
+ latest_message_timestamp?: string | null;
1837
1942
  member_count?: number | null;
1838
1943
  member_unread_count?: Json | null;
1839
1944
  mute_expiration?: number | null;
@@ -1865,6 +1970,7 @@ export type Database = {
1865
1970
  is_read_only?: boolean | null;
1866
1971
  latest_mention_at?: string | null;
1867
1972
  latest_message?: Json | null;
1973
+ latest_message_timestamp?: string | null;
1868
1974
  member_count?: number | null;
1869
1975
  member_unread_count?: Json | null;
1870
1976
  mute_expiration?: number | null;
@@ -2241,56 +2347,6 @@ export type Database = {
2241
2347
  }
2242
2348
  ];
2243
2349
  };
2244
- tbl_api_tokens: {
2245
- Row: {
2246
- exp: string;
2247
- iat: string;
2248
- id: string;
2249
- is_revealed: boolean;
2250
- name: string;
2251
- org_id: string;
2252
- role: string;
2253
- token: string;
2254
- token_hash: string;
2255
- token_metadata: Json;
2256
- type: Database["public"]["Enums"]["enum_integration_type"];
2257
- };
2258
- Insert: {
2259
- exp: string;
2260
- iat: string;
2261
- id: string;
2262
- is_revealed?: boolean;
2263
- name: string;
2264
- org_id: string;
2265
- role: string;
2266
- token: string;
2267
- token_hash: string;
2268
- token_metadata?: Json;
2269
- type: Database["public"]["Enums"]["enum_integration_type"];
2270
- };
2271
- Update: {
2272
- exp?: string;
2273
- iat?: string;
2274
- id?: string;
2275
- is_revealed?: boolean;
2276
- name?: string;
2277
- org_id?: string;
2278
- role?: string;
2279
- token?: string;
2280
- token_hash?: string;
2281
- token_metadata?: Json;
2282
- type?: Database["public"]["Enums"]["enum_integration_type"];
2283
- };
2284
- Relationships: [
2285
- {
2286
- foreignKeyName: "tbl_api_tokens_org_id_fkey";
2287
- columns: ["org_id"];
2288
- isOneToOne: false;
2289
- referencedRelation: "tbl_org";
2290
- referencedColumns: ["org_id"];
2291
- }
2292
- ];
2293
- };
2294
2350
  tbl_integration_tokens: {
2295
2351
  Row: {
2296
2352
  exp: string;
@@ -2370,51 +2426,6 @@ export type Database = {
2370
2426
  };
2371
2427
  Relationships: [];
2372
2428
  };
2373
- tbl_mcp_tokens: {
2374
- Row: {
2375
- access_token_expires_at: string;
2376
- access_token_hash: string;
2377
- client_id: string;
2378
- client_name: string | null;
2379
- created_at: string;
2380
- id: string;
2381
- integration_token_id: string;
2382
- org_id: string;
2383
- phone_scopes: string[] | null;
2384
- refresh_token_expires_at: string;
2385
- refresh_token_hash: string;
2386
- revoked_at: string | null;
2387
- };
2388
- Insert: {
2389
- access_token_expires_at: string;
2390
- access_token_hash: string;
2391
- client_id: string;
2392
- client_name?: string | null;
2393
- created_at?: string;
2394
- id?: string;
2395
- integration_token_id: string;
2396
- org_id: string;
2397
- phone_scopes?: string[] | null;
2398
- refresh_token_expires_at: string;
2399
- refresh_token_hash: string;
2400
- revoked_at?: string | null;
2401
- };
2402
- Update: {
2403
- access_token_expires_at?: string;
2404
- access_token_hash?: string;
2405
- client_id?: string;
2406
- client_name?: string | null;
2407
- created_at?: string;
2408
- id?: string;
2409
- integration_token_id?: string;
2410
- org_id?: string;
2411
- phone_scopes?: string[] | null;
2412
- refresh_token_expires_at?: string;
2413
- refresh_token_hash?: string;
2414
- revoked_at?: string | null;
2415
- };
2416
- Relationships: [];
2417
- };
2418
2429
  tbl_org: {
2419
2430
  Row: {
2420
2431
  ai_settings: Json | null;
@@ -2617,6 +2628,8 @@ export type Database = {
2617
2628
  library: string | null;
2618
2629
  org_id: string;
2619
2630
  org_phone: string | null;
2631
+ passkey_code: string | null;
2632
+ passkey_request: Json | null;
2620
2633
  phone_id: string;
2621
2634
  phone_image: string | null;
2622
2635
  phone_name: string | null;
@@ -2642,6 +2655,8 @@ export type Database = {
2642
2655
  library?: string | null;
2643
2656
  org_id: string;
2644
2657
  org_phone?: string | null;
2658
+ passkey_code?: string | null;
2659
+ passkey_request?: Json | null;
2645
2660
  phone_id?: string;
2646
2661
  phone_image?: string | null;
2647
2662
  phone_name?: string | null;
@@ -2667,6 +2682,8 @@ export type Database = {
2667
2682
  library?: string | null;
2668
2683
  org_id?: string;
2669
2684
  org_phone?: string | null;
2685
+ passkey_code?: string | null;
2686
+ passkey_request?: Json | null;
2670
2687
  phone_id?: string;
2671
2688
  phone_image?: string | null;
2672
2689
  phone_name?: string | null;
@@ -2985,7 +3002,6 @@ export type Database = {
2985
3002
  chat_ids: string[];
2986
3003
  created_at: string;
2987
3004
  delay: number | null;
2988
- scheduled_id: string;
2989
3005
  is_active: boolean;
2990
3006
  message_payload: Json;
2991
3007
  next_occurrence_at: string;
@@ -2994,6 +3010,7 @@ export type Database = {
2994
3010
  org_phones: string[] | null;
2995
3011
  performed_by: string | null;
2996
3012
  repeat_config: Json;
3013
+ scheduled_id: string;
2997
3014
  updated_at: string;
2998
3015
  variables: Json | null;
2999
3016
  };
@@ -3001,7 +3018,6 @@ export type Database = {
3001
3018
  chat_ids: string[];
3002
3019
  created_at?: string;
3003
3020
  delay?: number | null;
3004
- scheduled_id?: string;
3005
3021
  is_active?: boolean;
3006
3022
  message_payload: Json;
3007
3023
  next_occurrence_at: string;
@@ -3010,6 +3026,7 @@ export type Database = {
3010
3026
  org_phones?: string[] | null;
3011
3027
  performed_by?: string | null;
3012
3028
  repeat_config: Json;
3029
+ scheduled_id?: string;
3013
3030
  updated_at?: string;
3014
3031
  variables?: Json | null;
3015
3032
  };
@@ -3017,7 +3034,6 @@ export type Database = {
3017
3034
  chat_ids?: string[];
3018
3035
  created_at?: string;
3019
3036
  delay?: number | null;
3020
- scheduled_id?: string;
3021
3037
  is_active?: boolean;
3022
3038
  message_payload?: Json;
3023
3039
  next_occurrence_at?: string;
@@ -3026,6 +3042,7 @@ export type Database = {
3026
3042
  org_phones?: string[] | null;
3027
3043
  performed_by?: string | null;
3028
3044
  repeat_config?: Json;
3045
+ scheduled_id?: string;
3029
3046
  updated_at?: string;
3030
3047
  variables?: Json | null;
3031
3048
  };
@@ -3036,6 +3053,20 @@ export type Database = {
3036
3053
  isOneToOne: false;
3037
3054
  referencedRelation: "tbl_org";
3038
3055
  referencedColumns: ["org_id"];
3056
+ },
3057
+ {
3058
+ foreignKeyName: "tbl_recurring_broadcasts_org_id_fkey";
3059
+ columns: ["org_id"];
3060
+ isOneToOne: false;
3061
+ referencedRelation: "view_org";
3062
+ referencedColumns: ["org_id"];
3063
+ },
3064
+ {
3065
+ foreignKeyName: "tbl_recurring_broadcasts_org_id_fkey";
3066
+ columns: ["org_id"];
3067
+ isOneToOne: false;
3068
+ referencedRelation: "view_org_all";
3069
+ referencedColumns: ["org_id"];
3039
3070
  }
3040
3071
  ];
3041
3072
  };
@@ -3391,6 +3422,39 @@ export type Database = {
3391
3422
  }
3392
3423
  ];
3393
3424
  };
3425
+ tbl_usage_records: {
3426
+ Row: {
3427
+ amount: number;
3428
+ created_at: string;
3429
+ id: string;
3430
+ metadata: Json | null;
3431
+ org_id: string;
3432
+ source: string;
3433
+ transaction_type: Database["public"]["Enums"]["enum_credit_transaction_type"];
3434
+ unit_type: string;
3435
+ };
3436
+ Insert: {
3437
+ amount?: number;
3438
+ created_at?: string;
3439
+ id?: string;
3440
+ metadata?: Json | null;
3441
+ org_id: string;
3442
+ source: string;
3443
+ transaction_type?: Database["public"]["Enums"]["enum_credit_transaction_type"];
3444
+ unit_type?: string;
3445
+ };
3446
+ Update: {
3447
+ amount?: number;
3448
+ created_at?: string;
3449
+ id?: string;
3450
+ metadata?: Json | null;
3451
+ org_id?: string;
3452
+ source?: string;
3453
+ transaction_type?: Database["public"]["Enums"]["enum_credit_transaction_type"];
3454
+ unit_type?: string;
3455
+ };
3456
+ Relationships: [];
3457
+ };
3394
3458
  };
3395
3459
  Views: {
3396
3460
  view_broadcast_logs: {
@@ -3399,8 +3463,12 @@ export type Database = {
3399
3463
  broadcast_status: Database["public"]["Enums"]["enum_broadcast_status"] | null;
3400
3464
  created_at: string | null;
3401
3465
  delivered_percentage: number | null;
3466
+ due_at: string | null;
3402
3467
  failed_chats: number | null;
3468
+ is_active: boolean | null;
3403
3469
  message_payload: Json | null;
3470
+ next_occurrence_at: string | null;
3471
+ occurrence_count: number | null;
3404
3472
  org_id: string | null;
3405
3473
  parent_broadcast_id: string | null;
3406
3474
  pending_chats: number | null;
@@ -3408,18 +3476,14 @@ export type Database = {
3408
3476
  performed_by: string | null;
3409
3477
  previous_retries: Json | null;
3410
3478
  read_percentage: number | null;
3479
+ repeat_config: Json | null;
3411
3480
  retry_count: number | null;
3412
3481
  scheduled_at: string | null;
3413
3482
  sent_chats: number | null;
3414
- is_active: boolean | null;
3415
- next_occurrence_at: string | null;
3416
- occurrence_count: number | null;
3417
- repeat_config: Json | null;
3418
3483
  total_chats: number | null;
3419
3484
  total_delivered_count: number | null;
3420
3485
  total_member_count: number | null;
3421
3486
  total_read_count: number | null;
3422
- due_at: string | null;
3423
3487
  };
3424
3488
  Relationships: [
3425
3489
  {
@@ -3509,9 +3573,11 @@ export type Database = {
3509
3573
  is_archived: boolean | null;
3510
3574
  is_exited: boolean | null;
3511
3575
  is_muted: boolean | null;
3576
+ join_approval_mode: boolean | null;
3512
3577
  label_ids: Json | null;
3513
3578
  latest_mention_at: string | null;
3514
3579
  latest_message: Json | null;
3580
+ latest_message_timestamp: string | null;
3515
3581
  member_closed_at: Json | null;
3516
3582
  member_count: number | null;
3517
3583
  member_unread_count: Json | null;
@@ -3795,12 +3861,6 @@ export type Database = {
3795
3861
  };
3796
3862
  Returns: Json[];
3797
3863
  };
3798
- get_mcp_connections: {
3799
- Args: {
3800
- org_id_input: string;
3801
- };
3802
- Returns: Json;
3803
- };
3804
3864
  get_chat_properties_by_chat_ids: {
3805
3865
  Args: {
3806
3866
  chat_id_input?: string[];
@@ -3868,12 +3928,23 @@ export type Database = {
3868
3928
  get_counts: {
3869
3929
  Args: {
3870
3930
  org_id_input: string;
3871
- sync_wa_unread_count?: boolean;
3872
3931
  org_phone_input?: string[];
3932
+ sync_wa_unread_count?: boolean;
3873
3933
  };
3874
3934
  Returns: Json;
3875
3935
  };
3876
3936
  get_export_chats_data: {
3937
+ Args: {
3938
+ chat_id_input?: string[];
3939
+ chat_type_input?: string;
3940
+ end_date_input?: string;
3941
+ limit_input?: number;
3942
+ offset_input?: number;
3943
+ org_id_input: string;
3944
+ start_date_input?: string;
3945
+ };
3946
+ Returns: Json;
3947
+ } | {
3877
3948
  Args: {
3878
3949
  chat_id_input?: string[];
3879
3950
  chat_type_input?: string;
@@ -3923,38 +3994,44 @@ export type Database = {
3923
3994
  };
3924
3995
  Returns: Json;
3925
3996
  };
3926
- get_message_rule_info: {
3997
+ get_integration_data: {
3927
3998
  Args: {
3928
- chat_id_input: string;
3929
- message_id_input: string;
3930
- org_id_input: string;
3931
- org_phone_input: string;
3932
- sender_id_input: string;
3999
+ org_id_input?: string;
3933
4000
  };
3934
4001
  Returns: Json;
3935
4002
  };
3936
- get_integration_data: {
4003
+ get_mcp_connections: {
3937
4004
  Args: {
3938
- org_id_input?: string;
4005
+ org_id_input: string;
3939
4006
  };
3940
4007
  Returns: Json;
3941
4008
  };
3942
4009
  get_media_library: {
3943
4010
  Args: {
3944
- org_id_input: string;
3945
- type_input: string;
3946
- search_query?: string;
3947
4011
  limit_input?: number;
3948
4012
  offset_input?: number;
4013
+ org_id_input: string;
4014
+ search_query?: string;
4015
+ type_input: string;
3949
4016
  };
3950
4017
  Returns: {
4018
+ created_at: string;
3951
4019
  id: string;
4020
+ metadata: Json;
3952
4021
  name: string;
3953
- created_at: string;
3954
4022
  updated_at: string;
3955
- metadata: Json;
3956
4023
  }[];
3957
4024
  };
4025
+ get_message_rule_info: {
4026
+ Args: {
4027
+ chat_id_input: string;
4028
+ message_id_input: string;
4029
+ org_id_input: string;
4030
+ org_phone_input: string;
4031
+ sender_id_input: string;
4032
+ };
4033
+ Returns: Json;
4034
+ };
3958
4035
  get_message_workflow_info: {
3959
4036
  Args: {
3960
4037
  chat_id_input: string;
@@ -4179,6 +4256,7 @@ export type Database = {
4179
4256
  is_read_only: boolean | null;
4180
4257
  latest_mention_at: string | null;
4181
4258
  latest_message: Json | null;
4259
+ latest_message_timestamp: string | null;
4182
4260
  member_count: number | null;
4183
4261
  member_unread_count: Json | null;
4184
4262
  mute_expiration: number | null;