notification-template.interface.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import type { BuilderFieldType, BuilderGroupValues, TemplateVariableTypeEnum, FilterParts } from '../../types';
  2. import { IMessageTemplate } from '../message-template';
  3. import { IPreferenceChannels } from '../subscriber-preference';
  4. import { IWorkflowStepMetadata } from '../step';
  5. export interface INotificationTemplate {
  6. _id?: string;
  7. name: string;
  8. description?: string;
  9. _notificationGroupId: string;
  10. _parentId?: string;
  11. _environmentId: string;
  12. tags: string[];
  13. draft?: boolean;
  14. active: boolean;
  15. critical: boolean;
  16. preferenceSettings: IPreferenceChannels;
  17. createdAt?: string;
  18. updatedAt?: string;
  19. steps: INotificationTemplateStep[];
  20. triggers: INotificationTrigger[];
  21. isBlueprint?: boolean;
  22. }
  23. export declare class IGroupedBlueprint {
  24. name: string;
  25. blueprints: INotificationTemplate[];
  26. }
  27. export declare enum TriggerTypeEnum {
  28. EVENT = "event"
  29. }
  30. export interface INotificationTrigger {
  31. type: TriggerTypeEnum;
  32. identifier: string;
  33. variables: INotificationTriggerVariable[];
  34. subscriberVariables?: INotificationTriggerVariable[];
  35. reservedVariables?: ITriggerReservedVariable[];
  36. }
  37. export declare enum TriggerContextTypeEnum {
  38. TENANT = "tenant",
  39. ACTOR = "actor"
  40. }
  41. export interface ITriggerReservedVariable {
  42. type: TriggerContextTypeEnum;
  43. variables: INotificationTriggerVariable[];
  44. }
  45. export interface INotificationTriggerVariable {
  46. name: string;
  47. value?: any;
  48. type?: TemplateVariableTypeEnum;
  49. }
  50. export interface IStepVariant {
  51. _id?: string;
  52. uuid?: string;
  53. name?: string;
  54. filters?: IMessageFilter[];
  55. _templateId?: string;
  56. _parentId?: string | null;
  57. template?: IMessageTemplate;
  58. active?: boolean;
  59. shouldStopOnFail?: boolean;
  60. replyCallback?: {
  61. active: boolean;
  62. url: string;
  63. };
  64. metadata?: IWorkflowStepMetadata;
  65. }
  66. export interface INotificationTemplateStep extends IStepVariant {
  67. variants?: IStepVariant[];
  68. }
  69. export interface IMessageFilter {
  70. isNegated?: boolean;
  71. type?: BuilderFieldType;
  72. value: BuilderGroupValues;
  73. children: FilterParts[];
  74. }
  75. //# sourceMappingURL=notification-template.interface.d.ts.map