1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use HashMap;
use Value;
/// An inbound command request.
///
/// Generic command envelope used by in-process dispatch and adapters that
/// already decoded a gateway payload. Example shape:
/// ```json
/// {
/// "command": "order.create",
/// "input": { "product_id": "SKU-1" },
/// "session_variables": { "x-user-id": "user-42" }
/// }
/// ```
///
/// `session_variables` keys are deployment convention (see [`Session`]). A
/// query-layer action (Hasura, custom BFF, …) can map its native claims into
/// these variables before calling `dispatch_request`.
/// Response from dispatching a command.