@periskope/types 0.6.244 → 0.6.246

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.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@periskope/types",
3
- "version": "0.6.244",
3
+ "version": "0.6.246",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "dependencies": {
8
8
  "@types/pg": "8.11.2",
9
9
  "pg": "^8.11.3",
10
- "stripe": "^17.6.0",
10
+ "stripe": "17.6.0",
11
11
  "ts-node": "^10.9.2",
12
12
  "type-fest": "^4.8.3"
13
13
  },
@@ -819,6 +819,10 @@ export type CreateTicketAction = {
819
819
  append_to_latest_ticket?: 'true' | 'false';
820
820
  round_robin?: 'true' | 'false';
821
821
  assignee?: string;
822
+ rr_check_for?:
823
+ | 'shift_time'
824
+ | 'user_status'
825
+ | 'shift_time user_status'
822
826
  };
823
827
  };
824
828
 
@@ -838,6 +842,10 @@ export type AssignTicketAction = {
838
842
  metadata: {
839
843
  assignee: string;
840
844
  round_robin: 'true' | 'false';
845
+ rr_check_for?:
846
+ | 'shift_time'
847
+ | 'user_status'
848
+ | 'shift_time user_status'
841
849
  };
842
850
  };
843
851
 
@@ -875,6 +883,10 @@ export type AssignChatAction = {
875
883
  metadata: {
876
884
  assignee: string;
877
885
  round_robin: 'true' | 'false';
886
+ rr_check_for?:
887
+ | 'shift_time'
888
+ | 'user_status'
889
+ | 'shift_time user_status'
878
890
  };
879
891
  };
880
892
 
@@ -1375,6 +1387,31 @@ export const ActionNameMap: Record<
1375
1387
  info: 'If enabled, the ticket will be assigned to the next available agent in the list',
1376
1388
  required: false,
1377
1389
  },
1390
+ rr_check_for: {
1391
+ id: 'rr_check_for',
1392
+ type: 'dropdown',
1393
+ value: [
1394
+ {
1395
+ id: 'shift_time',
1396
+ value: 'shift_time',
1397
+ label: 'Consider shift timings',
1398
+ },
1399
+ {
1400
+ id: 'user_status',
1401
+ value: 'user_status',
1402
+ label: 'Consider user online/offline status',
1403
+ },
1404
+ {
1405
+ id: 'shift_time user_status',
1406
+ value: 'shift_time user_status',
1407
+ label: 'Consider both shift timings and user status',
1408
+ },
1409
+ ],
1410
+ label: 'Check Assignee status for (Round Robin)',
1411
+ placeholder: 'Select...',
1412
+ info: 'Criteria for assigning the next available agent',
1413
+ required: false,
1414
+ },
1378
1415
  assignee: {
1379
1416
  id: 'assignee',
1380
1417
  type: 'dynamic',
@@ -1433,6 +1470,31 @@ export const ActionNameMap: Record<
1433
1470
  info: 'If enabled, the ticket will be assigned to the next available agent in the list',
1434
1471
  required: false,
1435
1472
  },
1473
+ rr_check_for: {
1474
+ id: 'rr_check_for',
1475
+ type: 'dropdown',
1476
+ value: [
1477
+ {
1478
+ id: 'shift_time',
1479
+ value: 'shift_time',
1480
+ label: 'Consider shift timings',
1481
+ },
1482
+ {
1483
+ id: 'user_status',
1484
+ value: 'user_status',
1485
+ label: 'Consider user online/offline status',
1486
+ },
1487
+ {
1488
+ id: 'shift_time user_status',
1489
+ value: 'shift_time user_status',
1490
+ label: 'Consider both shift timings and user status',
1491
+ },
1492
+ ],
1493
+ label: 'Check Assignee status for (Round Robin)',
1494
+ placeholder: 'Select...',
1495
+ info: 'Criteria for assigning the next available agent',
1496
+ required: false,
1497
+ },
1436
1498
  assignee: {
1437
1499
  id: 'assignee',
1438
1500
  type: 'dynamic',
@@ -1548,6 +1610,31 @@ export const ActionNameMap: Record<
1548
1610
  info: 'If enabled, the chat will be assigned to the next available agent in the list',
1549
1611
  required: false,
1550
1612
  },
1613
+ rr_check_for: {
1614
+ id: 'rr_check_for',
1615
+ type: 'dropdown',
1616
+ value: [
1617
+ {
1618
+ id: 'shift_time',
1619
+ value: 'shift_time',
1620
+ label: 'Consider shift timings',
1621
+ },
1622
+ {
1623
+ id: 'user_status',
1624
+ value: 'user_status',
1625
+ label: 'Consider user online/offline status',
1626
+ },
1627
+ {
1628
+ id: 'shift_time user_status',
1629
+ value: 'shift_time user_status',
1630
+ label: 'Consider both shift timings and user status',
1631
+ },
1632
+ ],
1633
+ label: 'Check Assignee status for (Round Robin)',
1634
+ placeholder: 'Select...',
1635
+ info: 'Criteria for assigning the next available agent',
1636
+ required: false,
1637
+ },
1551
1638
  assignee: {
1552
1639
  id: 'assignee',
1553
1640
  type: 'dynamic',
@@ -1592,10 +1592,12 @@ export type Database = {
1592
1592
  invited_at: string | null
1593
1593
  invited_by: string | null
1594
1594
  is_active: boolean
1595
+ is_online: boolean
1595
1596
  is_owner: boolean | null
1596
1597
  label_ids: string[] | null
1597
1598
  member_color: Database["public"]["Enums"]["enum_chat_colors"]
1598
1599
  member_image: string | null
1600
+ member_metadata: Json | null
1599
1601
  member_name: string | null
1600
1602
  org_id: string
1601
1603
  org_phones: string[] | null
@@ -1609,10 +1611,12 @@ export type Database = {
1609
1611
  invited_at?: string | null
1610
1612
  invited_by?: string | null
1611
1613
  is_active?: boolean
1614
+ is_online?: boolean
1612
1615
  is_owner?: boolean | null
1613
1616
  label_ids?: string[] | null
1614
1617
  member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1615
1618
  member_image?: string | null
1619
+ member_metadata?: Json | null
1616
1620
  member_name?: string | null
1617
1621
  org_id: string
1618
1622
  org_phones?: string[] | null
@@ -1626,10 +1630,12 @@ export type Database = {
1626
1630
  invited_at?: string | null
1627
1631
  invited_by?: string | null
1628
1632
  is_active?: boolean
1633
+ is_online?: boolean
1629
1634
  is_owner?: boolean | null
1630
1635
  label_ids?: string[] | null
1631
1636
  member_color?: Database["public"]["Enums"]["enum_chat_colors"]
1632
1637
  member_image?: string | null
1638
+ member_metadata?: Json | null
1633
1639
  member_name?: string | null
1634
1640
  org_id?: string
1635
1641
  org_phones?: string[] | null
package/src/types.ts CHANGED
@@ -230,12 +230,32 @@ type AccessScopes = {
230
230
  exports: boolean;
231
231
  };
232
232
 
233
+ export type OrgMembersType = OverrideProperties<
234
+ Tables<'tbl_org_members'>,
235
+ {
236
+ member_metadata: {
237
+ shift_times: {
238
+ [day in
239
+ | 'monday'
240
+ | 'tuesday'
241
+ | 'wednesday'
242
+ | 'thursday'
243
+ | 'friday'
244
+ | 'saturday'
245
+ | 'sunday']?: [[string, string]];
246
+ };
247
+ override_status: boolean;
248
+ [key: string]: any
249
+ };
250
+ }
251
+ >;
252
+
233
253
  export type OrgType = OverrideProperties<
234
254
  Merge<
235
255
  Tables<'tbl_org'>,
236
256
  {
237
- user: Tables<'tbl_org_members'>;
238
- members: Tables<'tbl_org_members'>[];
257
+ user: OrgMembersType;
258
+ members: OrgMembersType[];
239
259
  phones: Tables<'tbl_org_phones'>[];
240
260
  labels: Tables<'tbl_org_labels'>[];
241
261
  quick_replies: Tables<'tbl_quick_replies'>[];
@@ -443,6 +463,27 @@ export type PhoneType = OverrideProperties<
443
463
  }
444
464
  >;
445
465
 
466
+ export type PhoneInfoType = Merge<
467
+ Pick<
468
+ PhoneType,
469
+ | 'created_at'
470
+ | 'first_connected_at'
471
+ | 'is_ready'
472
+ | 'label_ids'
473
+ | 'org_id'
474
+ | 'org_phone'
475
+ | 'phone_id'
476
+ | 'phone_image'
477
+ | 'phone_name'
478
+ | 'qr_code'
479
+ | 'updated_at'
480
+ | 'wa_state'
481
+ >,
482
+ {
483
+ labels: string[];
484
+ }
485
+ >;
486
+
446
487
  /* -------------------------------- CONSTANTS ------------------------------- */
447
488
 
448
489
  export const labelColors = [
@@ -569,6 +610,7 @@ export type ScheduleMessagePayload = {
569
610
  is_repeat?: boolean | null;
570
611
  scheduled_at: string;
571
612
  repeat_config?: {
613
+ timezone?: string;
572
614
  repeat_ends?: string;
573
615
  repeat_interval?: RepeatIntervalType;
574
616
  repeat_value?: number;