@periskope/types 0.6.181 → 0.6.183

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.
@@ -755,6 +755,8 @@ exports.ActionNameMap = {
755
755
  'message.updated',
756
756
  'reaction.added',
757
757
  'message.flagged',
758
+ 'ticket.created',
759
+ 'ticket.updated',
758
760
  ],
759
761
  },
760
762
  delete_message: {
@@ -766,6 +768,8 @@ exports.ActionNameMap = {
766
768
  'message.updated',
767
769
  'reaction.added',
768
770
  'message.flagged',
771
+ 'ticket.created',
772
+ 'ticket.updated',
769
773
  ],
770
774
  },
771
775
  notify_http: {
@@ -779,7 +783,7 @@ exports.ActionNameMap = {
779
783
  placeholder: 'Enter URL',
780
784
  value: null,
781
785
  required: true,
782
- description: 'Enter the Webhook URL here. The endpoint added here should be a **POST HTTP / Endpoint** with no open auth.'
786
+ description: 'Enter the Webhook URL here. The endpoint added here should be a **POST HTTP / Endpoint** with no open auth.',
783
787
  },
784
788
  },
785
789
  validTriggers: [
@@ -883,6 +887,8 @@ exports.ActionNameMap = {
883
887
  'message.updated',
884
888
  'reaction.added',
885
889
  'message.flagged',
890
+ 'ticket.created',
891
+ 'ticket.updated'
886
892
  ],
887
893
  },
888
894
  assign_ticket: {
@@ -2,31 +2,6 @@ export type Json = {
2
2
  [key: string]: any;
3
3
  } | any;
4
4
  export type Database = {
5
- graphql_public: {
6
- Tables: {
7
- [_ in never]: never;
8
- };
9
- Views: {
10
- [_ in never]: never;
11
- };
12
- Functions: {
13
- graphql: {
14
- Args: {
15
- operationName?: string;
16
- query?: string;
17
- variables?: Json;
18
- extensions?: Json;
19
- };
20
- Returns: Json;
21
- };
22
- };
23
- Enums: {
24
- [_ in never]: never;
25
- };
26
- CompositeTypes: {
27
- [_ in never]: never;
28
- };
29
- };
30
5
  internal: {
31
6
  Tables: {
32
7
  config: {
@@ -704,6 +679,72 @@ export type Database = {
704
679
  };
705
680
  Relationships: [];
706
681
  };
682
+ tbl_chat_notes: {
683
+ Row: {
684
+ ack: string | null;
685
+ body: string | null;
686
+ chat_id: string | null;
687
+ from_me: boolean | null;
688
+ is_private_note: boolean;
689
+ media: Json | null;
690
+ mentioned_ids: string[] | null;
691
+ message_id: string;
692
+ message_type: string | null;
693
+ org_id: string;
694
+ org_phone: string;
695
+ performed_by: string | null;
696
+ prev_body: string | null;
697
+ quoted_message_id: string | null;
698
+ sender_phone: string | null;
699
+ sent_message_id: string | null;
700
+ timestamp: string | null;
701
+ unique_id: string | null;
702
+ updated_at: string | null;
703
+ };
704
+ Insert: {
705
+ ack?: string | null;
706
+ body?: string | null;
707
+ chat_id?: string | null;
708
+ from_me?: boolean | null;
709
+ is_private_note?: boolean;
710
+ media?: Json | null;
711
+ mentioned_ids?: string[] | null;
712
+ message_id: string;
713
+ message_type?: string | null;
714
+ org_id: string;
715
+ org_phone: string;
716
+ performed_by?: string | null;
717
+ prev_body?: string | null;
718
+ quoted_message_id?: string | null;
719
+ sender_phone?: string | null;
720
+ sent_message_id?: string | null;
721
+ timestamp?: string | null;
722
+ unique_id?: string | null;
723
+ updated_at?: string | null;
724
+ };
725
+ Update: {
726
+ ack?: string | null;
727
+ body?: string | null;
728
+ chat_id?: string | null;
729
+ from_me?: boolean | null;
730
+ is_private_note?: boolean;
731
+ media?: Json | null;
732
+ mentioned_ids?: string[] | null;
733
+ message_id?: string;
734
+ message_type?: string | null;
735
+ org_id?: string;
736
+ org_phone?: string;
737
+ performed_by?: string | null;
738
+ prev_body?: string | null;
739
+ quoted_message_id?: string | null;
740
+ sender_phone?: string | null;
741
+ sent_message_id?: string | null;
742
+ timestamp?: string | null;
743
+ unique_id?: string | null;
744
+ updated_at?: string | null;
745
+ };
746
+ Relationships: [];
747
+ };
707
748
  tbl_chat_notifications: {
708
749
  Row: {
709
750
  author: string | null;
@@ -1510,13 +1551,6 @@ export type Database = {
1510
1551
  user_id?: string | null;
1511
1552
  };
1512
1553
  Relationships: [
1513
- {
1514
- foreignKeyName: "tbl_org_members_fkey_auth_users";
1515
- columns: ["user_id"];
1516
- isOneToOne: false;
1517
- referencedRelation: "users";
1518
- referencedColumns: ["id"];
1519
- },
1520
1554
  {
1521
1555
  foreignKeyName: "tbl_org_members_fkey_tbl_org";
1522
1556
  columns: ["org_id"];
@@ -1634,6 +1668,81 @@ export type Database = {
1634
1668
  }
1635
1669
  ];
1636
1670
  };
1671
+ tbl_org_tasks: {
1672
+ Row: {
1673
+ assignee: string | null;
1674
+ associated_object_metadata: Json | null;
1675
+ completed_metadata: Json | null;
1676
+ created_at: string;
1677
+ created_by: string;
1678
+ due_date: string | null;
1679
+ last_updated_at: string;
1680
+ last_updated_by: string;
1681
+ notes: string | null;
1682
+ org_id: string;
1683
+ priority: number;
1684
+ remind_at: string | null;
1685
+ reminder_setting: Json | null;
1686
+ status: string;
1687
+ task_id: string;
1688
+ title: string;
1689
+ type: string;
1690
+ };
1691
+ Insert: {
1692
+ assignee?: string | null;
1693
+ associated_object_metadata?: Json | null;
1694
+ completed_metadata?: Json | null;
1695
+ created_at?: string;
1696
+ created_by?: string;
1697
+ due_date?: string | null;
1698
+ last_updated_at?: string;
1699
+ last_updated_by: string;
1700
+ notes?: string | null;
1701
+ org_id: string;
1702
+ priority?: number;
1703
+ remind_at?: string | null;
1704
+ reminder_setting?: Json | null;
1705
+ status?: string;
1706
+ task_id?: string;
1707
+ title: string;
1708
+ type: string;
1709
+ };
1710
+ Update: {
1711
+ assignee?: string | null;
1712
+ associated_object_metadata?: Json | null;
1713
+ completed_metadata?: Json | null;
1714
+ created_at?: string;
1715
+ created_by?: string;
1716
+ due_date?: string | null;
1717
+ last_updated_at?: string;
1718
+ last_updated_by?: string;
1719
+ notes?: string | null;
1720
+ org_id?: string;
1721
+ priority?: number;
1722
+ remind_at?: string | null;
1723
+ reminder_setting?: Json | null;
1724
+ status?: string;
1725
+ task_id?: string;
1726
+ title?: string;
1727
+ type?: string;
1728
+ };
1729
+ Relationships: [
1730
+ {
1731
+ foreignKeyName: "tbl_org_task_org_id_fkey";
1732
+ columns: ["org_id"];
1733
+ isOneToOne: false;
1734
+ referencedRelation: "tbl_org";
1735
+ referencedColumns: ["org_id"];
1736
+ },
1737
+ {
1738
+ foreignKeyName: "tbl_org_task_org_id_fkey";
1739
+ columns: ["org_id"];
1740
+ isOneToOne: false;
1741
+ referencedRelation: "view_org";
1742
+ referencedColumns: ["org_id"];
1743
+ }
1744
+ ];
1745
+ };
1637
1746
  tbl_org_transactions: {
1638
1747
  Row: {
1639
1748
  amount: number;
@@ -1871,20 +1980,6 @@ export type Database = {
1871
1980
  sent_message_id?: string | null;
1872
1981
  };
1873
1982
  Relationships: [
1874
- {
1875
- foreignKeyName: "tbl_scheduled_logs_scheduled_id_fkey";
1876
- columns: ["scheduled_id"];
1877
- isOneToOne: false;
1878
- referencedRelation: "tbl_recurring_messages";
1879
- referencedColumns: ["scheduled_id"];
1880
- },
1881
- {
1882
- foreignKeyName: "tbl_scheduled_logs_scheduled_id_fkey";
1883
- columns: ["scheduled_id"];
1884
- isOneToOne: false;
1885
- referencedRelation: "view_scheduled_logs";
1886
- referencedColumns: ["scheduled_id"];
1887
- },
1888
1983
  {
1889
1984
  foreignKeyName: "tbl_scheduled_message_logs_org_id_fkey";
1890
1985
  columns: ["org_id"];
@@ -1964,30 +2059,6 @@ export type Database = {
1964
2059
  }
1965
2060
  ];
1966
2061
  };
1967
- tbl_tools_whatsapp_links: {
1968
- Row: {
1969
- created_at: string;
1970
- link_id: string;
1971
- link_name: string;
1972
- message: string | null;
1973
- phone: string;
1974
- };
1975
- Insert: {
1976
- created_at?: string;
1977
- link_id?: string;
1978
- link_name: string;
1979
- message?: string | null;
1980
- phone: string;
1981
- };
1982
- Update: {
1983
- created_at?: string;
1984
- link_id?: string;
1985
- link_name?: string;
1986
- message?: string | null;
1987
- phone?: string;
1988
- };
1989
- Relationships: [];
1990
- };
1991
2062
  };
1992
2063
  Views: {
1993
2064
  view_broadcast_logs: {
@@ -2203,12 +2274,6 @@ export type Database = {
2203
2274
  };
2204
2275
  Returns: boolean;
2205
2276
  };
2206
- create_partition: {
2207
- Args: {
2208
- org_id_input: string;
2209
- };
2210
- Returns: boolean;
2211
- };
2212
2277
  custom_access_token_hook: {
2213
2278
  Args: {
2214
2279
  event: Json;
@@ -2249,6 +2314,7 @@ export type Database = {
2249
2314
  name_input?: string;
2250
2315
  type_input?: Database["public"]["Enums"]["enum_integration_type"];
2251
2316
  org_id_input?: string;
2317
+ metadata_input?: Json;
2252
2318
  };
2253
2319
  Returns: Json;
2254
2320
  };
@@ -2312,6 +2378,9 @@ export type Database = {
2312
2378
  Args: {
2313
2379
  org_id_input: string;
2314
2380
  chat_id_input?: string[];
2381
+ chat_type_input?: string;
2382
+ start_date_input?: string;
2383
+ end_date_input?: string;
2315
2384
  };
2316
2385
  Returns: Json;
2317
2386
  };
@@ -2319,6 +2388,10 @@ export type Database = {
2319
2388
  Args: {
2320
2389
  org_id_input: string;
2321
2390
  ticket_id_input?: string[];
2391
+ start_date_input?: string;
2392
+ end_date_input?: string;
2393
+ status_input?: Database["public"]["Enums"]["enum_chat_tickets_status"];
2394
+ priority_input?: number;
2322
2395
  };
2323
2396
  Returns: Json;
2324
2397
  };
@@ -2421,14 +2494,6 @@ export type Database = {
2421
2494
  result: Json;
2422
2495
  }[];
2423
2496
  };
2424
- image_path: {
2425
- Args: {
2426
- path_input?: string;
2427
- bucket_name?: string;
2428
- req_base?: boolean;
2429
- };
2430
- Returns: string;
2431
- };
2432
2497
  list_org_from_user: {
2433
2498
  Args: Record<PropertyKey, never>;
2434
2499
  Returns: string[];
@@ -2437,6 +2502,10 @@ export type Database = {
2437
2502
  Args: Record<PropertyKey, never>;
2438
2503
  Returns: Database["public"]["Enums"]["enum_member_role"];
2439
2504
  };
2505
+ notify_org_tasks: {
2506
+ Args: Record<PropertyKey, never>;
2507
+ Returns: string;
2508
+ };
2440
2509
  update_chat_properties: {
2441
2510
  Args: {
2442
2511
  column_name: string;
@@ -2553,6 +2622,7 @@ export type Database = {
2553
2622
  owner_id: string | null;
2554
2623
  path_tokens: string[] | null;
2555
2624
  updated_at: string | null;
2625
+ user_metadata: Json | null;
2556
2626
  version: string | null;
2557
2627
  };
2558
2628
  Insert: {
@@ -2566,6 +2636,7 @@ export type Database = {
2566
2636
  owner_id?: string | null;
2567
2637
  path_tokens?: string[] | null;
2568
2638
  updated_at?: string | null;
2639
+ user_metadata?: Json | null;
2569
2640
  version?: string | null;
2570
2641
  };
2571
2642
  Update: {
@@ -2579,6 +2650,7 @@ export type Database = {
2579
2650
  owner_id?: string | null;
2580
2651
  path_tokens?: string[] | null;
2581
2652
  updated_at?: string | null;
2653
+ user_metadata?: Json | null;
2582
2654
  version?: string | null;
2583
2655
  };
2584
2656
  Relationships: [
@@ -2600,6 +2672,7 @@ export type Database = {
2600
2672
  key: string;
2601
2673
  owner_id: string | null;
2602
2674
  upload_signature: string;
2675
+ user_metadata: Json | null;
2603
2676
  version: string;
2604
2677
  };
2605
2678
  Insert: {
@@ -2610,6 +2683,7 @@ export type Database = {
2610
2683
  key: string;
2611
2684
  owner_id?: string | null;
2612
2685
  upload_signature: string;
2686
+ user_metadata?: Json | null;
2613
2687
  version: string;
2614
2688
  };
2615
2689
  Update: {
@@ -2620,6 +2694,7 @@ export type Database = {
2620
2694
  key?: string;
2621
2695
  owner_id?: string | null;
2622
2696
  upload_signature?: string;
2697
+ user_metadata?: Json | null;
2623
2698
  version?: string;
2624
2699
  };
2625
2700
  Relationships: [
@@ -2756,6 +2831,10 @@ export type Database = {
2756
2831
  updated_at: string;
2757
2832
  }[];
2758
2833
  };
2834
+ operation: {
2835
+ Args: Record<PropertyKey, never>;
2836
+ Returns: string;
2837
+ };
2759
2838
  search: {
2760
2839
  Args: {
2761
2840
  prefix: string;
@@ -2826,4 +2905,11 @@ export type Enums<PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] |
2826
2905
  } ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"] : never = never> = PublicEnumNameOrOptions extends {
2827
2906
  schema: keyof Database;
2828
2907
  } ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] ? PublicSchema["Enums"][PublicEnumNameOrOptions] : never;
2908
+ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"] | {
2909
+ schema: keyof Database;
2910
+ }, CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
2911
+ schema: keyof Database;
2912
+ } ? keyof Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] : never = never> = PublicCompositeTypeNameOrOptions extends {
2913
+ schema: keyof Database;
2914
+ } ? Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"] ? PublicSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never;
2829
2915
  export {};
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { default as _Stripe } from 'stripe';
2
2
  import { Merge, OverrideProperties } from 'type-fest';
3
3
  import { Filter, Rule } from './rules.types';
4
- import { Tables, TablesUpdate } from './supabase.types';
4
+ import { Tables, TablesInsert, TablesUpdate } from './supabase.types';
5
5
  export declare enum AllPlans {
6
6
  FREE_TRIAL = "free-trial",
7
7
  ENTERPRISE = "enterprise",
@@ -21,6 +21,8 @@ export type OrgPlanEnterprise = {
21
21
  phone_limit: number;
22
22
  current_period_start: number;
23
23
  current_period_end: number | null;
24
+ additional_user_limit?: number;
25
+ additional_phone_limit?: number;
24
26
  };
25
27
  export type OrgPlanNonEnterprise = {
26
28
  subscription_id: string;
@@ -31,6 +33,8 @@ export type OrgPlanNonEnterprise = {
31
33
  phone_limit: number;
32
34
  current_period_end: number;
33
35
  current_period_start: number;
36
+ additional_user_limit?: number;
37
+ additional_phone_limit?: number;
34
38
  };
35
39
  export type OrgPlan<T extends AllPlans | Enterprise> = T extends Enterprise ? OrgPlanEnterprise : T extends AllPlans ? OrgPlanNonEnterprise : never;
36
40
  export type MicrosurveyData = {
@@ -81,6 +85,7 @@ export type OrgMetadata = {
81
85
  };
82
86
  };
83
87
  attribution?: Object;
88
+ affiliate_id?: string;
84
89
  custom_properties?: {
85
90
  chats_order?: {
86
91
  [id: string]: number;
@@ -175,14 +180,14 @@ export type MediaType = {
175
180
  filedata?: string;
176
181
  compress?: boolean;
177
182
  };
178
- export type MessageType = Merge<OverrideProperties<Tables<'tbl_chat_messages'>, {
183
+ export type MessageType = Merge<OverrideProperties<TablesInsert<'tbl_chat_messages'>, {
179
184
  message_id: string;
180
185
  org_id: string;
181
186
  org_phone: string;
182
187
  chat_id: string;
183
188
  message_type: (typeof SUPPORTED_TYPES)[number];
184
189
  media: MediaType | null;
185
- flag_metadata: MessageFlagType | null;
190
+ flag_metadata?: MessageFlagType | null;
186
191
  poll_info?: PollSendType | null;
187
192
  poll_results?: PollResultType | null;
188
193
  delivery_info?: DeliveryInfoType | null;
@@ -190,6 +195,7 @@ export type MessageType = Merge<OverrideProperties<Tables<'tbl_chat_messages'>,
190
195
  reactions?: ReactionType[];
191
196
  message_payload?: SingleMessagePayload;
192
197
  highlight?: number;
198
+ is_private_note?: boolean;
193
199
  }>;
194
200
  export type MessageFlagType = {
195
201
  status: boolean;
@@ -577,4 +583,39 @@ export type RuleLogsType = OverrideProperties<Tables<'tbl_rules_logs'>, {
577
583
  checked_at: string | null;
578
584
  };
579
585
  }>;
586
+ /************************** TASKS ***************************/
587
+ export type TaskType = OverrideProperties<Tables<'tbl_org_tasks'>, {
588
+ reminder_setting: {
589
+ remind_in: `${number} ${'minutes' | 'hours' | 'days'} ${'before' | 'after'}` | string | null;
590
+ repeat?: {
591
+ frequency: number;
592
+ interval: 'days' | 'weeks' | 'months' | 'years';
593
+ end: 'never' | 'after' | 'on';
594
+ on?: string;
595
+ };
596
+ } | null;
597
+ associated_object_metadata: {
598
+ type: 'chat';
599
+ index: 'chat_id';
600
+ id: string;
601
+ object: ChatType;
602
+ } | {
603
+ type: 'message';
604
+ index: 'message_id';
605
+ id: string;
606
+ object: MessageType;
607
+ } | {
608
+ type: 'ticket';
609
+ index: 'ticket_id';
610
+ id: string;
611
+ object: TicketType;
612
+ } | null;
613
+ status: 'open' | 'inprogress' | 'closed';
614
+ priority: 1 | 2 | 3;
615
+ completed_metadata?: {
616
+ completed_at: string;
617
+ completed_by: string;
618
+ } | null;
619
+ type: 'todo' | 'chat' | 'message' | 'ticket';
620
+ }>;
580
621
  export {};