@periskope/types 0.6.4 → 0.6.5

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.
@@ -51,7 +51,15 @@ export interface Database {
51
51
  last_read_timestamp?: string | null;
52
52
  org_id?: string;
53
53
  };
54
- Relationships: [];
54
+ Relationships: [
55
+ {
56
+ foreignKeyName: "tbl_chat_access_org_id_fkey";
57
+ columns: ["org_id"];
58
+ isOneToOne: false;
59
+ referencedRelation: "tbl_org";
60
+ referencedColumns: ["org_id"];
61
+ }
62
+ ];
55
63
  };
56
64
  tbl_chat_messages: {
57
65
  Row: {
@@ -80,15 +88,16 @@ export interface Database {
80
88
  media_key: string | null;
81
89
  mentioned_ids: string[] | null;
82
90
  message_id: string;
91
+ message_type: string | null;
83
92
  order_id: string | null;
84
93
  org_id: string;
85
94
  org_phone: string;
86
95
  performed_by: string | null;
87
96
  raw_data: Json | null;
97
+ sender_phone: string | null;
88
98
  timestamp: string | null;
89
99
  to: string | null;
90
100
  token: string | null;
91
- type: string | null;
92
101
  url: string | null;
93
102
  vcards: string[] | null;
94
103
  };
@@ -118,15 +127,16 @@ export interface Database {
118
127
  media_key?: string | null;
119
128
  mentioned_ids?: string[] | null;
120
129
  message_id: string;
130
+ message_type?: string | null;
121
131
  order_id?: string | null;
122
132
  org_id: string;
123
133
  org_phone: string;
124
134
  performed_by?: string | null;
125
135
  raw_data?: Json | null;
136
+ sender_phone?: string | null;
126
137
  timestamp?: string | null;
127
138
  to?: string | null;
128
139
  token?: string | null;
129
- type?: string | null;
130
140
  url?: string | null;
131
141
  vcards?: string[] | null;
132
142
  };
@@ -156,15 +166,16 @@ export interface Database {
156
166
  media_key?: string | null;
157
167
  mentioned_ids?: string[] | null;
158
168
  message_id?: string;
169
+ message_type?: string | null;
159
170
  order_id?: string | null;
160
171
  org_id?: string;
161
172
  org_phone?: string;
162
173
  performed_by?: string | null;
163
174
  raw_data?: Json | null;
175
+ sender_phone?: string | null;
164
176
  timestamp?: string | null;
165
177
  to?: string | null;
166
178
  token?: string | null;
167
- type?: string | null;
168
179
  url?: string | null;
169
180
  vcards?: string[] | null;
170
181
  };
@@ -319,7 +330,7 @@ export interface Database {
319
330
  is_group: boolean | null;
320
331
  is_muted: boolean | null;
321
332
  is_read_only: boolean | null;
322
- label_ids: string[] | null;
333
+ label_ids: Json;
323
334
  mute_expiration: number | null;
324
335
  name: string | null;
325
336
  org_id: string;
@@ -338,7 +349,7 @@ export interface Database {
338
349
  is_group?: boolean | null;
339
350
  is_muted?: boolean | null;
340
351
  is_read_only?: boolean | null;
341
- label_ids?: string[] | null;
352
+ label_ids?: Json;
342
353
  mute_expiration?: number | null;
343
354
  name?: string | null;
344
355
  org_id: string;
@@ -357,7 +368,7 @@ export interface Database {
357
368
  is_group?: boolean | null;
358
369
  is_muted?: boolean | null;
359
370
  is_read_only?: boolean | null;
360
- label_ids?: string[] | null;
371
+ label_ids?: Json;
361
372
  mute_expiration?: number | null;
362
373
  name?: string | null;
363
374
  org_id?: string;
@@ -366,71 +377,82 @@ export interface Database {
366
377
  timestamp?: string | null;
367
378
  unread_count?: number | null;
368
379
  };
369
- Relationships: [];
380
+ Relationships: [
381
+ {
382
+ foreignKeyName: "tbl_chats_org_id_fkey";
383
+ columns: ["org_id"];
384
+ isOneToOne: false;
385
+ referencedRelation: "tbl_org";
386
+ referencedColumns: ["org_id"];
387
+ }
388
+ ];
370
389
  };
371
390
  tbl_contacts: {
372
391
  Row: {
373
392
  contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null;
374
393
  contact_id: string;
375
394
  contact_image: string | null;
395
+ contact_type: string | null;
376
396
  id: Json | null;
377
397
  is_blocked: boolean | null;
378
398
  is_business: boolean | null;
379
399
  is_enterprise: boolean | null;
380
400
  is_group: boolean | null;
401
+ is_internal: boolean | null;
381
402
  is_me: boolean | null;
382
403
  is_my_contact: boolean | null;
383
404
  is_user: boolean | null;
384
405
  is_wa_contact: boolean | null;
385
- label_ids: string[] | null;
406
+ label_ids: Json;
386
407
  name: string | null;
387
408
  number: string | null;
388
409
  org_id: string;
389
410
  pushname: string | null;
390
411
  short_name: string | null;
391
- type: string | null;
392
412
  };
393
413
  Insert: {
394
414
  contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null;
395
415
  contact_id: string;
396
416
  contact_image?: string | null;
417
+ contact_type?: string | null;
397
418
  id?: Json | null;
398
419
  is_blocked?: boolean | null;
399
420
  is_business?: boolean | null;
400
421
  is_enterprise?: boolean | null;
401
422
  is_group?: boolean | null;
423
+ is_internal?: boolean | null;
402
424
  is_me?: boolean | null;
403
425
  is_my_contact?: boolean | null;
404
426
  is_user?: boolean | null;
405
427
  is_wa_contact?: boolean | null;
406
- label_ids?: string[] | null;
428
+ label_ids?: Json;
407
429
  name?: string | null;
408
430
  number?: string | null;
409
431
  org_id: string;
410
432
  pushname?: string | null;
411
433
  short_name?: string | null;
412
- type?: string | null;
413
434
  };
414
435
  Update: {
415
436
  contact_color?: Database["public"]["Enums"]["enum_chat_colors"] | null;
416
437
  contact_id?: string;
417
438
  contact_image?: string | null;
439
+ contact_type?: string | null;
418
440
  id?: Json | null;
419
441
  is_blocked?: boolean | null;
420
442
  is_business?: boolean | null;
421
443
  is_enterprise?: boolean | null;
422
444
  is_group?: boolean | null;
445
+ is_internal?: boolean | null;
423
446
  is_me?: boolean | null;
424
447
  is_my_contact?: boolean | null;
425
448
  is_user?: boolean | null;
426
449
  is_wa_contact?: boolean | null;
427
- label_ids?: string[] | null;
450
+ label_ids?: Json;
428
451
  name?: string | null;
429
452
  number?: string | null;
430
453
  org_id?: string;
431
454
  pushname?: string | null;
432
455
  short_name?: string | null;
433
- type?: string | null;
434
456
  };
435
457
  Relationships: [
436
458
  {
@@ -562,6 +584,8 @@ export interface Database {
562
584
  org_id: string;
563
585
  org_phone: string | null;
564
586
  phone_id: string;
587
+ phone_image: string | null;
588
+ phone_name: string | null;
565
589
  qr_code: string | null;
566
590
  updated_at: string;
567
591
  wa_state: string | null;
@@ -572,6 +596,8 @@ export interface Database {
572
596
  org_id: string;
573
597
  org_phone?: string | null;
574
598
  phone_id?: string;
599
+ phone_image?: string | null;
600
+ phone_name?: string | null;
575
601
  qr_code?: string | null;
576
602
  updated_at?: string;
577
603
  wa_state?: string | null;
@@ -582,6 +608,8 @@ export interface Database {
582
608
  org_id?: string;
583
609
  org_phone?: string | null;
584
610
  phone_id?: string;
611
+ phone_image?: string | null;
612
+ phone_name?: string | null;
585
613
  qr_code?: string | null;
586
614
  updated_at?: string;
587
615
  wa_state?: string | null;
@@ -598,59 +626,6 @@ export interface Database {
598
626
  };
599
627
  };
600
628
  Views: {
601
- view_chat_messages: {
602
- Row: {
603
- ack: string | null;
604
- author: string | null;
605
- body: string | null;
606
- broadcast: boolean | null;
607
- chat_id: string | null;
608
- contact_color: Database["public"]["Enums"]["enum_chat_colors"] | null;
609
- device_type: string | null;
610
- duration: string | null;
611
- forwarding_score: number | null;
612
- from: string | null;
613
- from_me: boolean | null;
614
- has_media: boolean | null;
615
- has_quoted_msg: boolean | null;
616
- has_reaction: boolean | null;
617
- id: Json | null;
618
- invite_v4: Json | null;
619
- is_ephemeral: boolean | null;
620
- is_forwarded: boolean | null;
621
- is_gif: boolean | null;
622
- is_starred: boolean | null;
623
- is_status: boolean | null;
624
- links: Json | null;
625
- location: Json | null;
626
- media_key: string | null;
627
- mentioned_ids: string[] | null;
628
- message_id: string | null;
629
- name: string | null;
630
- order_id: string | null;
631
- org_id: string | null;
632
- org_phone: string | null;
633
- performed_by: string | null;
634
- pushname: string | null;
635
- raw_data: Json | null;
636
- sender_phone: string | null;
637
- timestamp: string | null;
638
- to: string | null;
639
- token: string | null;
640
- type: string | null;
641
- url: string | null;
642
- vcards: string[] | null;
643
- };
644
- Relationships: [
645
- {
646
- foreignKeyName: "tbl_chat_messages_fkey_tbl_org_phones";
647
- columns: ["org_id", "org_phone"];
648
- isOneToOne: false;
649
- referencedRelation: "tbl_org_phones";
650
- referencedColumns: ["org_id", "org_phone"];
651
- }
652
- ];
653
- };
654
629
  view_chats: {
655
630
  Row: {
656
631
  archived: boolean | null;
@@ -665,11 +640,12 @@ export interface Database {
665
640
  is_group: boolean | null;
666
641
  is_muted: boolean | null;
667
642
  is_read_only: boolean | null;
668
- label_ids: string[] | null;
643
+ label_ids: Json | null;
669
644
  last_read_timestamp: string | null;
670
645
  latest_message: Json | null;
671
646
  latest_message_timestamp: string | null;
672
647
  member_count: number | null;
648
+ message_unread_count: number | null;
673
649
  mute_expiration: number | null;
674
650
  name: string | null;
675
651
  org_id: string | null;
@@ -679,7 +655,15 @@ export interface Database {
679
655
  timestamp: string | null;
680
656
  unread_count: number | null;
681
657
  };
682
- Relationships: [];
658
+ Relationships: [
659
+ {
660
+ foreignKeyName: "tbl_chats_org_id_fkey";
661
+ columns: ["org_id"];
662
+ isOneToOne: false;
663
+ referencedRelation: "tbl_org";
664
+ referencedColumns: ["org_id"];
665
+ }
666
+ ];
683
667
  };
684
668
  };
685
669
  Functions: {
@@ -700,7 +684,7 @@ export interface Database {
700
684
  };
701
685
  get_contacts: {
702
686
  Args: {
703
- contact_id_input?: string;
687
+ contact_ids_input?: string[];
704
688
  };
705
689
  Returns: Json;
706
690
  };
@@ -725,6 +709,14 @@ export interface Database {
725
709
  Args: Record<PropertyKey, never>;
726
710
  Returns: Database["public"]["Enums"]["enum_member_role"];
727
711
  };
712
+ update_labels: {
713
+ Args: {
714
+ tbl_type: string;
715
+ label_ids_input: Json;
716
+ row_id_input: string[];
717
+ };
718
+ Returns: undefined;
719
+ };
728
720
  };
729
721
  Enums: {
730
722
  enum_chat_colors: "#B4876E" | "#A5B337" | "#06CF9C" | "#25D366" | "#02A698" | "#7D9EF1" | "#007BFC" | "#5E47DE" | "#7F66FF" | "#9333EA" | "#FA6533" | "#C4532D" | "#DC2626" | "#FF2E74" | "#DB2777";
package/dist/types.d.ts CHANGED
@@ -12,25 +12,25 @@ export type OrgType = Tables<'tbl_org'> & {
12
12
  phones: Tables<'tbl_org_phones'>[];
13
13
  labels: Tables<'tbl_org_labels'>[];
14
14
  };
15
+ export type ChatMemberType = Merge<Tables<'tbl_chat_participants'>, Tables<'tbl_contacts'>>;
15
16
  export type ChatType = Merge<Tables<'view_chats'>, {
16
17
  chat_id: string;
17
18
  latest_message: MessageType | null;
18
- members: (Tables<'tbl_chat_participants'> & Partial<Tables<'tbl_contacts'>>)[] | null;
19
- notifications: Tables<'tbl_chat_notifications'>[] | null;
19
+ members: Record<string, ChatMemberType> | null;
20
20
  chat_type: 'user' | 'group' | 'business';
21
21
  active_phone?: boolean;
22
22
  org_participants?: Tables<'tbl_chat_participants'>[];
23
- chat_access?: {
24
- email: string;
25
- has_access: boolean | null;
26
- }[];
23
+ chat_access: Record<string, boolean>;
24
+ label_ids: Record<string, boolean>;
27
25
  }>;
28
- export type MessageType = OverrideProperties<Tables<'view_chat_messages'>, {
29
- type: MessageTypes;
26
+ export type MessageType = OverrideProperties<Tables<'tbl_chat_messages'>, {
27
+ message_type: MessageTypes;
30
28
  }>;
31
29
  export type ContactType = Merge<Tables<'tbl_contacts'>, {
32
30
  chats: ChatType[] | null;
33
31
  chat_count: number | null;
32
+ chat_ids: string[] | null;
34
33
  }>;
34
+ export type ChatAccessType = Merge<Partial<Tables<'tbl_chat_access'>>, Tables<'tbl_org_members'>>;
35
35
  export declare const labelColors: string[];
36
36
  export declare const enumChatColors: readonly ["#B4876E", "#A5B337", "#06CF9C", "#25D366", "#02A698", "#7D9EF1", "#007BFC", "#5E47DE", "#7F66FF", "#9333EA", "#FA6533", "#C4532D", "#DC2626", "#FF2E74", "#DB2777"];
package/dist/types.js CHANGED
@@ -10,7 +10,19 @@ exports.labelColors = [
10
10
  '#F97316',
11
11
  ];
12
12
  exports.enumChatColors = [
13
- "#B4876E", "#A5B337", "#06CF9C", "#25D366", "#02A698",
14
- "#7D9EF1", "#007BFC", "#5E47DE", "#7F66FF", "#9333EA",
15
- "#FA6533", "#C4532D", "#DC2626", "#FF2E74", "#DB2777"
13
+ '#B4876E',
14
+ '#A5B337',
15
+ '#06CF9C',
16
+ '#25D366',
17
+ '#02A698',
18
+ '#7D9EF1',
19
+ '#007BFC',
20
+ '#5E47DE',
21
+ '#7F66FF',
22
+ '#9333EA',
23
+ '#FA6533',
24
+ '#C4532D',
25
+ '#DC2626',
26
+ '#FF2E74',
27
+ '#DB2777',
16
28
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@periskope/types",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",