|
126 | 126 | "messageTraits": { |
127 | 127 | "commonHeaders": { |
128 | 128 | "userspaceHeaders": { |
129 | | - "$defs": { |
130 | | - "IntersectDataHandler": { |
131 | | - "description": "What data transfer type do you want to use for handling the request/response?\n\nDefault: MESSAGE", |
132 | | - "enum": [ |
133 | | - 0, |
134 | | - 1 |
135 | | - ], |
136 | | - "title": "IntersectDataHandler", |
137 | | - "type": "integer" |
138 | | - } |
139 | | - }, |
140 | | - "description": "Matches the current header definition for INTERSECT messages.\n\nALL messages should contain this header.", |
| 129 | + "description": "ALL request/response/command messages must contain this header.\n\nWe do not include the content type of the message in the header, it is handled separately.", |
141 | 130 | "properties": { |
| 131 | + "message_id": { |
| 132 | + "description": "Unique message ID", |
| 133 | + "title": "Message Id", |
| 134 | + "type": "string" |
| 135 | + }, |
| 136 | + "campaign_id": { |
| 137 | + "description": "ID associated with a campaign", |
| 138 | + "title": "Campaign Id", |
| 139 | + "type": "string" |
| 140 | + }, |
| 141 | + "request_id": { |
| 142 | + "description": "ID associated with a specific request message and response message sequence", |
| 143 | + "title": "Request Id", |
| 144 | + "type": "string" |
| 145 | + }, |
142 | 146 | "source": { |
143 | 147 | "description": "source of the message", |
144 | 148 | "pattern": "^[a-z0-9][-a-z0-9.]*[-a-z0-9]$", |
|
153 | 157 | }, |
154 | 158 | "created_at": { |
155 | 159 | "description": "the UTC timestamp of message creation", |
156 | | - "format": "date-time", |
157 | 160 | "title": "Created At", |
158 | 161 | "type": "string" |
159 | 162 | }, |
|
163 | 166 | "title": "Sdk Version", |
164 | 167 | "type": "string" |
165 | 168 | }, |
| 169 | + "operation_id": { |
| 170 | + "description": "Name of capability and operation we want to call, in the format ${CAPABILITY_NAME}.${FUNCTION_NAME}", |
| 171 | + "title": "Operation Id", |
| 172 | + "type": "string" |
| 173 | + }, |
166 | 174 | "data_handler": { |
167 | | - "$ref": "#/components/messageTraits/commonHeaders/userspaceHeaders/$defs/IntersectDataHandler", |
168 | | - "default": 0, |
169 | | - "description": "Code signifying where data is stored." |
| 175 | + "description": "Code signifying where data is stored.", |
| 176 | + "type": "string" |
170 | 177 | }, |
171 | 178 | "has_error": { |
172 | | - "default": false, |
173 | 179 | "description": "If this value is True, the payload will contain the error message (a string)", |
174 | 180 | "title": "Has Error", |
175 | | - "type": "boolean" |
| 181 | + "type": "string" |
176 | 182 | } |
177 | 183 | }, |
178 | 184 | "required": [ |
| 185 | + "message_id", |
| 186 | + "campaign_id", |
| 187 | + "request_id", |
179 | 188 | "source", |
180 | 189 | "destination", |
181 | 190 | "created_at", |
182 | | - "sdk_version" |
| 191 | + "sdk_version", |
| 192 | + "operation_id" |
183 | 193 | ], |
184 | | - "title": "UserspaceMessageHeader", |
| 194 | + "title": "UserspaceMessageHeaders", |
185 | 195 | "type": "object" |
186 | 196 | }, |
187 | 197 | "eventHeaders": { |
188 | | - "$defs": { |
189 | | - "IntersectDataHandler": { |
190 | | - "description": "What data transfer type do you want to use for handling the request/response?\n\nDefault: MESSAGE", |
191 | | - "enum": [ |
192 | | - 0, |
193 | | - 1 |
194 | | - ], |
195 | | - "title": "IntersectDataHandler", |
196 | | - "type": "integer" |
197 | | - } |
198 | | - }, |
199 | | - "description": "Matches the current header definition for INTERSECT messages.\n\nALL messages should contain this header.", |
| 198 | + "description": "ALL event messages must include this header.\n\nWe do not include the content type of the message in the header, it is handled separately.", |
200 | 199 | "properties": { |
| 200 | + "message_id": { |
| 201 | + "description": "Unique message ID", |
| 202 | + "title": "Message Id", |
| 203 | + "type": "string" |
| 204 | + }, |
201 | 205 | "source": { |
202 | 206 | "description": "source of the message", |
203 | 207 | "pattern": "^[a-z0-9][-a-z0-9.]*[-a-z0-9]$", |
|
206 | 210 | }, |
207 | 211 | "created_at": { |
208 | 212 | "description": "the UTC timestamp of message creation", |
209 | | - "format": "date-time", |
210 | 213 | "title": "Created At", |
211 | 214 | "type": "string" |
212 | 215 | }, |
|
217 | 220 | "type": "string" |
218 | 221 | }, |
219 | 222 | "data_handler": { |
220 | | - "$ref": "#/components/messageTraits/commonHeaders/eventHeaders/$defs/IntersectDataHandler", |
221 | | - "default": 0, |
222 | | - "description": "Code signifying where data is stored." |
| 223 | + "description": "Code signifying where data is stored.", |
| 224 | + "type": "string" |
223 | 225 | }, |
224 | 226 | "capability_name": { |
| 227 | + "description": "The name of the capability which emitted the event originally.", |
| 228 | + "pattern": "^[a-zA-Z0-9]\\w*$", |
225 | 229 | "title": "Capability Name", |
226 | 230 | "type": "string" |
227 | 231 | }, |
228 | 232 | "event_name": { |
| 233 | + "description": "The name of the event that was emitted, namespaced to the capability.", |
| 234 | + "pattern": "^[a-zA-Z0-9]\\w*$", |
229 | 235 | "title": "Event Name", |
230 | 236 | "type": "string" |
231 | 237 | } |
232 | 238 | }, |
233 | 239 | "required": [ |
| 240 | + "message_id", |
234 | 241 | "source", |
235 | 242 | "created_at", |
236 | 243 | "sdk_version", |
|
0 commit comments