@@ -185,6 +185,8 @@ pub enum ClientType {
185185 // For HTTP requests from the dashboard. Requests from the dashboard via a
186186 // Convex client will have an `NPM` version
187187 Dashboard ,
188+ Swift ,
189+ Kotlin ,
188190 // We convert to lower case when we parse, so lets just generate lowercase strings.
189191 #[ cfg_attr(
190192 any( test, feature = "testing" ) ,
@@ -200,6 +202,7 @@ impl FromStr for ClientType {
200202 fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
201203 let client_type = match & * s. to_ascii_lowercase ( ) {
202204 "python-convex" => Self :: Python ,
205+ "python" => Self :: Python ,
203206 "npm-cli" => Self :: CLI ,
204207 "npm" => Self :: NPM ,
205208 "actions" => Self :: Actions ,
@@ -209,6 +212,8 @@ impl FromStr for ClientType {
209212 "fivetran-import" => Self :: FivetranImport ,
210213 "fivetran-export" => Self :: FivetranExport ,
211214 "dashboard" => Self :: Dashboard ,
215+ "swift" => Self :: Swift ,
216+ "kotlin" => Self :: Kotlin ,
212217 unrecognized => Self :: Unrecognized ( unrecognized. to_string ( ) ) ,
213218 } ;
214219 Ok ( client_type)
@@ -218,7 +223,7 @@ impl FromStr for ClientType {
218223impl Display for ClientType {
219224 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
220225 match self {
221- Self :: Python => write ! ( f, "python-convex " ) ,
226+ Self :: Python => write ! ( f, "python" ) ,
222227 Self :: CLI => write ! ( f, "npm-cli" ) ,
223228 Self :: NPM => write ! ( f, "npm" ) ,
224229 Self :: Actions => write ! ( f, "actions" ) ,
@@ -228,6 +233,8 @@ impl Display for ClientType {
228233 Self :: FivetranImport => write ! ( f, "fivetran-import" ) ,
229234 Self :: FivetranExport => write ! ( f, "fivetran-export" ) ,
230235 Self :: Dashboard => write ! ( f, "dashboard" ) ,
236+ Self :: Swift => write ! ( f, "swift" ) ,
237+ Self :: Kotlin => write ! ( f, "kotlin" ) ,
231238 Self :: Unrecognized ( other_client) => write ! ( f, "{other_client}" ) ,
232239 }
233240 }
@@ -245,6 +252,8 @@ impl ClientType {
245252 | Self :: FivetranImport
246253 | Self :: FivetranExport
247254 | Self :: Dashboard
255+ | Self :: Swift
256+ | Self :: Kotlin
248257 | Self :: Unrecognized ( _) => None ,
249258 }
250259 }
@@ -260,6 +269,8 @@ impl ClientType {
260269 | Self :: FivetranImport
261270 | Self :: FivetranExport
262271 | Self :: Dashboard
272+ | Self :: Swift
273+ | Self :: Kotlin
263274 | Self :: Unrecognized ( _) => None ,
264275 }
265276 }
@@ -281,6 +292,8 @@ impl ClientType {
281292 | Self :: FivetranImport
282293 | Self :: FivetranExport
283294 | Self :: Dashboard
295+ | Self :: Swift
296+ | Self :: Kotlin
284297 | Self :: Unrecognized ( _) => "" ,
285298 }
286299 }
@@ -397,6 +410,8 @@ impl ClientVersion {
397410 | ClientType :: FivetranImport
398411 | ClientType :: FivetranExport
399412 | ClientType :: Dashboard
413+ | ClientType :: Swift
414+ | ClientType :: Kotlin
400415 | ClientType :: Unrecognized ( _) => true ,
401416 } ;
402417
@@ -484,9 +499,7 @@ mod tests {
484499
485500 // Versions higher than what we know about are also considered latest.
486501 assert_eq ! (
487- "python-convex-1000.0.0"
488- . parse:: <ClientVersion >( ) ?
489- . current_state( ) ,
502+ "python-1000.0.0" . parse:: <ClientVersion >( ) ?. current_state( ) ,
490503 ClientVersionState :: Supported
491504 ) ;
492505 assert_eq ! (
@@ -554,9 +567,9 @@ mod tests {
554567 "npm-2.0.0" ,
555568 "actions-1.4.1" ,
556569 "npm-cli-1.4.1" ,
557- "python-convex- 0.5.0" ,
558- "python-convex- 0.6.0" ,
559- "python-convex- 1.6.0" ,
570+ "python-0.5.0" ,
571+ "python-0.6.0" ,
572+ "python-1.6.0" ,
560573 "asdf-0.0.0" , // unknown
561574 ] ;
562575 for r in require {
@@ -571,8 +584,8 @@ mod tests {
571584 "npm-0.19.0" ,
572585 "actions-1.3.0" ,
573586 "npm-cli-1.3.0" ,
574- "python-convex- 0.4.0" ,
575- "python-convex- 0.3.0" ,
587+ "python-0.4.0" ,
588+ "python-0.3.0" ,
576589 ] ;
577590 for r in not_require {
578591 assert_eq ! (
0 commit comments