@nyaruka/temba-components 0.129.7 → 0.129.8

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 (127) hide show
  1. package/.devcontainer/Dockerfile +11 -4
  2. package/.devcontainer/devcontainer.json +3 -2
  3. package/.github/workflows/build.yml +4 -14
  4. package/CHANGELOG.md +8 -3
  5. package/demo/components/flow/example.html +1 -1
  6. package/demo/components/message-editor/example.html +125 -0
  7. package/demo/components/textinput/completion.html +1 -0
  8. package/demo/data/flows/food-order.json +12 -21
  9. package/demo/data/flows/sample-flow.json +42 -26
  10. package/dist/temba-components.js +506 -218
  11. package/dist/temba-components.js.map +1 -1
  12. package/out-tsc/src/display/Thumbnail.js +2 -1
  13. package/out-tsc/src/display/Thumbnail.js.map +1 -1
  14. package/out-tsc/src/events.js.map +1 -1
  15. package/out-tsc/src/flow/NodeEditor.js +245 -22
  16. package/out-tsc/src/flow/NodeEditor.js.map +1 -1
  17. package/out-tsc/src/flow/actions/call_webhook.js +26 -17
  18. package/out-tsc/src/flow/actions/call_webhook.js.map +1 -1
  19. package/out-tsc/src/flow/actions/send_msg.js +147 -6
  20. package/out-tsc/src/flow/actions/send_msg.js.map +1 -1
  21. package/out-tsc/src/flow/types.js.map +1 -1
  22. package/out-tsc/src/form/ArrayEditor.js +111 -38
  23. package/out-tsc/src/form/ArrayEditor.js.map +1 -1
  24. package/out-tsc/src/form/BaseListEditor.js +19 -4
  25. package/out-tsc/src/form/BaseListEditor.js.map +1 -1
  26. package/out-tsc/src/form/FormField.js +1 -1
  27. package/out-tsc/src/form/FormField.js.map +1 -1
  28. package/out-tsc/src/form/KeyValueEditor.js +1 -1
  29. package/out-tsc/src/form/KeyValueEditor.js.map +1 -1
  30. package/out-tsc/src/form/MediaPicker.js +13 -1
  31. package/out-tsc/src/form/MediaPicker.js.map +1 -1
  32. package/out-tsc/src/form/MessageEditor.js +422 -0
  33. package/out-tsc/src/form/MessageEditor.js.map +1 -0
  34. package/out-tsc/src/form/TextInput.js +12 -5
  35. package/out-tsc/src/form/TextInput.js.map +1 -1
  36. package/out-tsc/src/form/select/Select.js +4 -4
  37. package/out-tsc/src/form/select/Select.js.map +1 -1
  38. package/out-tsc/src/live/ContactChat.js +27 -2
  39. package/out-tsc/src/live/ContactChat.js.map +1 -1
  40. package/out-tsc/temba-modules.js +2 -0
  41. package/out-tsc/temba-modules.js.map +1 -1
  42. package/out-tsc/test/temba-field-config.test.js +4 -2
  43. package/out-tsc/test/temba-field-config.test.js.map +1 -1
  44. package/out-tsc/test/temba-message-editor.test.js +194 -0
  45. package/out-tsc/test/temba-message-editor.test.js.map +1 -0
  46. package/out-tsc/test/temba-node-editor.test.js +71 -0
  47. package/out-tsc/test/temba-node-editor.test.js.map +1 -1
  48. package/out-tsc/test/temba-select.test.js +1 -1
  49. package/out-tsc/test/temba-select.test.js.map +1 -1
  50. package/out-tsc/test/temba-textinput.test.js +16 -0
  51. package/out-tsc/test/temba-textinput.test.js.map +1 -1
  52. package/out-tsc/test/temba-webchat.test.js +4 -0
  53. package/out-tsc/test/temba-webchat.test.js.map +1 -1
  54. package/out-tsc/test/utils.test.js +2 -8
  55. package/out-tsc/test/utils.test.js.map +1 -1
  56. package/package.json +7 -4
  57. package/screenshots/truth/actions/add_contact_groups/editor/descriptive-group-names.png +0 -0
  58. package/screenshots/truth/actions/add_contact_groups/editor/long-group-names.png +0 -0
  59. package/screenshots/truth/actions/add_contact_groups/editor/many-groups.png +0 -0
  60. package/screenshots/truth/actions/add_contact_groups/editor/multiple-groups.png +0 -0
  61. package/screenshots/truth/actions/add_contact_groups/editor/single-group.png +0 -0
  62. package/screenshots/truth/actions/remove_contact_groups/editor/cleanup-groups.png +0 -0
  63. package/screenshots/truth/actions/remove_contact_groups/editor/long-descriptive-group-names.png +0 -0
  64. package/screenshots/truth/actions/remove_contact_groups/editor/many-groups.png +0 -0
  65. package/screenshots/truth/actions/remove_contact_groups/editor/multiple-groups.png +0 -0
  66. package/screenshots/truth/actions/remove_contact_groups/editor/single-group.png +0 -0
  67. package/screenshots/truth/actions/send_email/editor/complex-business-email.png +0 -0
  68. package/screenshots/truth/actions/send_email/editor/empty-body.png +0 -0
  69. package/screenshots/truth/actions/send_email/editor/empty-subject.png +0 -0
  70. package/screenshots/truth/actions/send_email/editor/long-subject.png +0 -0
  71. package/screenshots/truth/actions/send_email/editor/multiline-body.png +0 -0
  72. package/screenshots/truth/actions/send_email/editor/multiple-recipients.png +0 -0
  73. package/screenshots/truth/actions/send_email/editor/simple-email.png +0 -0
  74. package/screenshots/truth/actions/send_email/editor/with-expressions.png +0 -0
  75. package/screenshots/truth/actions/send_msg/editor/long-quick-replies.png +0 -0
  76. package/screenshots/truth/actions/send_msg/editor/multiline-text-with-replies.png +0 -0
  77. package/screenshots/truth/actions/send_msg/editor/simple-text.png +0 -0
  78. package/screenshots/truth/actions/send_msg/editor/text-with-linebreaks.png +0 -0
  79. package/screenshots/truth/actions/send_msg/editor/text-with-many-quick-replies.png +0 -0
  80. package/screenshots/truth/actions/send_msg/editor/text-with-quick-replies.png +0 -0
  81. package/screenshots/truth/actions/send_msg/editor/text-without-quick-replies.png +0 -0
  82. package/screenshots/truth/editor/send_msg.png +0 -0
  83. package/screenshots/truth/editor/set_contact_language.png +0 -0
  84. package/screenshots/truth/editor/set_contact_name.png +0 -0
  85. package/screenshots/truth/editor/set_run_result.png +0 -0
  86. package/screenshots/truth/formfield/markdown-errors.png +0 -0
  87. package/screenshots/truth/formfield/no-errors.png +0 -0
  88. package/screenshots/truth/formfield/plain-text-errors.png +0 -0
  89. package/screenshots/truth/message-editor/autogrow-initial-content.png +0 -0
  90. package/screenshots/truth/message-editor/default.png +0 -0
  91. package/screenshots/truth/message-editor/drag-highlight.png +0 -0
  92. package/screenshots/truth/message-editor/filtered-attachments.png +0 -0
  93. package/screenshots/truth/message-editor/with-completion.png +0 -0
  94. package/screenshots/truth/message-editor/with-properties.png +0 -0
  95. package/screenshots/truth/textinput/autogrow-initial.png +0 -0
  96. package/screenshots/truth/textinput/input-form.png +0 -0
  97. package/src/display/Thumbnail.ts +2 -1
  98. package/src/events.ts +5 -0
  99. package/src/flow/NodeEditor.ts +269 -23
  100. package/src/flow/actions/call_webhook.ts +28 -18
  101. package/src/flow/actions/send_msg.ts +170 -6
  102. package/src/flow/types.ts +21 -2
  103. package/src/form/ArrayEditor.ts +120 -42
  104. package/src/form/BaseListEditor.ts +22 -6
  105. package/src/form/FormField.ts +1 -1
  106. package/src/form/KeyValueEditor.ts +1 -1
  107. package/src/form/MediaPicker.ts +13 -1
  108. package/src/form/MessageEditor.ts +449 -0
  109. package/src/form/TextInput.ts +15 -7
  110. package/src/form/select/Select.ts +4 -4
  111. package/src/live/ContactChat.ts +30 -4
  112. package/static/css/temba-components.css +2 -0
  113. package/static/mr/docs/en-us/editor.json +2588 -0
  114. package/stress-test.js +138 -0
  115. package/temba-modules.ts +2 -0
  116. package/test/temba-field-config.test.ts +4 -2
  117. package/test/temba-message-editor.test.ts +300 -0
  118. package/test/temba-node-editor.test.ts +94 -0
  119. package/test/temba-select.test.ts +1 -1
  120. package/test/temba-textinput.test.ts +26 -0
  121. package/test/temba-webchat.test.ts +5 -0
  122. package/test/utils.test.ts +2 -13
  123. package/test-assets/contacts/history.json +19 -0
  124. package/test-assets/style.css +2 -0
  125. package/web-dev-mock.mjs +433 -0
  126. package/web-dev-server.config.mjs +51 -5
  127. package/web-test-runner.config.mjs +9 -4
@@ -1,14 +1,21 @@
1
1
  FROM "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye"
2
2
 
3
- RUN apt-get update \
4
- && apt-get install chromium fonts-noto-color-emoji -y --no-install-recommends -qq
5
-
6
- # The rest of our environment
3
+ # The rest of our environment
7
4
  ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
8
5
  ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
9
6
  ENV CHROME_PATH=/usr/bin/chromium
10
7
  ENV DEBIAN_FRONTEND=noninteractive
11
8
 
9
+ # Add minio configuration
10
+ ENV MINIO_ENDPOINT=http://minio:9000
11
+ ENV MINIO_PUBLIC_ENDPOINT=http://localhost:9000
12
+ ENV MINIO_ACCESS_KEY=root
13
+ ENV MINIO_SECRET_KEY=tembatemba
14
+ ENV MINIO_BUCKET=temba-attachments
15
+
16
+ RUN apt-get update \
17
+ && apt-get install chromium fonts-noto-color-emoji dnsutils curl -y --no-install-recommends -qq
18
+
12
19
  WORKDIR /workspaces/temba-components
13
20
  RUN yarn install
14
21
  USER node
@@ -10,10 +10,11 @@
10
10
  "runArgs": [
11
11
  "--name=dev-components",
12
12
  "--network=textit_default",
13
- "--hostname=temba-components"
13
+ "--hostname=temba-components",
14
+ "--add-host=minio:host-gateway"
14
15
  ],
15
16
  "remoteUser": "node",
16
- "postCreateCommand": "sudo chown -R node /workspaces/temba-components/static/svg && sudo chown node /workspaces/temba-components && sudo chown node /workspaces/temba-components/screenshots && yarn install",
17
+ "postCreateCommand": "sudo chown -R node /workspaces/temba-components/static/svg && sudo chown node /workspaces/temba-components && sudo chown node /workspaces/temba-components/screenshots && yarn install && echo 'Testing minio connection:' && curl -f http://minio:9000/minio/health/live || echo 'Minio connection failed - this is expected if minio is not running'",
17
18
  "customizations": {
18
19
  "vscode": {
19
20
  "extensions": [
@@ -23,7 +23,6 @@ jobs:
23
23
  - name: Build and run dev container task
24
24
  id: validate
25
25
  uses: devcontainers/ci@v0.3
26
- continue-on-error: true
27
26
  with:
28
27
  runCmd: |
29
28
  yarn validate 2>&1 | tee validate_output.log
@@ -33,7 +32,7 @@ jobs:
33
32
  CI=true
34
33
 
35
34
  - name: Extract coverage stats
36
- if: always()
35
+ if: success() || failure()
37
36
  run: |
38
37
  if [ -f validate_output.log ]; then
39
38
  echo "Extracting coverage information from validate output..."
@@ -69,7 +68,7 @@ jobs:
69
68
  fi
70
69
 
71
70
  - name: Comment coverage on PR
72
- if: github.event_name == 'pull_request' && always()
71
+ if: github.event_name == 'pull_request' && (success() || failure())
73
72
  uses: actions/github-script@v7
74
73
  with:
75
74
  script: |
@@ -123,7 +122,7 @@ jobs:
123
122
  }
124
123
 
125
124
  - name: Configure AWS credentials
126
- if: always()
125
+ if: success() || failure()
127
126
  uses: aws-actions/configure-aws-credentials@v4
128
127
  with:
129
128
  aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -131,7 +130,7 @@ jobs:
131
130
  aws-region: us-east-1
132
131
 
133
132
  - name: Upload coverage report to S3
134
- if: always()
133
+ if: success() || failure()
135
134
  run: |
136
135
  # Check if coverage directory exists
137
136
  if [ -d "coverage/lcov-report" ]; then
@@ -151,15 +150,6 @@ jobs:
151
150
  echo "No coverage report found to upload"
152
151
  fi
153
152
 
154
- - name: Check validation result
155
- run: |
156
- if [ "${{ steps.validate.outcome }}" != "success" ]; then
157
- echo "❌ Validation failed"
158
- exit 1
159
- else
160
- echo "✅ Validation passed"
161
- fi
162
-
163
153
  - name: Upload artifacts
164
154
  if: failure()
165
155
  uses: actions/upload-artifact@v4
package/CHANGELOG.md CHANGED
@@ -4,14 +4,19 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
- #### [v0.129.7](https://github.com/nyaruka/temba-components/compare/v0.129.6...v0.129.7)
7
+ #### [v0.129.8](https://github.com/nyaruka/temba-components/compare/v0.129.6...v0.129.8)
8
8
 
9
+ - Add support for `run_started` and `run_ended` events in chat history [`#660`](https://github.com/nyaruka/temba-components/pull/660)
10
+ - Fix completion in dev environment [`#659`](https://github.com/nyaruka/temba-components/pull/659)
11
+ - Roll our own flow info generator for dev env [`#658`](https://github.com/nyaruka/temba-components/pull/658)
12
+ - Group updates [`#657`](https://github.com/nyaruka/temba-components/pull/657)
13
+ - Integrate MessageEditor component with flow editor for send_msg action [`#654`](https://github.com/nyaruka/temba-components/pull/654)
9
14
  - Fix rendering of airtime transfer events [`#656`](https://github.com/nyaruka/temba-components/pull/656)
10
15
  - Update some flow def, show wa templates, fix exit clicks [`#652`](https://github.com/nyaruka/temba-components/pull/652)
11
16
  - Flow example list page [`#651`](https://github.com/nyaruka/temba-components/pull/651)
17
+ - Add minio dev support, finish attachment work [`8b1a930`](https://github.com/nyaruka/temba-components/commit/8b1a930ba6f2c87b46cfe7c79af949fe27fa43c8)
18
+ - Add MessageEditor component with tests [`0994c7f`](https://github.com/nyaruka/temba-components/commit/0994c7fa58d8e77741925049934ccca96c85653a)
12
19
  - Support multiple flow examples [`932de08`](https://github.com/nyaruka/temba-components/commit/932de08987089145781dd9756ef9a8752f630ccb)
13
- - Update screenshots [`7ee7687`](https://github.com/nyaruka/temba-components/commit/7ee76872923341ba310ccfe99cea1a939d72d9f3)
14
- - Use json for flow list [`208f26e`](https://github.com/nyaruka/temba-components/commit/208f26ead8060ebeedac68f4d50a9ade2f7fc4e6)
15
20
 
16
21
  #### [v0.129.6](https://github.com/nyaruka/temba-components/compare/v0.129.5...v0.129.6)
17
22
 
@@ -36,7 +36,7 @@
36
36
  </style>
37
37
  </head>
38
38
  <body>
39
- <temba-store></temba-store>
39
+ <temba-store completion="/api/v2/completion.json"></temba-store>
40
40
  <temba-flow-editor id="flow-editor"></temba-flow-editor>
41
41
 
42
42
  <script type="module">
@@ -0,0 +1,125 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Message Editor Examples</title>
6
+ <link
7
+ href="/static/css/temba-components.css"
8
+ rel="stylesheet"
9
+ type="text/css"
10
+ />
11
+ <link
12
+ href="https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:300,400,500"
13
+ rel="stylesheet"
14
+ />
15
+ <link href="/demo/static/css/styles.css" rel="stylesheet" type="text/css" />
16
+ </head>
17
+ <body>
18
+ <h1>Message Editor Examples</h1>
19
+
20
+ <p>
21
+ <a href="/demo/index.html">← Back to main demo</a>
22
+ </p>
23
+
24
+ <div class="example">
25
+ <h3>Basic Message Editor</h3>
26
+ <p>A composed component that combines text completion and media picker</p>
27
+ <temba-message-editor
28
+ name="message"
29
+ placeholder="Type your message here..."
30
+ label="Message"
31
+ ></temba-message-editor>
32
+ </div>
33
+
34
+ <div class="example">
35
+ <h3>Message Editor with Value</h3>
36
+ <p>Pre-populated with a message</p>
37
+ <temba-message-editor
38
+ name="message2"
39
+ value="Hello @contact.name, your order is ready!"
40
+ placeholder="Type your message here..."
41
+ label="Message with Completion"
42
+ ></temba-message-editor>
43
+ </div>
44
+
45
+ <div class="example">
46
+ <h3>Message Editor with Attachments</h3>
47
+ <p>Pre-populated with mixed attachment types (static and runtime)</p>
48
+ <temba-message-editor
49
+ name="message3"
50
+ value="Check out this document and image"
51
+ placeholder="Type your message here..."
52
+ label="Message with Attachments"
53
+ attachments='["image/jpeg:http://example.com/photo.jpg", "application/pdf:http://example.com/doc.pdf", "image:@fields.profile_pic", "video:@fields.intro_video"]'
54
+ ></temba-message-editor>
55
+ </div>
56
+
57
+ <div class="example">
58
+ <h3>Message Editor with File Type Restrictions</h3>
59
+ <p>Only accepts image files</p>
60
+ <temba-message-editor
61
+ name="message4"
62
+ placeholder="Type your message and attach images..."
63
+ label="Images Only"
64
+ accept="image/*"
65
+ max-attachments="5"
66
+ ></temba-message-editor>
67
+ </div>
68
+
69
+ <div class="example">
70
+ <h3>Message Editor with Counter</h3>
71
+ <p>With GSM character counter</p>
72
+ <temba-message-editor
73
+ name="message5"
74
+ value="This message has a GSM character counter"
75
+ placeholder="Type your message..."
76
+ label="Message with Counter"
77
+ counter="temba-charcount"
78
+ gsm
79
+ ></temba-message-editor>
80
+ <temba-charcount text="count this text"></temba-charcount>
81
+ </div>
82
+
83
+ <div class="example">
84
+ <h3>Compact Message Editor</h3>
85
+ <p>Smaller minimum height</p>
86
+ <temba-message-editor
87
+ name="message6"
88
+ placeholder="Quick message..."
89
+ label="Compact Editor"
90
+ min-height="40"
91
+ ></temba-message-editor>
92
+ </div>
93
+
94
+ <div class="example">
95
+ <h3>Widget Only (No Label)</h3>
96
+ <p>Just the widget without field wrapper</p>
97
+ <temba-message-editor
98
+ name="message7"
99
+ placeholder="Widget only mode..."
100
+ widget-only
101
+ ></temba-message-editor>
102
+ </div>
103
+
104
+ <script type="module">
105
+ import '/out-tsc/temba-modules.js';
106
+
107
+ // Add some event listeners to show how the component works
108
+ document.addEventListener('DOMContentLoaded', () => {
109
+ const editors = document.querySelectorAll('temba-message-editor');
110
+ editors.forEach(editor => {
111
+ editor.addEventListener('change', (e) => {
112
+ console.log(`Message Editor "${editor.name}" changed:`, {
113
+ value: editor.value,
114
+ attachments: editor.attachments
115
+ });
116
+ });
117
+
118
+ editor.addEventListener('loading', (e) => {
119
+ console.log(`Message Editor "${editor.name}" loading:`, e.detail.loading);
120
+ });
121
+ });
122
+ });
123
+ </script>
124
+ </body>
125
+ </html>
@@ -15,6 +15,7 @@
15
15
  <link href="/demo/static/css/styles.css" rel="stylesheet" type="text/css" />
16
16
  </head>
17
17
  <body>
18
+ <temba-store completion="/api/v2/completion.json"></temba-store>
18
19
  <h1>Completion Examples</h1>
19
20
 
20
21
  <p>
@@ -4,8 +4,8 @@
4
4
  "nodes": {
5
5
  "b01610c8-d6dc-4bdb-9439-5713cdcf9afa": {
6
6
  "position": {
7
- "left": 80,
8
- "top": 80
7
+ "left": 60,
8
+ "top": 20
9
9
  },
10
10
  "type": "execute_actions"
11
11
  },
@@ -13,7 +13,7 @@
13
13
  "type": "wait_for_response",
14
14
  "position": {
15
15
  "left": 80,
16
- "top": 260
16
+ "top": 240
17
17
  },
18
18
  "config": {
19
19
  "cases": {}
@@ -41,27 +41,17 @@
41
41
  "uuid": "b01610c8-d6dc-4bdb-9439-5713cdcf9afa",
42
42
  "actions": [
43
43
  {
44
+ "uuid": "90957b4e-05a4-4d00-8163-47046f81246d",
45
+ "type": "send_msg",
46
+ "text": "Would you like chicken or fish?",
44
47
  "attachments": [
45
- "image/jpeg:http://minio:9000/temba-default/orgs/1/media/495c/495c33e3-237e-4c36-b854-6ca609839e3a/intro-1745448388.jpg",
46
- "image:@fields.profile_pic"
48
+ "image/jpeg:http://localhost:9000/temba-attachments/816f8797-c929-47a8-a1ad-9a33f0123406-IMG_0917.jpeg",
49
+ "image/jpeg:http://localhost:9000/temba-attachments/de0f23fc-2d71-4a93-90d3-729b1ad65cd2-IMG_3208.jpeg"
47
50
  ],
48
- "text": "Chicken or fish?",
49
- "type": "send_msg",
50
51
  "quick_replies": [
51
- "Chicken",
52
- "Fish"
53
- ],
54
- "uuid": "90957b4e-05a4-4d00-8163-47046f81246d",
55
- "template": {
56
- "uuid": "b5e47571-4ee7-4e9e-b48f-1c4efd4d6429",
57
- "name": "Dinner Menu"
58
- },
59
- "template_variables": [
60
- "Food",
61
- "@contact.name",
62
- "Chicken",
63
52
  "Fish",
64
- "Rowan"
53
+ "Chicken",
54
+ "arst"
65
55
  ]
66
56
  }
67
57
  ],
@@ -124,7 +114,8 @@
124
114
  "uuid": "9e84e680-a710-4894-a838-dd22a8dcc341"
125
115
  },
126
116
  {
127
- "uuid": "12043e9e-7aa0-41fd-8f04-e0d42a0c2099"
117
+ "uuid": "12043e9e-7aa0-41fd-8f04-e0d42a0c2099",
118
+ "destination_uuid": null
128
119
  },
129
120
  {
130
121
  "uuid": "79b6a4e6-1a00-44cc-9fd4-2d9ba2a394e0",
@@ -10,17 +10,27 @@
10
10
  "uuid": "a229fa3c-16bb-440b-9ae8-b7ee7a723f44",
11
11
  "actions": [
12
12
  {
13
+ "uuid": "3d56e4cf-1e88-499a-b0b4-ff48385fc9a5",
14
+ "type": "send_msg",
15
+ "text": "What is your favorite color?! @contact.uuid. It works.",
13
16
  "attachments": [
14
- "image:http://google.com/logo.png"
17
+ "image/jpeg:http://localhost:9000/temba-attachments/c4e84ebf-fdd7-439b-a2ca-aeb5e54dfc1d-IMG_3245.jpeg",
18
+ "image/jpeg:http://localhost:9000/temba-attachments/e7d4d3cd-ec89-45c2-bc0b-4f652f1f7fde-IMG_3262.jpeg",
19
+ "image/jpeg:http://localhost:9000/temba-attachments/ae831575-0d23-40b7-ae0c-531b8775a6bc-IMG_3282.jpeg",
20
+ "image/jpeg:http://localhost:9000/temba-attachments/837ac13b-e524-4a4c-9385-81873c5df138-IMG_3290.jpeg",
21
+ "image/jpeg:http://localhost:9000/temba-attachments/761e6345-3a19-49da-8a53-5c772d7739bc-IMG_3339.jpeg",
22
+ "image/jpeg:http://localhost:9000/temba-attachments/ea6b336d-4389-4d32-b58a-e5a138d13c84-IMG_3237.jpeg"
15
23
  ],
16
- "text": "What is your favorite color?",
17
- "type": "send_msg",
18
24
  "quick_replies": [
19
25
  "Red",
20
26
  "Green",
21
- "Blue"
22
- ],
23
- "uuid": "3d56e4cf-1e88-499a-b0b4-ff48385fc9a5"
27
+ "Blue",
28
+ "Yellow",
29
+ "Purple",
30
+ "@contact.first_name",
31
+ "@contact.uuid",
32
+ "@contact.last_name"
33
+ ]
24
34
  }
25
35
  ],
26
36
  "exits": [
@@ -135,7 +145,7 @@
135
145
  "Content-Type": "application/json",
136
146
  "Authorization": "Bearer token here"
137
147
  },
138
- "body": "@(json(object(\n \"contact\", object(\n \"uuid\", contact.uuid, \n \"name\", contact.name, \n \"urn\", contact.urn\n ),\n \"flow\", object(\n \"uuid\", run.flow.uuid, \n \"name\", run.flow.name\n ),\n \"results\", foreach_value(results, extract_object, \"value\", \"category\")\n)))"
148
+ "body": "@(json(object(\n \"contact\", object(\n \"uuid\", contact.uuid, \n \"name\", contact.name, \n \"urn\", contact.urn\n ),\n \"flow\", object(\n \"uuid\", run.flow.uuid, \n \"name\", run.flow.name\n ),\n \"results\", foreach_value(results, extract_object, \"value\", \"category\")\n)))ast"
139
149
  }
140
150
  ],
141
151
  "router": {
@@ -181,6 +191,21 @@
181
191
  {
182
192
  "uuid": "4efc49e0-ebfe-454d-a1a0-900a911dd5ef",
183
193
  "actions": [
194
+ {
195
+ "uuid": "9963160a-a007-4c7b-8c9e-7325e1b69ed8",
196
+ "type": "send_msg",
197
+ "text": "Excellent choices.",
198
+ "attachments": [
199
+ "audio:http://arst",
200
+ "image:@contact.first_name"
201
+ ],
202
+ "quick_replies": [
203
+ "Red",
204
+ "Green",
205
+ "Blue",
206
+ "@contact.name"
207
+ ]
208
+ },
184
209
  {
185
210
  "uuid": "ffe1c2d3-4e5f-6a7b-8c9d-e0f1a2b3c4d5",
186
211
  "type": "remove_contact_groups",
@@ -221,15 +246,6 @@
221
246
  ],
222
247
  "all_groups": false
223
248
  },
224
- {
225
- "uuid": "9963160a-a007-4c7b-8c9e-7325e1b69ed8",
226
- "type": "send_msg",
227
- "text": "Excellent choices.",
228
- "quick_replies": [
229
- "blooooop",
230
- "bleep"
231
- ]
232
- },
233
249
  {
234
250
  "uuid": "d1ca86da-f321-4e09-8bb2-981de03f5a90",
235
251
  "type": "add_contact_groups",
@@ -798,7 +814,7 @@
798
814
  "nodes": {
799
815
  "a229fa3c-16bb-440b-9ae8-b7ee7a723f44": {
800
816
  "position": {
801
- "left": 260,
817
+ "left": 240,
802
818
  "top": 0
803
819
  },
804
820
  "type": "execute_actions"
@@ -806,8 +822,8 @@
806
822
  "ef1a5b06-1331-4c0d-9f46-58b1e5baf671": {
807
823
  "type": "wait_for_response",
808
824
  "position": {
809
- "left": 260,
810
- "top": 160
825
+ "left": 220,
826
+ "top": 260
811
827
  },
812
828
  "config": {
813
829
  "cases": {}
@@ -816,15 +832,15 @@
816
832
  "e1f22e97-a170-44b4-a79b-98ab916f4c34": {
817
833
  "type": "split_by_webhook",
818
834
  "position": {
819
- "left": 800,
820
- "top": 0
835
+ "left": 700,
836
+ "top": 20
821
837
  },
822
838
  "config": {}
823
839
  },
824
840
  "4efc49e0-ebfe-454d-a1a0-900a911dd5ef": {
825
841
  "position": {
826
- "left": 240,
827
- "top": 340
842
+ "left": 220,
843
+ "top": 440
828
844
  },
829
845
  "type": "execute_actions"
830
846
  },
@@ -887,8 +903,8 @@
887
903
  "5f1394c1-4b8c-4357-8863-db24817b2aa3": {
888
904
  "type": "split_by_groups",
889
905
  "position": {
890
- "left": 500,
891
- "top": 360
906
+ "left": 520,
907
+ "top": 380
892
908
  },
893
909
  "config": {
894
910
  "cases": {}
@@ -950,7 +966,7 @@
950
966
  "598a87e4-f20b-48ba-aac5-bb365d8f1501": {
951
967
  "position": {
952
968
  "left": 0,
953
- "top": 720
969
+ "top": 780
954
970
  },
955
971
  "title": "Green Note",
956
972
  "body": "They also come in green, do I like them better? Maybe I do. There is a standard height, they will have to get used to it.",