messages.interface.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { INotificationTemplate } from '../notification-template';
  2. import { ButtonTypeEnum } from './action.enum';
  3. import { ChannelCTATypeEnum, ChannelTypeEnum, IEmailBlock, ActorTypeEnum } from '../../types';
  4. export interface IMessage {
  5. _id: string;
  6. _templateId: string;
  7. _environmentId: string;
  8. _organizationId: string;
  9. _notificationId: string;
  10. _subscriberId: string;
  11. template?: INotificationTemplate;
  12. templateIdentifier?: string;
  13. content: string | IEmailBlock[];
  14. channel: ChannelTypeEnum;
  15. seen: boolean;
  16. read: boolean;
  17. lastSeenDate: string;
  18. lastReadDate: string;
  19. createdAt: string;
  20. cta?: IMessageCTA;
  21. _feedId: string;
  22. _layoutId?: string;
  23. payload: Record<string, unknown>;
  24. actor?: IActor;
  25. }
  26. export interface IMessageCTA {
  27. type: ChannelCTATypeEnum;
  28. data: {
  29. url?: string;
  30. };
  31. action?: IMessageAction;
  32. }
  33. export interface IMessageAction {
  34. status?: MessageActionStatusEnum;
  35. buttons?: IMessageButton[];
  36. result: {
  37. payload?: Record<string, unknown>;
  38. type?: ButtonTypeEnum;
  39. };
  40. }
  41. export interface IMessageButton {
  42. type: ButtonTypeEnum;
  43. content: string;
  44. resultContent?: string;
  45. }
  46. export declare enum MessageActionStatusEnum {
  47. PENDING = "pending",
  48. DONE = "done"
  49. }
  50. export interface IActor {
  51. type: ActorTypeEnum;
  52. data: string | null;
  53. }
  54. //# sourceMappingURL=messages.interface.d.ts.map