Skip to content

Commit 041e057

Browse files
committed
v3.3.0
1 parent ce7b65a commit 041e057

File tree

9 files changed

+55
-29
lines changed

9 files changed

+55
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Add a new dependency to `mix.exs`:
1717
```elixir
1818
def deps do
1919
[
20-
{:elixir_lokalise_api, "~> 2.0"}
20+
{:elixir_lokalise_api, "~> 3.3"}
2121
]
2222
end
2323
```

config/dev.exs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ import Config
33
config :elixir_lokalise_api,
44
api_token: {:system, "LOKALISE_API_TOKEN"},
55
oauth2_client_id: {:system, "OAUTH2_CLIENT_ID"},
6-
oauth2_client_secret: {:system, "OAUTH2_CLIENT_SECRET"}
6+
oauth2_client_secret: {:system, "OAUTH2_CLIENT_SECRET"},
7+
base_url_api: {:system, "LOKALISE_API_BASE_URL"},
8+
base_url_oauth2: {:system, "LOKALISE_OAUTH2_BASE_URL"}

docs/Gemfile.lock

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.2.1)
4+
activesupport (8.0.0)
55
base64
6+
benchmark (>= 0.3)
67
bigdecimal
78
concurrent-ruby (~> 1.0, >= 1.3.1)
89
connection_pool (>= 2.2.5)
@@ -12,20 +13,23 @@ GEM
1213
minitest (>= 5.1)
1314
securerandom (>= 0.3)
1415
tzinfo (~> 2.0, >= 2.0.5)
16+
uri (>= 0.13.1)
1517
addressable (2.8.7)
1618
public_suffix (>= 2.0.2, < 7.0)
1719
base64 (0.2.0)
20+
benchmark (0.4.0)
1821
bigdecimal (3.1.8)
1922
coffee-script (2.4.1)
2023
coffee-script-source
2124
execjs
2225
coffee-script-source (1.12.2)
2326
colorator (1.1.0)
24-
commonmarker (0.23.10)
27+
commonmarker (0.23.11)
2528
concurrent-ruby (1.3.4)
2629
connection_pool (2.4.1)
2730
csv (3.3.0)
28-
dnsruby (1.72.2)
31+
dnsruby (1.72.3)
32+
base64 (~> 0.2.0)
2933
simpleidn (~> 0.2.1)
3034
drb (2.2.1)
3135
em-websocket (0.5.3)
@@ -34,13 +38,13 @@ GEM
3438
ethon (0.16.0)
3539
ffi (>= 1.15.0)
3640
eventmachine (1.2.7)
37-
execjs (2.9.1)
38-
faraday (2.12.0)
39-
faraday-net_http (>= 2.0, < 3.4)
41+
execjs (2.10.0)
42+
faraday (2.12.1)
43+
faraday-net_http (>= 2.0, < 3.5)
4044
json
4145
logger
42-
faraday-net_http (3.3.0)
43-
net-http
46+
faraday-net_http (3.4.0)
47+
net-http (>= 0.5.0)
4448
ffi (1.17.0-x64-mingw-ucrt)
4549
forwardable-extended (2.6.0)
4650
gemoji (4.1.0)
@@ -212,7 +216,7 @@ GEM
212216
gemoji (>= 3, < 5)
213217
html-pipeline (~> 2.2)
214218
jekyll (>= 3.0, < 5.0)
215-
json (2.7.2)
219+
json (2.8.2)
216220
kramdown (2.4.0)
217221
rexml
218222
kramdown-parser-gfm (1.1.0)
@@ -227,8 +231,8 @@ GEM
227231
jekyll (>= 3.5, < 5.0)
228232
jekyll-feed (~> 0.9)
229233
jekyll-seo-tag (~> 2.1)
230-
minitest (5.25.1)
231-
net-http (0.4.1)
234+
minitest (5.25.2)
235+
net-http (0.5.0)
232236
uri
233237
nokogiri (1.16.7-x64-mingw-ucrt)
234238
racc (~> 1.4)
@@ -242,7 +246,7 @@ GEM
242246
rb-fsevent (0.11.2)
243247
rb-inotify (0.11.1)
244248
ffi (~> 1.0)
245-
rexml (3.3.8)
249+
rexml (3.3.9)
246250
rouge (3.30.0)
247251
rubyzip (2.3.2)
248252
safe_yaml (1.0.5)
@@ -254,7 +258,7 @@ GEM
254258
sawyer (0.9.2)
255259
addressable (>= 2.3.5)
256260
faraday (>= 0.17.3, < 3)
257-
securerandom (0.3.1)
261+
securerandom (0.3.2)
258262
simpleidn (0.2.3)
259263
terminal-table (1.8.0)
260264
unicode-display_width (~> 1.1, >= 1.1.1)
@@ -265,9 +269,9 @@ GEM
265269
tzinfo-data (1.2024.2)
266270
tzinfo (>= 1.0.0)
267271
unicode-display_width (1.8.0)
268-
uri (0.13.1)
272+
uri (1.0.2)
269273
wdm (0.2.0)
270-
webrick (1.8.2)
274+
webrick (1.9.0)
271275

272276
PLATFORMS
273277
x64-mingw-ucrt
@@ -283,4 +287,4 @@ DEPENDENCIES
283287
wdm (~> 0.2.0)
284288

285289
BUNDLED WITH
286-
2.5.21
290+
2.5.23

docs/additional_info/changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 3.3.0 (27-Nov-2024)
4+
5+
* Allow to redefine host for API and OAuth2 requests:
6+
7+
```elixir
8+
config :elixir_lokalise_api, base_url_api: "YOUR_API_BASE_URL"
9+
config :elixir_lokalise_api, base_url_oauth2: "YOUR_OAUTH2_BASE_URL"
10+
```
11+
312
## 3.2.0 (15-Oct-2024)
413

514
* Added support for a new [`PermissionTemplates` endpoint](https://developers.lokalise.com/reference/list-all-permission-templates):

docs/additional_info/customization.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,11 @@ config :elixir_lokalise_api,
1313
```
1414

1515
If the `request_options` is not provided, the default options will be utilized. You can find full list
16-
of all the available `:options` in the [HTTPoison docs](https://hexdocs.pm/httpoison/HTTPoison.Request.html).
16+
of all the available `:options` in the [HTTPoison docs](https://hexdocs.pm/httpoison/HTTPoison.Request.html).
17+
18+
You can also override the default host URLs:
19+
20+
```elixir
21+
config :elixir_lokalise_api, base_url_api: "YOUR_API_BASE_URL"
22+
config :elixir_lokalise_api, base_url_oauth2: "YOUR_OAUTH2_BASE_URL"
23+
```

lib/elixir_lokalise_api/config.ex

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,17 @@ defmodule ElixirLokaliseApi.Config do
3737
@doc """
3838
Returns package version
3939
"""
40-
def version, do: from_env(:version, "3.2.0")
40+
def version, do: from_env(:version, "3.3.0")
4141

4242
@doc """
43-
Returns the base URL of the Lokalise APIv2 or OAuth2
44-
"""
45-
def base_url(:api), do: "https://api.lokalise.com/api2/"
43+
Returns the base URL of the Lokalise APIv2 or OAuth2. Set it inside your `mix.exs`:
44+
config :elixir_lokalise_api, base_url_api: "YOUR_API_BASE_URL"
45+
config :elixir_lokalise_api, base_url_oauth2: "YOUR_OAUTH2_BASE_URL"
4646
47-
def base_url(:oauth2), do: "https://app.lokalise.com/oauth2/"
47+
You can also use `{:system, "ENV_VAR_NAME"}` to set it via environment variables.
48+
"""
49+
def base_url(:api), do: from_env(:base_url_api, "https://api.lokalise.com/api2/")
50+
def base_url(:oauth2), do: from_env(:base_url_oauth2, "https://app.lokalise.com/oauth2/")
4851

4952
@doc """
5053
A wrapper around `Application.put_env/3`

lib/elixir_lokalise_api/request.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ defmodule ElixirLokaliseApi.Request do
4242
{:error, error} ->
4343
# HTTPoison error
4444
{:error, error.reason}
45+
4546
# coveralls-ignore-end
4647

4748
{:error, data, status} ->

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule ElixirLokaliseApi.MixProject do
22
use Mix.Project
33

44
@source_url "https://github.com/lokalise/elixir-lokalise-api"
5-
@version "3.2.0"
5+
@version "3.3.0"
66

77
def project do
88
[

mix.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
%{
22
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
33
"certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"},
4-
"credo": {:hex, :credo, "1.7.8", "9722ba1681e973025908d542ec3d95db5f9c549251ba5b028e251ad8c24ab8c5", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cb9e87cc64f152f3ed1c6e325e7b894dea8f5ef2e41123bd864e3cd5ceb44968"},
5-
"dialyxir": {:hex, :dialyxir, "1.4.4", "fb3ce8741edeaea59c9ae84d5cec75da00fa89fe401c72d6e047d11a61f65f70", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "cd6111e8017ccd563e65621a4d9a4a1c5cd333df30cebc7face8029cacb4eff6"},
4+
"credo": {:hex, :credo, "1.7.10", "6e64fe59be8da5e30a1b96273b247b5cf1cc9e336b5fd66302a64b25749ad44d", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "71fbc9a6b8be21d993deca85bf151df023a3097b01e09a2809d460348561d8cd"},
5+
"dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"},
66
"earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"},
77
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
88
"ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"},
@@ -16,8 +16,8 @@
1616
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
1717
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
1818
"jsx": {:hex, :jsx, "2.8.3", "a05252d381885240744d955fbe3cf810504eb2567164824e19303ea59eef62cf", [:mix, :rebar3], [], "hexpm", "fc3499fed7a726995aa659143a248534adc754ebd16ccd437cd93b649a95091f"},
19-
"makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"},
20-
"makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"},
19+
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
20+
"makeup_elixir": {:hex, :makeup_elixir, "1.0.0", "74bb8348c9b3a51d5c589bf5aebb0466a84b33274150e3b6ece1da45584afc82", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "49159b7d7d999e836bedaf09dcf35ca18b312230cf901b725a64f3f42e407983"},
2121
"makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"},
2222
"meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"},
2323
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},

0 commit comments

Comments
 (0)