@periskope/types 0.6.180 → 0.6.182

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.
@@ -294,6 +294,7 @@ export declare const ActionNameMap: Record<Action['type'], {
294
294
  placeholder: string;
295
295
  info?: string;
296
296
  required: boolean;
297
+ description?: string;
297
298
  }>;
298
299
  validTriggers: Rule['trigger'][];
299
300
  }>;
@@ -779,6 +779,7 @@ exports.ActionNameMap = {
779
779
  placeholder: 'Enter URL',
780
780
  value: null,
781
781
  required: true,
782
+ description: 'Enter the Webhook URL here. The endpoint added here should be a **POST HTTP / Endpoint** with no open auth.'
782
783
  },
783
784
  },
784
785
  validTriggers: [
@@ -812,7 +813,7 @@ exports.ActionNameMap = {
812
813
  id: 'priority',
813
814
  type: 'dropdown',
814
815
  value: [
815
- { id: '0', value: '0', label: 'No Prioriy' },
816
+ { id: '0', value: '0', label: 'No Priority' },
816
817
  { id: '1', value: '1', label: 'Low' },
817
818
  { id: '2', value: '2', label: 'Medium' },
818
819
  { id: '3', value: '3', label: 'High' },
@@ -1117,6 +1118,7 @@ exports.ActionNameMap = {
1117
1118
  placeholder: 'Enter webhook URL',
1118
1119
  value: null,
1119
1120
  required: true,
1121
+ description: 'Enter the webhook URL to send the notification, to create a slack incoming webhook to start receiving notification check [here](https://api.slack.com/messaging/webhooks)',
1120
1122
  },
1121
1123
  slack_payload: {
1122
1124
  type: 'json_editor',
@@ -1125,6 +1127,7 @@ exports.ActionNameMap = {
1125
1127
  placeholder: 'Enter payload',
1126
1128
  value: null,
1127
1129
  required: true,
1130
+ description: 'You can send slack blocks as notifications to the provided hook URL.\n\nIn order to **build a slack notification block**, you can visit [here](https://api.slack.com/block-kit/building)',
1128
1131
  },
1129
1132
  },
1130
1133
  },
@@ -121,6 +121,30 @@ export type Database = {
121
121
  };
122
122
  Relationships: [];
123
123
  };
124
+ tbl_tools_whatsapp_links: {
125
+ Row: {
126
+ created_at: string;
127
+ link_id: string;
128
+ link_name: string;
129
+ message: string | null;
130
+ phone: string;
131
+ };
132
+ Insert: {
133
+ created_at?: string;
134
+ link_id?: string;
135
+ link_name: string;
136
+ message?: string | null;
137
+ phone: string;
138
+ };
139
+ Update: {
140
+ created_at?: string;
141
+ link_id?: string;
142
+ link_name?: string;
143
+ message?: string | null;
144
+ phone?: string;
145
+ };
146
+ Relationships: [];
147
+ };
124
148
  tbl_trigger_logs: {
125
149
  Row: {
126
150
  created_at: string;
@@ -655,6 +679,72 @@ export type Database = {
655
679
  };
656
680
  Relationships: [];
657
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
+ };
658
748
  tbl_chat_notifications: {
659
749
  Row: {
660
750
  author: string | null;
@@ -1578,6 +1668,81 @@ export type Database = {
1578
1668
  }
1579
1669
  ];
1580
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
+ };
1581
1746
  tbl_org_transactions: {
1582
1747
  Row: {
1583
1748
  amount: number;
@@ -1665,6 +1830,63 @@ export type Database = {
1665
1830
  }
1666
1831
  ];
1667
1832
  };
1833
+ tbl_recurring_messages: {
1834
+ Row: {
1835
+ chat_id: string;
1836
+ created_at: string;
1837
+ is_repeat: boolean | null;
1838
+ message_payload: Json | null;
1839
+ org_id: string;
1840
+ org_phone: string | null;
1841
+ performed_by: string | null;
1842
+ repeat_config: Json | null;
1843
+ scheduled_at: string;
1844
+ scheduled_id: string;
1845
+ updated_at: string | null;
1846
+ };
1847
+ Insert: {
1848
+ chat_id: string;
1849
+ created_at?: string;
1850
+ is_repeat?: boolean | null;
1851
+ message_payload?: Json | null;
1852
+ org_id: string;
1853
+ org_phone?: string | null;
1854
+ performed_by?: string | null;
1855
+ repeat_config?: Json | null;
1856
+ scheduled_at: string;
1857
+ scheduled_id?: string;
1858
+ updated_at?: string | null;
1859
+ };
1860
+ Update: {
1861
+ chat_id?: string;
1862
+ created_at?: string;
1863
+ is_repeat?: boolean | null;
1864
+ message_payload?: Json | null;
1865
+ org_id?: string;
1866
+ org_phone?: string | null;
1867
+ performed_by?: string | null;
1868
+ repeat_config?: Json | null;
1869
+ scheduled_at?: string;
1870
+ scheduled_id?: string;
1871
+ updated_at?: string | null;
1872
+ };
1873
+ Relationships: [
1874
+ {
1875
+ foreignKeyName: "tbl_recurring_messages_org_id_fkey";
1876
+ columns: ["org_id"];
1877
+ isOneToOne: false;
1878
+ referencedRelation: "tbl_org";
1879
+ referencedColumns: ["org_id"];
1880
+ },
1881
+ {
1882
+ foreignKeyName: "tbl_recurring_messages_org_id_fkey";
1883
+ columns: ["org_id"];
1884
+ isOneToOne: false;
1885
+ referencedRelation: "view_org";
1886
+ referencedColumns: ["org_id"];
1887
+ }
1888
+ ];
1889
+ };
1668
1890
  tbl_rules_logs: {
1669
1891
  Row: {
1670
1892
  actions_progress: Json | null;
@@ -1723,15 +1945,82 @@ export type Database = {
1723
1945
  }
1724
1946
  ];
1725
1947
  };
1948
+ tbl_scheduled_logs: {
1949
+ Row: {
1950
+ chat_id: string | null;
1951
+ created_at: string;
1952
+ delivered_at: string | null;
1953
+ id: string;
1954
+ is_success: boolean | null;
1955
+ message_id: string | null;
1956
+ org_id: string | null;
1957
+ scheduled_id: string;
1958
+ sent_message_id: string | null;
1959
+ };
1960
+ Insert: {
1961
+ chat_id?: string | null;
1962
+ created_at?: string;
1963
+ delivered_at?: string | null;
1964
+ id?: string;
1965
+ is_success?: boolean | null;
1966
+ message_id?: string | null;
1967
+ org_id?: string | null;
1968
+ scheduled_id: string;
1969
+ sent_message_id?: string | null;
1970
+ };
1971
+ Update: {
1972
+ chat_id?: string | null;
1973
+ created_at?: string;
1974
+ delivered_at?: string | null;
1975
+ id?: string;
1976
+ is_success?: boolean | null;
1977
+ message_id?: string | null;
1978
+ org_id?: string | null;
1979
+ scheduled_id?: string;
1980
+ sent_message_id?: string | null;
1981
+ };
1982
+ Relationships: [
1983
+ {
1984
+ foreignKeyName: "tbl_scheduled_logs_scheduled_id_fkey";
1985
+ columns: ["scheduled_id"];
1986
+ isOneToOne: false;
1987
+ referencedRelation: "tbl_recurring_messages";
1988
+ referencedColumns: ["scheduled_id"];
1989
+ },
1990
+ {
1991
+ foreignKeyName: "tbl_scheduled_logs_scheduled_id_fkey";
1992
+ columns: ["scheduled_id"];
1993
+ isOneToOne: false;
1994
+ referencedRelation: "view_scheduled_logs";
1995
+ referencedColumns: ["scheduled_id"];
1996
+ },
1997
+ {
1998
+ foreignKeyName: "tbl_scheduled_message_logs_org_id_fkey";
1999
+ columns: ["org_id"];
2000
+ isOneToOne: false;
2001
+ referencedRelation: "tbl_org";
2002
+ referencedColumns: ["org_id"];
2003
+ },
2004
+ {
2005
+ foreignKeyName: "tbl_scheduled_message_logs_org_id_fkey";
2006
+ columns: ["org_id"];
2007
+ isOneToOne: false;
2008
+ referencedRelation: "view_org";
2009
+ referencedColumns: ["org_id"];
2010
+ }
2011
+ ];
2012
+ };
1726
2013
  tbl_scheduled_messages: {
1727
2014
  Row: {
1728
2015
  chat_id: string;
1729
2016
  created_at: string;
2017
+ is_repeat: boolean | null;
1730
2018
  message_id: string | null;
1731
2019
  message_payload: Json | null;
1732
2020
  org_id: string;
1733
2021
  org_phone: string | null;
1734
2022
  performed_by: string | null;
2023
+ repeat_config: Json | null;
1735
2024
  scheduled_at: string;
1736
2025
  sent_message_id: string;
1737
2026
  status: boolean | null;
@@ -1740,11 +2029,13 @@ export type Database = {
1740
2029
  Insert: {
1741
2030
  chat_id: string;
1742
2031
  created_at?: string;
2032
+ is_repeat?: boolean | null;
1743
2033
  message_id?: string | null;
1744
2034
  message_payload?: Json | null;
1745
2035
  org_id: string;
1746
2036
  org_phone?: string | null;
1747
2037
  performed_by?: string | null;
2038
+ repeat_config?: Json | null;
1748
2039
  scheduled_at: string;
1749
2040
  sent_message_id: string;
1750
2041
  status?: boolean | null;
@@ -1753,11 +2044,13 @@ export type Database = {
1753
2044
  Update: {
1754
2045
  chat_id?: string;
1755
2046
  created_at?: string;
2047
+ is_repeat?: boolean | null;
1756
2048
  message_id?: string | null;
1757
2049
  message_payload?: Json | null;
1758
2050
  org_id?: string;
1759
2051
  org_phone?: string | null;
1760
2052
  performed_by?: string | null;
2053
+ repeat_config?: Json | null;
1761
2054
  scheduled_at?: string;
1762
2055
  sent_message_id?: string;
1763
2056
  status?: boolean | null;
@@ -1780,30 +2073,6 @@ export type Database = {
1780
2073
  }
1781
2074
  ];
1782
2075
  };
1783
- tbl_tools_whatsapp_links: {
1784
- Row: {
1785
- created_at: string;
1786
- link_id: string;
1787
- link_name: string;
1788
- message: string | null;
1789
- phone: string;
1790
- };
1791
- Insert: {
1792
- created_at?: string;
1793
- link_id?: string;
1794
- link_name: string;
1795
- message?: string | null;
1796
- phone: string;
1797
- };
1798
- Update: {
1799
- created_at?: string;
1800
- link_id?: string;
1801
- link_name?: string;
1802
- message?: string | null;
1803
- phone?: string;
1804
- };
1805
- Relationships: [];
1806
- };
1807
2076
  };
1808
2077
  Views: {
1809
2078
  view_broadcast_logs: {
@@ -1980,6 +2249,36 @@ export type Database = {
1980
2249
  };
1981
2250
  Relationships: [];
1982
2251
  };
2252
+ view_scheduled_logs: {
2253
+ Row: {
2254
+ chat_id: string | null;
2255
+ failed_count: number | null;
2256
+ is_repeat: boolean | null;
2257
+ message_payload: Json | null;
2258
+ org_id: string | null;
2259
+ performed_by: string | null;
2260
+ scheduled_id: string | null;
2261
+ sent_count: number | null;
2262
+ success_count: number | null;
2263
+ updated_at: string | null;
2264
+ };
2265
+ Relationships: [
2266
+ {
2267
+ foreignKeyName: "tbl_recurring_messages_org_id_fkey";
2268
+ columns: ["org_id"];
2269
+ isOneToOne: false;
2270
+ referencedRelation: "tbl_org";
2271
+ referencedColumns: ["org_id"];
2272
+ },
2273
+ {
2274
+ foreignKeyName: "tbl_recurring_messages_org_id_fkey";
2275
+ columns: ["org_id"];
2276
+ isOneToOne: false;
2277
+ referencedRelation: "view_org";
2278
+ referencedColumns: ["org_id"];
2279
+ }
2280
+ ];
2281
+ };
1983
2282
  };
1984
2283
  Functions: {
1985
2284
  check_feature_flag_access: {
@@ -1989,12 +2288,6 @@ export type Database = {
1989
2288
  };
1990
2289
  Returns: boolean;
1991
2290
  };
1992
- create_partition: {
1993
- Args: {
1994
- org_id_input: string;
1995
- };
1996
- Returns: boolean;
1997
- };
1998
2291
  custom_access_token_hook: {
1999
2292
  Args: {
2000
2293
  event: Json;
@@ -2207,14 +2500,6 @@ export type Database = {
2207
2500
  result: Json;
2208
2501
  }[];
2209
2502
  };
2210
- image_path: {
2211
- Args: {
2212
- path_input?: string;
2213
- bucket_name?: string;
2214
- req_base?: boolean;
2215
- };
2216
- Returns: string;
2217
- };
2218
2503
  list_org_from_user: {
2219
2504
  Args: Record<PropertyKey, never>;
2220
2505
  Returns: string[];
@@ -2223,6 +2508,10 @@ export type Database = {
2223
2508
  Args: Record<PropertyKey, never>;
2224
2509
  Returns: Database["public"]["Enums"]["enum_member_role"];
2225
2510
  };
2511
+ notify_org_tasks: {
2512
+ Args: Record<PropertyKey, never>;
2513
+ Returns: string;
2514
+ };
2226
2515
  update_chat_properties: {
2227
2516
  Args: {
2228
2517
  column_name: string;
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",
@@ -81,6 +81,7 @@ export type OrgMetadata = {
81
81
  };
82
82
  };
83
83
  attribution?: Object;
84
+ affiliate_id?: string;
84
85
  custom_properties?: {
85
86
  chats_order?: {
86
87
  [id: string]: number;
@@ -175,14 +176,14 @@ export type MediaType = {
175
176
  filedata?: string;
176
177
  compress?: boolean;
177
178
  };
178
- export type MessageType = Merge<OverrideProperties<Tables<'tbl_chat_messages'>, {
179
+ export type MessageType = Merge<OverrideProperties<TablesInsert<'tbl_chat_messages'>, {
179
180
  message_id: string;
180
181
  org_id: string;
181
182
  org_phone: string;
182
183
  chat_id: string;
183
184
  message_type: (typeof SUPPORTED_TYPES)[number];
184
185
  media: MediaType | null;
185
- flag_metadata: MessageFlagType | null;
186
+ flag_metadata?: MessageFlagType | null;
186
187
  poll_info?: PollSendType | null;
187
188
  poll_results?: PollResultType | null;
188
189
  delivery_info?: DeliveryInfoType | null;
@@ -190,6 +191,7 @@ export type MessageType = Merge<OverrideProperties<Tables<'tbl_chat_messages'>,
190
191
  reactions?: ReactionType[];
191
192
  message_payload?: SingleMessagePayload;
192
193
  highlight?: number;
194
+ is_private_note?: boolean;
193
195
  }>;
194
196
  export type MessageFlagType = {
195
197
  status: boolean;
@@ -244,6 +246,8 @@ export type PhoneType = OverrideProperties<Tables<'tbl_org_phones'>, {
244
246
  }>;
245
247
  export declare const labelColors: string[];
246
248
  export declare const enumChatColors: readonly ["#B4876E", "#A5B337", "#06CF9C", "#25D366", "#02A698", "#7D9EF1", "#007BFC", "#5E47DE", "#7F66FF", "#9333EA", "#FA6533", "#C4532D", "#DC2626", "#FF2E74", "#DB2777"];
249
+ export type RepeatDaysType = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
250
+ export type RepeatIntervalType = 'day' | 'week' | 'month';
247
251
  export declare const SUPPORTED_TYPES: readonly ["chat", "sticker", "image", "video", "document", "vcard", "multi_vcard", "audio", "ptt", "poll_creation", "location", "ciphertext"];
248
252
  export type SendMessageContent = {
249
253
  message_type?: (typeof SUPPORTED_TYPES)[number];
@@ -266,6 +270,17 @@ export type SendMessageContent = {
266
270
  performed_by?: string;
267
271
  };
268
272
  export type QuickReplyContent = Omit<SendMessageContent, 'broadcast_id' | 'variables'>;
273
+ export type ScheduleMessagePayload = {
274
+ scheduled_id?: string;
275
+ is_repeat?: boolean | null;
276
+ scheduled_at: string;
277
+ repeat_config?: {
278
+ repeat_ends?: string;
279
+ repeat_interval?: RepeatIntervalType;
280
+ repeat_value?: number;
281
+ repeat_days?: RepeatDaysType[];
282
+ };
283
+ };
269
284
  export type BroadcastVariableType = {
270
285
  chat_id: string;
271
286
  values: {
@@ -457,6 +472,7 @@ export type UserPreferences = {
457
472
  archived_chats: string[];
458
473
  closed_chats: Record<string, number>;
459
474
  periskope_chat_limit: number;
475
+ notifications: Record<string, boolean>;
460
476
  };
461
477
  export type PollSendType = {
462
478
  pollName: string;
@@ -563,4 +579,39 @@ export type RuleLogsType = OverrideProperties<Tables<'tbl_rules_logs'>, {
563
579
  checked_at: string | null;
564
580
  };
565
581
  }>;
582
+ /************************** TASKS ***************************/
583
+ export type TaskType = OverrideProperties<Tables<'tbl_org_tasks'>, {
584
+ reminder_setting: {
585
+ remind_in: `${number} ${'minutes' | 'hours' | 'days'} ${'before' | 'after'}` | string | null;
586
+ repeat?: {
587
+ frequency: number;
588
+ interval: 'days' | 'weeks' | 'months' | 'years';
589
+ end: 'never' | 'after' | 'on';
590
+ on?: string;
591
+ };
592
+ } | null;
593
+ associated_object_metadata: {
594
+ type: 'chat';
595
+ index: 'chat_id';
596
+ id: string;
597
+ object: ChatType;
598
+ } | {
599
+ type: 'message';
600
+ index: 'message_id';
601
+ id: string;
602
+ object: MessageType;
603
+ } | {
604
+ type: 'ticket';
605
+ index: 'ticket_id';
606
+ id: string;
607
+ object: TicketType;
608
+ } | null;
609
+ status: 'open' | 'inprogress' | 'closed';
610
+ priority: 0 | 1 | 2 | 3 | 4;
611
+ completed_metadata?: {
612
+ completed_at: string;
613
+ completed_by: string;
614
+ } | null;
615
+ type: 'todo' | 'chat' | 'message' | 'ticket';
616
+ }>;
566
617
  export {};
package/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './rules.types';
2
- export * from './supabase.types';
3
- export * from './types';
1
+ export * from './rules.types';
2
+ export * from './supabase.types';
3
+ export * from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@periskope/types",
3
- "version": "0.6.180",
3
+ "version": "0.6.182",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",