Skip to content

Commit c052bad

Browse files
committed
expose api_host as public constant
1 parent 43428ec commit c052bad

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

gleam.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "midas_sdk"
2-
version = "0.1.4"
2+
version = "0.1.5"
33
target = "javascript"
44

55
description = "A bag of SDK's that can be used with midas."

src/midas/sdk/dnsimple.gleam

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ const auth_host = "dnsimple.com"
2222
const auth_path = "/oauth/authorize"
2323

2424
pub fn authenticate(app) {
25-
let App(client_id, client_secret, redirect_uri) = app
2625
let state = int.to_string(int.random(1_000_000_000))
26+
do_authenticate(app, state)
27+
}
28+
29+
pub fn do_authenticate(app, state) {
30+
let App(client_id, client_secret, redirect_uri) = app
2731
let url = auth_url(client_id, redirect_uri, state)
2832
use redirect <- t.do(t.follow(url))
2933
use #(code, returned_state) <- t.try(
@@ -106,7 +110,7 @@ pub fn token_response(response) {
106110
Ok(token)
107111
}
108112

109-
const api_host = "api.dnsimple.com"
113+
pub const api_host = "api.dnsimple.com"
110114

111115
fn base_request(token) {
112116
request.new()

src/midas/sdk/linkedin.gleam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub fn token_response(response) {
103103
Ok(token)
104104
}
105105

106-
const api_host = "api.linkedin.com"
106+
pub const api_host = "api.linkedin.com"
107107

108108
fn base_request(token) {
109109
request.new()

src/midas/sdk/twitter.gleam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn key_find(items, key) {
8585
|> result.replace_error("Did not find key: " <> key)
8686
}
8787

88-
const api_host = "api.twitter.com"
88+
pub const api_host = "api.twitter.com"
8989

9090
const token_path = "/2/oauth2/token"
9191

0 commit comments

Comments
 (0)