@periskope/types 0.6.360 → 0.6.361

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.
@@ -55,7 +55,7 @@ export type TicketRulesInfoType = Merge<
55
55
  >,
56
56
  {
57
57
  id: 'ticket.ticket_id';
58
- type: `ticket.${'created' | 'updated' | 'closed'}` | 'ticket.label.updated';
58
+ type: `ticket.${'created' | 'updated' | 'closed' | 'label.updated'}`;
59
59
  org_id: string;
60
60
  rule: Tables<'tbl_automation_rules'>[];
61
61
  }
@@ -1037,7 +1037,9 @@ export type SetTicketDueDateAction = {
1037
1037
  type: 'set_ticket_due_date';
1038
1038
  delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
1039
1039
  metadata: {
1040
- due_date_option_time: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
1040
+ due_date_option: 'today' | 'tomorrow' | 'custom';
1041
+ custom_duration?: number;
1042
+ custom_unit?: 'minutes' | 'hours' | 'days';
1041
1043
  };
1042
1044
  };
1043
1045
 
@@ -1215,11 +1217,11 @@ export type Rule = OverrideProperties<
1215
1217
  | 'ticket.created'
1216
1218
  | 'reaction.added'
1217
1219
  | 'chat.label.updated'
1220
+ | 'ticket.label.updated'
1218
1221
  | 'message.flagged'
1219
1222
  | 'message.unflagged'
1220
1223
  | 'message.deleted'
1221
1224
  | 'ticket.closed'
1222
- | 'ticket.label.updated'
1223
1225
  | 'task.created'
1224
1226
  | 'task.assignee.updated';
1225
1227
  }
@@ -1277,16 +1279,16 @@ export const RuleNameMap: Record<
1277
1279
  org_phone: false,
1278
1280
  },
1279
1281
  },
1280
- 'ticket.label.updated': {
1281
- title: 'Ticket Label Added/Removed',
1282
- description: 'When labels on tickets are updated',
1282
+ 'chat.label.updated': {
1283
+ title: 'Chat Label Added/Removed',
1284
+ description: 'When labels on chats are updated',
1283
1285
  base_conditions: {
1284
1286
  org_phone: false,
1285
1287
  },
1286
1288
  },
1287
- 'chat.label.updated': {
1288
- title: 'Chat Label Added/Removed',
1289
- description: 'When labels on chats are updated',
1289
+ 'ticket.label.updated': {
1290
+ title: 'Ticket Label Added/Removed',
1291
+ description: 'When labels on tickets are updated',
1290
1292
  base_conditions: {
1291
1293
  org_phone: false,
1292
1294
  },
@@ -1373,7 +1375,7 @@ type ActionNameMapType = {
1373
1375
  | null
1374
1376
  | 'org.custom_properties'
1375
1377
  | 'custom_property_values'
1376
- | 'custom_duration';
1378
+ | 'debounce_messages';
1377
1379
  label: string;
1378
1380
  placeholder: string;
1379
1381
  info?: string;
@@ -1438,7 +1440,7 @@ export const ActionNameMap: ActionNameMapType = {
1438
1440
  type: 'dynamic',
1439
1441
  label: 'Cooldown Period',
1440
1442
  placeholder: 'Enter time',
1441
- value: 'custom_duration',
1443
+ value: 'debounce_messages',
1442
1444
  required: false,
1443
1445
  },
1444
1446
  },
@@ -1456,7 +1458,6 @@ export const ActionNameMap: ActionNameMapType = {
1456
1458
  'ticket.closed',
1457
1459
  'task.created',
1458
1460
  'task.assignee.updated',
1459
- 'ticket.label.updated'
1460
1461
  ],
1461
1462
  validate: () => true,
1462
1463
  },
@@ -1508,7 +1509,7 @@ export const ActionNameMap: ActionNameMapType = {
1508
1509
  type: 'dynamic',
1509
1510
  label: 'Cooldown Period',
1510
1511
  placeholder: 'Enter time',
1511
- value: 'custom_duration',
1512
+ value: 'debounce_messages',
1512
1513
  required: false,
1513
1514
  },
1514
1515
  },
@@ -1523,7 +1524,6 @@ export const ActionNameMap: ActionNameMapType = {
1523
1524
  'message.unflagged',
1524
1525
  'task.created',
1525
1526
  'task.assignee.updated',
1526
- 'ticket.label.updated'
1527
1527
  ],
1528
1528
  validate: () => true,
1529
1529
  },
@@ -1540,7 +1540,6 @@ export const ActionNameMap: ActionNameMapType = {
1540
1540
  'ticket.updated',
1541
1541
  'ticket.closed',
1542
1542
  'message.unflagged',
1543
- 'ticket.label.updated'
1544
1543
  ],
1545
1544
  validate: () => true,
1546
1545
  },
@@ -1603,7 +1602,6 @@ export const ActionNameMap: ActionNameMapType = {
1603
1602
  'message.unflagged',
1604
1603
  'task.created',
1605
1604
  'task.assignee.updated',
1606
- 'ticket.label.updated'
1607
1605
  ],
1608
1606
  validate: () => true,
1609
1607
  },
@@ -1738,7 +1736,6 @@ export const ActionNameMap: ActionNameMapType = {
1738
1736
  'ticket.closed',
1739
1737
  'task.created',
1740
1738
  'task.assignee.updated',
1741
- 'ticket.label.updated'
1742
1739
  ],
1743
1740
  validate: () => true,
1744
1741
  },
@@ -1804,7 +1801,6 @@ export const ActionNameMap: ActionNameMapType = {
1804
1801
  'ticket.created',
1805
1802
  'task.created',
1806
1803
  'task.assignee.updated',
1807
- 'ticket.label.updated'
1808
1804
  ],
1809
1805
  validate: () => true,
1810
1806
  },
@@ -1828,7 +1824,6 @@ export const ActionNameMap: ActionNameMapType = {
1828
1824
  'reaction.added',
1829
1825
  'message.unflagged',
1830
1826
  'message.deleted',
1831
- 'ticket.label.updated',
1832
1827
  ],
1833
1828
  validate: () => true,
1834
1829
  },
@@ -1873,29 +1868,59 @@ export const ActionNameMap: ActionNameMapType = {
1873
1868
  required: true,
1874
1869
  },
1875
1870
  },
1876
- validTriggers: ['ticket.updated', 'ticket.created', 'ticket.label.updated'],
1871
+ validTriggers: ['ticket.updated', 'ticket.created'],
1877
1872
  validate: () => true,
1878
1873
  },
1879
1874
  set_ticket_due_date: {
1880
1875
  title: 'Set Ticket Due Date',
1881
1876
  description: 'Set a due date for the ticket',
1882
- info: 'This action will set a due date for the ticket. The due date will be set after the specified time from the current date and time of rule execution.',
1883
1877
  inputs: {
1884
1878
  due_date_option: {
1885
- id: 'due_date_option_time',
1886
- type: 'dynamic',
1887
- label: 'Due After',
1888
- placeholder: 'Enter time',
1889
- value: 'custom_duration',
1879
+ id: 'due_date_option',
1880
+ type: 'dropdown',
1881
+ label: 'Due Date Option',
1882
+ placeholder: 'Select option',
1883
+ value: [
1884
+ { id: 'today', value: 'today', label: 'Today' },
1885
+ { id: 'tomorrow', value: 'tomorrow', label: 'Tomorrow' },
1886
+ { id: 'custom', value: 'custom', label: 'Custom' },
1887
+ ],
1890
1888
  required: true,
1891
1889
  },
1890
+ custom_duration: {
1891
+ id: 'custom_duration',
1892
+ type: 'text',
1893
+ label: 'Duration',
1894
+ placeholder: 'Enter number',
1895
+ value: null,
1896
+ required: false,
1897
+ },
1898
+ custom_unit: {
1899
+ id: 'custom_unit',
1900
+ type: 'dropdown',
1901
+ label: 'Unit',
1902
+ placeholder: 'Select unit',
1903
+ value: [
1904
+ { id: 'minutes', value: 'minutes', label: 'Minutes' },
1905
+ { id: 'hours', value: 'hours', label: 'Hours' },
1906
+ { id: 'days', value: 'days', label: 'Days' },
1907
+ ],
1908
+ required: false,
1909
+ },
1892
1910
  },
1893
1911
  validTriggers: [
1894
- 'ticket.updated',
1912
+ 'message.created',
1913
+ 'message.updated',
1914
+ 'chat.created',
1895
1915
  'ticket.created',
1896
1916
  'reaction.added',
1897
- 'ticket.label.updated',
1917
+ 'chat.label.updated',
1918
+ 'message.flagged',
1919
+ 'message.deleted',
1920
+ 'message.unflagged',
1898
1921
  'ticket.closed',
1922
+ 'task.created',
1923
+ 'task.assignee.updated',
1899
1924
  ],
1900
1925
  validate: () => true,
1901
1926
  },
@@ -1914,7 +1939,6 @@ export const ActionNameMap: ActionNameMapType = {
1914
1939
  'message.deleted',
1915
1940
  'message.unflagged',
1916
1941
  'ticket.closed',
1917
- 'ticket.label.updated'
1918
1942
  ],
1919
1943
  inputs: {
1920
1944
  property_id: {
@@ -2006,7 +2030,6 @@ export const ActionNameMap: ActionNameMapType = {
2006
2030
  'ticket.closed',
2007
2031
  'task.created',
2008
2032
  'task.assignee.updated',
2009
- 'ticket.label.updated'
2010
2033
  ],
2011
2034
  validate: () => true,
2012
2035
  },
@@ -2026,7 +2049,6 @@ export const ActionNameMap: ActionNameMapType = {
2026
2049
  'message.unflagged',
2027
2050
  'message.deleted',
2028
2051
  'ticket.closed',
2029
- 'ticket.label.updated'
2030
2052
  ],
2031
2053
  validate: () => true,
2032
2054
  },
@@ -2053,7 +2075,6 @@ export const ActionNameMap: ActionNameMapType = {
2053
2075
  'message.unflagged',
2054
2076
  'message.flagged',
2055
2077
  'ticket.closed',
2056
- 'ticket.label.updated',
2057
2078
  'task.created',
2058
2079
  'task.assignee.updated',
2059
2080
  ],
@@ -2102,7 +2123,6 @@ export const ActionNameMap: ActionNameMapType = {
2102
2123
  'ticket.closed',
2103
2124
  'task.created',
2104
2125
  'task.assignee.updated',
2105
- 'ticket.label.updated',
2106
2126
  ],
2107
2127
  validate: () => true,
2108
2128
  },
@@ -2121,7 +2141,6 @@ export const ActionNameMap: ActionNameMapType = {
2121
2141
  'chat.label.updated',
2122
2142
  'message.deleted',
2123
2143
  'ticket.closed',
2124
- 'ticket.label.updated',
2125
2144
  'task.created',
2126
2145
  'task.assignee.updated',
2127
2146
  ],
@@ -2190,7 +2209,6 @@ export const ActionNameMap: ActionNameMapType = {
2190
2209
  'chat.label.updated',
2191
2210
  'message.deleted',
2192
2211
  'ticket.closed',
2193
- 'ticket.label.updated',
2194
2212
  'task.created',
2195
2213
  'task.assignee.updated',
2196
2214
  ],
@@ -2613,7 +2631,6 @@ export const variablesExclusionList: Record<
2613
2631
  'sender.is_internal',
2614
2632
  ],
2615
2633
  'ticket.updated': ['ticket.is_deleted'],
2616
- "ticket.label.updated": ['ticket.is_deleted'],
2617
2634
  'reaction.added': [],
2618
2635
  'message.updated': [],
2619
2636
  'message.flagged': [],
@@ -2623,4 +2640,5 @@ export const variablesExclusionList: Record<
2623
2640
  'chat.label.updated': [],
2624
2641
  'task.created': [],
2625
2642
  'task.assignee.updated': [],
2643
+ 'ticket.label.updated': [],
2626
2644
  };
package/src/types.ts CHANGED
@@ -1,10 +1,4 @@
1
- import {
2
- Customer,
3
- Estimate,
4
- HostedPage,
5
- ItemPrice,
6
- Subscription,
7
- } from 'chargebee';
1
+ import ChargeBee, { ChargebeeResponse, Estimate, HostedPage, ItemPrice, Subscription, Customer, Invoice } from 'chargebee';
8
2
 
9
3
  import { Merge, OverrideProperties } from 'type-fest';
10
4
  import { Filter, Rule } from './rules.types';
@@ -783,10 +777,8 @@ export type ChatOperationReturn = {
783
777
  export type ChargebeeSubscription = Subscription;
784
778
  export type ChargebeeCustomer = Customer;
785
779
  export type ChargebeePrice = ItemPrice;
786
- export type ChargebeeUpcomingInvoice =
787
- Estimate.RenewalEstimateResponse['estimate'];
788
- export type ChargebeeLineItem =
789
- HostedPage.CheckoutNewForItemsInputParam['subscription_items'];
780
+ export type ChargebeeUpcomingInvoice = Estimate.RenewalEstimateResponse['estimate'];
781
+ export type ChargebeeLineItem = HostedPage.CheckoutNewForItemsInputParam['subscription_items']
790
782
 
791
783
  /* -------------------------------- REALTIME -------------------------------- */
792
784
 
@@ -884,7 +876,7 @@ export enum IntegrationLogType {
884
876
  PHONE_UPDATED = 'org.phone.updated',
885
877
  PHONE_QR_UPDATED = 'org.phone.qr',
886
878
  NOTE_CREATED = 'note.created',
887
- CHAT_CUSTOM_PROPERTIES_UPDATED = 'chat.custom_properties.updated',
879
+ CHAT_CUSTOM_PROPERTIES_UPDATED = 'chat.custom_properties.updated'
888
880
  }
889
881
 
890
882
  export type IntegrationLogMetadataType<T extends IntegrationLogType> =
@@ -1612,3 +1604,4 @@ export type ZohodeskIntegrationTokenType = OverrideProperties<
1612
1604
  };
1613
1605
  }
1614
1606
  >;
1607
+