@periskope/types 0.6.146 → 0.6.148

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/dist/types.d.ts CHANGED
@@ -134,6 +134,7 @@ export type ChatType = Merge<Tables<'view_chats'>, {
134
134
  };
135
135
  is_archived?: boolean;
136
136
  is_pinned?: boolean;
137
+ closed_at?: number;
137
138
  }>;
138
139
  export type MediaType = {
139
140
  path: string;
@@ -350,9 +351,11 @@ export declare enum IntegrationLogType {
350
351
  REACTION_UPDATED = "reaction.updated",
351
352
  NEW_TICKET = "ticket.created",
352
353
  TICKET_UPDATED = "ticket.updated",
353
- TICKET_DELETED = "ticket.deleted"
354
+ TICKET_DELETED = "ticket.deleted",
355
+ MESSAGE_FLAGGED = "message.flagged",
356
+ MESSAGE_UNFLAGGED = "message.unflagged"
354
357
  }
355
- export type IntegrationLogMetadataType<T extends IntegrationLogType> = T extends IntegrationLogType.NEW_TICKET | IntegrationLogType.TICKET_UPDATED ? TicketInfoType : T extends IntegrationLogType.NEW_CHAT ? Tables<'tbl_chats'> : T extends IntegrationLogType.NEW_MESSAGE | IntegrationLogType.MESSAGE_UPDATED | IntegrationLogType.MESSAGE_DELETED | IntegrationLogType.MESSAGE_ACK_UPDATED ? Tables<'tbl_chat_messages'> : T extends IntegrationLogType.REACTION_CREATED | IntegrationLogType.REACTION_UPDATED ? Tables<'tbl_chat_reactions'> : {
358
+ export type IntegrationLogMetadataType<T extends IntegrationLogType> = T extends IntegrationLogType.NEW_TICKET | IntegrationLogType.TICKET_UPDATED ? TicketInfoType : T extends IntegrationLogType.NEW_CHAT ? Tables<'tbl_chats'> : T extends IntegrationLogType.NEW_MESSAGE | IntegrationLogType.MESSAGE_UPDATED | IntegrationLogType.MESSAGE_DELETED | IntegrationLogType.MESSAGE_ACK_UPDATED | IntegrationLogType.MESSAGE_FLAGGED | IntegrationLogType.MESSAGE_UNFLAGGED ? Tables<'tbl_chat_messages'> : T extends IntegrationLogType.REACTION_CREATED | IntegrationLogType.REACTION_UPDATED ? Tables<'tbl_chat_reactions'> : {
356
359
  [key: string]: unknown;
357
360
  };
358
361
  export type IntegrationLogDetailsType<T extends IntegrationLogType> = OverrideProperties<Tables<'tbl_integration_logs'>, {
@@ -400,6 +403,9 @@ export type UserPreferences = {
400
403
  right_sidepanel_open: boolean;
401
404
  sync_wa_unread_count: boolean;
402
405
  pinned_chats: string[];
406
+ archived_chats: string[];
407
+ closed_chats: Record<string, number>;
408
+ periskope_chat_limit: number;
403
409
  };
404
410
  export type PollSendType = {
405
411
  pollName: string;
@@ -428,4 +434,49 @@ export type DeliveryInfoType = {
428
434
  read_count: number;
429
435
  delivered_count: number;
430
436
  };
437
+ export type OrgCreditsType = {
438
+ org_id: string;
439
+ recurring_allowance: number;
440
+ recurring_balance: number;
441
+ topup_balance: number;
442
+ total_credits_used: number;
443
+ next_renewal_date: string;
444
+ };
445
+ export type ChatRuleInfoType = Merge<Pick<Tables<'view_chats'>, 'assigned_to' | 'chat_id' | 'chat_name' | 'chat_type' | 'created_at' | 'group_description' | 'info_admins_only' | 'is_exited' | 'is_muted' | 'org_id' | 'org_phone' | 'chat_org_phones' | 'messages_admins_only' | 'custom_properties'>, {
446
+ has_flagged_messages: boolean;
447
+ labels: string[];
448
+ members: string[];
449
+ custom_properties: {
450
+ [key: string]: string;
451
+ } | null;
452
+ }>;
453
+ 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'>, {
454
+ is_internal: boolean;
455
+ labels: string[] | null;
456
+ }>;
457
+ export type MessageRuleInfoType = {
458
+ chat: ChatRuleInfoType;
459
+ sender: SenderRuleInfoType;
460
+ 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'>, {
461
+ media: MediaType | null;
462
+ }>;
463
+ };
464
+ export type ReactionRuleInfoType = {
465
+ chat: ChatRuleInfoType;
466
+ sender: SenderRuleInfoType;
467
+ message: MessageRuleInfoType['message'];
468
+ reaction: Pick<Tables<'tbl_chat_reactions'>, 'reaction' | 'sender_id' | 'message_id' | 'chat_id' | 'reaction_id'>;
469
+ };
470
+ export type TicketRuleInfoType = {
471
+ chat: ChatRuleInfoType;
472
+ sender: SenderRuleInfoType;
473
+ 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'>, {
474
+ labels: string[] | null;
475
+ custom_properties: {
476
+ [key: string]: string;
477
+ } | null;
478
+ }>;
479
+ message: MessageRuleInfoType['message'];
480
+ };
481
+ export type FeatureFlagReturnType = Record<string, boolean>;
431
482
  export {};
package/dist/types.js CHANGED
@@ -69,4 +69,6 @@ var IntegrationLogType;
69
69
  IntegrationLogType["NEW_TICKET"] = "ticket.created";
70
70
  IntegrationLogType["TICKET_UPDATED"] = "ticket.updated";
71
71
  IntegrationLogType["TICKET_DELETED"] = "ticket.deleted";
72
+ IntegrationLogType["MESSAGE_FLAGGED"] = "message.flagged";
73
+ IntegrationLogType["MESSAGE_UNFLAGGED"] = "message.unflagged";
72
74
  })(IntegrationLogType || (exports.IntegrationLogType = IntegrationLogType = {}));
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.146",
3
+ "version": "0.6.148",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",