A collection of utilities for the Daggerheart SRD katari.fyi
daggerheart ttrpg gleam api

api: Update to Wisp v2.0.0

Signed-off-by: Naomi Roberts <mia@naomieow.xyz>

lesbian.skin 64cf6ce6 19b8a9f2

verified
+11 -20
+1 -1
api/gleam.toml
··· 14 14 15 15 [dependencies] 16 16 gleam_stdlib = ">= 0.44.0 and < 2.0.0" 17 - wisp = ">= 1.8.0 and < 2.0.0" 17 + wisp = ">= 2.0.0 and < 3.0.0" 18 18 mist = ">= 5.0.3 and < 6.0.0" 19 19 gleam_erlang = ">= 1.3.0 and < 2.0.0" 20 20 gleam_http = ">= 4.1.1 and < 5.0.0"
+2 -2
api/manifest.toml
··· 25 25 { name = "shared", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_json", "gleam_stdlib", "simplifile"], source = "local", path = "../shared" }, 26 26 { name = "simplifile", version = "2.3.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0A868DAC6063D9E983477981839810DC2E553285AB4588B87E3E9C96A7FB4CB4" }, 27 27 { name = "telemetry", version = "1.3.0", build_tools = ["rebar3"], requirements = [], otp_app = "telemetry", source = "hex", outer_checksum = "7015FC8919DBE63764F4B4B87A95B7C0996BD539E0D499BE6EC9D7F3875B79E6" }, 28 - { name = "wisp", version = "1.8.0", build_tools = ["gleam"], requirements = ["directories", "exception", "gleam_crypto", "gleam_erlang", "gleam_http", "gleam_json", "gleam_stdlib", "houdini", "logging", "marceau", "mist", "simplifile"], otp_app = "wisp", source = "hex", outer_checksum = "0FE9049AFFB7C8D5FC0B154EEE2704806F4D51B97F44925D69349B3F4F192957" }, 28 + { name = "wisp", version = "2.0.0", build_tools = ["gleam"], requirements = ["directories", "exception", "filepath", "gleam_crypto", "gleam_erlang", "gleam_http", "gleam_json", "gleam_stdlib", "houdini", "logging", "marceau", "mist", "simplifile"], otp_app = "wisp", source = "hex", outer_checksum = "E9E4CEE4A5ACB41E3D9CFEF7AB07BF7DF670AB32E1CB434A61C6DA6859C66168" }, 29 29 ] 30 30 31 31 [requirements] ··· 37 37 gleeunit = { version = ">= 1.0.0 and < 2.0.0" } 38 38 mist = { version = ">= 5.0.3 and < 6.0.0" } 39 39 shared = { path = "../shared" } 40 - wisp = { version = ">= 1.8.0 and < 2.0.0" } 40 + wisp = { version = ">= 2.0.0 and < 3.0.0" }
+2 -5
api/src/api/routes/abilities.gleam
··· 6 6 7 7 pub fn all(data: data.Data) { 8 8 let json = json.array(data.abilities, ability.ability_to_json) 9 - wisp.json_response(json.to_string_tree(json), 200) 9 + wisp.json_response(json.to_string(json), 200) 10 10 } 11 11 12 12 pub fn single(data: data.Data, id: String) { ··· 16 16 17 17 case single { 18 18 Ok(ability) -> 19 - wisp.json_response( 20 - json.to_string_tree(ability.ability_to_json(ability)), 21 - 200, 22 - ) 19 + wisp.json_response(json.to_string(ability.ability_to_json(ability)), 200) 23 20 _ -> wisp.not_found() 24 21 } 25 22 }
+2 -2
api/src/api/routes/classes.gleam
··· 6 6 7 7 pub fn all(data: data.Data) { 8 8 let json = json.array(data.classes, class.class_to_json) 9 - wisp.json_response(json.to_string_tree(json), 200) 9 + wisp.json_response(json.to_string(json), 200) 10 10 } 11 11 12 12 pub fn single(data: data.Data, id: String) { ··· 16 16 17 17 case single { 18 18 Ok(class) -> 19 - wisp.json_response(json.to_string_tree(class.class_to_json(class)), 200) 19 + wisp.json_response(json.to_string(class.class_to_json(class)), 200) 20 20 _ -> wisp.not_found() 21 21 } 22 22 }
+2 -5
api/src/api/routes/domains.gleam
··· 6 6 7 7 pub fn all(data: data.Data) { 8 8 let json = json.array(data.domains, domain.domain_to_json) 9 - wisp.json_response(json.to_string_tree(json), 200) 9 + wisp.json_response(json.to_string(json), 200) 10 10 } 11 11 12 12 pub fn single(data: data.Data, id: String) { ··· 16 16 17 17 case single { 18 18 Ok(domain) -> 19 - wisp.json_response( 20 - json.to_string_tree(domain.domain_to_json(domain)), 21 - 200, 22 - ) 19 + wisp.json_response(json.to_string(domain.domain_to_json(domain)), 200) 23 20 _ -> wisp.not_found() 24 21 } 25 22 }
+2 -5
api/src/api/routes/subclasses.gleam
··· 6 6 7 7 pub fn all(data: data.Data) { 8 8 let json = json.array(data.subclasses, subclass.subclass_to_json) 9 - wisp.json_response(json.to_string_tree(json), 200) 9 + wisp.json_response(json.to_string(json), 200) 10 10 } 11 11 12 12 pub fn single(data: data.Data, id: String) { ··· 16 16 17 17 case single { 18 18 Ok(class) -> 19 - wisp.json_response( 20 - json.to_string_tree(subclass.subclass_to_json(class)), 21 - 200, 22 - ) 19 + wisp.json_response(json.to_string(subclass.subclass_to_json(class)), 200) 23 20 _ -> wisp.not_found() 24 21 } 25 22 }