diff --git a/gleam.toml b/gleam.toml index 0cfb795..9de23cc 100644 --- a/gleam.toml +++ b/gleam.toml @@ -1,5 +1,5 @@ name = "glibsql" -version = "0.5.1" +version = "0.6.0" # Fill out these fields if you intend to generate HTML documentation or publish # your project to the Hex package manager. diff --git a/src/glibsql/http.gleam b/src/glibsql/http.gleam index b4252ad..cf189ba 100644 --- a/src/glibsql/http.gleam +++ b/src/glibsql/http.gleam @@ -165,7 +165,7 @@ pub fn build( ) |> http_request.set_header("Content-Type", "application/json") |> http_request.set_header("Accept", "application/json") - |> http_request.set_header("User-Agent", "glibsql/0.5.1") + |> http_request.set_header("User-Agent", "glibsql/0.6.0") |> http_request.set_body(build_json(request)), ) } @@ -353,7 +353,7 @@ fn json_parse(json: String) { Ok(dynamic_value) } -@external(javascript, "glibsql_http_ffi.mjs", "decode") +@external(javascript, "../glibsql_http_ffi.mjs", "decode") fn decode_string(json: String) -> Result(dynamic.Dynamic, Nil) pub fn decode_response(response: String) -> Result(HttpResponse, Nil) { diff --git a/test/glibsql/http_test.gleam b/test/glibsql/http_test.gleam index 4fa3505..ac9bbd0 100644 --- a/test/glibsql/http_test.gleam +++ b/test/glibsql/http_test.gleam @@ -13,7 +13,7 @@ pub fn builder_custom_host_test() { |> http_request.set_header("Authorization", "Bearer token") |> http_request.set_header("Content-Type", "application/json") |> http_request.set_header("Accept", "application/json") - |> http_request.set_header("User-Agent", "glibsql/0.5.1") + |> http_request.set_header("User-Agent", "glibsql/0.6.0") |> http_request.set_body("{\"baton\":null,\"requests\":[]}") glibsql.new_request() @@ -36,7 +36,7 @@ pub fn builder_no_statements_test() { |> http_request.set_header("Authorization", "Bearer token") |> http_request.set_header("Content-Type", "application/json") |> http_request.set_header("Accept", "application/json") - |> http_request.set_header("User-Agent", "glibsql/0.5.1") + |> http_request.set_header("User-Agent", "glibsql/0.6.0") |> http_request.set_body("{\"baton\":null,\"requests\":[]}") glibsql.new_request() @@ -57,7 +57,7 @@ pub fn builder_single_statement_test() { |> http_request.set_header("Authorization", "Bearer token") |> http_request.set_header("Content-Type", "application/json") |> http_request.set_header("Accept", "application/json") - |> http_request.set_header("User-Agent", "glibsql/0.5.1") + |> http_request.set_header("User-Agent", "glibsql/0.6.0") |> http_request.set_body( "{\"baton\":null,\"requests\":[{\"type\":\"execute\",\"stmt\":{\"sql\":\"SELECT * FROM users\"}},{\"type\":\"close\"}]}", ) @@ -82,7 +82,7 @@ pub fn builder_many_statement_test() { |> http_request.set_header("Authorization", "Bearer token") |> http_request.set_header("Content-Type", "application/json") |> http_request.set_header("Accept", "application/json") - |> http_request.set_header("User-Agent", "glibsql/0.5.1") + |> http_request.set_header("User-Agent", "glibsql/0.6.0") |> http_request.set_body( "{\"baton\":null,\"requests\":[{\"type\":\"execute\",\"stmt\":{\"sql\":\"SELECT * FROM users\"}},{\"type\":\"execute\",\"stmt\":{\"sql\":\"SELECT * FROM posts\"}},{\"type\":\"close\"}]}", ) @@ -108,7 +108,7 @@ pub fn builder_clear_statements_test() { |> http_request.set_header("Authorization", "Bearer token") |> http_request.set_header("Content-Type", "application/json") |> http_request.set_header("Accept", "application/json") - |> http_request.set_header("User-Agent", "glibsql/0.5.1") + |> http_request.set_header("User-Agent", "glibsql/0.6.0") |> http_request.set_body("{\"baton\":null,\"requests\":[]}") glibsql.new_request() @@ -133,7 +133,7 @@ pub fn builder_baton_test() { |> http_request.set_header("Authorization", "Bearer token") |> http_request.set_header("Content-Type", "application/json") |> http_request.set_header("Accept", "application/json") - |> http_request.set_header("User-Agent", "glibsql/0.5.1") + |> http_request.set_header("User-Agent", "glibsql/0.6.0") |> http_request.set_body( "{\"baton\":\"baton\",\"requests\":[{\"type\":\"close\"}]}", )