@nyaruka/temba-components 0.124.3 → 0.126.0

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 (61) hide show
  1. package/.eslintrc.js +3 -1
  2. package/CHANGELOG.md +23 -0
  3. package/demo/data/flows/sample-flow.json +926 -0
  4. package/demo/data/server/sample-flow.json +0 -0
  5. package/demo/flow/example.html +46 -0
  6. package/demo/index.html +155 -144
  7. package/demo/webchat/example.html +71 -0
  8. package/dist/temba-components.js +89 -41
  9. package/dist/temba-components.js.map +1 -1
  10. package/out-tsc/src/chart/TembaChart.js +118 -48
  11. package/out-tsc/src/chart/TembaChart.js.map +1 -1
  12. package/out-tsc/src/flow/Editor.js +70 -5
  13. package/out-tsc/src/flow/Editor.js.map +1 -1
  14. package/out-tsc/src/flow/EditorNode.js +140 -4
  15. package/out-tsc/src/flow/EditorNode.js.map +1 -1
  16. package/out-tsc/src/flow/Plumber.js +57 -0
  17. package/out-tsc/src/flow/Plumber.js.map +1 -1
  18. package/out-tsc/src/flow/config.js +70 -20
  19. package/out-tsc/src/flow/config.js.map +1 -1
  20. package/out-tsc/src/formfield/FormField.js +4 -1
  21. package/out-tsc/src/formfield/FormField.js.map +1 -1
  22. package/out-tsc/src/interfaces.js +1 -0
  23. package/out-tsc/src/interfaces.js.map +1 -1
  24. package/out-tsc/src/store/AppState.js +22 -5
  25. package/out-tsc/src/store/AppState.js.map +1 -1
  26. package/out-tsc/src/utils/index.js +3 -0
  27. package/out-tsc/src/utils/index.js.map +1 -1
  28. package/out-tsc/src/webchat/WebChat.js +2 -0
  29. package/out-tsc/src/webchat/WebChat.js.map +1 -1
  30. package/out-tsc/test/temba-chart.test.js +29 -15
  31. package/out-tsc/test/temba-chart.test.js.map +1 -1
  32. package/out-tsc/test/temba-flow-node-drag.test.js +257 -0
  33. package/out-tsc/test/temba-flow-node-drag.test.js.map +1 -0
  34. package/out-tsc/test/temba-formfield.test.js +94 -0
  35. package/out-tsc/test/temba-formfield.test.js.map +1 -0
  36. package/out-tsc/test/temba-integration-markdown.test.js +36 -0
  37. package/out-tsc/test/temba-integration-markdown.test.js.map +1 -0
  38. package/out-tsc/test/temba-select.test.js +14 -1
  39. package/out-tsc/test/temba-select.test.js.map +1 -1
  40. package/package.json +2 -1
  41. package/screenshots/truth/formfield/markdown-errors.png +0 -0
  42. package/screenshots/truth/formfield/no-errors.png +0 -0
  43. package/screenshots/truth/formfield/plain-text-errors.png +0 -0
  44. package/screenshots/truth/formfield/widget-only-markdown-errors.png +0 -0
  45. package/screenshots/truth/integration/checkbox-markdown-errors.png +0 -0
  46. package/src/chart/TembaChart.ts +130 -48
  47. package/src/flow/Editor.ts +78 -6
  48. package/src/flow/EditorNode.ts +164 -4
  49. package/src/flow/Plumber.ts +65 -0
  50. package/src/flow/config.ts +71 -20
  51. package/src/formfield/FormField.ts +4 -1
  52. package/src/interfaces.ts +2 -1
  53. package/src/store/AppState.ts +28 -7
  54. package/src/utils/index.ts +3 -0
  55. package/src/webchat/WebChat.ts +2 -0
  56. package/test/temba-chart.test.ts +35 -15
  57. package/test/temba-flow-node-drag.test.ts +337 -0
  58. package/test/temba-formfield.test.ts +121 -0
  59. package/test/temba-integration-markdown.test.ts +45 -0
  60. package/test/temba-select.test.ts +17 -0
  61. package/web-dev-server.config.mjs +43 -0
@@ -0,0 +1,926 @@
1
+ {
2
+ "definition": {
3
+ "name": "Sample Flow",
4
+ "uuid": "366af3d1-78da-42ed-b35b-d5718ce6e33b",
5
+ "spec_version": "14.3.0",
6
+ "language": "eng",
7
+ "type": "messaging",
8
+ "nodes": [
9
+ {
10
+ "uuid": "a229fa3c-16bb-440b-9ae8-b7ee7a723f44",
11
+ "actions": [
12
+ {
13
+ "attachments": [
14
+ "image:http://google.com/logo.png"
15
+ ],
16
+ "text": "What is your favorite color?",
17
+ "type": "send_msg",
18
+ "quick_replies": [
19
+ "red",
20
+ "green",
21
+ "blue"
22
+ ],
23
+ "uuid": "3d56e4cf-1e88-499a-b0b4-ff48385fc9a5"
24
+ }
25
+ ],
26
+ "exits": [
27
+ {
28
+ "uuid": "7b122f4f-cb46-4587-af27-3df748d62539",
29
+ "destination_uuid": "ef1a5b06-1331-4c0d-9f46-58b1e5baf671"
30
+ }
31
+ ]
32
+ },
33
+ {
34
+ "uuid": "ef1a5b06-1331-4c0d-9f46-58b1e5baf671",
35
+ "actions": [],
36
+ "router": {
37
+ "type": "switch",
38
+ "default_category_uuid": "e6a9f714-6f2a-4884-b850-f79ff397ee63",
39
+ "cases": [
40
+ {
41
+ "arguments": [
42
+ "red"
43
+ ],
44
+ "type": "has_any_word",
45
+ "uuid": "2040ff07-f509-416d-b150-15abc27a9dfd",
46
+ "category_uuid": "4ceb8f3b-05a2-4d75-950e-fa4934ab24fb"
47
+ },
48
+ {
49
+ "arguments": [
50
+ "green"
51
+ ],
52
+ "type": "has_any_word",
53
+ "uuid": "b7b142d8-2434-41d9-9e5c-4e0335841972",
54
+ "category_uuid": "153aa4a6-553c-4adf-9773-1f44596c33fb"
55
+ },
56
+ {
57
+ "arguments": [
58
+ "blue"
59
+ ],
60
+ "type": "has_any_word",
61
+ "uuid": "e2ccc4e7-c379-43e3-8115-48e8fe7ef4de",
62
+ "category_uuid": "ee972b45-3bfe-4e93-9d4e-e9c8f8ffc587"
63
+ }
64
+ ],
65
+ "categories": [
66
+ {
67
+ "uuid": "4ceb8f3b-05a2-4d75-950e-fa4934ab24fb",
68
+ "name": "Red",
69
+ "exit_uuid": "b13f498d-4331-478f-97f7-10a02c4135a1"
70
+ },
71
+ {
72
+ "uuid": "153aa4a6-553c-4adf-9773-1f44596c33fb",
73
+ "name": "Green",
74
+ "exit_uuid": "59a22734-24ab-4ff4-b6a9-ee6e66431d4b"
75
+ },
76
+ {
77
+ "uuid": "ee972b45-3bfe-4e93-9d4e-e9c8f8ffc587",
78
+ "name": "Blue",
79
+ "exit_uuid": "3dfd68c4-0184-49d8-b2a4-0bbb62425f33"
80
+ },
81
+ {
82
+ "uuid": "e6a9f714-6f2a-4884-b850-f79ff397ee63",
83
+ "name": "Other",
84
+ "exit_uuid": "ae901cf0-f7a1-491c-a56a-1922e242efa0"
85
+ },
86
+ {
87
+ "uuid": "d496cae6-6467-44f9-98eb-d893f57de93b",
88
+ "name": "No Response",
89
+ "exit_uuid": "bf3b071c-c383-4382-93a8-6093e74c2449"
90
+ }
91
+ ],
92
+ "operand": "@input.text",
93
+ "wait": {
94
+ "type": "msg",
95
+ "timeout": {
96
+ "seconds": 300,
97
+ "category_uuid": "d496cae6-6467-44f9-98eb-d893f57de93b"
98
+ }
99
+ },
100
+ "result_name": "Color"
101
+ },
102
+ "exits": [
103
+ {
104
+ "uuid": "b13f498d-4331-478f-97f7-10a02c4135a1",
105
+ "destination_uuid": "4efc49e0-ebfe-454d-a1a0-900a911dd5ef"
106
+ },
107
+ {
108
+ "uuid": "59a22734-24ab-4ff4-b6a9-ee6e66431d4b",
109
+ "destination_uuid": "4efc49e0-ebfe-454d-a1a0-900a911dd5ef"
110
+ },
111
+ {
112
+ "uuid": "3dfd68c4-0184-49d8-b2a4-0bbb62425f33",
113
+ "destination_uuid": "4efc49e0-ebfe-454d-a1a0-900a911dd5ef"
114
+ },
115
+ {
116
+ "uuid": "ae901cf0-f7a1-491c-a56a-1922e242efa0",
117
+ "destination_uuid": "4efc49e0-ebfe-454d-a1a0-900a911dd5ef"
118
+ },
119
+ {
120
+ "uuid": "bf3b071c-c383-4382-93a8-6093e74c2449",
121
+ "destination_uuid": "e1f22e97-a170-44b4-a79b-98ab916f4c34"
122
+ }
123
+ ]
124
+ },
125
+ {
126
+ "uuid": "e1f22e97-a170-44b4-a79b-98ab916f4c34",
127
+ "actions": [
128
+ {
129
+ "uuid": "cb497975-a8fb-4d28-a662-277eb7a699f9",
130
+ "headers": {
131
+ "Accept": "application/json"
132
+ },
133
+ "type": "call_webhook",
134
+ "url": "http://google.com",
135
+ "body": "",
136
+ "method": "GET"
137
+ }
138
+ ],
139
+ "router": {
140
+ "type": "switch",
141
+ "operand": "@webhook.status",
142
+ "cases": [
143
+ {
144
+ "uuid": "024a8d66-be1e-4821-bec4-8c54fd7135c6",
145
+ "type": "has_number_between",
146
+ "arguments": [
147
+ "200",
148
+ "299"
149
+ ],
150
+ "category_uuid": "0bb08076-45e2-4ca1-b321-1506f1779198"
151
+ }
152
+ ],
153
+ "categories": [
154
+ {
155
+ "uuid": "0bb08076-45e2-4ca1-b321-1506f1779198",
156
+ "name": "Success",
157
+ "exit_uuid": "4f1f8e3b-887c-42f5-bf59-fa59c5245dc2"
158
+ },
159
+ {
160
+ "uuid": "67fc0e41-eeb2-4f54-9f71-abdd64c097f4",
161
+ "name": "Failure",
162
+ "exit_uuid": "4929ff2a-35cf-43a5-8353-dfede604add7"
163
+ }
164
+ ],
165
+ "default_category_uuid": "67fc0e41-eeb2-4f54-9f71-abdd64c097f4",
166
+ "result_name": ""
167
+ },
168
+ "exits": [
169
+ {
170
+ "uuid": "4f1f8e3b-887c-42f5-bf59-fa59c5245dc2",
171
+ "destination_uuid": "f115fdb0-d92d-47a2-96f3-e03e36767b14"
172
+ },
173
+ {
174
+ "uuid": "4929ff2a-35cf-43a5-8353-dfede604add7",
175
+ "destination_uuid": null
176
+ }
177
+ ]
178
+ },
179
+ {
180
+ "uuid": "4efc49e0-ebfe-454d-a1a0-900a911dd5ef",
181
+ "actions": [
182
+ {
183
+ "attachments": [],
184
+ "text": "Excellent choice!",
185
+ "type": "send_msg",
186
+ "quick_replies": [],
187
+ "uuid": "9963160a-a007-4c7b-8c9e-7325e1b69ed8"
188
+ },
189
+ {
190
+ "type": "add_input_labels",
191
+ "labels": [
192
+ {
193
+ "uuid": "61cae99b-56e1-4f3e-a2b9-07fb5cf2be9e",
194
+ "name": "Spam",
195
+ "count": 0
196
+ }
197
+ ],
198
+ "uuid": "d0d1571c-bf9e-4156-ac7c-984789c71472"
199
+ },
200
+ {
201
+ "type": "add_contact_urn",
202
+ "uuid": "9ddb2da4-03da-40a9-9cec-06c9d05b6e72",
203
+ "scheme": "tel",
204
+ "path": "12065551212"
205
+ },
206
+ {
207
+ "uuid": "28c288f3-fb46-4c32-8a47-563132a2e8db",
208
+ "type": "set_contact_channel",
209
+ "channel": {
210
+ "uuid": "9afd9156-a34a-43fa-91d4-914615ae2e72",
211
+ "name": "WhatsApp"
212
+ }
213
+ },
214
+ {
215
+ "uuid": "730ae625-6535-467b-98af-ea83e9d27884",
216
+ "type": "set_contact_language",
217
+ "language": "eng"
218
+ },
219
+ {
220
+ "uuid": "a0b17ce5-f0f2-4c07-b399-facecbb403ae",
221
+ "type": "set_contact_field",
222
+ "field": {
223
+ "name": "Color",
224
+ "key": "color"
225
+ },
226
+ "value": "@results.color.category"
227
+ },
228
+ {
229
+ "type": "add_contact_groups",
230
+ "groups": [
231
+ {
232
+ "uuid": "269e8abf-e81b-404c-82ce-45ff42d13769",
233
+ "name": "Empty",
234
+ "query": null,
235
+ "status": "ready",
236
+ "system": false,
237
+ "count": 0
238
+ },
239
+ {
240
+ "uuid": "58a6a3cd-20c0-4791-82da-ce9f319ab91b",
241
+ "name": "Farmers",
242
+ "query": null,
243
+ "status": "ready",
244
+ "system": false,
245
+ "count": 2414
246
+ }
247
+ ],
248
+ "uuid": "d1ca86da-f321-4e09-8bb2-981de03f5a90"
249
+ },
250
+ {
251
+ "type": "remove_contact_groups",
252
+ "groups": [
253
+ {
254
+ "uuid": "269e8abf-e81b-404c-82ce-45ff42d13769",
255
+ "name": "Empty"
256
+ },
257
+ {
258
+ "uuid": "2f81d414-47b7-446d-b8c7-6662f611cb3d",
259
+ "name": "Testers"
260
+ },
261
+ {
262
+ "uuid": "90c0dc52-ddd8-466d-8333-a96fdd67195a",
263
+ "name": "Teachers"
264
+ },
265
+ {
266
+ "uuid": "58a6a3cd-20c0-4791-82da-ce9f319ab91b",
267
+ "name": "Farmers"
268
+ },
269
+ {
270
+ "uuid": "3b9caef9-e701-4475-a0c3-ef346704f71e",
271
+ "name": "Reporters"
272
+ },
273
+ {
274
+ "uuid": "f4f46e03-3d7c-4840-8ed3-8c6c5677a2f2",
275
+ "name": "Doctors"
276
+ },
277
+ {
278
+ "uuid": "4b4ad0a2-0be6-4edd-8d6f-f6fa40ce695c",
279
+ "name": "Drivers"
280
+ }
281
+ ],
282
+ "all_groups": false,
283
+ "uuid": "6ec87721-6ec2-43fa-b7d2-930bf1f0574d"
284
+ },
285
+ {
286
+ "addresses": [
287
+ "name@domain.com"
288
+ ],
289
+ "subject": "Did you get this?",
290
+ "body": "I hope it arrived!",
291
+ "type": "send_email",
292
+ "uuid": "a0f3f1f2-1869-4ad6-9fb0-e610a3e00ae7"
293
+ },
294
+ {
295
+ "type": "set_run_result",
296
+ "name": "Color",
297
+ "value": "Black",
298
+ "category": "",
299
+ "uuid": "b32fe165-e0cc-475c-a7c4-7f484fcce2f4"
300
+ }
301
+ ],
302
+ "exits": [
303
+ {
304
+ "uuid": "99fbc988-714e-4ea8-bf93-5bdaf397b37c",
305
+ "destination_uuid": "2c60c381-487d-42cd-80be-a31f44c36fd9"
306
+ }
307
+ ]
308
+ },
309
+ {
310
+ "uuid": "f115fdb0-d92d-47a2-96f3-e03e36767b14",
311
+ "actions": [],
312
+ "router": {
313
+ "type": "switch",
314
+ "default_category_uuid": "50ededa6-7dd3-4f4f-81d2-e3011ea1cc05",
315
+ "cases": [
316
+ {
317
+ "arguments": [
318
+ "Archived"
319
+ ],
320
+ "type": "has_any_word",
321
+ "uuid": "bc2e884d-9740-4028-a6bb-72f0c263336c",
322
+ "category_uuid": "8032da05-1778-4d0c-9b7d-d218a7fb561d"
323
+ }
324
+ ],
325
+ "categories": [
326
+ {
327
+ "uuid": "8032da05-1778-4d0c-9b7d-d218a7fb561d",
328
+ "name": "Archived",
329
+ "exit_uuid": "4654d1d0-f6d8-45ee-b941-0d61846b7da0"
330
+ },
331
+ {
332
+ "uuid": "50ededa6-7dd3-4f4f-81d2-e3011ea1cc05",
333
+ "name": "Other",
334
+ "exit_uuid": "e7161b36-544c-4b0e-814f-1e3784f8e1b5"
335
+ }
336
+ ],
337
+ "operand": "@contact.status"
338
+ },
339
+ "exits": [
340
+ {
341
+ "uuid": "4654d1d0-f6d8-45ee-b941-0d61846b7da0",
342
+ "destination_uuid": "b85000c4-1990-4d86-807a-1318ea512708"
343
+ },
344
+ {
345
+ "uuid": "e7161b36-544c-4b0e-814f-1e3784f8e1b5"
346
+ }
347
+ ]
348
+ },
349
+ {
350
+ "uuid": "b85000c4-1990-4d86-807a-1318ea512708",
351
+ "actions": [],
352
+ "router": {
353
+ "type": "switch",
354
+ "default_category_uuid": "208703ae-ba73-4272-852d-c5ca3d1abe8e",
355
+ "categories": [
356
+ {
357
+ "uuid": "5a9d7012-02c3-46ac-a926-7b6d9c503fde",
358
+ "name": "Bleep",
359
+ "exit_uuid": "7bda8b65-f797-4377-ba93-c92566e87c2e"
360
+ },
361
+ {
362
+ "uuid": "208703ae-ba73-4272-852d-c5ca3d1abe8e",
363
+ "name": "Other",
364
+ "exit_uuid": "2361f0e4-9ad8-4db3-ba37-d7fb02726307"
365
+ }
366
+ ],
367
+ "cases": [
368
+ {
369
+ "arguments": [
370
+ "bleep"
371
+ ],
372
+ "type": "has_any_word",
373
+ "uuid": "5fcb78ba-245d-40e5-986a-a9cbafb3e527",
374
+ "category_uuid": "5a9d7012-02c3-46ac-a926-7b6d9c503fde"
375
+ }
376
+ ],
377
+ "operand": "@input.text"
378
+ },
379
+ "exits": [
380
+ {
381
+ "uuid": "7bda8b65-f797-4377-ba93-c92566e87c2e",
382
+ "destination_uuid": "8ecec688-f154-4b80-a0b3-3cbff0fac892"
383
+ },
384
+ {
385
+ "uuid": "2361f0e4-9ad8-4db3-ba37-d7fb02726307"
386
+ }
387
+ ]
388
+ },
389
+ {
390
+ "uuid": "8ecec688-f154-4b80-a0b3-3cbff0fac892",
391
+ "actions": [],
392
+ "router": {
393
+ "type": "random",
394
+ "categories": [
395
+ {
396
+ "uuid": "2b7e6303-d95a-45ce-bafc-126ee383faaa",
397
+ "name": "Bucket 1",
398
+ "exit_uuid": "ec491209-44e9-417c-aea7-ca665e9d8441"
399
+ },
400
+ {
401
+ "uuid": "b2f0dd39-553e-4651-96ef-95cac79867f3",
402
+ "name": "Bucket 2",
403
+ "exit_uuid": "bdf64af3-8585-45ce-a3ba-10aab8dcc4fd"
404
+ }
405
+ ]
406
+ },
407
+ "exits": [
408
+ {
409
+ "uuid": "ec491209-44e9-417c-aea7-ca665e9d8441",
410
+ "destination_uuid": "66171418-2368-44b9-95db-fdf7cd5cf4fe"
411
+ },
412
+ {
413
+ "uuid": "bdf64af3-8585-45ce-a3ba-10aab8dcc4fd",
414
+ "destination_uuid": null
415
+ }
416
+ ]
417
+ },
418
+ {
419
+ "uuid": "66171418-2368-44b9-95db-fdf7cd5cf4fe",
420
+ "actions": [],
421
+ "router": {
422
+ "type": "switch",
423
+ "default_category_uuid": "b3fd9e97-968f-48ea-826c-9dc2d777be7d",
424
+ "categories": [
425
+ {
426
+ "uuid": "c8ba0faf-cf72-447a-84fe-5dc63775c0f5",
427
+ "name": "Red",
428
+ "exit_uuid": "c9b74142-5cfe-4236-aaf5-11993cd23114"
429
+ },
430
+ {
431
+ "uuid": "b3fd9e97-968f-48ea-826c-9dc2d777be7d",
432
+ "name": "Other",
433
+ "exit_uuid": "dfa269cb-9ef9-4666-a10c-c51b95dabca0"
434
+ }
435
+ ],
436
+ "cases": [
437
+ {
438
+ "arguments": [
439
+ "red"
440
+ ],
441
+ "type": "has_any_word",
442
+ "uuid": "44f4d027-f904-4c38-8cad-e01aae9b4faf",
443
+ "category_uuid": "c8ba0faf-cf72-447a-84fe-5dc63775c0f5"
444
+ }
445
+ ],
446
+ "operand": "@results.color"
447
+ },
448
+ "exits": [
449
+ {
450
+ "uuid": "c9b74142-5cfe-4236-aaf5-11993cd23114",
451
+ "destination_uuid": "5f1394c1-4b8c-4357-8863-db24817b2aa3"
452
+ },
453
+ {
454
+ "uuid": "dfa269cb-9ef9-4666-a10c-c51b95dabca0"
455
+ }
456
+ ]
457
+ },
458
+ {
459
+ "uuid": "5f1394c1-4b8c-4357-8863-db24817b2aa3",
460
+ "actions": [],
461
+ "router": {
462
+ "type": "switch",
463
+ "cases": [
464
+ {
465
+ "uuid": "e1c0d59e-1810-4677-ad3b-69c4d1d645e8",
466
+ "type": "has_group",
467
+ "arguments": [
468
+ "269e8abf-e81b-404c-82ce-45ff42d13769",
469
+ "Empty"
470
+ ],
471
+ "category_uuid": "d7ae9a33-357f-445f-84f0-ac11da786602"
472
+ },
473
+ {
474
+ "uuid": "90ab3ac3-bc46-402a-a569-5739aa8a590d",
475
+ "type": "has_group",
476
+ "arguments": [
477
+ "4b4ad0a2-0be6-4edd-8d6f-f6fa40ce695c",
478
+ "Drivers"
479
+ ],
480
+ "category_uuid": "92e8677a-8070-4a98-901d-8247ac8e1898"
481
+ }
482
+ ],
483
+ "categories": [
484
+ {
485
+ "uuid": "d7ae9a33-357f-445f-84f0-ac11da786602",
486
+ "name": "Empty",
487
+ "exit_uuid": "c82e10b5-e573-4443-821c-ee0a834ba71b"
488
+ },
489
+ {
490
+ "uuid": "92e8677a-8070-4a98-901d-8247ac8e1898",
491
+ "name": "Drivers",
492
+ "exit_uuid": "07e7136b-c27c-40b3-bd12-84768101331b"
493
+ },
494
+ {
495
+ "uuid": "987e753e-a6fa-4b4e-9234-19e5df31a7b1",
496
+ "name": "Other",
497
+ "exit_uuid": "5ef3425c-f015-46a5-9975-046879eba986"
498
+ }
499
+ ],
500
+ "default_category_uuid": "987e753e-a6fa-4b4e-9234-19e5df31a7b1",
501
+ "operand": "@contact.groups",
502
+ "result_name": ""
503
+ },
504
+ "exits": [
505
+ {
506
+ "uuid": "c82e10b5-e573-4443-821c-ee0a834ba71b",
507
+ "destination_uuid": "e780a7ef-9dad-45a3-abda-11200a9afbf4"
508
+ },
509
+ {
510
+ "uuid": "07e7136b-c27c-40b3-bd12-84768101331b"
511
+ },
512
+ {
513
+ "uuid": "5ef3425c-f015-46a5-9975-046879eba986"
514
+ }
515
+ ]
516
+ },
517
+ {
518
+ "uuid": "e780a7ef-9dad-45a3-abda-11200a9afbf4",
519
+ "actions": [],
520
+ "router": {
521
+ "type": "switch",
522
+ "cases": [
523
+ {
524
+ "uuid": "93312571-e686-4561-8bfd-5bc00c0cd442",
525
+ "type": "has_only_phrase",
526
+ "arguments": [
527
+ "tel"
528
+ ],
529
+ "category_uuid": "8334572c-c31d-422a-8a95-2cb3d55e733b"
530
+ },
531
+ {
532
+ "uuid": "03ce9105-dd9f-41b7-adc3-56b0547e031b",
533
+ "type": "has_only_phrase",
534
+ "arguments": [
535
+ "facebook"
536
+ ],
537
+ "category_uuid": "23e7a079-3f2c-406b-9acc-dbbf388b3b79"
538
+ }
539
+ ],
540
+ "categories": [
541
+ {
542
+ "uuid": "8334572c-c31d-422a-8a95-2cb3d55e733b",
543
+ "name": "SMS",
544
+ "exit_uuid": "6868ab9f-36fa-4507-a541-a99a78e14230"
545
+ },
546
+ {
547
+ "uuid": "23e7a079-3f2c-406b-9acc-dbbf388b3b79",
548
+ "name": "Facebook",
549
+ "exit_uuid": "946dbf63-09fa-4979-a83c-237b693d7379"
550
+ },
551
+ {
552
+ "uuid": "f54b7e9e-6676-4813-8154-4b56fccef942",
553
+ "name": "Other",
554
+ "exit_uuid": "1a502bae-98b3-42f7-bc28-27eb041c41e7"
555
+ }
556
+ ],
557
+ "default_category_uuid": "f54b7e9e-6676-4813-8154-4b56fccef942",
558
+ "operand": "@(urn_parts(contact.urn).scheme)",
559
+ "result_name": ""
560
+ },
561
+ "exits": [
562
+ {
563
+ "uuid": "6868ab9f-36fa-4507-a541-a99a78e14230"
564
+ },
565
+ {
566
+ "uuid": "946dbf63-09fa-4979-a83c-237b693d7379"
567
+ },
568
+ {
569
+ "uuid": "1a502bae-98b3-42f7-bc28-27eb041c41e7",
570
+ "destination_uuid": "2c60c381-487d-42cd-80be-a31f44c36fd9"
571
+ }
572
+ ]
573
+ },
574
+ {
575
+ "uuid": "2c60c381-487d-42cd-80be-a31f44c36fd9",
576
+ "actions": [
577
+ {
578
+ "uuid": "f842eab5-b7d0-4899-811f-e631c1a442ad",
579
+ "type": "enter_flow",
580
+ "flow": {
581
+ "uuid": "78d2429c-8fdc-421c-bd37-b381ae99b7c7",
582
+ "name": "Support"
583
+ }
584
+ }
585
+ ],
586
+ "router": {
587
+ "type": "switch",
588
+ "operand": "@child.status",
589
+ "cases": [
590
+ {
591
+ "uuid": "625daede-4c37-45d4-9af6-5607ad4b1ce0",
592
+ "type": "has_only_text",
593
+ "arguments": [
594
+ "completed"
595
+ ],
596
+ "category_uuid": "894652f9-cc6c-4192-827d-3c5543778478"
597
+ },
598
+ {
599
+ "uuid": "1e5f9d1e-794d-4279-ad93-3c7541962388",
600
+ "arguments": [
601
+ "expired"
602
+ ],
603
+ "type": "has_only_text",
604
+ "category_uuid": "48e318f7-4153-471a-856a-be01ac2f18a0"
605
+ }
606
+ ],
607
+ "categories": [
608
+ {
609
+ "uuid": "894652f9-cc6c-4192-827d-3c5543778478",
610
+ "name": "Complete",
611
+ "exit_uuid": "a893feff-d6cf-4f6d-a396-da78038dfb63"
612
+ },
613
+ {
614
+ "uuid": "48e318f7-4153-471a-856a-be01ac2f18a0",
615
+ "name": "Expired",
616
+ "exit_uuid": "e3314f8b-5598-4592-b5f9-2999c4a28a4f"
617
+ }
618
+ ],
619
+ "default_category_uuid": "48e318f7-4153-471a-856a-be01ac2f18a0"
620
+ },
621
+ "exits": [
622
+ {
623
+ "uuid": "a893feff-d6cf-4f6d-a396-da78038dfb63",
624
+ "destination_uuid": "3dfe9cf2-72d1-496f-8d20-d5743af0f9c8"
625
+ },
626
+ {
627
+ "uuid": "e3314f8b-5598-4592-b5f9-2999c4a28a4f",
628
+ "destination_uuid": null
629
+ }
630
+ ]
631
+ },
632
+ {
633
+ "uuid": "3dfe9cf2-72d1-496f-8d20-d5743af0f9c8",
634
+ "actions": [
635
+ {
636
+ "uuid": "bb664e68-91ab-4ee9-ab2b-a68b35adc9f0",
637
+ "type": "call_llm",
638
+ "llm": {
639
+ "uuid": "a5f05e3e-4f9c-4f24-96ff-13676b82ac95",
640
+ "name": "GPT 4o"
641
+ },
642
+ "input": "@input",
643
+ "instructions": "Translate to French",
644
+ "output_local": "_llm_output"
645
+ }
646
+ ],
647
+ "router": {
648
+ "type": "switch",
649
+ "operand": "@locals._llm_output",
650
+ "cases": [
651
+ {
652
+ "uuid": "ac40cb14-6886-4f4e-b309-bcf4ef92b26d",
653
+ "type": "has_only_text",
654
+ "arguments": [
655
+ "<ERROR>"
656
+ ],
657
+ "category_uuid": "00685353-2326-4150-a403-58f006e50885"
658
+ }
659
+ ],
660
+ "categories": [
661
+ {
662
+ "uuid": "70f7f57b-d00e-4473-99b3-968b1ab60911",
663
+ "name": "Success",
664
+ "exit_uuid": "9285a0af-c70e-4945-9829-e620069830d2"
665
+ },
666
+ {
667
+ "uuid": "00685353-2326-4150-a403-58f006e50885",
668
+ "name": "Failure",
669
+ "exit_uuid": "3c3cccef-9865-4246-802f-90d9e76af9bf"
670
+ }
671
+ ],
672
+ "default_category_uuid": "70f7f57b-d00e-4473-99b3-968b1ab60911",
673
+ "result_name": ""
674
+ },
675
+ "exits": [
676
+ {
677
+ "uuid": "9285a0af-c70e-4945-9829-e620069830d2",
678
+ "destination_uuid": "425c4757-bead-440f-92aa-a1cc3fcd7d35"
679
+ },
680
+ {
681
+ "uuid": "3c3cccef-9865-4246-802f-90d9e76af9bf",
682
+ "destination_uuid": null
683
+ }
684
+ ]
685
+ },
686
+ {
687
+ "uuid": "425c4757-bead-440f-92aa-a1cc3fcd7d35",
688
+ "actions": [
689
+ {
690
+ "legacy_vars": [],
691
+ "contacts": [],
692
+ "groups": [],
693
+ "create_contact": true,
694
+ "flow": {
695
+ "name": "Favorites",
696
+ "uuid": "85bc02bd-4d3a-4dd1-b8af-4e57810e4af3"
697
+ },
698
+ "type": "start_session",
699
+ "uuid": "d5575f49-70fb-4e4e-8571-15bde616c1b4",
700
+ "exclusions": {
701
+ "in_a_flow": false
702
+ }
703
+ }
704
+ ],
705
+ "exits": [
706
+ {
707
+ "uuid": "f0ec9380-f94b-41a1-892d-a8b42ee6a4c0",
708
+ "destination_uuid": "21ff86c2-5276-4448-afb6-54d1f832ba0c"
709
+ }
710
+ ]
711
+ },
712
+ {
713
+ "uuid": "21ff86c2-5276-4448-afb6-54d1f832ba0c",
714
+ "actions": [
715
+ {
716
+ "uuid": "a7f21fc4-8bf1-47ab-a6c7-3e072f88afe7",
717
+ "type": "open_ticket",
718
+ "topic": {
719
+ "uuid": "bf4b568d-97b8-4d20-aed5-ad8150270af8",
720
+ "name": "General"
721
+ },
722
+ "note": "This is a note",
723
+ "assignee": {
724
+ "email": "agent1@textit.com",
725
+ "name": "Agnes McAgent"
726
+ }
727
+ }
728
+ ],
729
+ "router": {
730
+ "type": "switch",
731
+ "operand": "@locals._new_ticket",
732
+ "cases": [
733
+ {
734
+ "uuid": "f32a3e1b-976d-4897-af3b-964041af1361",
735
+ "type": "has_text",
736
+ "arguments": [],
737
+ "category_uuid": "1ec9135f-e670-4bae-a6d7-2f6aa6ce9b59"
738
+ }
739
+ ],
740
+ "categories": [
741
+ {
742
+ "uuid": "1ec9135f-e670-4bae-a6d7-2f6aa6ce9b59",
743
+ "name": "Success",
744
+ "exit_uuid": "2505556e-3c87-4992-91e3-1cedd95dce72"
745
+ },
746
+ {
747
+ "uuid": "6c1b355d-7d3e-4c17-abef-7861bac5cf48",
748
+ "name": "Failure",
749
+ "exit_uuid": "4cf706ff-1888-4682-b844-d3ed3386bdbb"
750
+ }
751
+ ],
752
+ "default_category_uuid": "6c1b355d-7d3e-4c17-abef-7861bac5cf48",
753
+ "result_name": ""
754
+ },
755
+ "exits": [
756
+ {
757
+ "uuid": "2505556e-3c87-4992-91e3-1cedd95dce72",
758
+ "destination_uuid": null
759
+ },
760
+ {
761
+ "uuid": "4cf706ff-1888-4682-b844-d3ed3386bdbb",
762
+ "destination_uuid": null
763
+ }
764
+ ]
765
+ }
766
+ ],
767
+ "_ui": {
768
+ "nodes": {
769
+ "a229fa3c-16bb-440b-9ae8-b7ee7a723f44": {
770
+ "position": {
771
+ "left": 0,
772
+ "top": 0
773
+ },
774
+ "type": "execute_actions"
775
+ },
776
+ "ef1a5b06-1331-4c0d-9f46-58b1e5baf671": {
777
+ "type": "wait_for_response",
778
+ "position": {
779
+ "left": 0,
780
+ "top": 140
781
+ },
782
+ "config": {
783
+ "cases": {}
784
+ }
785
+ },
786
+ "e1f22e97-a170-44b4-a79b-98ab916f4c34": {
787
+ "type": "split_by_webhook",
788
+ "position": {
789
+ "left": 340,
790
+ "top": 20
791
+ },
792
+ "config": {}
793
+ },
794
+ "4efc49e0-ebfe-454d-a1a0-900a911dd5ef": {
795
+ "position": {
796
+ "left": 0,
797
+ "top": 300
798
+ },
799
+ "type": "execute_actions"
800
+ },
801
+ "2c60c381-487d-42cd-80be-a31f44c36fd9": {
802
+ "type": "split_by_subflow",
803
+ "position": {
804
+ "left": 300,
805
+ "top": 300
806
+ },
807
+ "config": {}
808
+ },
809
+ "f115fdb0-d92d-47a2-96f3-e03e36767b14": {
810
+ "type": "split_by_contact_field",
811
+ "position": {
812
+ "left": 340,
813
+ "top": 180
814
+ },
815
+ "config": {
816
+ "operand": {
817
+ "id": "status",
818
+ "type": "property",
819
+ "name": "Status"
820
+ },
821
+ "cases": {}
822
+ }
823
+ },
824
+ "b85000c4-1990-4d86-807a-1318ea512708": {
825
+ "type": "split_by_expression",
826
+ "position": {
827
+ "left": 640,
828
+ "top": 560
829
+ },
830
+ "config": {
831
+ "cases": {}
832
+ }
833
+ },
834
+ "8ecec688-f154-4b80-a0b3-3cbff0fac892": {
835
+ "type": "split_by_random",
836
+ "position": {
837
+ "left": 640,
838
+ "top": 60
839
+ },
840
+ "config": null
841
+ },
842
+ "66171418-2368-44b9-95db-fdf7cd5cf4fe": {
843
+ "type": "split_by_run_result",
844
+ "position": {
845
+ "left": 640,
846
+ "top": 180
847
+ },
848
+ "config": {
849
+ "operand": {
850
+ "name": "Color",
851
+ "id": "color",
852
+ "type": "result"
853
+ },
854
+ "cases": {}
855
+ }
856
+ },
857
+ "5f1394c1-4b8c-4357-8863-db24817b2aa3": {
858
+ "type": "split_by_groups",
859
+ "position": {
860
+ "left": 640,
861
+ "top": 320
862
+ },
863
+ "config": {
864
+ "cases": {}
865
+ }
866
+ },
867
+ "e780a7ef-9dad-45a3-abda-11200a9afbf4": {
868
+ "type": "split_by_scheme",
869
+ "position": {
870
+ "left": 640,
871
+ "top": 440
872
+ },
873
+ "config": {
874
+ "cases": {}
875
+ }
876
+ },
877
+ "3dfe9cf2-72d1-496f-8d20-d5743af0f9c8": {
878
+ "type": "split_by_llm",
879
+ "position": {
880
+ "left": 300,
881
+ "top": 480
882
+ },
883
+ "config": {}
884
+ },
885
+ "425c4757-bead-440f-92aa-a1cc3fcd7d35": {
886
+ "position": {
887
+ "left": 300,
888
+ "top": 660
889
+ },
890
+ "type": "execute_actions"
891
+ },
892
+ "21ff86c2-5276-4448-afb6-54d1f832ba0c": {
893
+ "type": "split_by_ticket",
894
+ "position": {
895
+ "left": 300,
896
+ "top": 800
897
+ },
898
+ "config": {}
899
+ }
900
+ },
901
+ "stickies": {
902
+ "1a32aff1-36b9-48e3-a51e-382efdcb9a83": {
903
+ "position": {
904
+ "left": 400,
905
+ "top": 1300
906
+ },
907
+ "title": "What the heck?",
908
+ "body": "This flow makes no sense. That's because it's just for general testing.",
909
+ "color": "yellow"
910
+ },
911
+ "598a87e4-f20b-48ba-aac5-bb365d8f1509": {
912
+ "position": {
913
+ "left": 360,
914
+ "top": 1480
915
+ },
916
+ "title": "Colors",
917
+ "body": "Did you know stickies can have different colors?",
918
+ "color": "blue"
919
+ }
920
+ }
921
+ },
922
+ "revision": 69,
923
+ "expire_after_minutes": 4320,
924
+ "localization": {}
925
+ }
926
+ }