@periskope/types 0.6.151 → 0.6.153

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.
@@ -2190,7 +2190,7 @@ export type Database = {
2190
2190
  enum_chat_colors: "#B4876E" | "#A5B337" | "#06CF9C" | "#25D366" | "#02A698" | "#7D9EF1" | "#007BFC" | "#5E47DE" | "#7F66FF" | "#9333EA" | "#FA6533" | "#C4532D" | "#DC2626" | "#FF2E74" | "#DB2777";
2191
2191
  enum_chat_tickets_status: "open" | "inprogress" | "closed" | "archived";
2192
2192
  enum_credit_transaction_type: "credit" | "debit";
2193
- enum_integration_name: "org.created" | "org.updated" | "org.member.created" | "org.member.updated" | "org.phone.created" | "org.phone.connected" | "org.phone.disconnected" | "org.subscription.trial_will_end" | "chat.created" | "chat.updated" | "chat.notification.created" | "message.created" | "message.updated" | "message.deleted" | "message.ack.updated" | "reaction.created" | "reaction.updated" | "ticket.created" | "ticket.updated" | "ticket.deleted" | "org.integrations.updated" | "message.flagged" | "message.unflagged";
2193
+ enum_integration_name: "org.created" | "org.updated" | "org.member.created" | "org.member.updated" | "org.phone.created" | "org.phone.connected" | "org.phone.disconnected" | "org.subscription.trial_will_end" | "chat.created" | "chat.updated" | "chat.notification.created" | "message.created" | "message.updated" | "message.deleted" | "message.ack.updated" | "reaction.created" | "reaction.updated" | "ticket.created" | "ticket.updated" | "ticket.deleted" | "org.integrations.updated" | "message.flagged" | "message.unflagged" | "chat.label.updated";
2194
2194
  enum_integration_type: "zapier" | "pabbly" | "api" | "webhook" | "hubspot" | "freshdesk" | "slack" | "jira" | "salesforce" | "zohodesk" | "gsheets";
2195
2195
  enum_member_role: "admin" | "member";
2196
2196
  };
package/dist/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { default as _Stripe } from 'stripe';
2
2
  import { Merge, OverrideProperties } from 'type-fest';
3
+ import { Rule } from "./rules.types";
3
4
  import { Tables, TablesUpdate } from './supabase.types';
4
5
  export declare enum AllPlans {
5
6
  FREE_TRIAL = "free-trial",
@@ -43,6 +44,7 @@ export type OrgPreferences = {
43
44
  sync_phone_contacts?: boolean;
44
45
  mask_phone_numbers?: boolean;
45
46
  show_sender_names?: boolean;
47
+ closed_chats?: Record<string, number>;
46
48
  };
47
49
  type OrgPreferenceKey = keyof OrgPreferences;
48
50
  export type OrgPreferencesValue = {
@@ -94,6 +96,7 @@ export type OrgType = OverrideProperties<Merge<Tables<'tbl_org'>, {
94
96
  is_freshdesk_connected: boolean;
95
97
  is_zohodesk_connected: boolean;
96
98
  access_scopes: AccessScopes;
99
+ rules: Rule[];
97
100
  }>, {
98
101
  org_plan: OrgPlan<AllPlans | Enterprise>;
99
102
  stripe_customer_details: _Stripe.Customer | null;
@@ -446,4 +449,41 @@ export type OrgCreditsType = {
446
449
  total_credits_used: number;
447
450
  next_renewal_date: string;
448
451
  };
452
+ export type ChatRuleInfoType = Merge<Pick<Tables<'view_chats'>, 'assigned_to' | 'chat_id' | 'chat_name' | 'chat_type' | 'created_at' | 'group_description' | 'info_admins_only' | 'is_muted' | 'org_id' | 'org_phone' | 'chat_org_phones' | 'messages_admins_only' | 'custom_properties'>, {
453
+ has_flagged_messages: boolean;
454
+ labels: string[];
455
+ members: string[];
456
+ custom_properties: {
457
+ [key: string]: string;
458
+ } | null;
459
+ }>;
460
+ export type SenderRuleInfoType = Merge<Omit<Merge<Tables<'tbl_contacts'>, Tables<'tbl_chat_participants'>>, 'verified_name' | 'verified_level' | 'updated_at' | 'short_name' | 'pushname' | 'periskope_name' | 'org_phone' | 'number' | 'name' | 'label_ids' | 'is_wa_contact' | 'is_user' | 'is_my_contact' | 'is_me' | 'is_imported' | 'is_group' | 'is_blocked' | 'contact_color' | 'business_profile' | 'id' | 'contact_image' | 'contact_type' | 'chat_id'>, {
461
+ is_internal: boolean;
462
+ labels: string[] | null;
463
+ }>;
464
+ export type MessageRuleInfoType = {
465
+ chat: ChatRuleInfoType;
466
+ sender: SenderRuleInfoType;
467
+ message: OverrideProperties<Omit<Tables<'tbl_chat_messages'>, 'vcards' | 'updated_at' | 'unique_id' | 'token' | 'to' | 'sent_message_id' | 'raw_data' | 'delivery_info' | 'poll_results' | 'poll_info' | 'order_id' | 'mentioned_ids' | 'media_key' | 'location' | 'links' | 'is_status' | 'is_starred' | 'is_gif' | 'is_forwarded' | 'is_ephemeral' | 'is_deleted' | 'fts' | 'quoted_message_id' | 'invite_v4' | 'id' | 'has_reaction' | 'has_media' | 'duration' | 'broadcast' | 'broadcast_id' | 'device_type' | 'forwarding_score' | 'from' | 'from_me' | 'message_ticket_id' | 'prev_body' | 'flag_response_time' | 'flag_metadata' | 'ack'>, {
468
+ media: MediaType | null;
469
+ }>;
470
+ };
471
+ export type ReactionRuleInfoType = {
472
+ chat: ChatRuleInfoType;
473
+ sender: SenderRuleInfoType;
474
+ message: MessageRuleInfoType['message'];
475
+ reaction: Pick<Tables<'tbl_chat_reactions'>, 'reaction' | 'sender_id' | 'message_id' | 'chat_id' | 'reaction_id'>;
476
+ };
477
+ export type TicketRuleInfoType = {
478
+ chat: ChatRuleInfoType;
479
+ sender: SenderRuleInfoType;
480
+ ticket: Merge<Pick<Tables<'tbl_chat_tickets'>, 'org_id' | 'status' | 'chat_id' | 'subject' | 'assignee' | 'due_date' | 'priority' | 'raised_by' | 'ticket_id' | 'created_at' | 'is_deleted'>, {
481
+ labels: string[] | null;
482
+ custom_properties: {
483
+ [key: string]: string;
484
+ } | null;
485
+ }>;
486
+ message: MessageRuleInfoType['message'];
487
+ };
488
+ export type FeatureFlagReturnType = Record<string, boolean>;
449
489
  export {};
package/index.ts CHANGED
@@ -1,3 +1,3 @@
1
+ export * from './rules.types';
1
2
  export * from './supabase.types';
2
3
  export * from './types';
3
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@periskope/types",
3
- "version": "0.6.151",
3
+ "version": "0.6.153",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",