@periskope/types 0.6.154 → 0.6.156

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.
@@ -244,7 +244,7 @@ export type UpdateCustomPropertyAction = {
244
244
  };
245
245
  };
246
246
  export type Action = SendMessageAction | NotifyHttpAction | CreateTicketAction | FlagMessageAction | AssignTicketAction | CloseTicketAction | AddChatLabelAction | AddTicketLabelAction | AssignChatAction | ForwardMessageAction | SendEmailAction | ReplyToMessageAction | UpdateCustomPropertyAction;
247
- export declare const isSendMessageAction: (action: Action) => action is SendMessageAction;
247
+ export declare const isSendMessageOrReplyToMessageAction: (action: Action) => action is SendMessageAction | ReplyToMessageAction;
248
248
  export type Rule = OverrideProperties<Tables<'tbl_automation_rules'>, {
249
249
  actions: Action[];
250
250
  conditions: Conditions;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.variablesExclusionList = exports.editorVariables = exports.ActionNameMap = exports.RuleNameMap = exports.isSendMessageAction = exports.FilterConditionMap = exports.ReactionVariableNameMap = exports.TicketVariableNameMap = exports.ChatVariableNameMap = exports.SenderVariableNameMap = exports.MessageVariableNameMap = exports.FilterNameMap = exports.isFilter = void 0;
3
+ exports.variablesExclusionList = exports.editorVariables = exports.ActionNameMap = exports.RuleNameMap = exports.isSendMessageOrReplyToMessageAction = 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 &&
@@ -417,7 +417,23 @@ exports.ChatVariableNameMap = {
417
417
  'chat.created_at': {
418
418
  text: 'Chat Created At',
419
419
  type: 'day-time',
420
- filters: ['LT', 'LTE', 'GT', 'GTE', 'ON'],
420
+ filters: {
421
+ LT: {
422
+ info: 'When chat is created before mentioned time (UTC)',
423
+ },
424
+ LTE: {
425
+ info: 'When chat is created before mentioned time (UTC)',
426
+ },
427
+ GT: {
428
+ info: 'When chat is created after mentioned time (UTC)',
429
+ },
430
+ GTE: {
431
+ info: 'When chat is created on or after mentioned time (UTC)',
432
+ },
433
+ ON: {
434
+ info: 'When chat is created on mentioned days',
435
+ },
436
+ },
421
437
  variable_type: 'day-time',
422
438
  },
423
439
  };
@@ -524,7 +540,23 @@ exports.TicketVariableNameMap = {
524
540
  'ticket.created_at': {
525
541
  text: 'Ticket Created At',
526
542
  type: 'day-time',
527
- filters: ['LT', 'LTE', 'GT', 'GTE', 'ON'],
543
+ filters: {
544
+ LT: {
545
+ info: 'When ticket is created before mentioned time (UTC)',
546
+ },
547
+ LTE: {
548
+ info: 'When ticket is created before mentioned time (UTC)',
549
+ },
550
+ GT: {
551
+ info: 'When ticket is created after mentioned time (UTC)',
552
+ },
553
+ GTE: {
554
+ info: 'When ticket is created on or after mentioned time (UTC)',
555
+ },
556
+ ON: {
557
+ info: 'When ticket is created on mentioned days',
558
+ },
559
+ },
528
560
  variable_type: 'day-time',
529
561
  },
530
562
  'ticket.chat_id': {
@@ -588,10 +620,10 @@ var FilterConditionMap;
588
620
  FilterConditionMap["NIS"] = "<>";
589
621
  FilterConditionMap["ON"] = "on";
590
622
  })(FilterConditionMap || (exports.FilterConditionMap = FilterConditionMap = {}));
591
- const isSendMessageAction = (action) => {
592
- return action.type === 'send_message';
623
+ const isSendMessageOrReplyToMessageAction = (action) => {
624
+ return ['send_message', 'reply_to_message'].includes(action.type);
593
625
  };
594
- exports.isSendMessageAction = isSendMessageAction;
626
+ exports.isSendMessageOrReplyToMessageAction = isSendMessageOrReplyToMessageAction;
595
627
  exports.RuleNameMap = {
596
628
  'message.created': {
597
629
  title: 'New Message Received',
@@ -1036,6 +1068,8 @@ exports.editorVariables = [
1036
1068
  'message.updated',
1037
1069
  'reaction.added',
1038
1070
  'message.flagged',
1071
+ 'ticket.created',
1072
+ 'ticket.updated'
1039
1073
  ],
1040
1074
  },
1041
1075
  {
@@ -1046,6 +1080,8 @@ exports.editorVariables = [
1046
1080
  'message.updated',
1047
1081
  'reaction.added',
1048
1082
  'message.flagged',
1083
+ 'ticket.created',
1084
+ 'ticket.updated'
1049
1085
  ],
1050
1086
  },
1051
1087
  {
@@ -1058,6 +1094,8 @@ exports.editorVariables = [
1058
1094
  'message.flagged',
1059
1095
  'chat.created',
1060
1096
  'chat.label.updated',
1097
+ 'ticket.created',
1098
+ 'ticket.updated'
1061
1099
  ],
1062
1100
  },
1063
1101
  {
@@ -1068,7 +1106,7 @@ exports.editorVariables = [
1068
1106
  ];
1069
1107
  exports.variablesExclusionList = {
1070
1108
  'ticket.created': ['ticket.is_deleted'],
1071
- 'chat.created': ['chat.chat_id'],
1109
+ 'chat.created': ['chat.chat_id', 'chat.labels', 'chat.has_flagged_messages', 'chat.assigned_to'],
1072
1110
  'message.created': [
1073
1111
  'message.author',
1074
1112
  'message.performed_by',
@@ -736,6 +736,7 @@ export type Database = {
736
736
  chat_name: string | null;
737
737
  chat_org_phones: string[];
738
738
  chat_type: string | null;
739
+ closed_at: number | null;
739
740
  custom_properties: Json | null;
740
741
  flag_count_map: Json | null;
741
742
  hubspot_metadata: Json | null;
@@ -754,6 +755,7 @@ export type Database = {
754
755
  chat_name?: string | null;
755
756
  chat_org_phones?: string[];
756
757
  chat_type?: string | null;
758
+ closed_at?: number | null;
757
759
  custom_properties?: Json | null;
758
760
  flag_count_map?: Json | null;
759
761
  hubspot_metadata?: Json | null;
@@ -772,6 +774,7 @@ export type Database = {
772
774
  chat_name?: string | null;
773
775
  chat_org_phones?: string[];
774
776
  chat_type?: string | null;
777
+ closed_at?: number | null;
775
778
  custom_properties?: Json | null;
776
779
  flag_count_map?: Json | null;
777
780
  hubspot_metadata?: Json | null;
@@ -2161,7 +2164,7 @@ export type Database = {
2161
2164
  column_name: string;
2162
2165
  org_id_input: string;
2163
2166
  chat_id_input: string[];
2164
- column_value_input?: string;
2167
+ column_value_input?: unknown;
2165
2168
  key_input?: string;
2166
2169
  value_input?: Json;
2167
2170
  };
package/dist/types.d.ts CHANGED
@@ -59,14 +59,17 @@ export type OrgMetadata = {
59
59
  referralSource?: string;
60
60
  surveyData?: MicrosurveyData;
61
61
  preferences?: OrgPreferences;
62
- hubspot_pipelines?: {
63
- id: string;
64
- label: string;
65
- default_stage: {
62
+ hubspot: {
63
+ hubspot_pipelines?: {
66
64
  id: string;
67
65
  label: string;
68
- };
69
- }[];
66
+ default_stage: {
67
+ id: string;
68
+ label: string;
69
+ };
70
+ }[];
71
+ hubspot_hidden_fields?: string[];
72
+ };
70
73
  partition?: boolean;
71
74
  tickets: {
72
75
  prefix?: string;
@@ -138,7 +141,7 @@ export type ChatType = Merge<Tables<'view_chats'>, {
138
141
  };
139
142
  is_archived?: boolean;
140
143
  is_pinned?: boolean;
141
- closed_at?: number;
144
+ closed_at?: number | null;
142
145
  common_chats?: string[];
143
146
  }>;
144
147
  export type MediaType = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@periskope/types",
3
- "version": "0.6.154",
3
+ "version": "0.6.156",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/rules.types.ts CHANGED
@@ -587,7 +587,23 @@ export const ChatVariableNameMap: Record<
587
587
  'chat.created_at': {
588
588
  text: 'Chat Created At',
589
589
  type: 'day-time',
590
- filters: ['LT', 'LTE', 'GT', 'GTE', 'ON'],
590
+ filters: {
591
+ LT: {
592
+ info: 'When chat is created before mentioned time (UTC)',
593
+ },
594
+ LTE: {
595
+ info: 'When chat is created before mentioned time (UTC)',
596
+ },
597
+ GT: {
598
+ info: 'When chat is created after mentioned time (UTC)',
599
+ },
600
+ GTE: {
601
+ info: 'When chat is created on or after mentioned time (UTC)',
602
+ },
603
+ ON: {
604
+ info: 'When chat is created on mentioned days',
605
+ },
606
+ },
591
607
  variable_type: 'day-time',
592
608
  },
593
609
  };
@@ -698,7 +714,23 @@ export const TicketVariableNameMap: Record<
698
714
  'ticket.created_at': {
699
715
  text: 'Ticket Created At',
700
716
  type: 'day-time',
701
- filters: ['LT', 'LTE', 'GT', 'GTE', 'ON'],
717
+ filters: {
718
+ LT: {
719
+ info: 'When ticket is created before mentioned time (UTC)',
720
+ },
721
+ LTE: {
722
+ info: 'When ticket is created before mentioned time (UTC)',
723
+ },
724
+ GT: {
725
+ info: 'When ticket is created after mentioned time (UTC)',
726
+ },
727
+ GTE: {
728
+ info: 'When ticket is created on or after mentioned time (UTC)',
729
+ },
730
+ ON: {
731
+ info: 'When ticket is created on mentioned days',
732
+ },
733
+ },
702
734
  variable_type: 'day-time',
703
735
  },
704
736
  'ticket.chat_id': {
@@ -932,10 +964,10 @@ export type Action =
932
964
  | ReplyToMessageAction
933
965
  | UpdateCustomPropertyAction;
934
966
 
935
- export const isSendMessageAction = (
967
+ export const isSendMessageOrReplyToMessageAction = (
936
968
  action: Action
937
- ): action is SendMessageAction => {
938
- return action.type === 'send_message';
969
+ ): action is SendMessageAction | ReplyToMessageAction => {
970
+ return ['send_message', 'reply_to_message'].includes(action.type);
939
971
  };
940
972
 
941
973
  export type Rule = OverrideProperties<
@@ -1452,6 +1484,8 @@ export const editorVariables: Array<{
1452
1484
  'message.updated',
1453
1485
  'reaction.added',
1454
1486
  'message.flagged',
1487
+ 'ticket.created',
1488
+ 'ticket.updated'
1455
1489
  ],
1456
1490
  },
1457
1491
  {
@@ -1462,6 +1496,8 @@ export const editorVariables: Array<{
1462
1496
  'message.updated',
1463
1497
  'reaction.added',
1464
1498
  'message.flagged',
1499
+ 'ticket.created',
1500
+ 'ticket.updated'
1465
1501
  ],
1466
1502
  },
1467
1503
  {
@@ -1474,6 +1510,8 @@ export const editorVariables: Array<{
1474
1510
  'message.flagged',
1475
1511
  'chat.created',
1476
1512
  'chat.label.updated',
1513
+ 'ticket.created',
1514
+ 'ticket.updated'
1477
1515
  ],
1478
1516
  },
1479
1517
  {
@@ -1494,7 +1532,7 @@ export const variablesExclusionList: Record<
1494
1532
  >
1495
1533
  > = {
1496
1534
  'ticket.created': ['ticket.is_deleted'],
1497
- 'chat.created': ['chat.chat_id'],
1535
+ 'chat.created': ['chat.chat_id', 'chat.labels', 'chat.has_flagged_messages', 'chat.assigned_to'],
1498
1536
  'message.created': [
1499
1537
  'message.author',
1500
1538
  'message.performed_by',