@periskope/types 0.6.441 → 0.6.442

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.
@@ -63,7 +63,10 @@ export type TicketRulesInfoType = Merge<
63
63
  >,
64
64
  {
65
65
  id: 'ticket.ticket_id';
66
- type: `ticket.${'created' | 'updated' | 'closed'}` | 'ticket.label.updated';
66
+ type:
67
+ | `ticket.${'created' | 'updated' | 'closed'}`
68
+ | 'ticket.label.updated'
69
+ | 'ticket.message.attached';
67
70
  org_id: string;
68
71
  rule: Tables<'tbl_automation_rules'>[];
69
72
  }
@@ -1250,6 +1253,15 @@ export type AddChatLabelAction = {
1250
1253
  };
1251
1254
  };
1252
1255
 
1256
+ export type RemoveChatLabelAction = {
1257
+ id: string;
1258
+ type: 'remove_chat_label';
1259
+ delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
1260
+ metadata: {
1261
+ label: string;
1262
+ };
1263
+ };
1264
+
1253
1265
  export type AddTicketLabelAction = {
1254
1266
  id: string;
1255
1267
  type: 'add_ticket_label';
@@ -1259,6 +1271,15 @@ export type AddTicketLabelAction = {
1259
1271
  };
1260
1272
  };
1261
1273
 
1274
+ export type RemoveTicketLabelAction = {
1275
+ id: string;
1276
+ type: 'remove_ticket_label';
1277
+ delay: `${number} ${'seconds' | 'minutes' | 'hours' | 'days'}`;
1278
+ metadata: {
1279
+ label: string;
1280
+ };
1281
+ };
1282
+
1262
1283
  export type SetTicketDueDateAction = {
1263
1284
  id: string;
1264
1285
  type: 'set_ticket_due_date';
@@ -1433,7 +1454,9 @@ export type Action =
1433
1454
  | FreshdeskCreateTicketAction
1434
1455
  | HubspotCreateTicketAction
1435
1456
  | ZohodeskCreateTicketAction
1436
- | SendPollOptionAction;
1457
+ | SendPollOptionAction
1458
+ | RemoveChatLabelAction
1459
+ | RemoveTicketLabelAction;
1437
1460
 
1438
1461
  export const isSendMessageOrReplyToMessageAction = (
1439
1462
  action: Action
@@ -1457,7 +1480,8 @@ export type TriggerRuleType =
1457
1480
  | 'task.created'
1458
1481
  | 'task.assignee.updated'
1459
1482
  | 'call.created'
1460
- | 'member.joined';
1483
+ | 'member.joined'
1484
+ | 'ticket.message.attached';
1461
1485
 
1462
1486
  export type Rule = OverrideProperties<
1463
1487
  Tables<'tbl_automation_rules'>,
@@ -1590,6 +1614,13 @@ export const RuleNameMap: Record<
1590
1614
  org_phone: true,
1591
1615
  },
1592
1616
  },
1617
+ 'ticket.message.attached': {
1618
+ title: 'Message Attached to Ticket',
1619
+ description: 'When a message is attached to a ticket',
1620
+ base_conditions: {
1621
+ org_phone: false,
1622
+ },
1623
+ },
1593
1624
  };
1594
1625
 
1595
1626
  export type ValidateFunction<T extends any[] = any[]> = (...args: T) => boolean;
@@ -1719,6 +1750,7 @@ export const ActionNameMap: ActionNameMapType = {
1719
1750
  'task.assignee.updated',
1720
1751
  'ticket.label.updated',
1721
1752
  'member.joined',
1753
+ 'ticket.message.attached',
1722
1754
  ],
1723
1755
  validate: () => true,
1724
1756
  },
@@ -1786,6 +1818,7 @@ export const ActionNameMap: ActionNameMapType = {
1786
1818
  'task.created',
1787
1819
  'task.assignee.updated',
1788
1820
  'ticket.label.updated',
1821
+ 'ticket.message.attached',
1789
1822
  ],
1790
1823
  validate: () => true,
1791
1824
  },
@@ -1867,6 +1900,7 @@ export const ActionNameMap: ActionNameMapType = {
1867
1900
  'task.assignee.updated',
1868
1901
  'ticket.label.updated',
1869
1902
  'member.joined',
1903
+ 'ticket.message.attached',
1870
1904
  ],
1871
1905
  validate: () => true,
1872
1906
  },
@@ -1884,6 +1918,7 @@ export const ActionNameMap: ActionNameMapType = {
1884
1918
  'ticket.closed',
1885
1919
  'message.unflagged',
1886
1920
  'ticket.label.updated',
1921
+ 'ticket.message.attached',
1887
1922
  ],
1888
1923
  validate: () => true,
1889
1924
  },
@@ -1949,6 +1984,7 @@ export const ActionNameMap: ActionNameMapType = {
1949
1984
  'task.assignee.updated',
1950
1985
  'ticket.label.updated',
1951
1986
  'member.joined',
1987
+ 'ticket.message.attached',
1952
1988
  ],
1953
1989
  validate: () => true,
1954
1990
  },
@@ -2086,6 +2122,7 @@ export const ActionNameMap: ActionNameMapType = {
2086
2122
  'task.created',
2087
2123
  'task.assignee.updated',
2088
2124
  'ticket.label.updated',
2125
+ 'ticket.message.attached',
2089
2126
  ],
2090
2127
  validate: () => true,
2091
2128
  },
@@ -2152,6 +2189,7 @@ export const ActionNameMap: ActionNameMapType = {
2152
2189
  'task.created',
2153
2190
  'task.assignee.updated',
2154
2191
  'ticket.label.updated',
2192
+ 'ticket.message.attached',
2155
2193
  ],
2156
2194
  validate: () => true,
2157
2195
  },
@@ -2176,6 +2214,7 @@ export const ActionNameMap: ActionNameMapType = {
2176
2214
  'message.unflagged',
2177
2215
  'message.deleted',
2178
2216
  'ticket.label.updated',
2217
+ 'ticket.message.attached',
2179
2218
  ],
2180
2219
  validate: () => true,
2181
2220
  },
@@ -2206,6 +2245,38 @@ export const ActionNameMap: ActionNameMapType = {
2206
2245
  'message.unflagged',
2207
2246
  'ticket.closed',
2208
2247
  'member.joined',
2248
+ 'ticket.message.attached',
2249
+ ],
2250
+ validate: () => true,
2251
+ },
2252
+ remove_chat_label: {
2253
+ title: 'Remove Chat Label',
2254
+ description: 'Remove a label from a chat',
2255
+ inputs: {
2256
+ label: {
2257
+ id: 'label',
2258
+ type: 'dropdown',
2259
+ value: 'chat.labels',
2260
+ label: 'Label',
2261
+ placeholder: 'Select label',
2262
+ required: true,
2263
+ },
2264
+ },
2265
+ validTriggers: [
2266
+ 'message.created',
2267
+ 'call.created',
2268
+ 'message.updated',
2269
+ 'chat.created',
2270
+ 'ticket.updated',
2271
+ 'ticket.created',
2272
+ 'reaction.added',
2273
+ 'chat.label.updated',
2274
+ 'message.flagged',
2275
+ 'message.deleted',
2276
+ 'message.unflagged',
2277
+ 'ticket.closed',
2278
+ 'member.joined',
2279
+ 'ticket.message.attached',
2209
2280
  ],
2210
2281
  validate: () => true,
2211
2282
  },
@@ -2222,7 +2293,33 @@ export const ActionNameMap: ActionNameMapType = {
2222
2293
  required: true,
2223
2294
  },
2224
2295
  },
2225
- validTriggers: ['ticket.updated', 'ticket.created', 'ticket.label.updated'],
2296
+ validTriggers: [
2297
+ 'ticket.updated',
2298
+ 'ticket.created',
2299
+ 'ticket.label.updated',
2300
+ 'ticket.message.attached',
2301
+ ],
2302
+ validate: () => true,
2303
+ },
2304
+ remove_ticket_label: {
2305
+ title: 'Remove Ticket Label',
2306
+ description: 'Remove a label from a ticket',
2307
+ inputs: {
2308
+ label: {
2309
+ id: 'label',
2310
+ type: 'dropdown',
2311
+ value: 'ticket.labels',
2312
+ label: 'Label',
2313
+ placeholder: 'Select label',
2314
+ required: true,
2315
+ },
2316
+ },
2317
+ validTriggers: [
2318
+ 'ticket.updated',
2319
+ 'ticket.created',
2320
+ 'ticket.label.updated',
2321
+ 'ticket.message.attached',
2322
+ ],
2226
2323
  validate: () => true,
2227
2324
  },
2228
2325
  set_ticket_due_date: {
@@ -2244,6 +2341,7 @@ export const ActionNameMap: ActionNameMapType = {
2244
2341
  'reaction.added',
2245
2342
  'ticket.label.updated',
2246
2343
  'ticket.closed',
2344
+ 'ticket.message.attached',
2247
2345
  ],
2248
2346
  validate: () => true,
2249
2347
  },
@@ -2265,6 +2363,7 @@ export const ActionNameMap: ActionNameMapType = {
2265
2363
  'ticket.closed',
2266
2364
  'ticket.label.updated',
2267
2365
  'member.joined',
2366
+ 'ticket.message.attached',
2268
2367
  ],
2269
2368
  inputs: {
2270
2369
  property_id: {
@@ -2295,6 +2394,7 @@ export const ActionNameMap: ActionNameMapType = {
2295
2394
  'reaction.added',
2296
2395
  'ticket.closed',
2297
2396
  'ticket.label.updated',
2397
+ 'ticket.message.attached',
2298
2398
  ],
2299
2399
  inputs: {
2300
2400
  property_id: {
@@ -2389,6 +2489,7 @@ export const ActionNameMap: ActionNameMapType = {
2389
2489
  'task.assignee.updated',
2390
2490
  'ticket.label.updated',
2391
2491
  'member.joined',
2492
+ 'ticket.message.attached',
2392
2493
  ],
2393
2494
  validate: () => true,
2394
2495
  },
@@ -2411,6 +2512,7 @@ export const ActionNameMap: ActionNameMapType = {
2411
2512
  'ticket.closed',
2412
2513
  'ticket.label.updated',
2413
2514
  'member.joined',
2515
+ 'ticket.message.attached',
2414
2516
  ],
2415
2517
  validate: () => true,
2416
2518
  },
@@ -2489,6 +2591,7 @@ export const ActionNameMap: ActionNameMapType = {
2489
2591
  'task.assignee.updated',
2490
2592
  'ticket.label.updated',
2491
2593
  'member.joined',
2594
+ 'ticket.message.attached',
2492
2595
  ],
2493
2596
  validate: () => true,
2494
2597
  },
@@ -2512,6 +2615,7 @@ export const ActionNameMap: ActionNameMapType = {
2512
2615
  'task.created',
2513
2616
  'task.assignee.updated',
2514
2617
  'member.joined',
2618
+ 'ticket.message.attached',
2515
2619
  ],
2516
2620
  inputs: {
2517
2621
  webhook_url: {
@@ -2681,6 +2785,7 @@ export const editorVariables: Array<{
2681
2785
  'ticket.created',
2682
2786
  'ticket.closed',
2683
2787
  'ticket.label.updated',
2788
+ 'ticket.message.attached',
2684
2789
  ],
2685
2790
  },
2686
2791
  {
@@ -2691,6 +2796,7 @@ export const editorVariables: Array<{
2691
2796
  'ticket.created',
2692
2797
  'ticket.closed',
2693
2798
  'ticket.label.updated',
2799
+ 'ticket.message.attached',
2694
2800
  ],
2695
2801
  },
2696
2802
  {
@@ -2701,6 +2807,7 @@ export const editorVariables: Array<{
2701
2807
  'ticket.created',
2702
2808
  'ticket.closed',
2703
2809
  'ticket.label.updated',
2810
+ 'ticket.message.attached',
2704
2811
  ],
2705
2812
  },
2706
2813
  {
@@ -2711,6 +2818,7 @@ export const editorVariables: Array<{
2711
2818
  'ticket.created',
2712
2819
  'ticket.closed',
2713
2820
  'ticket.label.updated',
2821
+ 'ticket.message.attached',
2714
2822
  ],
2715
2823
  },
2716
2824
  {
@@ -2721,6 +2829,7 @@ export const editorVariables: Array<{
2721
2829
  'ticket.created',
2722
2830
  'ticket.closed',
2723
2831
  'ticket.label.updated',
2832
+ 'ticket.message.attached',
2724
2833
  ],
2725
2834
  },
2726
2835
  {
@@ -2731,6 +2840,7 @@ export const editorVariables: Array<{
2731
2840
  'ticket.created',
2732
2841
  'ticket.closed',
2733
2842
  'ticket.label.updated',
2843
+ 'ticket.message.attached',
2734
2844
  ],
2735
2845
  },
2736
2846
  {
@@ -2908,6 +3018,7 @@ export const editorVariables: Array<{
2908
3018
  'message.deleted',
2909
3019
  'task.created',
2910
3020
  'task.assignee.updated',
3021
+ 'ticket.message.attached',
2911
3022
  ],
2912
3023
  },
2913
3024
  {
@@ -2928,6 +3039,7 @@ export const editorVariables: Array<{
2928
3039
  'message.deleted',
2929
3040
  'task.created',
2930
3041
  'task.assignee.updated',
3042
+ 'ticket.message.attached',
2931
3043
  ],
2932
3044
  },
2933
3045
  {
@@ -2947,6 +3059,7 @@ export const editorVariables: Array<{
2947
3059
  'message.deleted',
2948
3060
  'task.created',
2949
3061
  'task.assignee.updated',
3062
+ 'ticket.message.attached',
2950
3063
  ],
2951
3064
  },
2952
3065
  {
@@ -2967,6 +3080,7 @@ export const editorVariables: Array<{
2967
3080
  'message.deleted',
2968
3081
  'task.created',
2969
3082
  'task.assignee.updated',
3083
+ 'ticket.message.attached',
2970
3084
  ],
2971
3085
  },
2972
3086
  {
@@ -2986,6 +3100,7 @@ export const editorVariables: Array<{
2986
3100
  'message.deleted',
2987
3101
  'task.created',
2988
3102
  'task.assignee.updated',
3103
+ 'ticket.message.attached',
2989
3104
  ],
2990
3105
  },
2991
3106
  {
@@ -3006,6 +3121,7 @@ export const editorVariables: Array<{
3006
3121
  'message.deleted',
3007
3122
  'task.created',
3008
3123
  'task.assignee.updated',
3124
+ 'ticket.message.attached',
3009
3125
  ],
3010
3126
  },
3011
3127
  {
@@ -3026,6 +3142,7 @@ export const editorVariables: Array<{
3026
3142
  'message.deleted',
3027
3143
  'task.created',
3028
3144
  'task.assignee.updated',
3145
+ 'ticket.message.attached',
3029
3146
  ],
3030
3147
  },
3031
3148
  {
@@ -3125,4 +3242,5 @@ export const variablesExclusionList: Record<
3125
3242
  'task.assignee.updated': [],
3126
3243
  'call.created': [],
3127
3244
  'member.joined': [],
3245
+ 'ticket.message.attached': [],
3128
3246
  };