beem-component 2.1.20 → 2.1.21
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.
|
@@ -658,7 +658,7 @@ BmChat.Details = _ref30 => {
|
|
|
658
658
|
})) : /*#__PURE__*/_react.default.createElement(Messages, {
|
|
659
659
|
metadata: metadata,
|
|
660
660
|
state: state
|
|
661
|
-
}, metadata.message), children) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, type && (type === 'interactive' || type === 'order') ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ((children === null || children === void 0 || (_children$message = children.message) === null || _children$message === void 0 ? void 0 : _children$message.type) === 'quick_reply' || (children === null || children === void 0 || (_children$message2 = children.message) === null || _children$message2 === void 0 ? void 0 : _children$message2.type) === 'button') && /*#__PURE__*/_react.default.createElement(QuickReplyRender, _extends({
|
|
661
|
+
}, metadata.message.text), children) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, type && (type === 'interactive' || type === 'order') ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ((children === null || children === void 0 || (_children$message = children.message) === null || _children$message === void 0 ? void 0 : _children$message.type) === 'quick_reply' || (children === null || children === void 0 || (_children$message2 = children.message) === null || _children$message2 === void 0 ? void 0 : _children$message2.type) === 'button') && /*#__PURE__*/_react.default.createElement(QuickReplyRender, _extends({
|
|
662
662
|
rest: rest
|
|
663
663
|
}, children.message, {
|
|
664
664
|
type: type,
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -42,130 +42,467 @@ import { BmChat, GlobalStyle } from './lib/components';
|
|
|
42
42
|
// console.log(datsa);
|
|
43
43
|
|
|
44
44
|
const Chat = () => {
|
|
45
|
+
// const metaQuickReply = [
|
|
46
|
+
// {
|
|
47
|
+
// id: 104342,
|
|
48
|
+
// message:
|
|
49
|
+
// '{\n "type":"list",\n "body":{\n "text":"Please select a service from the options below:"\n },\n "footer":{\n "text":"You can only select one option"\n },\n "action":{\n "button":"Choose Service",\n "sections":[\n {\n "title":"Financial Services",\n "rows":[\n {\n "id":"loan_services",\n "title":"Loan Services",\n "description":"Get personal or business loans"\n },\n {\n "id":"savings_services",\n "title":"Savings & Investments",\n "description":"Grow your money with our plans"\n }\n ]\n },\n {\n "title":"Customer Support",\n "rows":[\n {\n "id":"support_faq",\n "title":"FAQ",\n "description":"Common questions answered"\n },\n {\n "id":"contact_agent",\n "title":"Contact an Agent",\n "description":"Chat with a live support agent"\n }\n ]\n },\n {\n "title":"Promotions",\n "rows":[\n {\n "id":"discounts",\n "title":"Discounts & Offers",\n "description":"Check out latest promotions"\n }\n ]\n }\n ]\n }\n}',
|
|
50
|
+
|
|
51
|
+
// time: '2025-09-17T10:08:10.000Z',
|
|
52
|
+
// direction: 'inbound',
|
|
53
|
+
// message_type: 'interactive',
|
|
54
|
+
// messageId: 'ac498221-3dd9-4b09-ad2b-826c0d1e3e29',
|
|
55
|
+
// is_live_agent: 0,
|
|
56
|
+
// is_deleted: 0,
|
|
57
|
+
// is_comment: 0,
|
|
58
|
+
// channel: 'whatsapp',
|
|
59
|
+
// sent_to_vendor: 1,
|
|
60
|
+
// replyMessageId: null,
|
|
61
|
+
// agent_name: null,
|
|
62
|
+
// df_agent_name: null,
|
|
63
|
+
// resolve_time: null,
|
|
64
|
+
// metadata: null,
|
|
65
|
+
// statusDetails: {
|
|
66
|
+
// statusCode: 3,
|
|
67
|
+
// },
|
|
68
|
+
// },
|
|
69
|
+
// {
|
|
70
|
+
// id: 104342,
|
|
71
|
+
|
|
72
|
+
// message:
|
|
73
|
+
// '{"type":"button","header":{"type":"image","image":{"link":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/cook.jpg"}},"body":{"text":"Hey there! This is a Breakfast bot. \\nWhat would you like to have?"},"action":{"buttons":[{"type":"reply","reply":{"id":"dev-defined-postback1","title":"Tea"}},{"type":"reply","reply":{"id":"dev-defined-postback2","title":"Coffee"}},{"type":"reply","reply":{"id":"dev-defined-postback3","title":"Chat with Agent"}}]}}',
|
|
74
|
+
|
|
75
|
+
// time: '2025-09-17T10:08:10.000Z',
|
|
76
|
+
// direction: 'inbound',
|
|
77
|
+
// message_type: 'interactive',
|
|
78
|
+
// messageId: 'ac498221-3dd9-4b09-ad2b-826c0d1e3e29',
|
|
79
|
+
// is_live_agent: 0,
|
|
80
|
+
// is_deleted: 0,
|
|
81
|
+
// is_comment: 0,
|
|
82
|
+
// channel: 'whatsapp',
|
|
83
|
+
// sent_to_vendor: 1,
|
|
84
|
+
// replyMessageId: null,
|
|
85
|
+
// agent_name: null,
|
|
86
|
+
// df_agent_name: null,
|
|
87
|
+
// resolve_time: null,
|
|
88
|
+
// metadata: null,
|
|
89
|
+
// statusDetails: {
|
|
90
|
+
// statusCode: 3,
|
|
91
|
+
// },
|
|
92
|
+
// },
|
|
93
|
+
// {
|
|
94
|
+
// id: 104342,
|
|
95
|
+
// message:
|
|
96
|
+
// '{\n "type":"button",\n "body":{\n "text":"Hey there! This is a Breakfast bot. \\nWhat would you like to have?"\n },\n "action":{\n "buttons":[\n {\n "type":"reply",\n "reply":{\n "id":"dev-defined-postback1",\n "title":"Tea"\n }\n },\n {\n "type":"reply",\n "reply":{\n "id":"dev-defined-postback2",\n "title":"Coffee"\n }\n },\n {\n "type":"reply",\n "reply":{\n "id":"dev-defined-postback3",\n "title":"Chat with Agent"\n }\n }\n ]\n }\n}',
|
|
97
|
+
// time: '2025-09-17T10:08:10.000Z',
|
|
98
|
+
// direction: 'inbound',
|
|
99
|
+
// message_type: 'interactive',
|
|
100
|
+
// messageId: 'ac498221-3dd9-4b09-ad2b-826c0d1e3e29',
|
|
101
|
+
// is_live_agent: 0,
|
|
102
|
+
// is_deleted: 0,
|
|
103
|
+
// is_comment: 0,
|
|
104
|
+
// channel: 'whatsapp',
|
|
105
|
+
// sent_to_vendor: 1,
|
|
106
|
+
// replyMessageId: null,
|
|
107
|
+
// agent_name: null,
|
|
108
|
+
// df_agent_name: null,
|
|
109
|
+
// resolve_time: null,
|
|
110
|
+
// metadata: null,
|
|
111
|
+
// statusDetails: {
|
|
112
|
+
// statusCode: 3,
|
|
113
|
+
// },
|
|
114
|
+
// },
|
|
115
|
+
|
|
116
|
+
// {
|
|
117
|
+
// id: 104342,
|
|
118
|
+
// message:
|
|
119
|
+
// '{"dotgoV2":{"type":"quick_reply","content":{"type":"text","header":"","text":"We value your opinion! Would you be willing to take a short survey to help us improve?","caption":""},"options":[{"type":"text","title":"Give Feedback","postbackText":"bm-feedback|0|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"No Thank You","postbackText":"dev-defined-postback2"}]}}',
|
|
120
|
+
// time: '2025-09-17T10:08:10.000Z',
|
|
121
|
+
// direction: 'outbound',
|
|
122
|
+
// message_type: 'interactive',
|
|
123
|
+
// messageId: 'ac498221-3dd9-4b09-ad2b-826c0d1e3e29',
|
|
124
|
+
// is_live_agent: 0,
|
|
125
|
+
// is_deleted: 0,
|
|
126
|
+
// is_comment: 0,
|
|
127
|
+
// channel: 'whatsapp',
|
|
128
|
+
// sent_to_vendor: 1,
|
|
129
|
+
// replyMessageId: null,
|
|
130
|
+
// agent_name: null,
|
|
131
|
+
// df_agent_name: null,
|
|
132
|
+
// resolve_time: null,
|
|
133
|
+
// metadata: null,
|
|
134
|
+
// statusDetails: {
|
|
135
|
+
// statusCode: 3,
|
|
136
|
+
// },
|
|
137
|
+
// },
|
|
138
|
+
// {
|
|
139
|
+
// id: 104342,
|
|
140
|
+
// message:
|
|
141
|
+
// '{"dotgoV2":{"type":"list","title":"Question 3 of 7","body":"No oh ny","globalButtons":[{"type":"text","title":"Responses"}],"items":[{"title":"Responses","subtitle":"","options":[{"type":"text","title":"1","postbackText":"bm-feedback|3|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"2","postbackText":"bm-feedback|3|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"3","postbackText":"bm-feedback|3|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"4","postbackText":"bm-feedback|3|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"5","postbackText":"bm-feedback|3|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"6","postbackText":"bm-feedback|3|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"7","postbackText":"bm-feedback|3|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"8","postbackText":"bm-feedback|3|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"9","postbackText":"bm-feedback|3|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"10","postbackText":"bm-feedback|3|fd4858ed-0fbd-4da1-9453-ecf3a1371874"}]}]}}',
|
|
142
|
+
// time: '2025-09-17T10:08:10.000Z',
|
|
143
|
+
// direction: 'outbound',
|
|
144
|
+
// message_type: 'interactive',
|
|
145
|
+
// messageId: 'ac498221-3dd9-4b09-ad2b-826c0d1e3e29',
|
|
146
|
+
// is_live_agent: 0,
|
|
147
|
+
// is_deleted: 0,
|
|
148
|
+
// is_comment: 0,
|
|
149
|
+
// channel: 'whatsapp',
|
|
150
|
+
// sent_to_vendor: 1,
|
|
151
|
+
// replyMessageId: null,
|
|
152
|
+
// agent_name: null,
|
|
153
|
+
// df_agent_name: null,
|
|
154
|
+
// resolve_time: null,
|
|
155
|
+
// metadata: null,
|
|
156
|
+
// statusDetails: {
|
|
157
|
+
// statusCode: 3,
|
|
158
|
+
// },
|
|
159
|
+
// },
|
|
160
|
+
// {
|
|
161
|
+
// id: 104342,
|
|
162
|
+
// message:
|
|
163
|
+
// '{"dotgoV2":{"type":"quick_reply","content":{"type":"image","header":"yest","url":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/cook.jpg","text":"We value your opinion! Would you be willing to take a short survey to help us improve?","caption":""},"options":[{"type":"text","title":"Give Feedback","postbackText":"bm-feedback|0|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"No Thank You","postbackText":"dev-defined-postback2"}]}}',
|
|
164
|
+
// time: '2025-09-17T10:08:10.000Z',
|
|
165
|
+
// direction: 'outbound',
|
|
166
|
+
// message_type: 'interactive',
|
|
167
|
+
// messageId: 'ac498221-3dd9-4b09-ad2b-826c0d1e3e29',
|
|
168
|
+
// is_live_agent: 0,
|
|
169
|
+
// is_deleted: 0,
|
|
170
|
+
// is_comment: 0,
|
|
171
|
+
// channel: 'whatsapp',
|
|
172
|
+
// sent_to_vendor: 1,
|
|
173
|
+
// replyMessageId: null,
|
|
174
|
+
// agent_name: null,
|
|
175
|
+
// df_agent_name: null,
|
|
176
|
+
// resolve_time: null,
|
|
177
|
+
// metadata: null,
|
|
178
|
+
// statusDetails: {
|
|
179
|
+
// statusCode: 3,
|
|
180
|
+
// },
|
|
181
|
+
// },
|
|
182
|
+
// {
|
|
183
|
+
// id: 104429,
|
|
184
|
+
// message: 'Give Feedback',
|
|
185
|
+
// time: '2025-09-18T02:48:51.000Z',
|
|
186
|
+
// direction: 'inbound',
|
|
187
|
+
// message_type: 'text',
|
|
188
|
+
// messageId:
|
|
189
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNBRTE0QjVENTkxM0ZDNDUxMkY3RTA0NEU4NzEyQzUA',
|
|
190
|
+
// is_live_agent: 1,
|
|
191
|
+
// is_deleted: 0,
|
|
192
|
+
// is_comment: 0,
|
|
193
|
+
// channel: 'whatsapp',
|
|
194
|
+
// sent_to_vendor: 1,
|
|
195
|
+
// replyMessageId: 'eaf92cdf-32c7-4524-a11e-dd9cdf37d717',
|
|
196
|
+
// agent_name: null,
|
|
197
|
+
// df_agent_name: null,
|
|
198
|
+
// resolve_time: null,
|
|
199
|
+
// metadata: null,
|
|
200
|
+
// },
|
|
201
|
+
// {
|
|
202
|
+
// id: 104429,
|
|
203
|
+
// message:
|
|
204
|
+
// '{"catalog_id":"3567267706900621","product_items":[{"id":182,"currency":"TZS","amount":10000,"quantity":1,"description":"1 Burger Kalimiz Burger Philly Beef","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/a6176a3a-a918-4623-b22d-99ceca7b9fad 1.jpg"},{"id":181,"currency":"TZS","amount":10000,"quantity":1,"description":"1 Burger Kalimiz Burger Bollywood Paneer","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/fed84589-31c5-4ea9-8505-75ceb4932906 1.jpg"}],"type":"order"}',
|
|
205
|
+
// time: '2025-09-18T02:48:51.000Z',
|
|
206
|
+
// direction: 'inbound',
|
|
207
|
+
// message_type: 'order',
|
|
208
|
+
// messageId:
|
|
209
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNBRTE0QjVENTkxM0ZDNDUxMkY3RTA0NEU4NzEyQzUA',
|
|
210
|
+
// is_live_agent: 1,
|
|
211
|
+
// is_deleted: 0,
|
|
212
|
+
// is_comment: 0,
|
|
213
|
+
// channel: 'whatsapp',
|
|
214
|
+
// sent_to_vendor: 1,
|
|
215
|
+
// replyMessageId: 'eaf92cdf-32c7-4524-a11e-dd9cdf37d717',
|
|
216
|
+
// agent_name: null,
|
|
217
|
+
// df_agent_name: null,
|
|
218
|
+
// resolve_time: null,
|
|
219
|
+
// metadata: null,
|
|
220
|
+
// },
|
|
221
|
+
// {
|
|
222
|
+
// id: 104429,
|
|
223
|
+
// message:
|
|
224
|
+
// '{"dotgoV2":{"type":"order","catalog":{"id":"3567267706900621","order":{"items":[{"id":181,"currency":"TZS","amount":"10000","quantity":"1","description":"1 Burger Kalimiz Burger Bollywood Paneer","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/fed84589-31c5-4ea9-8505-75ceb4932906 1.jpg"},{"id":182,"currency":"TZS","amount":"10000","quantity":"1","description":"1 Burger Kalimiz Burger Philly Beef","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/a6176a3a-a918-4623-b22d-99ceca7b9fad 1.jpg"}]}},"forwarded":false,"frequently_forwarded":false}}',
|
|
225
|
+
// time: '2025-09-18T02:48:51.000Z',
|
|
226
|
+
// direction: 'outbound',
|
|
227
|
+
// message_type: 'order',
|
|
228
|
+
// messageId:
|
|
229
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNBRTE0QjVENTkxM0ZDNDUxMkY3RTA0NEU4NzEyQzUA',
|
|
230
|
+
// is_live_agent: 1,
|
|
231
|
+
// is_deleted: 0,
|
|
232
|
+
// is_comment: 0,
|
|
233
|
+
// channel: 'whatsapp',
|
|
234
|
+
// sent_to_vendor: 1,
|
|
235
|
+
// replyMessageId: 'eaf92cdf-32c7-4524-a11e-dd9cdf37d717',
|
|
236
|
+
// agent_name: null,
|
|
237
|
+
// df_agent_name: null,
|
|
238
|
+
// resolve_time: null,
|
|
239
|
+
// metadata: null,
|
|
240
|
+
// },
|
|
241
|
+
// {
|
|
242
|
+
// id: 104429,
|
|
243
|
+
|
|
244
|
+
// message:
|
|
245
|
+
// '{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3567267706900621","header":{"text":"View Menu"},"body":{"text":"Menu included \\n "},"footer":{"text":"sdefsdfsdf"},"sections":[{"title":"Title 1","productList":[{"productId":181},{"productId":182},{"productId":183}]}]}}',
|
|
246
|
+
// time: '2025-09-18T02:48:51.000Z',
|
|
247
|
+
// direction: 'outbound',
|
|
248
|
+
// message_type: 'interactive',
|
|
249
|
+
// messageId:
|
|
250
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNBRTE0QjVENTkxM0ZDNDUxMkY3RTA0NEU4NzEyQzUA',
|
|
251
|
+
// is_live_agent: 1,
|
|
252
|
+
// is_deleted: 0,
|
|
253
|
+
// is_comment: 0,
|
|
254
|
+
// channel: 'whatsapp',
|
|
255
|
+
// sent_to_vendor: 1,
|
|
256
|
+
// replyMessageId: 'eaf92cdf-32c7-4524-a11e-dd9cdf37d717',
|
|
257
|
+
// agent_name: null,
|
|
258
|
+
// df_agent_name: null,
|
|
259
|
+
// resolve_time: null,
|
|
260
|
+
// metadata: null,
|
|
261
|
+
// },
|
|
262
|
+
// {
|
|
263
|
+
// id: 104704,
|
|
264
|
+
// message: '3',
|
|
265
|
+
// time: '2025-09-19T03:51:43.000Z',
|
|
266
|
+
// direction: 'inbound',
|
|
267
|
+
// message_type: 'text',
|
|
268
|
+
// messageId:
|
|
269
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNEMkRFMTEyQUI1OTMxQTQwMzc1Rjk1QjY4M0MyNjYA',
|
|
270
|
+
// is_live_agent: 1,
|
|
271
|
+
// is_deleted: 0,
|
|
272
|
+
// is_comment: 0,
|
|
273
|
+
// channel: 'whatsapp',
|
|
274
|
+
// sent_to_vendor: 1,
|
|
275
|
+
// replyMessageId: 'c39b331f-629d-4244-98a2-eeda660fcd7d',
|
|
276
|
+
// agent_name: null,
|
|
277
|
+
// df_agent_name: null,
|
|
278
|
+
// resolve_time: null,
|
|
279
|
+
// metadata: {
|
|
280
|
+
// id: 'c39b331f-629d-4244-98a2-eeda660fcd7d',
|
|
281
|
+
// prev_message:
|
|
282
|
+
// '{"type":"list","header":{"type":"text","text":"Question 1 of 7"},"body":{"text":"No wway"},"footer":{"text":"Responses"},"action":{"button":"Select an option","sections":[{"title":"Responses","rows":[{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|0","title":"1","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|1","title":"2","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|2","title":"3","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|3","title":"4","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|4","title":"5","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|5","title":"6","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|6","title":"7","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|7","title":"8","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|8","title":"9","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|9","title":"10","description":""}]}]}}',
|
|
283
|
+
// },
|
|
284
|
+
// },
|
|
285
|
+
// {
|
|
286
|
+
// id: 104702,
|
|
287
|
+
// message: 'Give Feedback',
|
|
288
|
+
// time: '2025-09-19T03:51:23.000Z',
|
|
289
|
+
// direction: 'outbound',
|
|
290
|
+
// message_type: 'text',
|
|
291
|
+
// messageId:
|
|
292
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUM0RkMzNERFODBCQTI3RTdBMUQzMUY4MzEyQ0FBNzgA',
|
|
293
|
+
// is_live_agent: 1,
|
|
294
|
+
// is_deleted: 0,
|
|
295
|
+
// is_comment: 0,
|
|
296
|
+
// channel: 'whatsapp',
|
|
297
|
+
// sent_to_vendor: 1,
|
|
298
|
+
// replyMessageId: '283d451e-3fe2-478c-8d7a-433a703dbab4',
|
|
299
|
+
// agent_name: null,
|
|
300
|
+
// df_agent_name: null,
|
|
301
|
+
// resolve_time: null,
|
|
302
|
+
// metadata: {
|
|
303
|
+
// id: '283d451e-3fe2-478c-8d7a-433a703dbab4',
|
|
304
|
+
// prev_message:
|
|
305
|
+
// '{"dotgoV2":{"type":"quick_reply","content":{"type":"text","header":"","text":"We value your opinion! Would you be willing to take a short survey to help us improve?","caption":""},"options":[{"type":"text","title":"Give Feedback","postbackText":"bm-feedback|0|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"No Thank You","postbackText":"dev-defined-postback2"}]}}',
|
|
306
|
+
// },
|
|
307
|
+
// },
|
|
308
|
+
// {
|
|
309
|
+
// id: 104709,
|
|
310
|
+
// message: 'Test',
|
|
311
|
+
// time: '2025-09-19T04:16:06.000Z',
|
|
312
|
+
// direction: 'inbound',
|
|
313
|
+
// message_type: 'text',
|
|
314
|
+
// messageId:
|
|
315
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUMxQkQ0NzRGNjBBMkU2NDcwNjEzNTQ1NUJGMzYzNjIA',
|
|
316
|
+
// is_live_agent: 1,
|
|
317
|
+
// is_deleted: 0,
|
|
318
|
+
// is_comment: 0,
|
|
319
|
+
// channel: 'whatsapp',
|
|
320
|
+
// sent_to_vendor: 1,
|
|
321
|
+
// replyMessageId: 'f556a647-a115-453f-8461-c2caafc6aeaf',
|
|
322
|
+
// agent_name: null,
|
|
323
|
+
// df_agent_name: null,
|
|
324
|
+
// resolve_time: null,
|
|
325
|
+
// metadata: {
|
|
326
|
+
// id: 'f556a647-a115-453f-8461-c2caafc6aeaf',
|
|
327
|
+
// prev_message:
|
|
328
|
+
// '{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3567267706900621","header":{"text":"View Menu"},"body":{"text":"Menu included \\n "},"footer":{"text":"sdefsdfsdf"},"sections":[{"title":"Title 1","productList":[{"productId":182}]}]}}',
|
|
329
|
+
// },
|
|
330
|
+
// },
|
|
331
|
+
// {
|
|
332
|
+
// id: 104729,
|
|
333
|
+
// message: 'Test',
|
|
334
|
+
// time: '2025-09-19T04:36:32.000Z',
|
|
335
|
+
// direction: 'inbound',
|
|
336
|
+
// message_type: 'text',
|
|
337
|
+
// messageId:
|
|
338
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUM1QTU1MTBBM0M2MkE1NUY3M0YyMzI1NkU1RTVEQjQA',
|
|
339
|
+
// is_live_agent: 0,
|
|
340
|
+
// is_deleted: 0,
|
|
341
|
+
// is_comment: 0,
|
|
342
|
+
// channel: 'whatsapp',
|
|
343
|
+
// sent_to_vendor: 1,
|
|
344
|
+
// replyMessageId:
|
|
345
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNFODBDNTNBREMyRDFCODNBNEM1NzI4QTgxNERGMTgA',
|
|
346
|
+
// agent_name: null,
|
|
347
|
+
// df_agent_name: null,
|
|
348
|
+
// resolve_time: null,
|
|
349
|
+
// metadata: {
|
|
350
|
+
// id: 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNFODBDNTNBREMyRDFCODNBNEM1NzI4QTgxNERGMTgA',
|
|
351
|
+
// prev_message:
|
|
352
|
+
// '{"catalog_id":"3567267706900621","product_items":[{"id":193,"currency":"TZS","amount":10000,"quantity":1,"description":"1 Salad Kalimiz Salad Assian Noodle Salad","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/384d26b3-87cd-407f-a9d3-7b2977ab0a22 1.jpg"}],"type":"order"}',
|
|
353
|
+
// },
|
|
354
|
+
// },
|
|
355
|
+
// {
|
|
356
|
+
// id: 104729,
|
|
357
|
+
// message: 'Test',
|
|
358
|
+
// time: '2025-09-19T04:36:32.000Z',
|
|
359
|
+
// direction: 'inbound',
|
|
360
|
+
// message_type: 'text',
|
|
361
|
+
// messageId:
|
|
362
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUM1QTU1MTBBM0M2MkE1NUY3M0YyMzI1NkU1RTVEQjQA',
|
|
363
|
+
// is_live_agent: 0,
|
|
364
|
+
// is_deleted: 0,
|
|
365
|
+
// is_comment: 0,
|
|
366
|
+
// channel: 'whatsapp',
|
|
367
|
+
// sent_to_vendor: 1,
|
|
368
|
+
// replyMessageId:
|
|
369
|
+
// 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNFODBDNTNBREMyRDFCODNBNEM1NzI4QTgxNERGMTgA',
|
|
370
|
+
// agent_name: null,
|
|
371
|
+
// df_agent_name: null,
|
|
372
|
+
// resolve_time: null,
|
|
373
|
+
// metadata: {
|
|
374
|
+
// id: 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNFODBDNTNBREMyRDFCODNBNEM1NzI4QTgxNERGMTgA',
|
|
375
|
+
// prev_message:
|
|
376
|
+
// '{"dotgoV2":{"type":"order","catalog":{"id":"3567267706900621","order":{"items":[{"id":181,"currency":"TZS","amount":"10000","quantity":"1","description":"1 Burger Kalimiz Burger Bollywood Paneer","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/fed84589-31c5-4ea9-8505-75ceb4932906 1.jpg"},{"id":182,"currency":"TZS","amount":"10000","quantity":"1","description":"1 Burger Kalimiz Burger Philly Beef","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/a6176a3a-a918-4623-b22d-99ceca7b9fad 1.jpg"}]}},"forwarded":false,"frequently_forwarded":false}}',
|
|
377
|
+
// },
|
|
378
|
+
// },
|
|
379
|
+
// ];
|
|
380
|
+
|
|
45
381
|
const metaQuickReply = [
|
|
46
382
|
{
|
|
47
|
-
id:
|
|
48
|
-
message:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
time: '2025-09-17T10:08:10.000Z',
|
|
383
|
+
id: 104759,
|
|
384
|
+
message: 'Second outbound',
|
|
385
|
+
time: '2025-09-20T05:22:38.000Z',
|
|
52
386
|
direction: 'inbound',
|
|
53
|
-
message_type: '
|
|
54
|
-
messageId:
|
|
387
|
+
message_type: 'text',
|
|
388
|
+
messageId:
|
|
389
|
+
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUM4M0JFNzM1QjI4QkQzQjcyQUE4ODdBQzJGMDBBQjQA',
|
|
55
390
|
is_live_agent: 0,
|
|
56
391
|
is_deleted: 0,
|
|
57
392
|
is_comment: 0,
|
|
58
393
|
channel: 'whatsapp',
|
|
59
394
|
sent_to_vendor: 1,
|
|
60
|
-
replyMessageId:
|
|
395
|
+
replyMessageId: '36222689-a3e0-4597-8872-9af486fd1fd7',
|
|
61
396
|
agent_name: null,
|
|
62
397
|
df_agent_name: null,
|
|
63
398
|
resolve_time: null,
|
|
64
|
-
metadata:
|
|
65
|
-
|
|
66
|
-
|
|
399
|
+
metadata: {
|
|
400
|
+
id: '36222689-a3e0-4597-8872-9af486fd1fd7',
|
|
401
|
+
prev_message: 'second outbound initiated',
|
|
67
402
|
},
|
|
68
403
|
},
|
|
69
404
|
{
|
|
70
|
-
id:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'{"type":"button","header":{"type":"image","image":{"link":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/cook.jpg"}},"body":{"text":"Hey there! This is a Breakfast bot. \\nWhat would you like to have?"},"action":{"buttons":[{"type":"reply","reply":{"id":"dev-defined-postback1","title":"Tea"}},{"type":"reply","reply":{"id":"dev-defined-postback2","title":"Coffee"}},{"type":"reply","reply":{"id":"dev-defined-postback3","title":"Chat with Agent"}}]}}',
|
|
74
|
-
|
|
75
|
-
time: '2025-09-17T10:08:10.000Z',
|
|
405
|
+
id: 104758,
|
|
406
|
+
message: 'Bounce',
|
|
407
|
+
time: '2025-09-20T05:19:44.000Z',
|
|
76
408
|
direction: 'inbound',
|
|
77
|
-
message_type: '
|
|
78
|
-
messageId:
|
|
409
|
+
message_type: 'text',
|
|
410
|
+
messageId:
|
|
411
|
+
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUMxMjAyOUQ0MDQ4MUVBNDM4NTdGNTE2NTlFMUY3REUA',
|
|
79
412
|
is_live_agent: 0,
|
|
80
413
|
is_deleted: 0,
|
|
81
414
|
is_comment: 0,
|
|
82
415
|
channel: 'whatsapp',
|
|
83
416
|
sent_to_vendor: 1,
|
|
84
|
-
replyMessageId:
|
|
417
|
+
replyMessageId:
|
|
418
|
+
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUM2M0Y2OUI3RkU0RDI2MjFBMDVGRDg1N0RBQkQyMEUA',
|
|
85
419
|
agent_name: null,
|
|
86
420
|
df_agent_name: null,
|
|
87
421
|
resolve_time: null,
|
|
88
|
-
metadata:
|
|
89
|
-
|
|
90
|
-
|
|
422
|
+
metadata: {
|
|
423
|
+
id: 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUM2M0Y2OUI3RkU0RDI2MjFBMDVGRDg1N0RBQkQyMEUA',
|
|
424
|
+
prev_message: 'Refeto secomd',
|
|
91
425
|
},
|
|
92
426
|
},
|
|
93
427
|
{
|
|
94
|
-
id:
|
|
95
|
-
message:
|
|
96
|
-
|
|
97
|
-
time: '2025-09-17T10:08:10.000Z',
|
|
428
|
+
id: 104757,
|
|
429
|
+
message: 'Chai',
|
|
430
|
+
time: '2025-09-20T05:15:05.000Z',
|
|
98
431
|
direction: 'inbound',
|
|
99
|
-
message_type: '
|
|
100
|
-
messageId:
|
|
432
|
+
message_type: 'text',
|
|
433
|
+
messageId:
|
|
434
|
+
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNFNzhDMkRBOUU5OEVDQzhBNThCODhDMzg2RTNCREEA',
|
|
101
435
|
is_live_agent: 0,
|
|
102
436
|
is_deleted: 0,
|
|
103
437
|
is_comment: 0,
|
|
104
438
|
channel: 'whatsapp',
|
|
105
439
|
sent_to_vendor: 1,
|
|
106
|
-
replyMessageId:
|
|
440
|
+
replyMessageId: '65352cb5-3800-4e78-aaba-f01dc9aadd58',
|
|
107
441
|
agent_name: null,
|
|
108
442
|
df_agent_name: null,
|
|
109
443
|
resolve_time: null,
|
|
110
|
-
metadata:
|
|
111
|
-
|
|
112
|
-
|
|
444
|
+
metadata: {
|
|
445
|
+
id: '65352cb5-3800-4e78-aaba-f01dc9aadd58',
|
|
446
|
+
prev_message:
|
|
447
|
+
'{\n "type":"button",\n "header":{\n "type":"image",\n "image":{\n "link":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/cook.jpg"\n }\n },\n "body":{\n "text":"Hey there! This is a Breakfast bot. \\nWhat would you like to have?"\n },\n "action":{\n "buttons":[\n {\n "type":"reply",\n "reply":{\n "id":"dev-defined-postback1",\n "title":"Tea"\n }\n },\n {\n "type":"reply",\n "reply":{\n "id":"dev-defined-postback2",\n "title":"Coffee"\n }\n },\n {\n "type":"reply",\n "reply":{\n "id":"dev-defined-postback3",\n "title":"Chat with Agent"\n }\n }\n ]\n }\n}',
|
|
113
448
|
},
|
|
114
449
|
},
|
|
115
|
-
|
|
116
450
|
{
|
|
117
|
-
id:
|
|
118
|
-
message:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
451
|
+
id: 104756,
|
|
452
|
+
message: 'Price',
|
|
453
|
+
time: '2025-09-20T05:11:36.000Z',
|
|
454
|
+
direction: 'inbound',
|
|
455
|
+
message_type: 'text',
|
|
456
|
+
messageId:
|
|
457
|
+
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNFMkM5NTA0NzU2MTU2RjA2MTEwRDBDM0QxOTQxODIA',
|
|
124
458
|
is_live_agent: 0,
|
|
125
459
|
is_deleted: 0,
|
|
126
460
|
is_comment: 0,
|
|
127
461
|
channel: 'whatsapp',
|
|
128
462
|
sent_to_vendor: 1,
|
|
129
|
-
replyMessageId:
|
|
463
|
+
replyMessageId:
|
|
464
|
+
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUMwMzk1RjQxQjg1RTU5QzAwM0M5Q0FFMTg2NEFCNDgA',
|
|
130
465
|
agent_name: null,
|
|
131
466
|
df_agent_name: null,
|
|
132
467
|
resolve_time: null,
|
|
133
|
-
metadata:
|
|
134
|
-
|
|
135
|
-
|
|
468
|
+
metadata: {
|
|
469
|
+
id: 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUMwMzk1RjQxQjg1RTU5QzAwM0M5Q0FFMTg2NEFCNDgA',
|
|
470
|
+
prev_message:
|
|
471
|
+
'{"catalog_id":"3567267706900621","product_items":[{"id":193,"currency":"TZS","amount":10000,"quantity":2,"description":"1 Salad Kalimiz Salad Assian Noodle Salad","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/384d26b3-87cd-407f-a9d3-7b2977ab0a22 1.jpg"}],"type":"order"}',
|
|
136
472
|
},
|
|
137
473
|
},
|
|
138
474
|
{
|
|
139
|
-
id:
|
|
140
|
-
message:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
475
|
+
id: 104755,
|
|
476
|
+
message: 'Test',
|
|
477
|
+
time: '2025-09-20T05:11:22.000Z',
|
|
478
|
+
direction: 'inbound',
|
|
479
|
+
message_type: 'text',
|
|
480
|
+
messageId:
|
|
481
|
+
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUMxMERENThDNDk0QjExNTE5MUFFNjgwM0M1OUU3NTMA',
|
|
146
482
|
is_live_agent: 0,
|
|
147
483
|
is_deleted: 0,
|
|
148
484
|
is_comment: 0,
|
|
149
485
|
channel: 'whatsapp',
|
|
150
486
|
sent_to_vendor: 1,
|
|
151
|
-
replyMessageId:
|
|
487
|
+
replyMessageId: '47a32fc1-7684-47e7-bff7-6eb0951663cb',
|
|
152
488
|
agent_name: null,
|
|
153
489
|
df_agent_name: null,
|
|
154
490
|
resolve_time: null,
|
|
155
|
-
metadata:
|
|
156
|
-
|
|
157
|
-
|
|
491
|
+
metadata: {
|
|
492
|
+
id: '47a32fc1-7684-47e7-bff7-6eb0951663cb',
|
|
493
|
+
prev_message:
|
|
494
|
+
'{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3567267706900621","header":{"text":"View Menu"},"body":{"text":"Menu included \\n "},"footer":{"text":"sdefsdfsdf"},"sections":[{"title":"Title 1","productList":[{"productId":181}]}]}}',
|
|
158
495
|
},
|
|
159
496
|
},
|
|
160
497
|
{
|
|
161
|
-
id:
|
|
498
|
+
id: 104754,
|
|
162
499
|
message:
|
|
163
|
-
'{"dotgoV2":{"type":"quick_reply","content":{"type":"
|
|
164
|
-
time: '2025-09-
|
|
500
|
+
'{"dotgoV2":{"type":"quick_reply","content":{"type":"text","header":"","text":"Successfully end the session.","caption":""},"options":[{"type":"text","title":"Main Menu","postbackText":"dev-defined-postback1"}]}}',
|
|
501
|
+
time: '2025-09-20T02:20:00.000Z',
|
|
165
502
|
direction: 'outbound',
|
|
166
503
|
message_type: 'interactive',
|
|
167
|
-
messageId:
|
|
168
|
-
is_live_agent:
|
|
504
|
+
messageId: null,
|
|
505
|
+
is_live_agent: 1,
|
|
169
506
|
is_deleted: 0,
|
|
170
507
|
is_comment: 0,
|
|
171
508
|
channel: 'whatsapp',
|
|
@@ -180,204 +517,90 @@ const Chat = () => {
|
|
|
180
517
|
},
|
|
181
518
|
},
|
|
182
519
|
{
|
|
183
|
-
id:
|
|
184
|
-
message:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
is_live_agent:
|
|
520
|
+
id: 104752,
|
|
521
|
+
message:
|
|
522
|
+
'{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3567267706900621","header":{"text":"View Menu"},"body":{"text":"Menu included \\n "},"footer":{"text":"sdefsdfsdf"},"sections":[{"title":"Title 1","productList":[{"productId":181}]}]}}',
|
|
523
|
+
time: '2025-09-19T08:24:49.000Z',
|
|
524
|
+
direction: 'outbound',
|
|
525
|
+
message_type: 'interactive',
|
|
526
|
+
messageId: '47a32fc1-7684-47e7-bff7-6eb0951663cb',
|
|
527
|
+
is_live_agent: 0,
|
|
191
528
|
is_deleted: 0,
|
|
192
529
|
is_comment: 0,
|
|
193
530
|
channel: 'whatsapp',
|
|
194
531
|
sent_to_vendor: 1,
|
|
195
|
-
replyMessageId:
|
|
196
|
-
agent_name:
|
|
197
|
-
df_agent_name:
|
|
532
|
+
replyMessageId: null,
|
|
533
|
+
agent_name: 'mustafa.s@beem.africa',
|
|
534
|
+
df_agent_name: 'Mustafa Saifuddin',
|
|
198
535
|
resolve_time: null,
|
|
199
536
|
metadata: null,
|
|
537
|
+
statusDetails: {
|
|
538
|
+
statusCode: 3,
|
|
539
|
+
},
|
|
200
540
|
},
|
|
201
541
|
{
|
|
202
|
-
id:
|
|
542
|
+
id: 104751,
|
|
203
543
|
message:
|
|
204
|
-
'{"catalog_id":"3567267706900621","product_items":[{"id":
|
|
205
|
-
time: '2025-09-
|
|
544
|
+
'{"catalog_id":"3567267706900621","product_items":[{"id":193,"currency":"TZS","amount":10000,"quantity":2,"description":"1 Salad Kalimiz Salad Assian Noodle Salad","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/384d26b3-87cd-407f-a9d3-7b2977ab0a22 1.jpg"}],"type":"order"}',
|
|
545
|
+
time: '2025-09-19T06:30:24.000Z',
|
|
206
546
|
direction: 'inbound',
|
|
207
547
|
message_type: 'order',
|
|
208
548
|
messageId:
|
|
209
|
-
'wamid.
|
|
210
|
-
is_live_agent:
|
|
549
|
+
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUMwMzk1RjQxQjg1RTU5QzAwM0M5Q0FFMTg2NEFCNDgA',
|
|
550
|
+
is_live_agent: 0,
|
|
211
551
|
is_deleted: 0,
|
|
212
552
|
is_comment: 0,
|
|
213
553
|
channel: 'whatsapp',
|
|
214
554
|
sent_to_vendor: 1,
|
|
215
|
-
replyMessageId:
|
|
555
|
+
replyMessageId: null,
|
|
216
556
|
agent_name: null,
|
|
217
557
|
df_agent_name: null,
|
|
218
558
|
resolve_time: null,
|
|
219
559
|
metadata: null,
|
|
220
560
|
},
|
|
221
561
|
{
|
|
222
|
-
id:
|
|
562
|
+
id: 104750,
|
|
223
563
|
message:
|
|
224
|
-
'{"
|
|
225
|
-
time: '2025-09-
|
|
226
|
-
direction: '
|
|
564
|
+
'{"catalog_id":"3567267706900621","product_items":[{"id":193,"currency":"TZS","amount":10000,"quantity":1,"description":"1 Salad Kalimiz Salad Assian Noodle Salad","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/384d26b3-87cd-407f-a9d3-7b2977ab0a22 1.jpg"}],"type":"order"}',
|
|
565
|
+
time: '2025-09-19T06:29:51.000Z',
|
|
566
|
+
direction: 'inbound',
|
|
227
567
|
message_type: 'order',
|
|
228
568
|
messageId:
|
|
229
|
-
'wamid.
|
|
230
|
-
is_live_agent:
|
|
569
|
+
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUM1RDIwQjEyQTY1N0FFMDQzMkU1QUI0MTBENTIyRDkA',
|
|
570
|
+
is_live_agent: 0,
|
|
231
571
|
is_deleted: 0,
|
|
232
572
|
is_comment: 0,
|
|
233
573
|
channel: 'whatsapp',
|
|
234
574
|
sent_to_vendor: 1,
|
|
235
|
-
replyMessageId:
|
|
575
|
+
replyMessageId: null,
|
|
236
576
|
agent_name: null,
|
|
237
577
|
df_agent_name: null,
|
|
238
578
|
resolve_time: null,
|
|
239
579
|
metadata: null,
|
|
240
580
|
},
|
|
241
581
|
{
|
|
242
|
-
id:
|
|
243
|
-
|
|
582
|
+
id: 104749,
|
|
244
583
|
message:
|
|
245
|
-
'{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3567267706900621","header":{"text":"View Menu"},"body":{"text":"Menu included \\n "},"footer":{"text":"sdefsdfsdf"},"sections":[{"title":"Title 1","productList":[{"productId":
|
|
246
|
-
time: '2025-09-
|
|
584
|
+
'{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3567267706900621","header":{"text":"View Menu"},"body":{"text":"Menu included \\n "},"footer":{"text":"sdefsdfsdf"},"sections":[{"title":"Title 1","productList":[{"productId":193}]}]}}',
|
|
585
|
+
time: '2025-09-19T06:29:35.000Z',
|
|
247
586
|
direction: 'outbound',
|
|
248
587
|
message_type: 'interactive',
|
|
249
|
-
messageId:
|
|
250
|
-
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNBRTE0QjVENTkxM0ZDNDUxMkY3RTA0NEU4NzEyQzUA',
|
|
251
|
-
is_live_agent: 1,
|
|
252
|
-
is_deleted: 0,
|
|
253
|
-
is_comment: 0,
|
|
254
|
-
channel: 'whatsapp',
|
|
255
|
-
sent_to_vendor: 1,
|
|
256
|
-
replyMessageId: 'eaf92cdf-32c7-4524-a11e-dd9cdf37d717',
|
|
257
|
-
agent_name: null,
|
|
258
|
-
df_agent_name: null,
|
|
259
|
-
resolve_time: null,
|
|
260
|
-
metadata: null,
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
id: 104704,
|
|
264
|
-
message: '3',
|
|
265
|
-
time: '2025-09-19T03:51:43.000Z',
|
|
266
|
-
direction: 'inbound',
|
|
267
|
-
message_type: 'text',
|
|
268
|
-
messageId:
|
|
269
|
-
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNEMkRFMTEyQUI1OTMxQTQwMzc1Rjk1QjY4M0MyNjYA',
|
|
270
|
-
is_live_agent: 1,
|
|
271
|
-
is_deleted: 0,
|
|
272
|
-
is_comment: 0,
|
|
273
|
-
channel: 'whatsapp',
|
|
274
|
-
sent_to_vendor: 1,
|
|
275
|
-
replyMessageId: 'c39b331f-629d-4244-98a2-eeda660fcd7d',
|
|
276
|
-
agent_name: null,
|
|
277
|
-
df_agent_name: null,
|
|
278
|
-
resolve_time: null,
|
|
279
|
-
metadata: {
|
|
280
|
-
id: 'c39b331f-629d-4244-98a2-eeda660fcd7d',
|
|
281
|
-
prev_message:
|
|
282
|
-
'{"type":"list","header":{"type":"text","text":"Question 1 of 7"},"body":{"text":"No wway"},"footer":{"text":"Responses"},"action":{"button":"Select an option","sections":[{"title":"Responses","rows":[{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|0","title":"1","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|1","title":"2","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|2","title":"3","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|3","title":"4","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|4","title":"5","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|5","title":"6","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|6","title":"7","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|7","title":"8","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|8","title":"9","description":""},{"id":"bm-feedback|1|fd4858ed-0fbd-4da1-9453-ecf3a1371874|9","title":"10","description":""}]}]}}',
|
|
283
|
-
},
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
id: 104702,
|
|
287
|
-
message: 'Give Feedback',
|
|
288
|
-
time: '2025-09-19T03:51:23.000Z',
|
|
289
|
-
direction: 'outbound',
|
|
290
|
-
message_type: 'text',
|
|
291
|
-
messageId:
|
|
292
|
-
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUM0RkMzNERFODBCQTI3RTdBMUQzMUY4MzEyQ0FBNzgA',
|
|
293
|
-
is_live_agent: 1,
|
|
294
|
-
is_deleted: 0,
|
|
295
|
-
is_comment: 0,
|
|
296
|
-
channel: 'whatsapp',
|
|
297
|
-
sent_to_vendor: 1,
|
|
298
|
-
replyMessageId: '283d451e-3fe2-478c-8d7a-433a703dbab4',
|
|
299
|
-
agent_name: null,
|
|
300
|
-
df_agent_name: null,
|
|
301
|
-
resolve_time: null,
|
|
302
|
-
metadata: {
|
|
303
|
-
id: '283d451e-3fe2-478c-8d7a-433a703dbab4',
|
|
304
|
-
prev_message:
|
|
305
|
-
'{"dotgoV2":{"type":"quick_reply","content":{"type":"text","header":"","text":"We value your opinion! Would you be willing to take a short survey to help us improve?","caption":""},"options":[{"type":"text","title":"Give Feedback","postbackText":"bm-feedback|0|fd4858ed-0fbd-4da1-9453-ecf3a1371874"},{"type":"text","title":"No Thank You","postbackText":"dev-defined-postback2"}]}}',
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
id: 104709,
|
|
310
|
-
message: 'Test',
|
|
311
|
-
time: '2025-09-19T04:16:06.000Z',
|
|
312
|
-
direction: 'inbound',
|
|
313
|
-
message_type: 'text',
|
|
314
|
-
messageId:
|
|
315
|
-
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUMxQkQ0NzRGNjBBMkU2NDcwNjEzNTQ1NUJGMzYzNjIA',
|
|
316
|
-
is_live_agent: 1,
|
|
317
|
-
is_deleted: 0,
|
|
318
|
-
is_comment: 0,
|
|
319
|
-
channel: 'whatsapp',
|
|
320
|
-
sent_to_vendor: 1,
|
|
321
|
-
replyMessageId: 'f556a647-a115-453f-8461-c2caafc6aeaf',
|
|
322
|
-
agent_name: null,
|
|
323
|
-
df_agent_name: null,
|
|
324
|
-
resolve_time: null,
|
|
325
|
-
metadata: {
|
|
326
|
-
id: 'f556a647-a115-453f-8461-c2caafc6aeaf',
|
|
327
|
-
prev_message:
|
|
328
|
-
'{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3567267706900621","header":{"text":"View Menu"},"body":{"text":"Menu included \\n "},"footer":{"text":"sdefsdfsdf"},"sections":[{"title":"Title 1","productList":[{"productId":182}]}]}}',
|
|
329
|
-
},
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
id: 104729,
|
|
333
|
-
message: 'Test',
|
|
334
|
-
time: '2025-09-19T04:36:32.000Z',
|
|
335
|
-
direction: 'inbound',
|
|
336
|
-
message_type: 'text',
|
|
337
|
-
messageId:
|
|
338
|
-
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUM1QTU1MTBBM0M2MkE1NUY3M0YyMzI1NkU1RTVEQjQA',
|
|
588
|
+
messageId: '5f8f5ccc-3a34-44f1-acd6-92c7cad311c8',
|
|
339
589
|
is_live_agent: 0,
|
|
340
590
|
is_deleted: 0,
|
|
341
591
|
is_comment: 0,
|
|
342
592
|
channel: 'whatsapp',
|
|
343
593
|
sent_to_vendor: 1,
|
|
344
|
-
replyMessageId:
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
df_agent_name: null,
|
|
348
|
-
resolve_time: null,
|
|
349
|
-
metadata: {
|
|
350
|
-
id: 'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNFODBDNTNBREMyRDFCODNBNEM1NzI4QTgxNERGMTgA',
|
|
351
|
-
prev_message:
|
|
352
|
-
'{"catalog_id":"3567267706900621","product_items":[{"id":193,"currency":"TZS","amount":10000,"quantity":1,"description":"1 Salad Kalimiz Salad Assian Noodle Salad","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/384d26b3-87cd-407f-a9d3-7b2977ab0a22 1.jpg"}],"type":"order"}',
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
id: 104729,
|
|
357
|
-
message: 'Test',
|
|
358
|
-
time: '2025-09-19T04:36:32.000Z',
|
|
359
|
-
direction: 'inbound',
|
|
360
|
-
message_type: 'text',
|
|
361
|
-
messageId:
|
|
362
|
-
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUM1QTU1MTBBM0M2MkE1NUY3M0YyMzI1NkU1RTVEQjQA',
|
|
363
|
-
is_live_agent: 0,
|
|
364
|
-
is_deleted: 0,
|
|
365
|
-
is_comment: 0,
|
|
366
|
-
channel: 'whatsapp',
|
|
367
|
-
sent_to_vendor: 1,
|
|
368
|
-
replyMessageId:
|
|
369
|
-
'wamid.HBgMMjU1NzgyMjcwMDUyFQIAEhggQUNFODBDNTNBREMyRDFCODNBNEM1NzI4QTgxNERGMTgA',
|
|
370
|
-
agent_name: null,
|
|
371
|
-
df_agent_name: null,
|
|
594
|
+
replyMessageId: null,
|
|
595
|
+
agent_name: 'mustafa.s@beem.africa',
|
|
596
|
+
df_agent_name: 'Mustafa Saifuddin',
|
|
372
597
|
resolve_time: null,
|
|
373
|
-
metadata:
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
'{"dotgoV2":{"type":"order","catalog":{"id":"3567267706900621","order":{"items":[{"id":181,"currency":"TZS","amount":"10000","quantity":"1","description":"1 Burger Kalimiz Burger Bollywood Paneer","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/fed84589-31c5-4ea9-8505-75ceb4932906 1.jpg"},{"id":182,"currency":"TZS","amount":"10000","quantity":"1","description":"1 Burger Kalimiz Burger Philly Beef","imgURL":"https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/a6176a3a-a918-4623-b22d-99ceca7b9fad 1.jpg"}]}},"forwarded":false,"frequently_forwarded":false}}',
|
|
598
|
+
metadata: null,
|
|
599
|
+
statusDetails: {
|
|
600
|
+
statusCode: 3,
|
|
377
601
|
},
|
|
378
602
|
},
|
|
379
603
|
];
|
|
380
|
-
|
|
381
604
|
const isJson = (itemOg) => {
|
|
382
605
|
let item = itemOg;
|
|
383
606
|
item = typeof item !== 'string' ? JSON.stringify(item) : item;
|
|
@@ -445,7 +668,7 @@ const Chat = () => {
|
|
|
445
668
|
|
|
446
669
|
const renderMetadataJsonMessage = (metadata) => {
|
|
447
670
|
let parsedMessage;
|
|
448
|
-
|
|
671
|
+
|
|
449
672
|
try {
|
|
450
673
|
parsedMessage = JSON.parse(metadata.prev_message);
|
|
451
674
|
} catch (error) {
|
|
@@ -483,7 +706,7 @@ const Chat = () => {
|
|
|
483
706
|
: finalMessage?.product_items || [];
|
|
484
707
|
|
|
485
708
|
const summary = calculateOrderSummary(items);
|
|
486
|
-
|
|
709
|
+
|
|
487
710
|
if (summary === 0) return { amount: 0, type: 'order', count: 0 };
|
|
488
711
|
|
|
489
712
|
return {
|
|
@@ -505,7 +728,7 @@ const Chat = () => {
|
|
|
505
728
|
if (isJson(metadata?.prev_message) === true) {
|
|
506
729
|
return renderMetadataJsonMessage(metadata);
|
|
507
730
|
}
|
|
508
|
-
return metadata.prev_message;
|
|
731
|
+
return { message: { type: 'text', text: metadata.prev_message } };
|
|
509
732
|
}
|
|
510
733
|
};
|
|
511
734
|
const determineMetadataIsInteractive = (metadata) => {
|