Commit 533d9b2
authored
Add share_payload message type and book_feedback input type (#594)
* Add share_payload message type and book_feedback input type
Share payload: MessageNodeProcessor resolves share_payload_variable from
session state, returning structured data the frontend can render as a
shareable card.
Book feedback: QuestionNodeProcessor supports input_type "book_feedback"
with a book_source variable reference. Users can rate books (like/dislike/
read) and the structured feedback is stored in session state for downstream
condition routing. Updated recommendation flow to v2.0.0 with feedback
collection, share payload generation, and liked-book branching.
* Fix book_feedback validation and CEL has() syntax
- Add book_feedback to InteractionCreate.input_type regex pattern so
clients can submit feedback without getting a 422
- Fix CEL has() macro to use field-path syntax: has(obj.field) not
has(obj, 'field')
* Relax InteractionCreate.input_type to accept any valid identifier
The hardcoded enum of allowed input types required a schema change for
every new flow input type. Replace with a simple identifier pattern so
flow authors can define custom input types without API changes.
* Relax QuestionContentSchema input_type to accept any identifier
Same change as InteractionCreate — flow authors can define custom
question input types without needing API schema changes.
* Add KNOWN_INPUT_TYPES constant and OpenAPI examples for input_type
Centralizes the set of known input types in a frozenset so they're
discoverable via IDE autocomplete and OpenAPI examples, while keeping
input_type as an open string for custom types.
* Fix integration test for relaxed input_type validation
The test used "invalid_input_type" which now passes the relaxed
identifier regex. Use "123-INVALID!" which actually violates the
pattern.1 parent c5af7c4 commit 533d9b2
File tree
6 files changed
+130
-30
lines changed- app
- schemas
- services
- tests
- integration
- unit
- scripts/fixtures
6 files changed
+130
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
19 | 40 | | |
20 | 41 | | |
21 | 42 | | |
| |||
465 | 486 | | |
466 | 487 | | |
467 | 488 | | |
468 | | - | |
| 489 | + | |
| 490 | + | |
469 | 491 | | |
470 | 492 | | |
471 | 493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
139 | 148 | | |
140 | 149 | | |
141 | 150 | | |
| |||
407 | 416 | | |
408 | 417 | | |
409 | 418 | | |
410 | | - | |
| 419 | + | |
411 | 420 | | |
412 | 421 | | |
413 | 422 | | |
| |||
418 | 427 | | |
419 | 428 | | |
420 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
421 | 442 | | |
422 | 443 | | |
423 | 444 | | |
| |||
648 | 669 | | |
649 | 670 | | |
650 | 671 | | |
651 | | - | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
652 | 681 | | |
653 | 682 | | |
654 | 683 | | |
| |||
1855 | 1884 | | |
1856 | 1885 | | |
1857 | 1886 | | |
1858 | | - | |
| 1887 | + | |
1859 | 1888 | | |
1860 | 1889 | | |
1861 | 1890 | | |
1862 | 1891 | | |
1863 | 1892 | | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
1864 | 1897 | | |
1865 | 1898 | | |
1866 | 1899 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
117 | 110 | | |
118 | 111 | | |
119 | 112 | | |
120 | 113 | | |
121 | 114 | | |
122 | | - | |
| 115 | + | |
| 116 | + | |
123 | 117 | | |
124 | 118 | | |
125 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
74 | 110 | | |
75 | 111 | | |
76 | 112 | | |
77 | | - | |
78 | | - | |
| 113 | + | |
| 114 | + | |
79 | 115 | | |
80 | 116 | | |
81 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
82 | 128 | | |
83 | 129 | | |
84 | 130 | | |
| |||
118 | 164 | | |
119 | 165 | | |
120 | 166 | | |
121 | | - | |
| 167 | + | |
122 | 168 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
127 | 173 | | |
128 | 174 | | |
129 | 175 | | |
| |||
144 | 190 | | |
145 | 191 | | |
146 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
147 | 197 | | |
148 | 198 | | |
| 199 | + | |
149 | 200 | | |
150 | 201 | | |
151 | 202 | | |
| |||
0 commit comments