n8n-nodes-bgos 1.2.0 → 1.3.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.
- package/README.md +12 -2
- package/dist/credentials/bgos.svg +8 -13
- package/dist/icons/bgos.png +0 -0
- package/dist/icons/bgos.svg +8 -13
- package/dist/nodes/BGOSAction/BGOSAction.node.d.ts +9 -0
- package/dist/nodes/BGOSAction/BGOSAction.node.js +165 -10
- package/dist/nodes/BGOSAction/EventTypes.d.ts +2 -1
- package/dist/nodes/BGOSAction/EventTypes.js +1 -0
- package/dist/nodes/BGOSAction/bgos.png +0 -0
- package/dist/nodes/BGOSAction/bgos.svg +8 -13
- package/dist/nodes/BGOSAction/handler/eventHandler.d.ts +12 -0
- package/dist/nodes/BGOSAction/handler/eventHandler.js +136 -0
- package/dist/nodes/BGOSAction/techWebhook.d.ts +56 -0
- package/dist/nodes/BGOSAction/techWebhook.js +51 -0
- package/dist/nodes/Bgos/Bgos.node.js +17 -57
- package/dist/nodes/Bgos/bgos.png +0 -0
- package/dist/nodes/Bgos/bgos.svg +8 -13
- package/dist/nodes/Bgos/resources/message/index.js +37 -506
- package/dist/nodes/BgosTrigger/BgosTrigger.node.js +1 -0
- package/dist/nodes/BgosTrigger/bgos.png +0 -0
- package/dist/nodes/BgosTrigger/bgos.svg +8 -13
- package/package.json +1 -1
- package/dist/credentials/bgos.png +0 -0
- package/dist/nodes/BGOSAction/agentWebhook.d.ts +0 -8
- package/dist/nodes/BGOSAction/agentWebhook.js +0 -66
package/README.md
CHANGED
|
@@ -10,15 +10,24 @@ Perform operations on the BGOS platform:
|
|
|
10
10
|
|
|
11
11
|
| Resource | Operations |
|
|
12
12
|
|---|---|
|
|
13
|
-
| **Message** | Send Message, Create, Bulk Create, Edit, Delete, Button Callback |
|
|
13
|
+
| **Message** | Send Message, Create, Bulk Create, Edit, Delete, Button Callback, **Ask User Input** |
|
|
14
14
|
| **Chat** | Create, Get, Rename, Delete, Get Messages, Get Unread, Increment Unread, Mark as Read |
|
|
15
15
|
| **Assistant** | Create, Get, Update, Delete, Reorder, Get With Chats |
|
|
16
16
|
| **User** | Get or Create, Update |
|
|
17
17
|
| **Scheduled Task** | Get, Get User Tasks, Delete |
|
|
18
18
|
|
|
19
|
+
#### Ask User Input
|
|
20
|
+
|
|
21
|
+
Pops the BGOS app's polished modal/sheet to ask the user 1–4 multiple-choice questions in a single carousel. Each question accepts: option list (label + value), optional free-text fallback, optional skip. The node POSTs each question to `/api/v1/messages` with `messageType=ask_user_input`, sharing one `askId` so they group into one carousel.
|
|
22
|
+
|
|
23
|
+
Two response modes:
|
|
24
|
+
|
|
25
|
+
- **Wait for Answers (default)**: blocks until every question is answered (or the timeout expires) and returns `{ askId, answers: [{ messageId, askOrder, question, picked_option_value?, picked_option_label?, free_text?, skipped? }] }`. Requires a User ID for the polling chat-history GET.
|
|
26
|
+
- **Fire and Forget**: returns immediately with `{ askId, questionMessageIds }`. Subscribe to the `Ask Response` event in a separate `BGOS Trigger` workflow to receive each answer as it lands.
|
|
27
|
+
|
|
19
28
|
### BGOS Trigger (Webhook Node)
|
|
20
29
|
|
|
21
|
-
Starts workflows when BGOS events occur. Supports
|
|
30
|
+
Starts workflows when BGOS events occur. Supports 17 event types:
|
|
22
31
|
|
|
23
32
|
- `message`, `edited_message`, `voice_message`, `reply_message`
|
|
24
33
|
- `new_chat`, `chat_renamed`, `chat_deleted`
|
|
@@ -26,6 +35,7 @@ Starts workflows when BGOS events occur. Supports 16 event types:
|
|
|
26
35
|
- `voice_started`, `voice_ended`
|
|
27
36
|
- `message_deleted`, `button_clicked`
|
|
28
37
|
- `user_created`, `user_updated`
|
|
38
|
+
- `ask_response` (one event per answered/skipped ask_user_input question)
|
|
29
39
|
|
|
30
40
|
## Credentials
|
|
31
41
|
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg
|
|
3
|
-
<path d="
|
|
4
|
-
<path d="
|
|
5
|
-
<path d="
|
|
6
|
-
<path d="
|
|
7
|
-
<path d="
|
|
8
|
-
<path d="
|
|
9
|
-
<
|
|
10
|
-
<path d="M0 0 C4.13973026 2.92080968 7.04928755 5.93016815 8.484375 10.86328125 C8.70765629 15.20947751 8.65851859 19.51614126 8.484375 23.86328125 C6.504375 24.85328125 6.504375 24.85328125 4.484375 25.86328125 C3.64173488 22.59805077 3.48662623 19.70539538 3.609375 16.36328125 C3.64273027 12.34730708 3.17029892 10.0122955 0.484375 6.86328125 C-3.4008655 3.44897899 -7.18993708 3.42962147 -12.1484375 3.5546875 C-15.13605288 3.94416211 -17.04529049 5.19217261 -19.515625 6.86328125 C-21.828125 6.55078125 -21.828125 6.55078125 -23.515625 5.86328125 C-22.55838625 3.08728887 -21.56216899 1.89850373 -19.203125 0.11328125 C-13.02295694 -1.98169097 -6.09302597 -2.75321515 0 0 Z " fill="#E5CA45" transform="translate(51.515625,41.13671875)"/>
|
|
11
|
-
<path d="M0 0 C0.01417969 0.845625 0.02835938 1.69125 0.04296875 2.5625 C0.3517249 9.90588953 0.95656814 15.42643468 6 21 C10.08559728 24.51815321 14.76659932 24.88064174 20 25 C23.39342704 24.64619356 23.39342704 24.64619356 26 24 C26 24.99 26 25.98 26 27 C21.44482424 29.27758788 14.65495494 28.80570845 9.86328125 27.3515625 C5.39385687 25.00134833 1.74628131 21.20236334 -1 17 C-1.33333333 15.66666667 -1.66666667 14.33333333 -2 13 C-2.66 12.67 -3.32 12.34 -4 12 C-3.88648483 10.18674449 -3.75887039 8.37436643 -3.625 6.5625 C-3.55539063 5.55316406 -3.48578125 4.54382812 -3.4140625 3.50390625 C-3.27742188 2.67761719 -3.14078125 1.85132813 -3 1 C-1 0 -1 0 0 0 Z " fill="#302C1F" transform="translate(24,51)"/>
|
|
12
|
-
<path d="M0 0 C3.0625 0.3125 3.0625 0.3125 5 1.4375 C6.60193488 4.26444391 5.85834319 6.26176777 5.0625 9.3125 C4.0625 10.3125 4.0625 10.3125 0.625 10.5 C-2.9375 10.3125 -2.9375 10.3125 -4.9375 8.3125 C-5.1875 5.3125 -5.1875 5.3125 -4.9375 2.3125 C-2.9375 0.3125 -2.9375 0.3125 0 0 Z " fill="#EFD247" transform="translate(41.9375,52.6875)"/>
|
|
13
|
-
<path d="M0 0 C0.99 0.66 1.98 1.32 3 2 C2.31035156 2.07476562 1.62070312 2.14953125 0.91015625 2.2265625 C-8.46539433 3.53836793 -14.48467262 7.22405953 -21 14 C-21.66 14 -22.32 14 -23 14 C-21.60495725 8.72983849 -18.3903978 5.93763363 -14 3 C-4.66788403 -1.78790589 -4.66788403 -1.78790589 0 0 Z " fill="#343020" transform="translate(41,31)"/>
|
|
14
|
-
<path d="M0 0 C-0.33 0.99 -0.66 1.98 -1 3 C-2.9609375 3.94921875 -2.9609375 3.94921875 -5.375 4.6875 C-6.56222656 5.06455078 -6.56222656 5.06455078 -7.7734375 5.44921875 C-10 6 -10 6 -13 6 C-12 3 -12 3 -9.78515625 1.796875 C-8.43744141 1.27867188 -8.43744141 1.27867188 -7.0625 0.75 C-6.16660156 0.39421875 -5.27070312 0.0384375 -4.34765625 -0.328125 C-2 -1 -2 -1 0 0 Z " fill="#363221" transform="translate(57,80)"/>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 512.35 512.26">
|
|
3
|
+
<path d="M333.14,343.5c-42.62,37.65-105.73,39.01-150.07,3.23-40.95-33.05-54.68-89.68-33.38-137.72,3.58-8.08-.06-17.55-8.16-21.13-8.08-3.58-17.55.07-21.13,8.15-27.16,61.28-9.66,133.49,42.55,175.62,56.54,45.62,137.03,43.89,191.39-4.14,6.63-5.86,7.26-15.98,1.4-22.61-.61-.68-1.26-1.3-1.95-1.86-5.97-4.82-14.71-4.79-20.66.46" fill="#EFD247"/>
|
|
4
|
+
<path d="M98.73,129.09c-35.26,43.7-50.84,100.65-42.75,156.24.61,4.16,2.76,7.7,5.79,10.15,3.35,2.7,7.78,4.06,12.37,3.39,8.76-1.28,14.81-9.4,13.53-18.15-6.81-46.8,6.3-94.73,35.98-131.51,58.96-73.07,166.38-84.55,239.45-25.59,24.62,19.86,43.14,46.04,53.61,75.7,2.94,8.34,12.09,12.72,20.44,9.78,8.34-2.94,12.72-12.09,9.77-20.43-12.43-35.27-34.47-66.37-63.7-89.96-86.81-70.05-214.43-56.42-284.49,30.4" fill="#EFD247"/>
|
|
5
|
+
<path d="M247.5,107.94c-36.66,2.15-71.01,17.66-96.73,43.66-6.22,6.29-6.17,16.43.12,22.65.39.39.8.75,1.22,1.09,6.32,5.1,15.59,4.68,21.43-1.21,42.11-42.56,109.07-46.26,155.74-8.59,41.33,33.35,54.89,90.36,32.97,138.64-3.66,8.06-.09,17.56,7.96,21.21,8.06,3.66,17.55.09,21.21-7.96,27.96-61.59,10.68-134.3-42.02-176.82-28.8-23.24-64.98-34.84-101.9-32.67" fill="#EFD247"/>
|
|
6
|
+
<path d="M442.39,239.33c-8.84.04-15.98,7.25-15.94,16.1.12,23.82-4.63,46.92-14.09,68.65-6.07,13.93-14.04,27.05-23.68,39-58.96,73.07-166.37,84.54-239.44,25.58-24.19-19.52-42.55-45.18-53.09-74.22-3.01-8.31-12.2-12.61-20.52-9.59-8.32,3.02-12.6,12.21-9.59,20.52,12.54,34.53,34.35,65.04,63.08,88.22,86.81,70.05,214.43,56.42,284.48-30.39,11.44-14.18,20.9-29.76,28.12-46.32,11.26-25.83,16.89-53.28,16.76-81.59-.03-5.01-2.35-9.48-5.96-12.4-2.77-2.23-6.3-3.56-10.13-3.55" fill="#EFD247"/>
|
|
7
|
+
<path d="M366.47,24.87C315.34.43,256.55-6.28,200.91,5.99c-56.51,12.44-107.68,44.16-144.09,89.28C17.57,143.91-2.52,205.04.25,267.41c2.74,61.82,27.63,120.44,70.07,165.06.5.52,1.02,1,1.56,1.43,6.16,4.97,15.19,4.73,21.08-.87,6.41-6.09,6.66-16.23.57-22.64C16.47,329.38,11.4,202.54,81.74,115.38c32.32-40.06,75.92-67.06,126.06-78.11,48.7-10.73,100.15-4.87,144.86,16.49,7.98,3.82,17.54.44,21.36-7.55,3.26-6.83,1.26-14.8-4.38-19.36-.96-.77-2.01-1.44-3.17-1.99" fill="#EFD247"/>
|
|
8
|
+
<path d="M444.69,106.4c-7.27,5.03-9.09,15.01-4.06,22.28,26.95,38.96,41.01,86.65,39.59,134.28-1.46,49.2-18.62,95.51-49.62,133.93-64.87,80.39-175.46,106.1-268.96,62.53-8.02-3.73-17.55-.26-21.28,7.76-3.18,6.81-1.15,14.7,4.45,19.22.99.8,2.09,1.5,3.3,2.06,50.95,23.74,109.36,29.97,164.49,17.56,56.84-12.79,106.25-43.58,142.92-89.01,35.43-43.91,55.04-96.84,56.71-153.08,1.62-54.41-14.46-108.91-45.26-153.45-.9-1.3-1.95-2.42-3.12-3.36-5.39-4.35-13.19-4.84-19.16-.7" fill="#EFD247"/>
|
|
9
|
+
<circle cx="258.38" cy="256.71" r="44.45" fill="#EFD247"/>
|
|
15
10
|
</svg>
|
package/dist/icons/bgos.png
CHANGED
|
Binary file
|
package/dist/icons/bgos.svg
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg
|
|
3
|
-
<path d="
|
|
4
|
-
<path d="
|
|
5
|
-
<path d="
|
|
6
|
-
<path d="
|
|
7
|
-
<path d="
|
|
8
|
-
<path d="
|
|
9
|
-
<
|
|
10
|
-
<path d="M0 0 C4.13973026 2.92080968 7.04928755 5.93016815 8.484375 10.86328125 C8.70765629 15.20947751 8.65851859 19.51614126 8.484375 23.86328125 C6.504375 24.85328125 6.504375 24.85328125 4.484375 25.86328125 C3.64173488 22.59805077 3.48662623 19.70539538 3.609375 16.36328125 C3.64273027 12.34730708 3.17029892 10.0122955 0.484375 6.86328125 C-3.4008655 3.44897899 -7.18993708 3.42962147 -12.1484375 3.5546875 C-15.13605288 3.94416211 -17.04529049 5.19217261 -19.515625 6.86328125 C-21.828125 6.55078125 -21.828125 6.55078125 -23.515625 5.86328125 C-22.55838625 3.08728887 -21.56216899 1.89850373 -19.203125 0.11328125 C-13.02295694 -1.98169097 -6.09302597 -2.75321515 0 0 Z " fill="#E5CA45" transform="translate(51.515625,41.13671875)"/>
|
|
11
|
-
<path d="M0 0 C0.01417969 0.845625 0.02835938 1.69125 0.04296875 2.5625 C0.3517249 9.90588953 0.95656814 15.42643468 6 21 C10.08559728 24.51815321 14.76659932 24.88064174 20 25 C23.39342704 24.64619356 23.39342704 24.64619356 26 24 C26 24.99 26 25.98 26 27 C21.44482424 29.27758788 14.65495494 28.80570845 9.86328125 27.3515625 C5.39385687 25.00134833 1.74628131 21.20236334 -1 17 C-1.33333333 15.66666667 -1.66666667 14.33333333 -2 13 C-2.66 12.67 -3.32 12.34 -4 12 C-3.88648483 10.18674449 -3.75887039 8.37436643 -3.625 6.5625 C-3.55539063 5.55316406 -3.48578125 4.54382812 -3.4140625 3.50390625 C-3.27742188 2.67761719 -3.14078125 1.85132813 -3 1 C-1 0 -1 0 0 0 Z " fill="#302C1F" transform="translate(24,51)"/>
|
|
12
|
-
<path d="M0 0 C3.0625 0.3125 3.0625 0.3125 5 1.4375 C6.60193488 4.26444391 5.85834319 6.26176777 5.0625 9.3125 C4.0625 10.3125 4.0625 10.3125 0.625 10.5 C-2.9375 10.3125 -2.9375 10.3125 -4.9375 8.3125 C-5.1875 5.3125 -5.1875 5.3125 -4.9375 2.3125 C-2.9375 0.3125 -2.9375 0.3125 0 0 Z " fill="#EFD247" transform="translate(41.9375,52.6875)"/>
|
|
13
|
-
<path d="M0 0 C0.99 0.66 1.98 1.32 3 2 C2.31035156 2.07476562 1.62070312 2.14953125 0.91015625 2.2265625 C-8.46539433 3.53836793 -14.48467262 7.22405953 -21 14 C-21.66 14 -22.32 14 -23 14 C-21.60495725 8.72983849 -18.3903978 5.93763363 -14 3 C-4.66788403 -1.78790589 -4.66788403 -1.78790589 0 0 Z " fill="#343020" transform="translate(41,31)"/>
|
|
14
|
-
<path d="M0 0 C-0.33 0.99 -0.66 1.98 -1 3 C-2.9609375 3.94921875 -2.9609375 3.94921875 -5.375 4.6875 C-6.56222656 5.06455078 -6.56222656 5.06455078 -7.7734375 5.44921875 C-10 6 -10 6 -13 6 C-12 3 -12 3 -9.78515625 1.796875 C-8.43744141 1.27867188 -8.43744141 1.27867188 -7.0625 0.75 C-6.16660156 0.39421875 -5.27070312 0.0384375 -4.34765625 -0.328125 C-2 -1 -2 -1 0 0 Z " fill="#363221" transform="translate(57,80)"/>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 512.35 512.26">
|
|
3
|
+
<path d="M333.14,343.5c-42.62,37.65-105.73,39.01-150.07,3.23-40.95-33.05-54.68-89.68-33.38-137.72,3.58-8.08-.06-17.55-8.16-21.13-8.08-3.58-17.55.07-21.13,8.15-27.16,61.28-9.66,133.49,42.55,175.62,56.54,45.62,137.03,43.89,191.39-4.14,6.63-5.86,7.26-15.98,1.4-22.61-.61-.68-1.26-1.3-1.95-1.86-5.97-4.82-14.71-4.79-20.66.46" fill="#EFD247"/>
|
|
4
|
+
<path d="M98.73,129.09c-35.26,43.7-50.84,100.65-42.75,156.24.61,4.16,2.76,7.7,5.79,10.15,3.35,2.7,7.78,4.06,12.37,3.39,8.76-1.28,14.81-9.4,13.53-18.15-6.81-46.8,6.3-94.73,35.98-131.51,58.96-73.07,166.38-84.55,239.45-25.59,24.62,19.86,43.14,46.04,53.61,75.7,2.94,8.34,12.09,12.72,20.44,9.78,8.34-2.94,12.72-12.09,9.77-20.43-12.43-35.27-34.47-66.37-63.7-89.96-86.81-70.05-214.43-56.42-284.49,30.4" fill="#EFD247"/>
|
|
5
|
+
<path d="M247.5,107.94c-36.66,2.15-71.01,17.66-96.73,43.66-6.22,6.29-6.17,16.43.12,22.65.39.39.8.75,1.22,1.09,6.32,5.1,15.59,4.68,21.43-1.21,42.11-42.56,109.07-46.26,155.74-8.59,41.33,33.35,54.89,90.36,32.97,138.64-3.66,8.06-.09,17.56,7.96,21.21,8.06,3.66,17.55.09,21.21-7.96,27.96-61.59,10.68-134.3-42.02-176.82-28.8-23.24-64.98-34.84-101.9-32.67" fill="#EFD247"/>
|
|
6
|
+
<path d="M442.39,239.33c-8.84.04-15.98,7.25-15.94,16.1.12,23.82-4.63,46.92-14.09,68.65-6.07,13.93-14.04,27.05-23.68,39-58.96,73.07-166.37,84.54-239.44,25.58-24.19-19.52-42.55-45.18-53.09-74.22-3.01-8.31-12.2-12.61-20.52-9.59-8.32,3.02-12.6,12.21-9.59,20.52,12.54,34.53,34.35,65.04,63.08,88.22,86.81,70.05,214.43,56.42,284.48-30.39,11.44-14.18,20.9-29.76,28.12-46.32,11.26-25.83,16.89-53.28,16.76-81.59-.03-5.01-2.35-9.48-5.96-12.4-2.77-2.23-6.3-3.56-10.13-3.55" fill="#EFD247"/>
|
|
7
|
+
<path d="M366.47,24.87C315.34.43,256.55-6.28,200.91,5.99c-56.51,12.44-107.68,44.16-144.09,89.28C17.57,143.91-2.52,205.04.25,267.41c2.74,61.82,27.63,120.44,70.07,165.06.5.52,1.02,1,1.56,1.43,6.16,4.97,15.19,4.73,21.08-.87,6.41-6.09,6.66-16.23.57-22.64C16.47,329.38,11.4,202.54,81.74,115.38c32.32-40.06,75.92-67.06,126.06-78.11,48.7-10.73,100.15-4.87,144.86,16.49,7.98,3.82,17.54.44,21.36-7.55,3.26-6.83,1.26-14.8-4.38-19.36-.96-.77-2.01-1.44-3.17-1.99" fill="#EFD247"/>
|
|
8
|
+
<path d="M444.69,106.4c-7.27,5.03-9.09,15.01-4.06,22.28,26.95,38.96,41.01,86.65,39.59,134.28-1.46,49.2-18.62,95.51-49.62,133.93-64.87,80.39-175.46,106.1-268.96,62.53-8.02-3.73-17.55-.26-21.28,7.76-3.18,6.81-1.15,14.7,4.45,19.22.99.8,2.09,1.5,3.3,2.06,50.95,23.74,109.36,29.97,164.49,17.56,56.84-12.79,106.25-43.58,142.92-89.01,35.43-43.91,55.04-96.84,56.71-153.08,1.62-54.41-14.46-108.91-45.26-153.45-.9-1.3-1.95-2.42-3.12-3.36-5.39-4.35-13.19-4.84-19.16-.7" fill="#EFD247"/>
|
|
9
|
+
<circle cx="258.38" cy="256.71" r="44.45" fill="#EFD247"/>
|
|
15
10
|
</svg>
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export type AskQuestionParam = {
|
|
3
|
+
text: string;
|
|
4
|
+
options: Array<{
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}>;
|
|
8
|
+
allowFreeText: boolean;
|
|
9
|
+
allowSkip: boolean;
|
|
10
|
+
};
|
|
2
11
|
export declare class BGOSAction implements INodeType {
|
|
3
12
|
description: INodeTypeDescription;
|
|
4
13
|
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
@@ -57,6 +57,12 @@ class BGOSAction {
|
|
|
57
57
|
description: 'Send an assistant reply to the user with optional file attachment',
|
|
58
58
|
action: 'Send a message',
|
|
59
59
|
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Ask User Input',
|
|
62
|
+
value: 'askUserInput',
|
|
63
|
+
description: 'Ask the user 1–4 multiple-choice questions through the polished modal/sheet in the BGOS app',
|
|
64
|
+
action: 'Ask user input',
|
|
65
|
+
},
|
|
60
66
|
],
|
|
61
67
|
default: 'sendMessage',
|
|
62
68
|
required: true,
|
|
@@ -234,6 +240,130 @@ class BGOSAction {
|
|
|
234
240
|
description: 'ID of the message to delete. Falls back to message_id / messageId from input data.',
|
|
235
241
|
displayOptions: { show: { resource: ['message'], operation: ['deleteMessage'] } },
|
|
236
242
|
},
|
|
243
|
+
// ── Ask User Input ────────────────────────────────────────────────────
|
|
244
|
+
{
|
|
245
|
+
displayName: 'Chat ID',
|
|
246
|
+
name: 'chatId',
|
|
247
|
+
type: 'string',
|
|
248
|
+
default: '',
|
|
249
|
+
placeholder: '123',
|
|
250
|
+
description: 'ID of the chat to ask in. Falls back to chatId / chat_id from input data.',
|
|
251
|
+
displayOptions: { show: { resource: ['message'], operation: ['askUserInput'] } },
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
displayName: 'Questions',
|
|
255
|
+
name: 'askQuestions',
|
|
256
|
+
type: 'fixedCollection',
|
|
257
|
+
typeOptions: { multipleValues: true, sortable: true },
|
|
258
|
+
default: { question: [] },
|
|
259
|
+
placeholder: 'Add Question',
|
|
260
|
+
description: 'One to four questions to display in the carousel. Each question must have at least two options.',
|
|
261
|
+
displayOptions: { show: { resource: ['message'], operation: ['askUserInput'] } },
|
|
262
|
+
options: [
|
|
263
|
+
{
|
|
264
|
+
displayName: 'Question',
|
|
265
|
+
name: 'question',
|
|
266
|
+
values: [
|
|
267
|
+
{
|
|
268
|
+
displayName: 'Text',
|
|
269
|
+
name: 'text',
|
|
270
|
+
type: 'string',
|
|
271
|
+
default: '',
|
|
272
|
+
placeholder: 'Which destination should we use?',
|
|
273
|
+
description: 'The question to display. Keep under ~80 chars.',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
displayName: 'Options',
|
|
277
|
+
name: 'options',
|
|
278
|
+
type: 'fixedCollection',
|
|
279
|
+
typeOptions: { multipleValues: true, sortable: true },
|
|
280
|
+
default: { option: [] },
|
|
281
|
+
placeholder: 'Add Option',
|
|
282
|
+
description: 'Selectable choices. 2–6 items recommended. Labels under ~30 chars.',
|
|
283
|
+
options: [
|
|
284
|
+
{
|
|
285
|
+
displayName: 'Option',
|
|
286
|
+
name: 'option',
|
|
287
|
+
values: [
|
|
288
|
+
{
|
|
289
|
+
displayName: 'Label',
|
|
290
|
+
name: 'label',
|
|
291
|
+
type: 'string',
|
|
292
|
+
default: '',
|
|
293
|
+
placeholder: 'Yes',
|
|
294
|
+
description: 'Visible button text.',
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
displayName: 'Value',
|
|
298
|
+
name: 'value',
|
|
299
|
+
type: 'string',
|
|
300
|
+
default: '',
|
|
301
|
+
placeholder: 'yes',
|
|
302
|
+
description: 'Identifier returned in the answer when this option is picked.',
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
displayName: 'Allow Free Text',
|
|
310
|
+
name: 'allowFreeText',
|
|
311
|
+
type: 'boolean',
|
|
312
|
+
default: true,
|
|
313
|
+
description: 'Whether to show the "Your answer…" input below the options',
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
displayName: 'Allow Skip',
|
|
317
|
+
name: 'allowSkip',
|
|
318
|
+
type: 'boolean',
|
|
319
|
+
default: true,
|
|
320
|
+
description: 'Whether to show a Skip button so the user can move past without answering',
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
displayName: 'User ID',
|
|
328
|
+
name: 'askUserId',
|
|
329
|
+
type: 'string',
|
|
330
|
+
default: '',
|
|
331
|
+
placeholder: 'user_xxx',
|
|
332
|
+
description: 'User ID who will answer. Required when "Wait for Answers" is on (used to poll the backend). Falls back to user_id / userId from input data.',
|
|
333
|
+
displayOptions: { show: { resource: ['message'], operation: ['askUserInput'] } },
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
displayName: 'Wait for Answers',
|
|
337
|
+
name: 'waitForAnswers',
|
|
338
|
+
type: 'boolean',
|
|
339
|
+
default: true,
|
|
340
|
+
description: 'Whether the node should block until every question is answered (or the timeout expires) and return structured answers. When disabled, the node returns immediately after posting; subscribe to the Ask Response event in a BGOS Trigger to receive each answer.',
|
|
341
|
+
displayOptions: { show: { resource: ['message'], operation: ['askUserInput'] } },
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
displayName: 'Additional Fields',
|
|
345
|
+
name: 'askAdditionalFields',
|
|
346
|
+
type: 'collection',
|
|
347
|
+
placeholder: 'Add Field',
|
|
348
|
+
default: {},
|
|
349
|
+
displayOptions: { show: { resource: ['message'], operation: ['askUserInput'], waitForAnswers: [true] } },
|
|
350
|
+
options: [
|
|
351
|
+
{
|
|
352
|
+
displayName: 'Timeout (Seconds)',
|
|
353
|
+
name: 'timeoutSeconds',
|
|
354
|
+
type: 'number',
|
|
355
|
+
default: 600,
|
|
356
|
+
description: 'How long to wait for all answers before unanswered questions are reported as skipped',
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
displayName: 'Poll Interval (Ms)',
|
|
360
|
+
name: 'pollIntervalMs',
|
|
361
|
+
type: 'number',
|
|
362
|
+
default: 1500,
|
|
363
|
+
description: 'How often to check the backend for new answers',
|
|
364
|
+
},
|
|
365
|
+
],
|
|
366
|
+
},
|
|
237
367
|
// ── Chat: Set Title fields ────────────────────────────────────────────
|
|
238
368
|
{
|
|
239
369
|
displayName: 'Chat ID',
|
|
@@ -406,9 +536,8 @@ class BGOSAction {
|
|
|
406
536
|
placeholder: 'user_xxx',
|
|
407
537
|
description: 'Override the user ID. If empty, falls back to user_id from the input data.',
|
|
408
538
|
displayOptions: {
|
|
409
|
-
|
|
410
|
-
resource: ['
|
|
411
|
-
operation: ['sendMessage', 'deleteMessage'],
|
|
539
|
+
show: {
|
|
540
|
+
resource: ['chat', 'assistant', 'callback', 'file'],
|
|
412
541
|
},
|
|
413
542
|
},
|
|
414
543
|
},
|
|
@@ -444,6 +573,27 @@ class BGOSAction {
|
|
|
444
573
|
if (operation === 'deleteMessage') {
|
|
445
574
|
nodeParams.deleteMessageId = String(this.getNodeParameter('deleteMessageId', i, '') ?? '');
|
|
446
575
|
}
|
|
576
|
+
if (operation === 'askUserInput') {
|
|
577
|
+
nodeParams.chatId = String(this.getNodeParameter('chatId', i, '') ?? '');
|
|
578
|
+
nodeParams.userId = String(this.getNodeParameter('askUserId', i, '') ?? '');
|
|
579
|
+
nodeParams.waitForAnswers = Boolean(this.getNodeParameter('waitForAnswers', i, true));
|
|
580
|
+
const askQuestionsRaw = this.getNodeParameter('askQuestions', i, {});
|
|
581
|
+
const questions = (askQuestionsRaw.question ?? []).map((q) => ({
|
|
582
|
+
text: String(q.text ?? '').trim(),
|
|
583
|
+
options: (q.options?.option ?? []).map((o) => ({
|
|
584
|
+
label: String(o.label ?? '').trim(),
|
|
585
|
+
value: String(o.value ?? '').trim(),
|
|
586
|
+
})).filter((o) => o.label && o.value),
|
|
587
|
+
allowFreeText: q.allowFreeText !== false,
|
|
588
|
+
allowSkip: q.allowSkip !== false,
|
|
589
|
+
}));
|
|
590
|
+
nodeParams.askQuestions = questions;
|
|
591
|
+
if (nodeParams.waitForAnswers) {
|
|
592
|
+
const askAdditional = this.getNodeParameter('askAdditionalFields', i, {});
|
|
593
|
+
nodeParams.askTimeoutSeconds = Number(askAdditional.timeoutSeconds ?? 600);
|
|
594
|
+
nodeParams.askPollIntervalMs = Number(askAdditional.pollIntervalMs ?? 1500);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
447
597
|
if (['renameChat', 'deleteChat', 'saveChatHistory'].includes(operation)) {
|
|
448
598
|
nodeParams.userId = String(this.getNodeParameter('userId', i, '') ?? '');
|
|
449
599
|
nodeParams.chatId = String(this.getNodeParameter('chatId', i, '') ?? '');
|
|
@@ -488,13 +638,18 @@ class BGOSAction {
|
|
|
488
638
|
});
|
|
489
639
|
}
|
|
490
640
|
catch (error) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
641
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
642
|
+
if (this.continueOnFail()) {
|
|
643
|
+
returnData.push({
|
|
644
|
+
json: {
|
|
645
|
+
...items[i].json,
|
|
646
|
+
success: false,
|
|
647
|
+
error: message,
|
|
648
|
+
},
|
|
649
|
+
});
|
|
650
|
+
continue;
|
|
651
|
+
}
|
|
652
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), message, { itemIndex: i });
|
|
498
653
|
}
|
|
499
654
|
}
|
|
500
655
|
return [returnData];
|
|
Binary file
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg
|
|
3
|
-
<path d="
|
|
4
|
-
<path d="
|
|
5
|
-
<path d="
|
|
6
|
-
<path d="
|
|
7
|
-
<path d="
|
|
8
|
-
<path d="
|
|
9
|
-
<
|
|
10
|
-
<path d="M0 0 C4.13973026 2.92080968 7.04928755 5.93016815 8.484375 10.86328125 C8.70765629 15.20947751 8.65851859 19.51614126 8.484375 23.86328125 C6.504375 24.85328125 6.504375 24.85328125 4.484375 25.86328125 C3.64173488 22.59805077 3.48662623 19.70539538 3.609375 16.36328125 C3.64273027 12.34730708 3.17029892 10.0122955 0.484375 6.86328125 C-3.4008655 3.44897899 -7.18993708 3.42962147 -12.1484375 3.5546875 C-15.13605288 3.94416211 -17.04529049 5.19217261 -19.515625 6.86328125 C-21.828125 6.55078125 -21.828125 6.55078125 -23.515625 5.86328125 C-22.55838625 3.08728887 -21.56216899 1.89850373 -19.203125 0.11328125 C-13.02295694 -1.98169097 -6.09302597 -2.75321515 0 0 Z " fill="#E5CA45" transform="translate(51.515625,41.13671875)"/>
|
|
11
|
-
<path d="M0 0 C0.01417969 0.845625 0.02835938 1.69125 0.04296875 2.5625 C0.3517249 9.90588953 0.95656814 15.42643468 6 21 C10.08559728 24.51815321 14.76659932 24.88064174 20 25 C23.39342704 24.64619356 23.39342704 24.64619356 26 24 C26 24.99 26 25.98 26 27 C21.44482424 29.27758788 14.65495494 28.80570845 9.86328125 27.3515625 C5.39385687 25.00134833 1.74628131 21.20236334 -1 17 C-1.33333333 15.66666667 -1.66666667 14.33333333 -2 13 C-2.66 12.67 -3.32 12.34 -4 12 C-3.88648483 10.18674449 -3.75887039 8.37436643 -3.625 6.5625 C-3.55539063 5.55316406 -3.48578125 4.54382812 -3.4140625 3.50390625 C-3.27742188 2.67761719 -3.14078125 1.85132813 -3 1 C-1 0 -1 0 0 0 Z " fill="#302C1F" transform="translate(24,51)"/>
|
|
12
|
-
<path d="M0 0 C3.0625 0.3125 3.0625 0.3125 5 1.4375 C6.60193488 4.26444391 5.85834319 6.26176777 5.0625 9.3125 C4.0625 10.3125 4.0625 10.3125 0.625 10.5 C-2.9375 10.3125 -2.9375 10.3125 -4.9375 8.3125 C-5.1875 5.3125 -5.1875 5.3125 -4.9375 2.3125 C-2.9375 0.3125 -2.9375 0.3125 0 0 Z " fill="#EFD247" transform="translate(41.9375,52.6875)"/>
|
|
13
|
-
<path d="M0 0 C0.99 0.66 1.98 1.32 3 2 C2.31035156 2.07476562 1.62070312 2.14953125 0.91015625 2.2265625 C-8.46539433 3.53836793 -14.48467262 7.22405953 -21 14 C-21.66 14 -22.32 14 -23 14 C-21.60495725 8.72983849 -18.3903978 5.93763363 -14 3 C-4.66788403 -1.78790589 -4.66788403 -1.78790589 0 0 Z " fill="#343020" transform="translate(41,31)"/>
|
|
14
|
-
<path d="M0 0 C-0.33 0.99 -0.66 1.98 -1 3 C-2.9609375 3.94921875 -2.9609375 3.94921875 -5.375 4.6875 C-6.56222656 5.06455078 -6.56222656 5.06455078 -7.7734375 5.44921875 C-10 6 -10 6 -13 6 C-12 3 -12 3 -9.78515625 1.796875 C-8.43744141 1.27867188 -8.43744141 1.27867188 -7.0625 0.75 C-6.16660156 0.39421875 -5.27070312 0.0384375 -4.34765625 -0.328125 C-2 -1 -2 -1 0 0 Z " fill="#363221" transform="translate(57,80)"/>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 512.35 512.26">
|
|
3
|
+
<path d="M333.14,343.5c-42.62,37.65-105.73,39.01-150.07,3.23-40.95-33.05-54.68-89.68-33.38-137.72,3.58-8.08-.06-17.55-8.16-21.13-8.08-3.58-17.55.07-21.13,8.15-27.16,61.28-9.66,133.49,42.55,175.62,56.54,45.62,137.03,43.89,191.39-4.14,6.63-5.86,7.26-15.98,1.4-22.61-.61-.68-1.26-1.3-1.95-1.86-5.97-4.82-14.71-4.79-20.66.46" fill="#EFD247"/>
|
|
4
|
+
<path d="M98.73,129.09c-35.26,43.7-50.84,100.65-42.75,156.24.61,4.16,2.76,7.7,5.79,10.15,3.35,2.7,7.78,4.06,12.37,3.39,8.76-1.28,14.81-9.4,13.53-18.15-6.81-46.8,6.3-94.73,35.98-131.51,58.96-73.07,166.38-84.55,239.45-25.59,24.62,19.86,43.14,46.04,53.61,75.7,2.94,8.34,12.09,12.72,20.44,9.78,8.34-2.94,12.72-12.09,9.77-20.43-12.43-35.27-34.47-66.37-63.7-89.96-86.81-70.05-214.43-56.42-284.49,30.4" fill="#EFD247"/>
|
|
5
|
+
<path d="M247.5,107.94c-36.66,2.15-71.01,17.66-96.73,43.66-6.22,6.29-6.17,16.43.12,22.65.39.39.8.75,1.22,1.09,6.32,5.1,15.59,4.68,21.43-1.21,42.11-42.56,109.07-46.26,155.74-8.59,41.33,33.35,54.89,90.36,32.97,138.64-3.66,8.06-.09,17.56,7.96,21.21,8.06,3.66,17.55.09,21.21-7.96,27.96-61.59,10.68-134.3-42.02-176.82-28.8-23.24-64.98-34.84-101.9-32.67" fill="#EFD247"/>
|
|
6
|
+
<path d="M442.39,239.33c-8.84.04-15.98,7.25-15.94,16.1.12,23.82-4.63,46.92-14.09,68.65-6.07,13.93-14.04,27.05-23.68,39-58.96,73.07-166.37,84.54-239.44,25.58-24.19-19.52-42.55-45.18-53.09-74.22-3.01-8.31-12.2-12.61-20.52-9.59-8.32,3.02-12.6,12.21-9.59,20.52,12.54,34.53,34.35,65.04,63.08,88.22,86.81,70.05,214.43,56.42,284.48-30.39,11.44-14.18,20.9-29.76,28.12-46.32,11.26-25.83,16.89-53.28,16.76-81.59-.03-5.01-2.35-9.48-5.96-12.4-2.77-2.23-6.3-3.56-10.13-3.55" fill="#EFD247"/>
|
|
7
|
+
<path d="M366.47,24.87C315.34.43,256.55-6.28,200.91,5.99c-56.51,12.44-107.68,44.16-144.09,89.28C17.57,143.91-2.52,205.04.25,267.41c2.74,61.82,27.63,120.44,70.07,165.06.5.52,1.02,1,1.56,1.43,6.16,4.97,15.19,4.73,21.08-.87,6.41-6.09,6.66-16.23.57-22.64C16.47,329.38,11.4,202.54,81.74,115.38c32.32-40.06,75.92-67.06,126.06-78.11,48.7-10.73,100.15-4.87,144.86,16.49,7.98,3.82,17.54.44,21.36-7.55,3.26-6.83,1.26-14.8-4.38-19.36-.96-.77-2.01-1.44-3.17-1.99" fill="#EFD247"/>
|
|
8
|
+
<path d="M444.69,106.4c-7.27,5.03-9.09,15.01-4.06,22.28,26.95,38.96,41.01,86.65,39.59,134.28-1.46,49.2-18.62,95.51-49.62,133.93-64.87,80.39-175.46,106.1-268.96,62.53-8.02-3.73-17.55-.26-21.28,7.76-3.18,6.81-1.15,14.7,4.45,19.22.99.8,2.09,1.5,3.3,2.06,50.95,23.74,109.36,29.97,164.49,17.56,56.84-12.79,106.25-43.58,142.92-89.01,35.43-43.91,55.04-96.84,56.71-153.08,1.62-54.41-14.46-108.91-45.26-153.45-.9-1.3-1.95-2.42-3.12-3.36-5.39-4.35-13.19-4.84-19.16-.7" fill="#EFD247"/>
|
|
9
|
+
<circle cx="258.38" cy="256.71" r="44.45" fill="#EFD247"/>
|
|
15
10
|
</svg>
|
|
@@ -25,6 +25,18 @@ type NodeParams = {
|
|
|
25
25
|
optionId?: string;
|
|
26
26
|
callbackSuccess?: boolean;
|
|
27
27
|
callbackError?: string;
|
|
28
|
+
askQuestions?: Array<{
|
|
29
|
+
text: string;
|
|
30
|
+
options: Array<{
|
|
31
|
+
label: string;
|
|
32
|
+
value: string;
|
|
33
|
+
}>;
|
|
34
|
+
allowFreeText: boolean;
|
|
35
|
+
allowSkip: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
waitForAnswers?: boolean;
|
|
38
|
+
askTimeoutSeconds?: number;
|
|
39
|
+
askPollIntervalMs?: number;
|
|
28
40
|
[key: string]: unknown;
|
|
29
41
|
};
|
|
30
42
|
export declare function handleEventByType(this: IExecuteFunctions, eventType: string, eventData: Record<string, unknown>, nodeParams: NodeParams): Promise<unknown>;
|