@oneuptime/common 8.0.5312 → 8.0.5326

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.
Files changed (124) hide show
  1. package/Models/DatabaseModels/GlobalConfig.ts +90 -0
  2. package/Models/DatabaseModels/Index.ts +4 -0
  3. package/Models/DatabaseModels/Project.ts +27 -0
  4. package/Models/DatabaseModels/UserNotificationRule.ts +48 -0
  5. package/Models/DatabaseModels/UserNotificationSetting.ts +16 -0
  6. package/Models/DatabaseModels/UserOnCallLogTimeline.ts +48 -0
  7. package/Models/DatabaseModels/UserWhatsApp.ts +288 -0
  8. package/Models/DatabaseModels/WhatsAppLog.ts +884 -0
  9. package/Server/API/NotificationAPI.ts +4 -4
  10. package/Server/API/ProjectSSO.ts +41 -33
  11. package/Server/API/ShortLinkAPI.ts +33 -25
  12. package/Server/API/UserCallAPI.ts +82 -73
  13. package/Server/API/UserEmailAPI.ts +82 -73
  14. package/Server/API/UserOnCallLogTimelineAPI.ts +227 -214
  15. package/Server/API/UserPushAPI.ts +177 -169
  16. package/Server/API/UserSmsAPI.ts +82 -73
  17. package/Server/API/UserWhatsAppAPI.ts +136 -0
  18. package/Server/Infrastructure/Postgres/SchemaMigrations/1759838763506-MigrationName.ts +105 -0
  19. package/Server/Infrastructure/Postgres/SchemaMigrations/1759839342566-MigrationName.ts +71 -0
  20. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +4 -0
  21. package/Server/Services/Index.ts +4 -0
  22. package/Server/Services/MonitorService.ts +32 -4
  23. package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +36 -4
  24. package/Server/Services/OnCallDutyPolicyEscalationRuleTeamService.ts +34 -4
  25. package/Server/Services/OnCallDutyPolicyEscalationRuleUserService.ts +34 -4
  26. package/Server/Services/OnCallDutyPolicyScheduleService.ts +47 -6
  27. package/Server/Services/ProbeService.ts +17 -2
  28. package/Server/Services/UserNotificationRuleService.ts +258 -7
  29. package/Server/Services/UserNotificationSettingService.ts +60 -0
  30. package/Server/Services/UserWhatsAppService.ts +203 -0
  31. package/Server/Services/WhatsAppLogService.ts +15 -0
  32. package/Server/Services/WhatsAppService.ts +141 -0
  33. package/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.ts +17 -5
  34. package/Server/Types/Workflow/Components/Webhook.ts +2 -2
  35. package/Server/Utils/StartServer.ts +57 -31
  36. package/Server/Utils/WhatsAppTemplateUtil.ts +247 -0
  37. package/Types/Icon/IconProp.ts +1 -0
  38. package/Types/WhatsApp/WhatsAppMessage.ts +12 -0
  39. package/Types/WhatsApp/WhatsAppTemplates.ts +197 -0
  40. package/Types/WhatsAppStatus.ts +8 -0
  41. package/UI/Components/Icon/Icon.tsx +12 -0
  42. package/build/dist/Models/DatabaseModels/GlobalConfig.js +98 -0
  43. package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
  44. package/build/dist/Models/DatabaseModels/Index.js +4 -0
  45. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  46. package/build/dist/Models/DatabaseModels/Project.js +29 -0
  47. package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
  48. package/build/dist/Models/DatabaseModels/UserNotificationRule.js +48 -0
  49. package/build/dist/Models/DatabaseModels/UserNotificationRule.js.map +1 -1
  50. package/build/dist/Models/DatabaseModels/UserNotificationSetting.js +18 -0
  51. package/build/dist/Models/DatabaseModels/UserNotificationSetting.js.map +1 -1
  52. package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js +48 -0
  53. package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js.map +1 -1
  54. package/build/dist/Models/DatabaseModels/UserWhatsApp.js +308 -0
  55. package/build/dist/Models/DatabaseModels/UserWhatsApp.js.map +1 -0
  56. package/build/dist/Models/DatabaseModels/WhatsAppLog.js +911 -0
  57. package/build/dist/Models/DatabaseModels/WhatsAppLog.js.map +1 -0
  58. package/build/dist/Server/API/NotificationAPI.js +2 -2
  59. package/build/dist/Server/API/NotificationAPI.js.map +1 -1
  60. package/build/dist/Server/API/ProjectSSO.js +26 -21
  61. package/build/dist/Server/API/ProjectSSO.js.map +1 -1
  62. package/build/dist/Server/API/ShortLinkAPI.js +17 -12
  63. package/build/dist/Server/API/ShortLinkAPI.js.map +1 -1
  64. package/build/dist/Server/API/UserCallAPI.js +54 -44
  65. package/build/dist/Server/API/UserCallAPI.js.map +1 -1
  66. package/build/dist/Server/API/UserEmailAPI.js +54 -44
  67. package/build/dist/Server/API/UserEmailAPI.js.map +1 -1
  68. package/build/dist/Server/API/UserOnCallLogTimelineAPI.js +142 -127
  69. package/build/dist/Server/API/UserOnCallLogTimelineAPI.js.map +1 -1
  70. package/build/dist/Server/API/UserPushAPI.js +111 -96
  71. package/build/dist/Server/API/UserPushAPI.js.map +1 -1
  72. package/build/dist/Server/API/UserSmsAPI.js +54 -44
  73. package/build/dist/Server/API/UserSmsAPI.js.map +1 -1
  74. package/build/dist/Server/API/UserWhatsAppAPI.js +76 -0
  75. package/build/dist/Server/API/UserWhatsAppAPI.js.map +1 -0
  76. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759838763506-MigrationName.js +42 -0
  77. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759838763506-MigrationName.js.map +1 -0
  78. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759839342566-MigrationName.js +30 -0
  79. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1759839342566-MigrationName.js.map +1 -0
  80. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +4 -0
  81. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  82. package/build/dist/Server/Services/Index.js +4 -0
  83. package/build/dist/Server/Services/Index.js.map +1 -1
  84. package/build/dist/Server/Services/MonitorService.js +23 -2
  85. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  86. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +29 -6
  87. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
  88. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleTeamService.js +27 -6
  89. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleTeamService.js.map +1 -1
  90. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js +26 -5
  91. package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleUserService.js.map +1 -1
  92. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +34 -3
  93. package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
  94. package/build/dist/Server/Services/ProbeService.js +12 -1
  95. package/build/dist/Server/Services/ProbeService.js.map +1 -1
  96. package/build/dist/Server/Services/UserNotificationRuleService.js +196 -19
  97. package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
  98. package/build/dist/Server/Services/UserNotificationSettingService.js +45 -0
  99. package/build/dist/Server/Services/UserNotificationSettingService.js.map +1 -1
  100. package/build/dist/Server/Services/UserWhatsAppService.js +179 -0
  101. package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -0
  102. package/build/dist/Server/Services/WhatsAppLogService.js +13 -0
  103. package/build/dist/Server/Services/WhatsAppLogService.js.map +1 -0
  104. package/build/dist/Server/Services/WhatsAppService.js +103 -0
  105. package/build/dist/Server/Services/WhatsAppService.js.map +1 -0
  106. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js +14 -4
  107. package/build/dist/Server/Types/Workflow/Components/BaseModel/OnTriggerBaseModel.js.map +1 -1
  108. package/build/dist/Server/Types/Workflow/Components/Webhook.js +2 -2
  109. package/build/dist/Server/Types/Workflow/Components/Webhook.js.map +1 -1
  110. package/build/dist/Server/Utils/StartServer.js +41 -19
  111. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  112. package/build/dist/Server/Utils/WhatsAppTemplateUtil.js +124 -0
  113. package/build/dist/Server/Utils/WhatsAppTemplateUtil.js.map +1 -0
  114. package/build/dist/Types/Icon/IconProp.js +1 -0
  115. package/build/dist/Types/Icon/IconProp.js.map +1 -1
  116. package/build/dist/Types/WhatsApp/WhatsAppMessage.js +2 -0
  117. package/build/dist/Types/WhatsApp/WhatsAppMessage.js.map +1 -0
  118. package/build/dist/Types/WhatsApp/WhatsAppTemplates.js +118 -0
  119. package/build/dist/Types/WhatsApp/WhatsAppTemplates.js.map +1 -0
  120. package/build/dist/Types/WhatsAppStatus.js +9 -0
  121. package/build/dist/Types/WhatsAppStatus.js.map +1 -0
  122. package/build/dist/UI/Components/Icon/Icon.js +6 -0
  123. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  124. package/package.json +1 -1
@@ -0,0 +1,247 @@
1
+ import NotificationSettingEventType from "../../Types/NotificationSetting/NotificationSettingEventType";
2
+ import WhatsAppTemplateMessages, {
3
+ WhatsAppTemplateIds,
4
+ WhatsAppTemplateId,
5
+ WhatsAppTemplateLanguage,
6
+ } from "../../Types/WhatsApp/WhatsAppTemplates";
7
+ import WhatsAppMessage, {
8
+ WhatsAppMessagePayload,
9
+ } from "../../Types/WhatsApp/WhatsAppMessage";
10
+
11
+ const DEFAULT_ACTION_LINK: string = "https://oneuptime.com/dashboard";
12
+
13
+ const templateDashboardLinkVariableMap: Partial<
14
+ Record<WhatsAppTemplateId, string>
15
+ > = {
16
+ [WhatsAppTemplateIds.AlertCreated]: "alert_link",
17
+ [WhatsAppTemplateIds.AlertCreatedOwnerNotification]: "alert_link",
18
+ [WhatsAppTemplateIds.AlertNotePostedOwnerNotification]: "alert_link",
19
+ [WhatsAppTemplateIds.AlertStateChangedOwnerNotification]: "alert_link",
20
+ [WhatsAppTemplateIds.AlertOwnerAddedNotification]: "alert_link",
21
+ [WhatsAppTemplateIds.IncidentCreated]: "incident_link",
22
+ [WhatsAppTemplateIds.IncidentCreatedOwnerNotification]: "incident_link",
23
+ [WhatsAppTemplateIds.IncidentNotePostedOwnerNotification]: "incident_link",
24
+ [WhatsAppTemplateIds.IncidentStateChangedOwnerNotification]: "incident_link",
25
+ [WhatsAppTemplateIds.IncidentOwnerAddedNotification]: "incident_link",
26
+ [WhatsAppTemplateIds.MonitorOwnerAddedNotification]: "monitor_link",
27
+ [WhatsAppTemplateIds.MonitorCreatedOwnerNotification]: "monitor_link",
28
+ [WhatsAppTemplateIds.MonitorStatusChangedOwnerNotification]: "monitor_link",
29
+ [WhatsAppTemplateIds.MonitorProbeStatusChangedNotification]: "monitor_link",
30
+ [WhatsAppTemplateIds.MonitorNoProbesMonitoringNotification]: "monitor_link",
31
+ [WhatsAppTemplateIds.ScheduledMaintenanceCreatedOwnerNotification]:
32
+ "maintenance_link",
33
+ [WhatsAppTemplateIds.ScheduledMaintenanceNotePostedOwnerNotification]:
34
+ "maintenance_link",
35
+ [WhatsAppTemplateIds.ScheduledMaintenanceOwnerAddedNotification]:
36
+ "maintenance_link",
37
+ [WhatsAppTemplateIds.ScheduledMaintenanceStateChangedOwnerNotification]:
38
+ "maintenance_link",
39
+ [WhatsAppTemplateIds.StatusPageAnnouncementCreatedOwnerNotification]:
40
+ "status_page_link",
41
+ [WhatsAppTemplateIds.StatusPageCreatedOwnerNotification]: "status_page_link",
42
+ [WhatsAppTemplateIds.StatusPageOwnerAddedNotification]: "status_page_link",
43
+ [WhatsAppTemplateIds.ProbeStatusChangedOwnerNotification]: "probe_link",
44
+ [WhatsAppTemplateIds.ProbeOwnerAddedNotification]: "probe_link",
45
+ [WhatsAppTemplateIds.OnCallUserIsOnRosterNotification]: "schedule_link",
46
+ [WhatsAppTemplateIds.OnCallUserIsNextNotification]: "schedule_link",
47
+ [WhatsAppTemplateIds.OnCallUserNoLongerActiveNotification]: "schedule_link",
48
+ [WhatsAppTemplateIds.OnCallUserAddedToPolicyNotification]: "policy_link",
49
+ [WhatsAppTemplateIds.OnCallUserRemovedFromPolicyNotification]: "policy_link",
50
+ [WhatsAppTemplateIds.VerificationCode]: "dashboard_link",
51
+ };
52
+
53
+ const templateIdByEventType: Record<
54
+ NotificationSettingEventType,
55
+ WhatsAppTemplateId
56
+ > = {
57
+ [NotificationSettingEventType.SEND_INCIDENT_CREATED_OWNER_NOTIFICATION]:
58
+ WhatsAppTemplateIds.IncidentCreatedOwnerNotification,
59
+ [NotificationSettingEventType.SEND_INCIDENT_NOTE_POSTED_OWNER_NOTIFICATION]:
60
+ WhatsAppTemplateIds.IncidentNotePostedOwnerNotification,
61
+ [NotificationSettingEventType.SEND_INCIDENT_STATE_CHANGED_OWNER_NOTIFICATION]:
62
+ WhatsAppTemplateIds.IncidentStateChangedOwnerNotification,
63
+ [NotificationSettingEventType.SEND_INCIDENT_OWNER_ADDED_NOTIFICATION]:
64
+ WhatsAppTemplateIds.IncidentOwnerAddedNotification,
65
+ [NotificationSettingEventType.SEND_ALERT_CREATED_OWNER_NOTIFICATION]:
66
+ WhatsAppTemplateIds.AlertCreatedOwnerNotification,
67
+ [NotificationSettingEventType.SEND_ALERT_NOTE_POSTED_OWNER_NOTIFICATION]:
68
+ WhatsAppTemplateIds.AlertNotePostedOwnerNotification,
69
+ [NotificationSettingEventType.SEND_ALERT_STATE_CHANGED_OWNER_NOTIFICATION]:
70
+ WhatsAppTemplateIds.AlertStateChangedOwnerNotification,
71
+ [NotificationSettingEventType.SEND_ALERT_OWNER_ADDED_NOTIFICATION]:
72
+ WhatsAppTemplateIds.AlertOwnerAddedNotification,
73
+ [NotificationSettingEventType.SEND_MONITOR_OWNER_ADDED_NOTIFICATION]:
74
+ WhatsAppTemplateIds.MonitorOwnerAddedNotification,
75
+ [NotificationSettingEventType.SEND_MONITOR_CREATED_OWNER_NOTIFICATION]:
76
+ WhatsAppTemplateIds.MonitorCreatedOwnerNotification,
77
+ [NotificationSettingEventType.SEND_MONITOR_STATUS_CHANGED_OWNER_NOTIFICATION]:
78
+ WhatsAppTemplateIds.MonitorStatusChangedOwnerNotification,
79
+ [NotificationSettingEventType.SEND_MONITOR_NOTIFICATION_WHEN_PORBE_STATUS_CHANGES]:
80
+ WhatsAppTemplateIds.MonitorProbeStatusChangedNotification,
81
+ [NotificationSettingEventType.SEND_MONITOR_NOTIFICATION_WHEN_NO_PROBES_ARE_MONITORING_THE_MONITOR]:
82
+ WhatsAppTemplateIds.MonitorNoProbesMonitoringNotification,
83
+ [NotificationSettingEventType.SEND_SCHEDULED_MAINTENANCE_CREATED_OWNER_NOTIFICATION]:
84
+ WhatsAppTemplateIds.ScheduledMaintenanceCreatedOwnerNotification,
85
+ [NotificationSettingEventType.SEND_SCHEDULED_MAINTENANCE_NOTE_POSTED_OWNER_NOTIFICATION]:
86
+ WhatsAppTemplateIds.ScheduledMaintenanceNotePostedOwnerNotification,
87
+ [NotificationSettingEventType.SEND_SCHEDULED_MAINTENANCE_OWNER_ADDED_NOTIFICATION]:
88
+ WhatsAppTemplateIds.ScheduledMaintenanceOwnerAddedNotification,
89
+ [NotificationSettingEventType.SEND_SCHEDULED_MAINTENANCE_STATE_CHANGED_OWNER_NOTIFICATION]:
90
+ WhatsAppTemplateIds.ScheduledMaintenanceStateChangedOwnerNotification,
91
+ [NotificationSettingEventType.SEND_STATUS_PAGE_ANNOUNCEMENT_CREATED_OWNER_NOTIFICATION]:
92
+ WhatsAppTemplateIds.StatusPageAnnouncementCreatedOwnerNotification,
93
+ [NotificationSettingEventType.SEND_STATUS_PAGE_CREATED_OWNER_NOTIFICATION]:
94
+ WhatsAppTemplateIds.StatusPageCreatedOwnerNotification,
95
+ [NotificationSettingEventType.SEND_STATUS_PAGE_OWNER_ADDED_NOTIFICATION]:
96
+ WhatsAppTemplateIds.StatusPageOwnerAddedNotification,
97
+ [NotificationSettingEventType.SEND_PROBE_STATUS_CHANGED_OWNER_NOTIFICATION]:
98
+ WhatsAppTemplateIds.ProbeStatusChangedOwnerNotification,
99
+ [NotificationSettingEventType.SEND_PROBE_OWNER_ADDED_NOTIFICATION]:
100
+ WhatsAppTemplateIds.ProbeOwnerAddedNotification,
101
+ [NotificationSettingEventType.SEND_WHEN_USER_IS_ON_CALL_ROSTER]:
102
+ WhatsAppTemplateIds.OnCallUserIsOnRosterNotification,
103
+ [NotificationSettingEventType.SEND_WHEN_USER_IS_NEXT_ON_CALL_ROSTER]:
104
+ WhatsAppTemplateIds.OnCallUserIsNextNotification,
105
+ [NotificationSettingEventType.SEND_WHEN_USER_IS_ADDED_TO_ON_CALL_POLICY]:
106
+ WhatsAppTemplateIds.OnCallUserAddedToPolicyNotification,
107
+ [NotificationSettingEventType.SEND_WHEN_USER_IS_REMOVED_FROM_ON_CALL_POLICY]:
108
+ WhatsAppTemplateIds.OnCallUserRemovedFromPolicyNotification,
109
+ [NotificationSettingEventType.SEND_WHEN_USER_IS_NO_LONGER_ACTIVE_ON_ON_CALL_ROSTER]:
110
+ WhatsAppTemplateIds.OnCallUserNoLongerActiveNotification,
111
+ };
112
+
113
+ export function getWhatsAppTemplateIdForEventType(
114
+ eventType: NotificationSettingEventType,
115
+ ): WhatsAppTemplateId {
116
+ const templateId: WhatsAppTemplateId | undefined =
117
+ templateIdByEventType[eventType];
118
+
119
+ if (!templateId) {
120
+ throw new Error(
121
+ `WhatsApp template is not defined for event type ${eventType}.`,
122
+ );
123
+ }
124
+
125
+ return templateId;
126
+ }
127
+
128
+ export function getWhatsAppTemplateStringForEventType(
129
+ eventType: NotificationSettingEventType,
130
+ ): string {
131
+ const templateId: WhatsAppTemplateId =
132
+ getWhatsAppTemplateIdForEventType(eventType);
133
+
134
+ const templateContent: string | undefined =
135
+ WhatsAppTemplateMessages[templateId];
136
+
137
+ if (!templateContent) {
138
+ throw new Error(
139
+ `WhatsApp template content is not defined for event type ${eventType}.`,
140
+ );
141
+ }
142
+
143
+ return templateContent;
144
+ }
145
+
146
+ function renderTemplateContent(
147
+ templateContent: string,
148
+ variables: Record<string, string>,
149
+ context: string,
150
+ ): string {
151
+ return templateContent.replace(
152
+ /\{\{(.*?)\}\}/g,
153
+ (_match: string, key: string) => {
154
+ const value: string | undefined = variables[key];
155
+
156
+ if (value === undefined) {
157
+ throw new Error(
158
+ `Missing variable "${key}" for WhatsApp template ${context}.`,
159
+ );
160
+ }
161
+
162
+ return value;
163
+ },
164
+ );
165
+ }
166
+
167
+ export function createWhatsAppMessageFromTemplate({
168
+ templateString,
169
+ actionLink,
170
+ eventType,
171
+ templateKey,
172
+ templateVariables,
173
+ }: {
174
+ templateString?: string;
175
+ actionLink?: string | undefined;
176
+ eventType?: NotificationSettingEventType;
177
+ templateKey?: WhatsAppTemplateId;
178
+ templateVariables?: Record<string, string>;
179
+ }): WhatsAppMessagePayload {
180
+ const resolvedTemplateKey: WhatsAppTemplateId | undefined =
181
+ templateKey ??
182
+ (eventType ? getWhatsAppTemplateIdForEventType(eventType) : undefined);
183
+
184
+ if (!resolvedTemplateKey) {
185
+ throw new Error(
186
+ "WhatsApp template key or event type must be provided to create WhatsApp message.",
187
+ );
188
+ }
189
+
190
+ const resolvedActionLink: string = (actionLink ?? DEFAULT_ACTION_LINK).trim();
191
+
192
+ const templateVariablesWithDefaults: Record<string, string> = {
193
+ ...(templateVariables ?? {}),
194
+ };
195
+
196
+ const dashboardLinkVariableName: string | undefined =
197
+ templateDashboardLinkVariableMap[resolvedTemplateKey];
198
+
199
+ if (dashboardLinkVariableName) {
200
+ const providedLink: string | undefined =
201
+ templateVariablesWithDefaults[dashboardLinkVariableName] ??
202
+ templateVariables?.[dashboardLinkVariableName];
203
+
204
+ const finalLink: string = (providedLink || resolvedActionLink).trim();
205
+
206
+ templateVariablesWithDefaults[dashboardLinkVariableName] = finalLink;
207
+ }
208
+
209
+ const resolvedTemplateContent: string | undefined =
210
+ templateString ?? WhatsAppTemplateMessages[resolvedTemplateKey];
211
+
212
+ if (!resolvedTemplateContent) {
213
+ throw new Error(
214
+ `WhatsApp template content is not defined for template ${resolvedTemplateKey}.`,
215
+ );
216
+ }
217
+
218
+ const body: string = renderTemplateContent(
219
+ resolvedTemplateContent,
220
+ templateVariablesWithDefaults,
221
+ resolvedTemplateKey,
222
+ );
223
+
224
+ return {
225
+ body,
226
+ templateKey: resolvedTemplateKey,
227
+ templateVariables: templateVariablesWithDefaults,
228
+ templateLanguageCode: WhatsAppTemplateLanguage[resolvedTemplateKey],
229
+ };
230
+ }
231
+
232
+ export function appendRecipientToWhatsAppMessage(
233
+ payload: WhatsAppMessagePayload,
234
+ to: WhatsAppMessage["to"],
235
+ ): WhatsAppMessage {
236
+ return {
237
+ ...payload,
238
+ to,
239
+ };
240
+ }
241
+
242
+ export default {
243
+ createWhatsAppMessageFromTemplate,
244
+ appendRecipientToWhatsAppMessage,
245
+ getWhatsAppTemplateIdForEventType,
246
+ getWhatsAppTemplateStringForEventType,
247
+ };
@@ -137,6 +137,7 @@ enum IconProp {
137
137
  EyeSlash = "EyeSlash",
138
138
  SquareStack3D = "SquareStack3D",
139
139
  ExclaimationCircle = "ExclaimationCircle",
140
+ WhatsApp = "WhatsApp",
140
141
  }
141
142
 
142
143
  export default IconProp;
@@ -0,0 +1,12 @@
1
+ import Phone from "../Phone";
2
+
3
+ export interface WhatsAppMessagePayload {
4
+ body: string;
5
+ templateKey?: string | undefined;
6
+ templateVariables?: Record<string, string> | undefined;
7
+ templateLanguageCode?: string | undefined;
8
+ }
9
+
10
+ export default interface WhatsAppMessage extends WhatsAppMessagePayload {
11
+ to: Phone;
12
+ }
@@ -0,0 +1,197 @@
1
+ type TemplateIdsMap = {
2
+ readonly AlertCreated: "oneuptime_alert_created";
3
+ readonly IncidentCreated: "oneuptime_incident_created";
4
+ readonly VerificationCode: "oneuptime_verification_code";
5
+ readonly TestNotification: "oneuptime_test_notification";
6
+ readonly IncidentCreatedOwnerNotification: "oneuptime_incident_created_owner_notification";
7
+ readonly IncidentNotePostedOwnerNotification: "oneuptime_incident_note_posted_owner_notification";
8
+ readonly IncidentStateChangedOwnerNotification: "oneuptime_incident_state_changed_owner_notification";
9
+ readonly IncidentOwnerAddedNotification: "oneuptime_incident_owner_added_notification";
10
+ readonly AlertCreatedOwnerNotification: "oneuptime_alert_created_owner_notification";
11
+ readonly AlertNotePostedOwnerNotification: "oneuptime_alert_note_posted_owner_notification";
12
+ readonly AlertStateChangedOwnerNotification: "oneuptime_alert_state_changed_owner_notification";
13
+ readonly AlertOwnerAddedNotification: "oneuptime_alert_owner_added_notification";
14
+ readonly MonitorOwnerAddedNotification: "oneuptime_monitor_owner_added_notification";
15
+ readonly MonitorCreatedOwnerNotification: "oneuptime_monitor_created_owner_notification";
16
+ readonly MonitorStatusChangedOwnerNotification: "oneuptime_monitor_status_changed_owner_notification";
17
+ readonly MonitorProbeStatusChangedNotification: "oneuptime_monitor_probe_status_changed_notification";
18
+ readonly MonitorNoProbesMonitoringNotification: "oneuptime_monitor_no_probes_monitoring_notification";
19
+ readonly ScheduledMaintenanceCreatedOwnerNotification: "oneuptime_scheduled_maintenance_created_owner_notification";
20
+ readonly ScheduledMaintenanceNotePostedOwnerNotification: "oneuptime_scheduled_maintenance_note_posted_owner_notification";
21
+ readonly ScheduledMaintenanceOwnerAddedNotification: "oneuptime_scheduled_maintenance_owner_added_notification";
22
+ readonly ScheduledMaintenanceStateChangedOwnerNotification: "oneuptime_scheduled_maintenance_state_changed_owner_notification";
23
+ readonly StatusPageAnnouncementCreatedOwnerNotification: "oneuptime_status_page_announcement_created_owner_notification";
24
+ readonly StatusPageCreatedOwnerNotification: "oneuptime_status_page_created_owner_notification";
25
+ readonly StatusPageOwnerAddedNotification: "oneuptime_status_page_owner_added_notification";
26
+ readonly ProbeStatusChangedOwnerNotification: "oneuptime_probe_status_changed_owner_notification";
27
+ readonly ProbeOwnerAddedNotification: "oneuptime_probe_owner_added_notification";
28
+ readonly OnCallUserIsOnRosterNotification: "oneuptime_oncall_user_is_on_roster_notification";
29
+ readonly OnCallUserIsNextNotification: "oneuptime_oncall_user_is_next_notification";
30
+ readonly OnCallUserAddedToPolicyNotification: "oneuptime_oncall_user_added_to_policy_notification";
31
+ readonly OnCallUserRemovedFromPolicyNotification: "oneuptime_oncall_user_removed_from_policy_notification";
32
+ readonly OnCallUserNoLongerActiveNotification: "oneuptime_oncall_user_no_longer_active_notification";
33
+ };
34
+
35
+ const templateIds: TemplateIdsMap = {
36
+ AlertCreated: "oneuptime_alert_created",
37
+ IncidentCreated: "oneuptime_incident_created",
38
+ VerificationCode: "oneuptime_verification_code",
39
+ TestNotification: "oneuptime_test_notification",
40
+ IncidentCreatedOwnerNotification:
41
+ "oneuptime_incident_created_owner_notification",
42
+ IncidentNotePostedOwnerNotification:
43
+ "oneuptime_incident_note_posted_owner_notification",
44
+ IncidentStateChangedOwnerNotification:
45
+ "oneuptime_incident_state_changed_owner_notification",
46
+ IncidentOwnerAddedNotification: "oneuptime_incident_owner_added_notification",
47
+ AlertCreatedOwnerNotification: "oneuptime_alert_created_owner_notification",
48
+ AlertNotePostedOwnerNotification:
49
+ "oneuptime_alert_note_posted_owner_notification",
50
+ AlertStateChangedOwnerNotification:
51
+ "oneuptime_alert_state_changed_owner_notification",
52
+ AlertOwnerAddedNotification: "oneuptime_alert_owner_added_notification",
53
+ MonitorOwnerAddedNotification: "oneuptime_monitor_owner_added_notification",
54
+ MonitorCreatedOwnerNotification:
55
+ "oneuptime_monitor_created_owner_notification",
56
+ MonitorStatusChangedOwnerNotification:
57
+ "oneuptime_monitor_status_changed_owner_notification",
58
+ MonitorProbeStatusChangedNotification:
59
+ "oneuptime_monitor_probe_status_changed_notification",
60
+ MonitorNoProbesMonitoringNotification:
61
+ "oneuptime_monitor_no_probes_monitoring_notification",
62
+ ScheduledMaintenanceCreatedOwnerNotification:
63
+ "oneuptime_scheduled_maintenance_created_owner_notification",
64
+ ScheduledMaintenanceNotePostedOwnerNotification:
65
+ "oneuptime_scheduled_maintenance_note_posted_owner_notification",
66
+ ScheduledMaintenanceOwnerAddedNotification:
67
+ "oneuptime_scheduled_maintenance_owner_added_notification",
68
+ ScheduledMaintenanceStateChangedOwnerNotification:
69
+ "oneuptime_scheduled_maintenance_state_changed_owner_notification",
70
+ StatusPageAnnouncementCreatedOwnerNotification:
71
+ "oneuptime_status_page_announcement_created_owner_notification",
72
+ StatusPageCreatedOwnerNotification:
73
+ "oneuptime_status_page_created_owner_notification",
74
+ StatusPageOwnerAddedNotification:
75
+ "oneuptime_status_page_owner_added_notification",
76
+ ProbeStatusChangedOwnerNotification:
77
+ "oneuptime_probe_status_changed_owner_notification",
78
+ ProbeOwnerAddedNotification: "oneuptime_probe_owner_added_notification",
79
+ OnCallUserIsOnRosterNotification:
80
+ "oneuptime_oncall_user_is_on_roster_notification",
81
+ OnCallUserIsNextNotification: "oneuptime_oncall_user_is_next_notification",
82
+ OnCallUserAddedToPolicyNotification:
83
+ "oneuptime_oncall_user_added_to_policy_notification",
84
+ OnCallUserRemovedFromPolicyNotification:
85
+ "oneuptime_oncall_user_removed_from_policy_notification",
86
+ OnCallUserNoLongerActiveNotification:
87
+ "oneuptime_oncall_user_no_longer_active_notification",
88
+ } as const;
89
+
90
+ export const WhatsAppTemplateIds: TemplateIdsMap = templateIds;
91
+
92
+ export type WhatsAppTemplateIdsDefinition = typeof WhatsAppTemplateIds;
93
+
94
+ export type WhatsAppTemplateIdsMap = WhatsAppTemplateIdsDefinition;
95
+
96
+ export type WhatsAppTemplateId =
97
+ WhatsAppTemplateIdsDefinition[keyof WhatsAppTemplateIdsDefinition];
98
+
99
+ type WhatsAppTemplateMessagesDefinition = Readonly<
100
+ Record<WhatsAppTemplateId, string>
101
+ >;
102
+
103
+ export const WhatsAppTemplateMessages: WhatsAppTemplateMessagesDefinition = {
104
+ [WhatsAppTemplateIds.AlertCreated]: `A new alert #{{alert_number}} ({{alert_title}}) has been created for project {{project_name}}. To acknowledge this alert, open {{acknowledge_url}} to respond. For more information, please check out this alert {{alert_link}} on the OneUptime dashboard.`,
105
+ [WhatsAppTemplateIds.IncidentCreated]: `A new incident #{{incident_number}} ({{incident_title}}) has been created for project {{project_name}}. To acknowledge this incident, open {{acknowledge_url}} to respond. For more information, please check out this incident {{incident_link}} on the OneUptime dashboard.`,
106
+ [WhatsAppTemplateIds.VerificationCode]: `{{1}} is your verification code. For your security, do not share this code.`,
107
+ [WhatsAppTemplateIds.TestNotification]: `This is a WhatsApp test message from OneUptime to verify your integration. No action is required.`,
108
+ [WhatsAppTemplateIds.IncidentCreatedOwnerNotification]: `Incident #{{incident_number}} ({{incident_title}}) has been created for project {{project_name}}. View incident details using {{incident_link}} on the OneUptime dashboard for complete context.`,
109
+ [WhatsAppTemplateIds.IncidentNotePostedOwnerNotification]: `A new note was posted on incident #{{incident_number}} ({{incident_title}}). Review the incident using {{incident_link}} on the OneUptime dashboard for more context.`,
110
+ [WhatsAppTemplateIds.IncidentStateChangedOwnerNotification]: `Incident #{{incident_number}} ({{incident_title}}) state changed to {{incident_state}}. Track the incident status using {{incident_link}} on the OneUptime dashboard for more context.`,
111
+ [WhatsAppTemplateIds.IncidentOwnerAddedNotification]: `You have been added as an owner of incident #{{incident_number}} ({{incident_title}}). Manage the incident using {{incident_link}} on the OneUptime dashboard.`,
112
+ [WhatsAppTemplateIds.AlertCreatedOwnerNotification]: `Alert #{{alert_number}} ({{alert_title}}) has been created for project {{project_name}}. View alert details using {{alert_link}} on the OneUptime dashboard `,
113
+ [WhatsAppTemplateIds.AlertNotePostedOwnerNotification]: `A new note was posted on alert #{{alert_number}} ({{alert_title}}). Review the alert using {{alert_link}} on the OneUptime dashboard for updates.`,
114
+ [WhatsAppTemplateIds.AlertStateChangedOwnerNotification]: `Alert #{{alert_number}} ({{alert_title}}) state changed to {{alert_state}}. Track the alert status using {{alert_link}} on the OneUptime dashboard to stay informed.`,
115
+ [WhatsAppTemplateIds.AlertOwnerAddedNotification]: `You have been added as an owner of alert #{{alert_number}} ({{alert_title}}). Manage the alert using {{alert_link}} on the OneUptime dashboard to take action.`,
116
+ [WhatsAppTemplateIds.MonitorOwnerAddedNotification]: `You have been added as an owner of monitor {{monitor_name}}. Manage the monitor using {{monitor_link}} on the OneUptime dashboard to keep things running.`,
117
+ [WhatsAppTemplateIds.MonitorCreatedOwnerNotification]: `Monitor {{monitor_name}} has been created. Check monitor {{monitor_link}} on the OneUptime dashboard `,
118
+ [WhatsAppTemplateIds.MonitorStatusChangedOwnerNotification]: `Monitor {{monitor_name}} status changed to {{monitor_status}}. Check the monitor status using {{monitor_link}} on the OneUptime dashboard to stay informed.`,
119
+ [WhatsAppTemplateIds.MonitorProbeStatusChangedNotification]: `Probes for monitor {{monitor_name}} are {{probe_status}}. Review probe details using {{monitor_link}} on the OneUptime dashboard for more insight.`,
120
+ [WhatsAppTemplateIds.MonitorNoProbesMonitoringNotification]: `No probes are monitoring monitor {{monitor_name}}. Please check the monitor using {{monitor_link}} on the OneUptime dashboard to restore coverage.`,
121
+ [WhatsAppTemplateIds.ScheduledMaintenanceCreatedOwnerNotification]: `Scheduled maintenance #{{event_number}} ({{event_title}}) has been created. View event details using {{maintenance_link}} on the OneUptime dashboard to prepare.`,
122
+ [WhatsAppTemplateIds.ScheduledMaintenanceNotePostedOwnerNotification]: `A new note was posted on scheduled maintenance #{{event_number}} ({{event_title}}). Review the event using {{maintenance_link}} on the OneUptime dashboard for the latest updates.`,
123
+ [WhatsAppTemplateIds.ScheduledMaintenanceOwnerAddedNotification]: `You have been added as an owner of scheduled maintenance #{{event_number}} ({{event_title}}). Please check the event using {{maintenance_link}} on the OneUptime dashboard.`,
124
+ [WhatsAppTemplateIds.ScheduledMaintenanceStateChangedOwnerNotification]: `Scheduled maintenance #{{event_number}} ({{event_title}}) state changed to {{event_state}}. Track event status using {{maintenance_link}} on the OneUptime dashboard to stay aligned.`,
125
+ [WhatsAppTemplateIds.StatusPageAnnouncementCreatedOwnerNotification]: `Announcement {{announcement_title}} was published on status page {{status_page_name}}. View the announcement using {{status_page_link}} on the OneUptime dashboard `,
126
+ [WhatsAppTemplateIds.StatusPageCreatedOwnerNotification]: `Status page {{status_page_name}} has been created. View status page details using {{status_page_link}} on the OneUptime dashboard for full context.`,
127
+ [WhatsAppTemplateIds.StatusPageOwnerAddedNotification]: `You have been added as an owner of status page {{status_page_name}}. Manage the status page using {{status_page_link}} on the OneUptime dashboard to stay engaged.`,
128
+ [WhatsAppTemplateIds.ProbeStatusChangedOwnerNotification]: `Probe {{probe_name}} status is {{probe_status}}. Review the probe using {{probe_link}} on the OneUptime dashboard for specifics.`,
129
+ [WhatsAppTemplateIds.ProbeOwnerAddedNotification]: `You have been added as an owner of probe {{probe_name}}. Manage the probe using {{probe_link}} on the OneUptime dashboard to take action.`,
130
+ [WhatsAppTemplateIds.OnCallUserIsOnRosterNotification]: `You are now on-call for policy {{on_call_policy_name}} on schedule {{schedule_name}}. View the on-call schedule using {{schedule_link}} on the OneUptime dashboard to plan ahead.`,
131
+ [WhatsAppTemplateIds.OnCallUserIsNextNotification]: `You are next on-call for policy {{on_call_policy_name}} on schedule {{schedule_name}}. Prepare for your shift using {{schedule_link}} on the OneUptime dashboard for the latest details.`,
132
+ [WhatsAppTemplateIds.OnCallUserAddedToPolicyNotification]: `You have been added to on-call policy {{on_call_policy_name}} for {{on_call_context}}. Review the on-call policy using {{policy_link}} on the OneUptime dashboard for full guidelines.`,
133
+ [WhatsAppTemplateIds.OnCallUserRemovedFromPolicyNotification]: `You have been removed from on-call policy {{on_call_policy_name}} for {{on_call_context}}. View on-call policies using {{policy_link}} on the OneUptime dashboard for updates.`,
134
+ [WhatsAppTemplateIds.OnCallUserNoLongerActiveNotification]: `You are no longer on-call for policy {{on_call_policy_name}} on schedule {{schedule_name}}. Review your schedule using {{schedule_link}} on the OneUptime dashboard to stay informed.`,
135
+ };
136
+
137
+ export const WhatsAppTemplateLanguage: Record<WhatsAppTemplateId, string> = {
138
+ [WhatsAppTemplateIds.AlertCreated]: "en",
139
+ [WhatsAppTemplateIds.IncidentCreated]: "en",
140
+ [WhatsAppTemplateIds.VerificationCode]: "en",
141
+ [WhatsAppTemplateIds.TestNotification]: "en",
142
+ [WhatsAppTemplateIds.IncidentCreatedOwnerNotification]: "en",
143
+ [WhatsAppTemplateIds.IncidentNotePostedOwnerNotification]: "en",
144
+ [WhatsAppTemplateIds.IncidentStateChangedOwnerNotification]: "en",
145
+ [WhatsAppTemplateIds.IncidentOwnerAddedNotification]: "en",
146
+ [WhatsAppTemplateIds.AlertCreatedOwnerNotification]: "en",
147
+ [WhatsAppTemplateIds.AlertNotePostedOwnerNotification]: "en",
148
+ [WhatsAppTemplateIds.AlertStateChangedOwnerNotification]: "en",
149
+ [WhatsAppTemplateIds.AlertOwnerAddedNotification]: "en",
150
+ [WhatsAppTemplateIds.MonitorOwnerAddedNotification]: "en",
151
+ [WhatsAppTemplateIds.MonitorCreatedOwnerNotification]: "en",
152
+ [WhatsAppTemplateIds.MonitorStatusChangedOwnerNotification]: "en",
153
+ [WhatsAppTemplateIds.MonitorProbeStatusChangedNotification]: "en",
154
+ [WhatsAppTemplateIds.MonitorNoProbesMonitoringNotification]: "en",
155
+ [WhatsAppTemplateIds.ScheduledMaintenanceCreatedOwnerNotification]: "en",
156
+ [WhatsAppTemplateIds.ScheduledMaintenanceNotePostedOwnerNotification]: "en",
157
+ [WhatsAppTemplateIds.ScheduledMaintenanceOwnerAddedNotification]: "en",
158
+ [WhatsAppTemplateIds.ScheduledMaintenanceStateChangedOwnerNotification]: "en",
159
+ [WhatsAppTemplateIds.StatusPageAnnouncementCreatedOwnerNotification]: "en",
160
+ [WhatsAppTemplateIds.StatusPageCreatedOwnerNotification]: "en",
161
+ [WhatsAppTemplateIds.StatusPageOwnerAddedNotification]: "en",
162
+ [WhatsAppTemplateIds.ProbeStatusChangedOwnerNotification]: "en",
163
+ [WhatsAppTemplateIds.ProbeOwnerAddedNotification]: "en",
164
+ [WhatsAppTemplateIds.OnCallUserIsOnRosterNotification]: "en",
165
+ [WhatsAppTemplateIds.OnCallUserIsNextNotification]: "en",
166
+ [WhatsAppTemplateIds.OnCallUserAddedToPolicyNotification]: "en",
167
+ [WhatsAppTemplateIds.OnCallUserRemovedFromPolicyNotification]: "en",
168
+ [WhatsAppTemplateIds.OnCallUserNoLongerActiveNotification]: "en",
169
+ };
170
+
171
+ // Authentication templates that require OTP button components
172
+ export const AuthenticationTemplates: Set<WhatsAppTemplateId> = new Set([
173
+ WhatsAppTemplateIds.VerificationCode,
174
+ ]);
175
+
176
+ export function renderWhatsAppTemplate(
177
+ templateId: WhatsAppTemplateId,
178
+ variables: Record<string, string>,
179
+ ): string {
180
+ const template: string | undefined = WhatsAppTemplateMessages[templateId];
181
+
182
+ if (!template) {
183
+ throw new Error(`WhatsApp template ${templateId} is not defined.`);
184
+ }
185
+
186
+ return template.replace(/\{\{(.*?)\}\}/g, (_match: string, key: string) => {
187
+ if (variables[key] === undefined) {
188
+ throw new Error(
189
+ `Missing variable "${key}" for WhatsApp template ${templateId}.`,
190
+ );
191
+ }
192
+
193
+ return variables[key] as string;
194
+ });
195
+ }
196
+
197
+ export default WhatsAppTemplateMessages;
@@ -0,0 +1,8 @@
1
+ enum WhatsAppStatus {
2
+ Success = "Success",
3
+ Error = "Error",
4
+ LowBalance = "Low Balance",
5
+ NotVerified = "Not Verified",
6
+ }
7
+
8
+ export default WhatsAppStatus;
@@ -1042,6 +1042,18 @@ const Icon: FunctionComponent<ComponentProps> = ({
1042
1042
  d="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"
1043
1043
  />,
1044
1044
  );
1045
+ } else if (icon === IconProp.WhatsApp) {
1046
+ return getSvgWrapper(
1047
+ <path
1048
+ strokeLinecap="round"
1049
+ strokeLinejoin="round"
1050
+ d="M26.576 5.363c-2.69-2.69-6.406-4.354-10.511-4.354-8.209 0-14.865 6.655-14.865 14.865 0 2.732 0.737 5.291 2.022 7.491l-0.038-0.070-2.109 7.702 7.879-2.067c2.051 1.139 4.498 1.809 7.102 1.809h0.006c8.209-0.003 14.862-6.659 14.862-14.868 0-4.103-1.662-7.817-4.349-10.507l0 0zM16.062 28.228h-0.005c-0 0-0.001 0-0.001 0-2.319 0-4.489-0.64-6.342-1.753l0.056 0.031-0.451-0.267-4.675 1.227 1.247-4.559-0.294-0.467c-1.185-1.862-1.889-4.131-1.889-6.565 0-6.822 5.531-12.353 12.353-12.353s12.353 5.531 12.353 12.353c0 6.822-5.53 12.353-12.353 12.353h-0zM22.838 18.977c-0.371-0.186-2.197-1.083-2.537-1.208-0.341-0.124-0.589-0.185-0.837 0.187-0.246 0.371-0.958 1.207-1.175 1.455-0.216 0.249-0.434 0.279-0.805 0.094-1.15-0.466-2.138-1.087-2.997-1.852l0.010 0.009c-0.799-0.74-1.484-1.587-2.037-2.521l-0.028-0.052c-0.216-0.371-0.023-0.572 0.162-0.757 0.167-0.166 0.372-0.434 0.557-0.65 0.146-0.179 0.271-0.384 0.366-0.604l0.006-0.017c0.043-0.087 0.068-0.188 0.068-0.296 0-0.131-0.037-0.253-0.101-0.357l0.002 0.003c-0.094-0.186-0.836-2.014-1.145-2.758-0.302-0.724-0.609-0.625-0.836-0.637-0.216-0.010-0.464-0.012-0.712-0.012-0.395 0.010-0.746 0.188-0.988 0.463l-0.001 0.002c-0.802 0.761-1.3 1.834-1.3 3.023 0 0.026 0 0.053 0.001 0.079l-0-0.004c0.131 1.467 0.681 2.784 1.527 3.857l-0.012-0.015c1.604 2.379 3.742 4.282 6.251 5.564l0.094 0.043c0.548 0.248 1.25 0.513 1.968 0.74l0.149 0.041c0.442 0.14 0.951 0.221 1.479 0.221 0.303 0 0.601-0.027 0.889-0.078l-0.031 0.004c1.069-0.223 1.956-0.868 2.497-1.749l0.009-0.017c0.165-0.366 0.261-0.793 0.261-1.242 0-0.185-0.016-0.366-0.047-0.542l0.003 0.019c-0.092-0.155-0.34-0.247-0.712-0.434z"
1051
+ />,
1052
+ {
1053
+ viewBox: "0 0 32 32",
1054
+ strokeWidth: "1.2",
1055
+ },
1056
+ );
1045
1057
  } else if (icon === IconProp.Hide) {
1046
1058
  return getSvgWrapper(
1047
1059
  <path
@@ -46,6 +46,11 @@ let GlobalConfig = class GlobalConfig extends GlobalConfigModel {
46
46
  this.twilioAuthToken = undefined;
47
47
  this.twilioPrimaryPhoneNumber = undefined;
48
48
  this.twilioSecondaryPhoneNumbers = undefined; // phone numbers separated by comma
49
+ this.metaWhatsAppAccessToken = undefined;
50
+ this.metaWhatsAppPhoneNumberId = undefined;
51
+ this.metaWhatsAppBusinessAccountId = undefined;
52
+ this.metaWhatsAppAppId = undefined;
53
+ this.metaWhatsAppAppSecret = undefined;
49
54
  this.emailServerType = undefined;
50
55
  this.sendgridApiKey = undefined;
51
56
  this.sendgridFromEmail = undefined;
@@ -286,6 +291,99 @@ __decorate([
286
291
  }),
287
292
  __metadata("design:type", String)
288
293
  ], GlobalConfig.prototype, "twilioSecondaryPhoneNumbers", void 0);
294
+ __decorate([
295
+ ColumnAccessControl({
296
+ create: [],
297
+ read: [],
298
+ update: [],
299
+ }),
300
+ TableColumn({
301
+ type: TableColumnType.VeryLongText,
302
+ title: "Meta WhatsApp Access Token",
303
+ description: "Access token generated from Meta for sending WhatsApp messages.",
304
+ }),
305
+ Column({
306
+ type: ColumnType.VeryLongText,
307
+ nullable: true,
308
+ unique: true,
309
+ }),
310
+ __metadata("design:type", String)
311
+ ], GlobalConfig.prototype, "metaWhatsAppAccessToken", void 0);
312
+ __decorate([
313
+ ColumnAccessControl({
314
+ create: [],
315
+ read: [],
316
+ update: [],
317
+ }),
318
+ TableColumn({
319
+ type: TableColumnType.ShortText,
320
+ title: "Meta WhatsApp Phone Number ID",
321
+ description: "The WhatsApp Business phone number ID from Meta.",
322
+ }),
323
+ Column({
324
+ type: ColumnType.ShortText,
325
+ length: ColumnLength.ShortText,
326
+ nullable: true,
327
+ unique: true,
328
+ }),
329
+ __metadata("design:type", String)
330
+ ], GlobalConfig.prototype, "metaWhatsAppPhoneNumberId", void 0);
331
+ __decorate([
332
+ ColumnAccessControl({
333
+ create: [],
334
+ read: [],
335
+ update: [],
336
+ }),
337
+ TableColumn({
338
+ type: TableColumnType.ShortText,
339
+ title: "Meta WhatsApp Business Account ID",
340
+ description: "Business account ID associated with your WhatsApp setup.",
341
+ }),
342
+ Column({
343
+ type: ColumnType.ShortText,
344
+ length: ColumnLength.ShortText,
345
+ nullable: true,
346
+ unique: true,
347
+ }),
348
+ __metadata("design:type", String)
349
+ ], GlobalConfig.prototype, "metaWhatsAppBusinessAccountId", void 0);
350
+ __decorate([
351
+ ColumnAccessControl({
352
+ create: [],
353
+ read: [],
354
+ update: [],
355
+ }),
356
+ TableColumn({
357
+ type: TableColumnType.ShortText,
358
+ title: "Meta WhatsApp App ID",
359
+ description: "Facebook App ID used for the WhatsApp Business Platform integration.",
360
+ }),
361
+ Column({
362
+ type: ColumnType.ShortText,
363
+ length: ColumnLength.ShortText,
364
+ nullable: true,
365
+ unique: true,
366
+ }),
367
+ __metadata("design:type", String)
368
+ ], GlobalConfig.prototype, "metaWhatsAppAppId", void 0);
369
+ __decorate([
370
+ ColumnAccessControl({
371
+ create: [],
372
+ read: [],
373
+ update: [],
374
+ }),
375
+ TableColumn({
376
+ type: TableColumnType.VeryLongText,
377
+ title: "Meta WhatsApp App Secret",
378
+ description: "Facebook App Secret for the WhatsApp Business Platform.",
379
+ }),
380
+ Column({
381
+ type: ColumnType.VeryLongText,
382
+ nullable: true,
383
+ unique: true,
384
+ }),
385
+ __metadata("design:type", String)
386
+ ], GlobalConfig.prototype, "metaWhatsAppAppSecret", void 0);
289
387
  __decorate([
290
388
  ColumnAccessControl({
291
389
  create: [],
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalConfig.js","sourceRoot":"","sources":["../../../../Models/DatabaseModels/GlobalConfig.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,iBAAiB,MAAM,4DAA4D,CAAC;AAC3F,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,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