1#[derive(Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, prost::Message)]
13pub struct ProtoLoadPackageRequest {
14 #[prost(bytes = "vec", tag = "1")]
16 pub archive: Vec<u8>,
17}
18
19#[derive(Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, prost::Message)]
25pub struct ProtoLoadPackageResponse {
26 #[prost(string, tag = "1")]
28 pub workflow_type: String,
29 #[prost(string, tag = "2")]
31 pub content_hash: String,
32 #[prost(string, tag = "3")]
34 pub deployed_entry_module: String,
35 #[prost(string, tag = "4")]
37 pub entry_function: String,
38 #[prost(bool, tag = "5")]
40 pub freshly_loaded: bool,
41 #[prost(bool, tag = "6")]
43 pub route_changed: bool,
44}
45
46#[derive(Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize, prost::Message)]
48pub struct ProtoListVersionsRequest {}
49
50#[derive(Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, prost::Message)]
52pub struct ProtoWorkflowVersion {
53 #[prost(string, tag = "1")]
55 pub workflow_type: String,
56 #[prost(string, tag = "2")]
58 pub content_hash: String,
59 #[prost(string, tag = "3")]
61 pub deployed_entry_module: String,
62 #[prost(string, tag = "4")]
64 pub entry_function: String,
65 #[prost(string, tag = "5")]
67 pub manifest_version: String,
68 #[prost(string, tag = "6")]
70 pub loaded_at: String,
71 #[prost(bool, tag = "7")]
73 pub route_active: bool,
74}
75
76#[derive(Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, prost::Message)]
78pub struct ProtoListVersionsResponse {
79 #[prost(message, repeated, tag = "1")]
81 pub versions: Vec<ProtoWorkflowVersion>,
82}
83
84#[derive(Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, prost::Message)]
86pub struct ProtoRouteVersionRequest {
87 #[prost(string, tag = "1")]
89 pub workflow_type: String,
90 #[prost(string, tag = "2")]
92 pub content_hash: String,
93}
94
95#[derive(Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize, prost::Message)]
97pub struct ProtoRouteVersionResponse {}
98
99#[derive(Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, prost::Message)]
101pub struct ProtoUnloadVersionRequest {
102 #[prost(string, tag = "1")]
104 pub workflow_type: String,
105 #[prost(string, tag = "2")]
107 pub content_hash: String,
108}
109
110#[derive(Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize, prost::Message)]
112pub struct ProtoUnloadVersionResponse {}
113
114#[cfg(test)]
115mod tests {
116 use super::{ProtoLoadPackageResponse, ProtoRouteVersionRequest, ProtoWorkflowVersion};
117
118 #[test]
119 fn deploy_shapes_round_trip_through_json() -> Result<(), serde_json::Error> {
120 let response = ProtoLoadPackageResponse {
121 workflow_type: "order".to_owned(),
122 content_hash: "a".repeat(64),
123 deployed_entry_module: format!("order${}", "a".repeat(64)),
124 entry_function: "run".to_owned(),
125 freshly_loaded: true,
126 route_changed: true,
127 };
128 let decoded: ProtoLoadPackageResponse =
129 serde_json::from_str(&serde_json::to_string(&response)?)?;
130 assert_eq!(decoded, response);
131
132 let route = ProtoRouteVersionRequest {
133 workflow_type: "order".to_owned(),
134 content_hash: "b".repeat(64),
135 };
136 let decoded: ProtoRouteVersionRequest =
137 serde_json::from_str(&serde_json::to_string(&route)?)?;
138 assert_eq!(decoded, route);
139
140 let version = ProtoWorkflowVersion {
141 workflow_type: "order".to_owned(),
142 content_hash: "c".repeat(64),
143 deployed_entry_module: format!("order${}", "c".repeat(64)),
144 entry_function: "run".to_owned(),
145 manifest_version: "c".repeat(64),
146 loaded_at: "2026-06-12T00:00:00Z".to_owned(),
147 route_active: false,
148 };
149 let decoded: ProtoWorkflowVersion =
150 serde_json::from_str(&serde_json::to_string(&version)?)?;
151 assert_eq!(decoded, version);
152 Ok(())
153 }
154}