@periskope/types 0.6.13-7.4 → 0.6.13-7.6

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.
@@ -3,15 +3,15 @@ import { Tables } from './supabase.types';
3
3
  export type AppendTypes<T extends object, O extends string> = {
4
4
  [K in keyof T & string as `${K}${O}${keyof T[K] & string}`]: T[K][keyof T[K]];
5
5
  };
6
- export type TicketVariablesType = Merge<Pick<Tables<'tbl_chat_tickets'>, 'assigned_by' | 'assignee' | 'status' | 'subject' | 'is_deleted' | 'priority' | 'raised_by' | 'due_date'>, {
6
+ export type TicketVariablesType = Merge<Pick<Tables<'tbl_chat_tickets'>, 'assigned_by' | 'assignee' | 'status' | 'subject' | 'is_deleted' | 'priority' | 'raised_by' | 'due_date' | 'ticket_id'>, {
7
7
  labels: string[];
8
8
  }>;
9
- export type MessageVariablesType = Pick<Tables<'tbl_chat_messages'>, 'body' | 'sender_phone' | 'timestamp' | 'flag_status' | 'has_quoted_msg' | 'media' | 'performed_by'>;
9
+ export type MessageVariablesType = Pick<Tables<'tbl_chat_messages'>, 'body' | 'sender_phone' | 'timestamp' | 'flag_status' | 'has_quoted_msg' | 'media' | 'performed_by' | 'message_id' | 'chat_id'>;
10
10
  export type SenderVariablesType = Merge<Pick<Tables<'tbl_contacts'>, 'is_business' | 'is_enterprise' | 'is_internal' | 'contact_name' | 'contact_id'>, {
11
11
  labels: string[];
12
12
  }>;
13
- export type ReactionVariablesType = Pick<Tables<'tbl_chat_reactions'>, 'reaction' | 'sender_id'>;
14
- export type ChatVariablesType = Merge<Pick<Tables<'view_chats'>, 'assigned_to' | 'chat_name' | 'org_phone' | 'chat_type'>, {
13
+ export type ReactionVariablesType = Pick<Tables<'tbl_chat_reactions'>, 'reaction' | 'sender_id' | 'reaction_id' | 'message_id' | 'chat_id'>;
14
+ export type ChatVariablesType = Merge<Pick<Tables<'view_chats'>, 'assigned_to' | 'chat_name' | 'org_phone' | 'chat_type' | 'chat_id'>, {
15
15
  members: string[];
16
16
  labels: string[];
17
17
  }>;
@@ -70,9 +70,6 @@ export declare const FilterNameMap: Record<Filter['condition'], {
70
70
  name: string;
71
71
  input: boolean;
72
72
  }>;
73
- export declare const ReactionVariableFilterMap: Record<keyof AppendTypes<{
74
- reaction: ReactionVariablesType;
75
- }, '.'>, Filter['condition'][]>;
76
73
  export type VariableNameValueType = {
77
74
  text: string;
78
75
  type: 'string' | 'date' | 'boolean' | 'dropdown';
@@ -82,6 +79,7 @@ export type VariableNameValueType = {
82
79
  label: string;
83
80
  }[] | null;
84
81
  filters: Filter['condition'][];
82
+ hidden?: boolean;
85
83
  };
86
84
  export declare const MessageVariableNameMap: Record<keyof AppendTypes<{
87
85
  message: MessageVariablesType;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionNameMap = exports.RuleNameMap = exports.isSendMessageAction = exports.FilterConditionMap = exports.ReactionVariableNameMap = exports.TicketVariableNameMap = exports.ChatVariableNameMap = exports.SenderVariableNameMap = exports.MessageVariableNameMap = exports.ReactionVariableFilterMap = exports.FilterNameMap = exports.isFilter = void 0;
3
+ exports.ActionNameMap = exports.RuleNameMap = exports.isSendMessageAction = exports.FilterConditionMap = exports.ReactionVariableNameMap = exports.TicketVariableNameMap = exports.ChatVariableNameMap = exports.SenderVariableNameMap = exports.MessageVariableNameMap = exports.FilterNameMap = exports.isFilter = void 0;
4
4
  const isFilter = (filter) => {
5
5
  return (typeof filter === 'object' &&
6
6
  'id' in filter &&
@@ -59,10 +59,6 @@ exports.FilterNameMap = {
59
59
  input: true,
60
60
  },
61
61
  };
62
- exports.ReactionVariableFilterMap = {
63
- 'reaction.reaction': ['EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
64
- 'reaction.sender_id': ['EQ', 'NEQ'],
65
- };
66
62
  exports.MessageVariableNameMap = {
67
63
  'message.body': {
68
64
  text: 'Message Body',
@@ -100,6 +96,18 @@ exports.MessageVariableNameMap = {
100
96
  value: 'org.members',
101
97
  filters: ['EQ', 'NEQ'],
102
98
  },
99
+ "message.chat_id": {
100
+ text: 'Chat ID',
101
+ type: 'string',
102
+ filters: ['EQ', 'NEQ'],
103
+ hidden: true
104
+ },
105
+ "message.message_id": {
106
+ text: 'Message ID',
107
+ type: 'string',
108
+ filters: ['EQ', 'NEQ'],
109
+ hidden: true
110
+ }
103
111
  };
104
112
  exports.SenderVariableNameMap = {
105
113
  'sender.is_business': {
@@ -173,6 +181,12 @@ exports.ChatVariableNameMap = {
173
181
  value: 'org.labels',
174
182
  filters: ['CONTAINS', 'NCONTAINS'],
175
183
  },
184
+ "chat.chat_id": {
185
+ text: 'Chat ID',
186
+ type: 'string',
187
+ filters: ['EQ', 'NEQ'],
188
+ hidden: true
189
+ }
176
190
  };
177
191
  exports.TicketVariableNameMap = {
178
192
  'ticket.subject': {
@@ -236,6 +250,12 @@ exports.TicketVariableNameMap = {
236
250
  value: 'org.members',
237
251
  filters: ['EQ', 'NEQ'],
238
252
  },
253
+ "ticket.ticket_id": {
254
+ text: 'Ticket ID',
255
+ type: 'string',
256
+ filters: ['EQ', 'NEQ'],
257
+ hidden: true
258
+ }
239
259
  };
240
260
  exports.ReactionVariableNameMap = {
241
261
  'reaction.reaction': {
@@ -248,6 +268,24 @@ exports.ReactionVariableNameMap = {
248
268
  type: 'string',
249
269
  filters: ['EQ', 'NEQ'],
250
270
  },
271
+ 'reaction.message_id': {
272
+ text: 'Reaction Message ID',
273
+ type: 'string',
274
+ filters: ['EQ', 'NEQ'],
275
+ hidden: true
276
+ },
277
+ "reaction.chat_id": {
278
+ text: 'Chat ID',
279
+ type: 'string',
280
+ filters: ['EQ', 'NEQ'],
281
+ hidden: true
282
+ },
283
+ "reaction.reaction_id": {
284
+ text: 'Reaction ID',
285
+ type: 'string',
286
+ filters: ['EQ', 'NEQ'],
287
+ hidden: true
288
+ }
251
289
  };
252
290
  var FilterConditionMap;
253
291
  (function (FilterConditionMap) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@periskope/types",
3
- "version": "0.6.137.4",
3
+ "version": "0.6.137.6",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/rules.types.ts CHANGED
@@ -16,6 +16,7 @@ export type TicketVariablesType = Merge<
16
16
  | 'priority'
17
17
  | 'raised_by'
18
18
  | 'due_date'
19
+ | 'ticket_id'
19
20
  >,
20
21
  {
21
22
  labels: string[];
@@ -31,6 +32,8 @@ export type MessageVariablesType = Pick<
31
32
  | 'has_quoted_msg'
32
33
  | 'media'
33
34
  | 'performed_by'
35
+ | 'message_id'
36
+ | 'chat_id'
34
37
  >;
35
38
 
36
39
  export type SenderVariablesType = Merge<
@@ -49,13 +52,13 @@ export type SenderVariablesType = Merge<
49
52
 
50
53
  export type ReactionVariablesType = Pick<
51
54
  Tables<'tbl_chat_reactions'>,
52
- 'reaction' | 'sender_id'
55
+ 'reaction' | 'sender_id' | 'reaction_id' | 'message_id' | 'chat_id'
53
56
  >;
54
57
 
55
58
  export type ChatVariablesType = Merge<
56
59
  Pick<
57
60
  Tables<'view_chats'>,
58
- 'assigned_to' | 'chat_name' | 'org_phone' | 'chat_type'
61
+ 'assigned_to' | 'chat_name' | 'org_phone' | 'chat_type' | 'chat_id'
59
62
  >,
60
63
  {
61
64
  members: string[];
@@ -226,14 +229,6 @@ export const FilterNameMap: Record<
226
229
  },
227
230
  };
228
231
 
229
- export const ReactionVariableFilterMap: Record<
230
- keyof AppendTypes<{ reaction: ReactionVariablesType }, '.'>,
231
- Filter['condition'][]
232
- > = {
233
- 'reaction.reaction': ['EQ', 'NEQ', 'KNOWN', 'NKNOWN'],
234
- 'reaction.sender_id': ['EQ', 'NEQ'],
235
- };
236
-
237
232
  export type VariableNameValueType = {
238
233
  text: string;
239
234
  type: 'string' | 'date' | 'boolean' | 'dropdown';
@@ -246,6 +241,7 @@ export type VariableNameValueType = {
246
241
  }[]
247
242
  | null;
248
243
  filters: Filter['condition'][];
244
+ hidden?: boolean;
249
245
  };
250
246
 
251
247
  export const MessageVariableNameMap: Record<
@@ -288,6 +284,18 @@ export const MessageVariableNameMap: Record<
288
284
  value: 'org.members',
289
285
  filters: ['EQ', 'NEQ'],
290
286
  },
287
+ "message.chat_id":{
288
+ text: 'Chat ID',
289
+ type: 'string',
290
+ filters: ['EQ', 'NEQ'],
291
+ hidden: true
292
+ },
293
+ "message.message_id":{
294
+ text: 'Message ID',
295
+ type: 'string',
296
+ filters: ['EQ', 'NEQ'],
297
+ hidden: true
298
+ }
291
299
  };
292
300
 
293
301
  export const SenderVariableNameMap: Record<
@@ -369,6 +377,12 @@ export const ChatVariableNameMap: Record<
369
377
  value: 'org.labels',
370
378
  filters: ['CONTAINS', 'NCONTAINS'],
371
379
  },
380
+ "chat.chat_id": {
381
+ text: 'Chat ID',
382
+ type: 'string',
383
+ filters: ['EQ', 'NEQ'],
384
+ hidden: true
385
+ }
372
386
  };
373
387
 
374
388
  export const TicketVariableNameMap: Record<
@@ -436,6 +450,12 @@ export const TicketVariableNameMap: Record<
436
450
  value: 'org.members',
437
451
  filters: ['EQ', 'NEQ'],
438
452
  },
453
+ "ticket.ticket_id": {
454
+ text: 'Ticket ID',
455
+ type: 'string',
456
+ filters: ['EQ', 'NEQ'],
457
+ hidden: true
458
+ }
439
459
  };
440
460
 
441
461
  export const ReactionVariableNameMap: Record<
@@ -452,6 +472,24 @@ export const ReactionVariableNameMap: Record<
452
472
  type: 'string',
453
473
  filters: ['EQ', 'NEQ'],
454
474
  },
475
+ 'reaction.message_id': {
476
+ text: 'Reaction Message ID',
477
+ type: 'string',
478
+ filters: ['EQ', 'NEQ'],
479
+ hidden: true
480
+ },
481
+ "reaction.chat_id": {
482
+ text: 'Chat ID',
483
+ type: 'string',
484
+ filters: ['EQ', 'NEQ'],
485
+ hidden: true
486
+ },
487
+ "reaction.reaction_id": {
488
+ text: 'Reaction ID',
489
+ type: 'string',
490
+ filters: ['EQ', 'NEQ'],
491
+ hidden: true
492
+ }
455
493
  };
456
494
 
457
495
  export enum FilterConditionMap {