@periskope/types 0.6.178 → 0.6.179

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.
@@ -149,10 +149,11 @@ export type CreateTicketAction = {
149
149
  type: 'create_ticket';
150
150
  delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
151
151
  metadata: {
152
- assignee?: string;
153
152
  priority?: '0' | '1' | '2' | '3' | '4';
154
153
  label?: string;
155
154
  append_to_latest_ticket?: 'true' | 'false';
155
+ round_robin?: 'true' | 'false';
156
+ assignee?: string;
156
157
  };
157
158
  };
158
159
  export type FlagMessageAction = {
@@ -255,7 +256,16 @@ export type DeleteMessageAction = {
255
256
  delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
256
257
  metadata: {};
257
258
  };
258
- export type Action = SendMessageAction | NotifyHttpAction | CreateTicketAction | FlagMessageAction | AssignTicketAction | CloseTicketAction | AddChatLabelAction | AddTicketLabelAction | AssignChatAction | ForwardMessageAction | SendEmailAction | ReplyToMessageAction | UpdateCustomPropertyAction | DeleteMessageAction;
259
+ export type SendSlackNotificationAction = {
260
+ id: string;
261
+ type: 'send_slack_notification';
262
+ delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
263
+ metadata: {
264
+ slack_payload: string;
265
+ webhook_url: string;
266
+ };
267
+ };
268
+ export type Action = SendMessageAction | NotifyHttpAction | CreateTicketAction | FlagMessageAction | AssignTicketAction | CloseTicketAction | AddChatLabelAction | AddTicketLabelAction | AssignChatAction | ForwardMessageAction | SendEmailAction | ReplyToMessageAction | UpdateCustomPropertyAction | DeleteMessageAction | SendSlackNotificationAction;
259
269
  export declare const isSendMessageOrReplyToMessageAction: (action: Action) => action is SendMessageAction | ReplyToMessageAction;
260
270
  export type Rule = OverrideProperties<Tables<'tbl_automation_rules'>, {
261
271
  actions: Action[];
@@ -274,7 +284,7 @@ export declare const ActionNameMap: Record<Action['type'], {
274
284
  description: string;
275
285
  inputs: Record<string, {
276
286
  id: string;
277
- type: 'text' | 'dropdown' | 'editor' | 'date' | 'file' | 'textarea' | 'dynamic';
287
+ type: 'text' | 'dropdown' | 'editor' | 'date' | 'file' | 'textarea' | 'dynamic' | 'json_editor';
278
288
  value: 'ticket.labels' | 'org.members' | 'chat.labels' | 'org.chats' | {
279
289
  id: string;
280
290
  value: string;
@@ -289,7 +299,7 @@ export declare const ActionNameMap: Record<Action['type'], {
289
299
  }>;
290
300
  export declare const editorVariables: Array<{
291
301
  label: string;
292
- value: string;
302
+ value: keyof typeof MessageVariableNameMap | keyof typeof SenderVariableNameMap | keyof typeof ChatVariableNameMap | keyof typeof TicketVariableNameMap | keyof typeof ReactionVariableNameMap;
293
303
  validTriggers: Rule['trigger'][];
294
304
  }>;
295
305
  export declare const variablesExclusionList: Record<Rule['trigger'], Array<keyof AppendTypes<{
@@ -412,7 +412,7 @@ exports.TicketVariableNameMap = {
412
412
  text: 'Ticket Priority',
413
413
  type: 'dropdown',
414
414
  value: [
415
- { id: '0', value: '0', label: 'No Prioriy' },
415
+ { id: '0', value: '0', label: 'No Priority' },
416
416
  { id: '1', value: '1', label: 'Low' },
417
417
  { id: '2', value: '2', label: 'Medium' },
418
418
  { id: '3', value: '3', label: 'High' },
@@ -808,15 +808,6 @@ exports.ActionNameMap = {
808
808
  info: 'If enabled, the message will be appended to the latest open ticket (if available) else a new ticket will be created',
809
809
  required: false,
810
810
  },
811
- assignee: {
812
- id: 'assignee',
813
- type: 'dropdown',
814
- value: 'org.members',
815
- label: 'Assignee (New Ticket)',
816
- placeholder: 'Select assignee',
817
- info: 'Only applicable for create ticket. If no assignee is selected, the ticket will be unassigned.',
818
- required: false,
819
- },
820
811
  priority: {
821
812
  id: 'priority',
822
813
  type: 'dropdown',
@@ -841,6 +832,27 @@ exports.ActionNameMap = {
841
832
  info: 'Only applicable for create ticket. If no label is selected, the ticket will have no label.',
842
833
  required: false,
843
834
  },
835
+ round_robin: {
836
+ id: 'round_robin',
837
+ type: 'dropdown',
838
+ value: [
839
+ { id: 'true', value: 'true', label: 'True' },
840
+ { id: 'false', value: 'false', label: 'False' },
841
+ ],
842
+ label: 'Enable Round Robin (New Ticket: Assignee)',
843
+ placeholder: 'Select...',
844
+ info: 'If enabled, the ticket will be assigned to the next available agent in the list',
845
+ required: false,
846
+ },
847
+ assignee: {
848
+ id: 'assignee',
849
+ type: 'dynamic',
850
+ value: 'org.members',
851
+ label: 'Assignee (New Ticket)',
852
+ placeholder: 'Select assignee',
853
+ info: "If round robin is enabled, the ticket will be assigned to the next available agent in the list else it'll be assigned to the selected agent",
854
+ required: false,
855
+ },
844
856
  },
845
857
  validTriggers: [
846
858
  'message.created',
@@ -857,8 +869,8 @@ exports.ActionNameMap = {
857
869
  id: 'flag',
858
870
  type: 'dropdown',
859
871
  value: [
860
- { id: 'flag', value: 'true', label: 'TRUE' },
861
- { id: 'unflag', value: 'false', label: 'FALSE' },
872
+ { id: 'flag', value: 'true', label: 'True' },
873
+ { id: 'unflag', value: 'false', label: 'False' },
862
874
  ],
863
875
  label: 'Flag status',
864
876
  placeholder: 'Select flag',
@@ -1084,6 +1096,38 @@ exports.ActionNameMap = {
1084
1096
  'chat.label.updated',
1085
1097
  ],
1086
1098
  },
1099
+ send_slack_notification: {
1100
+ title: 'Send Slack Notification',
1101
+ description: 'Send a slack notification to a channel',
1102
+ validTriggers: [
1103
+ 'message.created',
1104
+ 'message.updated',
1105
+ 'chat.created',
1106
+ 'ticket.updated',
1107
+ 'ticket.created',
1108
+ 'reaction.added',
1109
+ 'message.flagged',
1110
+ 'chat.label.updated',
1111
+ ],
1112
+ inputs: {
1113
+ webhook_url: {
1114
+ type: 'text',
1115
+ id: 'webhook_url',
1116
+ label: 'Webhook URL',
1117
+ placeholder: 'Enter webhook URL',
1118
+ value: null,
1119
+ required: true,
1120
+ },
1121
+ slack_payload: {
1122
+ type: 'json_editor',
1123
+ id: 'slack_payload',
1124
+ label: 'Slack Notification Payload',
1125
+ placeholder: 'Enter payload',
1126
+ value: null,
1127
+ required: true,
1128
+ },
1129
+ },
1130
+ },
1087
1131
  };
1088
1132
  exports.editorVariables = [
1089
1133
  {
@@ -1148,6 +1192,20 @@ exports.editorVariables = [
1148
1192
  value: 'reaction.reaction',
1149
1193
  validTriggers: ['reaction.added'],
1150
1194
  },
1195
+ {
1196
+ value: 'chat.assigned_to',
1197
+ label: 'Chat Assigned To',
1198
+ validTriggers: [
1199
+ 'message.created',
1200
+ 'message.updated',
1201
+ 'reaction.added',
1202
+ 'message.flagged',
1203
+ 'chat.created',
1204
+ 'chat.label.updated',
1205
+ 'ticket.created',
1206
+ 'ticket.updated',
1207
+ ],
1208
+ },
1151
1209
  ];
1152
1210
  exports.variablesExclusionList = {
1153
1211
  'ticket.created': ['ticket.is_deleted'],
@@ -2,6 +2,31 @@ 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
+ };
5
30
  internal: {
6
31
  Tables: {
7
32
  config: {
@@ -1461,6 +1486,13 @@ export type Database = {
1461
1486
  user_id?: string | null;
1462
1487
  };
1463
1488
  Relationships: [
1489
+ {
1490
+ foreignKeyName: "tbl_org_members_fkey_auth_users";
1491
+ columns: ["user_id"];
1492
+ isOneToOne: false;
1493
+ referencedRelation: "users";
1494
+ referencedColumns: ["id"];
1495
+ },
1464
1496
  {
1465
1497
  foreignKeyName: "tbl_org_members_fkey_tbl_org";
1466
1498
  columns: ["org_id"];
@@ -1723,15 +1755,69 @@ export type Database = {
1723
1755
  }
1724
1756
  ];
1725
1757
  };
1758
+ tbl_scheduled_logs: {
1759
+ Row: {
1760
+ chat_id: string | null;
1761
+ created_at: string;
1762
+ delivered_at: string | null;
1763
+ id: number;
1764
+ is_success: boolean | null;
1765
+ org_id: string | null;
1766
+ sent_message_id: string | null;
1767
+ };
1768
+ Insert: {
1769
+ chat_id?: string | null;
1770
+ created_at?: string;
1771
+ delivered_at?: string | null;
1772
+ id?: number;
1773
+ is_success?: boolean | null;
1774
+ org_id?: string | null;
1775
+ sent_message_id?: string | null;
1776
+ };
1777
+ Update: {
1778
+ chat_id?: string | null;
1779
+ created_at?: string;
1780
+ delivered_at?: string | null;
1781
+ id?: number;
1782
+ is_success?: boolean | null;
1783
+ org_id?: string | null;
1784
+ sent_message_id?: string | null;
1785
+ };
1786
+ Relationships: [
1787
+ {
1788
+ foreignKeyName: "tbl_scheduled_message_logs_org_id_fkey";
1789
+ columns: ["org_id"];
1790
+ isOneToOne: false;
1791
+ referencedRelation: "tbl_org";
1792
+ referencedColumns: ["org_id"];
1793
+ },
1794
+ {
1795
+ foreignKeyName: "tbl_scheduled_message_logs_org_id_fkey";
1796
+ columns: ["org_id"];
1797
+ isOneToOne: false;
1798
+ referencedRelation: "view_org";
1799
+ referencedColumns: ["org_id"];
1800
+ },
1801
+ {
1802
+ foreignKeyName: "tbl_scheduled_message_logs_sent_message_id_fkey";
1803
+ columns: ["sent_message_id"];
1804
+ isOneToOne: false;
1805
+ referencedRelation: "tbl_scheduled_messages";
1806
+ referencedColumns: ["sent_message_id"];
1807
+ }
1808
+ ];
1809
+ };
1726
1810
  tbl_scheduled_messages: {
1727
1811
  Row: {
1728
1812
  chat_id: string;
1729
1813
  created_at: string;
1814
+ is_repeat: boolean | null;
1730
1815
  message_id: string | null;
1731
1816
  message_payload: Json | null;
1732
1817
  org_id: string;
1733
1818
  org_phone: string | null;
1734
1819
  performed_by: string | null;
1820
+ repeat_config: Json | null;
1735
1821
  scheduled_at: string;
1736
1822
  sent_message_id: string;
1737
1823
  status: boolean | null;
@@ -1740,11 +1826,13 @@ export type Database = {
1740
1826
  Insert: {
1741
1827
  chat_id: string;
1742
1828
  created_at?: string;
1829
+ is_repeat?: boolean | null;
1743
1830
  message_id?: string | null;
1744
1831
  message_payload?: Json | null;
1745
1832
  org_id: string;
1746
1833
  org_phone?: string | null;
1747
1834
  performed_by?: string | null;
1835
+ repeat_config?: Json | null;
1748
1836
  scheduled_at: string;
1749
1837
  sent_message_id: string;
1750
1838
  status?: boolean | null;
@@ -1753,11 +1841,13 @@ export type Database = {
1753
1841
  Update: {
1754
1842
  chat_id?: string;
1755
1843
  created_at?: string;
1844
+ is_repeat?: boolean | null;
1756
1845
  message_id?: string | null;
1757
1846
  message_payload?: Json | null;
1758
1847
  org_id?: string;
1759
1848
  org_phone?: string | null;
1760
1849
  performed_by?: string | null;
1850
+ repeat_config?: Json | null;
1761
1851
  scheduled_at?: string;
1762
1852
  sent_message_id?: string;
1763
1853
  status?: boolean | null;
@@ -1876,7 +1966,6 @@ export type Database = {
1876
1966
  };
1877
1967
  view_chats: {
1878
1968
  Row: {
1879
- add_members_admins_only: boolean | null;
1880
1969
  assigned_to: string | null;
1881
1970
  chat_access: Json | null;
1882
1971
  chat_id: string | null;
@@ -1896,6 +1985,7 @@ export type Database = {
1896
1985
  is_muted: boolean | null;
1897
1986
  label_ids: Json | null;
1898
1987
  latest_message: Json | null;
1988
+ member_add_mode: string | null;
1899
1989
  member_count: number | null;
1900
1990
  message_unread_count: number | null;
1901
1991
  messages_admins_only: boolean | null;
@@ -2339,7 +2429,6 @@ export type Database = {
2339
2429
  owner_id: string | null;
2340
2430
  path_tokens: string[] | null;
2341
2431
  updated_at: string | null;
2342
- user_metadata: Json | null;
2343
2432
  version: string | null;
2344
2433
  };
2345
2434
  Insert: {
@@ -2353,7 +2442,6 @@ export type Database = {
2353
2442
  owner_id?: string | null;
2354
2443
  path_tokens?: string[] | null;
2355
2444
  updated_at?: string | null;
2356
- user_metadata?: Json | null;
2357
2445
  version?: string | null;
2358
2446
  };
2359
2447
  Update: {
@@ -2367,7 +2455,6 @@ export type Database = {
2367
2455
  owner_id?: string | null;
2368
2456
  path_tokens?: string[] | null;
2369
2457
  updated_at?: string | null;
2370
- user_metadata?: Json | null;
2371
2458
  version?: string | null;
2372
2459
  };
2373
2460
  Relationships: [
@@ -2389,7 +2476,6 @@ export type Database = {
2389
2476
  key: string;
2390
2477
  owner_id: string | null;
2391
2478
  upload_signature: string;
2392
- user_metadata: Json | null;
2393
2479
  version: string;
2394
2480
  };
2395
2481
  Insert: {
@@ -2400,7 +2486,6 @@ export type Database = {
2400
2486
  key: string;
2401
2487
  owner_id?: string | null;
2402
2488
  upload_signature: string;
2403
- user_metadata?: Json | null;
2404
2489
  version: string;
2405
2490
  };
2406
2491
  Update: {
@@ -2411,7 +2496,6 @@ export type Database = {
2411
2496
  key?: string;
2412
2497
  owner_id?: string | null;
2413
2498
  upload_signature?: string;
2414
- user_metadata?: Json | null;
2415
2499
  version?: string;
2416
2500
  };
2417
2501
  Relationships: [
@@ -2548,10 +2632,6 @@ export type Database = {
2548
2632
  updated_at: string;
2549
2633
  }[];
2550
2634
  };
2551
- operation: {
2552
- Args: Record<PropertyKey, never>;
2553
- Returns: string;
2554
- };
2555
2635
  search: {
2556
2636
  Args: {
2557
2637
  prefix: string;
@@ -2622,11 +2702,4 @@ export type Enums<PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] |
2622
2702
  } ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"] : never = never> = PublicEnumNameOrOptions extends {
2623
2703
  schema: keyof Database;
2624
2704
  } ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] ? PublicSchema["Enums"][PublicEnumNameOrOptions] : never;
2625
- export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"] | {
2626
- schema: keyof Database;
2627
- }, CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
2628
- schema: keyof Database;
2629
- } ? keyof Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] : never = never> = PublicCompositeTypeNameOrOptions extends {
2630
- schema: keyof Database;
2631
- } ? Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"] ? PublicSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] : never;
2632
2705
  export {};
package/dist/types.d.ts CHANGED
@@ -473,7 +473,7 @@ export type PollResultType = {
473
473
  export type CreateGroupOptions = {
474
474
  messagesAdminsOnly?: boolean;
475
475
  infoAdminsOnly?: boolean;
476
- addMembersAdminsOnly?: boolean;
476
+ memberAddMode?: boolean;
477
477
  image?: string;
478
478
  name?: string;
479
479
  description?: string;
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.178",
3
+ "version": "0.6.179",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",