Skip to content

Commit

Permalink
Version 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bodrovis committed May 14, 2024
1 parent b5b67d2 commit 8dacb64
Show file tree
Hide file tree
Showing 18 changed files with 253 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
include:
- elixir: 1.15.x
- elixir: 1.16.x
otp: 26
env:
MIX_ENV: test
Expand Down
6 changes: 3 additions & 3 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ gem 'minima', '~> 2.0'

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem 'github-pages', '~> 228', group: :jekyll_plugins
gem 'github-pages', '~> 231', group: :jekyll_plugins

# If you have any plugins, put them here!
group :jekyll_plugins do
gem 'jekyll-feed', '~> 0.15'
gem 'jekyll-feed', '~> 0.17'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ /mingw|mswin|java/ } do
gem 'tzinfo', '~> 1.2'
gem 'tzinfo', '~> 2.0'
gem 'tzinfo-data'
end

Expand Down
127 changes: 67 additions & 60 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,49 +1,55 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.0.6.1)
activesupport (7.1.3.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.8.5)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.2.0)
bigdecimal (3.1.8)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
coffee-script-source (1.12.2)
colorator (1.1.0)
commonmarker (0.23.10)
concurrent-ruby (1.2.2)
dnsruby (1.70.0)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
dnsruby (1.72.1)
simpleidn (~> 0.2.1)
drb (2.2.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
execjs (2.9.1)
faraday (2.7.12)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.16.3-x64-mingw-ucrt)
faraday (2.9.0)
faraday-net_http (>= 2.0, < 3.2)
faraday-net_http (3.1.0)
net-http
ffi (1.16.3)
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (228)
github-pages-health-check (= 1.17.9)
jekyll (= 3.9.3)
jekyll-avatar (= 0.7.0)
jekyll-coffeescript (= 1.1.1)
gemoji (4.1.0)
github-pages (231)
github-pages-health-check (= 1.18.2)
jekyll (= 3.9.5)
jekyll-avatar (= 0.8.0)
jekyll-coffeescript (= 1.2.2)
jekyll-commonmark-ghpages (= 0.4.0)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.15.1)
jekyll-default-layout (= 0.1.5)
jekyll-feed (= 0.17.0)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.13.0)
jekyll-github-metadata (= 2.16.1)
jekyll-include-cache (= 0.2.1)
jekyll-mentions (= 1.6.0)
jekyll-optional-front-matter (= 0.3.2)
Expand All @@ -70,28 +76,28 @@ GEM
jekyll-theme-tactile (= 0.2.0)
jekyll-theme-time-machine (= 0.2.0)
jekyll-titles-from-headings (= 0.5.3)
jemoji (= 0.12.0)
kramdown (= 2.3.2)
jemoji (= 0.13.0)
kramdown (= 2.4.0)
kramdown-parser-gfm (= 1.1.0)
liquid (= 4.0.4)
mercenary (~> 0.3)
minima (= 2.5.1)
nokogiri (>= 1.13.6, < 2.0)
rouge (= 3.26.0)
rouge (= 3.30.0)
terminal-table (~> 1.4)
github-pages-health-check (1.17.9)
github-pages-health-check (1.18.2)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (>= 3.0, < 5.0)
octokit (>= 4, < 8)
public_suffix (>= 3.0, < 6.0)
typhoeus (~> 1.3)
html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (1.14.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
jekyll (3.9.3)
jekyll (3.9.5)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
Expand All @@ -104,27 +110,27 @@ GEM
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-avatar (0.7.0)
jekyll-avatar (0.8.0)
jekyll (>= 3.0, < 5.0)
jekyll-coffeescript (1.1.1)
jekyll-coffeescript (1.2.2)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
coffee-script-source (~> 1.12)
jekyll-commonmark (1.4.0)
commonmarker (~> 0.22)
jekyll-commonmark-ghpages (0.4.0)
commonmarker (~> 0.23.7)
jekyll (~> 3.9.0)
jekyll-commonmark (~> 1.4.0)
rouge (>= 2.0, < 5.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.15.1)
jekyll-default-layout (0.1.5)
jekyll (>= 3.0, < 5.0)
jekyll-feed (0.17.0)
jekyll (>= 3.7, < 5.0)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.13.0)
jekyll-github-metadata (2.16.1)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
octokit (>= 4, < 7, != 4.4.0)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-mentions (1.6.0)
Expand Down Expand Up @@ -195,39 +201,41 @@ GEM
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.12.0)
gemoji (~> 3.0)
jemoji (0.13.0)
gemoji (>= 3, < 5)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
kramdown (2.3.2)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.8.0)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.20.0)
nokogiri (1.15.5-x64-mingw-ucrt)
minitest (5.22.3)
mutex_m (0.2.0)
net-http (0.4.1)
uri
nokogiri (1.16.5-x64-mingw-ucrt)
racc (~> 1.4)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
public_suffix (5.0.5)
racc (1.7.3)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.6)
rouge (3.26.0)
ruby2_keywords (0.0.5)
rouge (3.30.0)
rubyzip (2.3.2)
safe_yaml (1.0.5)
sass (3.7.4)
Expand All @@ -238,36 +246,35 @@ GEM
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
simpleidn (0.2.1)
simpleidn (0.2.2)
unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (1.2.11)
thread_safe (~> 0.1)
tzinfo-data (1.2023.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2024.1)
tzinfo (>= 1.0.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.9.1-x64-mingw-ucrt)
unf_ext (0.0.9.1)
unicode-display_width (1.8.0)
uri (0.13.0)
wdm (0.1.1)
zeitwerk (2.6.12)

PLATFORMS
x64-mingw-ucrt

DEPENDENCIES
github-pages (~> 228)
github-pages (~> 231)
jekyll (~> 3.9.0)
jekyll-feed (~> 0.15)
jekyll-feed (~> 0.17)
kramdown-parser-gfm
minima (~> 2.0)
tzinfo (~> 1.2)
tzinfo (~> 2.0)
tzinfo-data
wdm (~> 0.1.0)

BUNDLED WITH
2.4.22
2.5.10
11 changes: 11 additions & 0 deletions docs/additional_info/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 3.1.0 (14-May-2024)

* Add support for [cursor pagination](https://lokalise.github.io/elixir-lokalise-api/api/getting-started#cursor-pagination) for List keys and List translation endpoints:

```elixir
{:ok, %KeysCollection{} = keys} = Keys.all(@project_id, limit: 2, pagination: "cursor", cursor: "eyIxIjozNzk3ODEzODh9")

keys.per_page_limit # => 2
keys.next_cursor # => "eyIxIjo0NTc4NDUxMDd9"
```

## 3.0.0 (02-Feb-2023)

* Elixir v1.14+ is required.
Expand Down
11 changes: 11 additions & 0 deletions docs/api/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ projects |> Pagination.next_page() # => What is the number of the next page?
projects |> Pagination.prev_page() # => What is the number of the previous page?
```

### Cursor pagination

The [List Keys](https://developers.lokalise.com/reference/list-all-keys) and [List Translations](https://developers.lokalise.com/reference/list-all-translations) endpoints support cursor pagination, which is recommended for its faster performance compared to traditional "offset" pagination. By default, "offset" pagination is used, so you must explicitly set `pagination` to `"cursor"` to use cursor pagination:

```elixir
{:ok, %KeysCollection{} = keys} = Keys.all(@project_id, limit: 2, pagination: "cursor", cursor: "eyIxIjozNzk3ODEzODh9")

keys.per_page_limit # => 2
keys.next_cursor # => "eyIxIjo0NTc4NDUxMDd9"
```

## Branching

If you are using [project branching feature](https://docs.lokalise.com/en/articles/3391861-project-branching), simply add branch name separated by semicolon to your project ID in any endpoint to access the branch. For example, in order to access `new-feature` branch for the project with an id `123abcdef.01`:
Expand Down
2 changes: 2 additions & 0 deletions docs/api/keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

[Doc](https://developers.lokalise.com/reference/list-all-keys)

**This endpoint also supports cursor pagination which is now a recommended approach, especially for fetching large amounts of data. Please [learn more in the Pagination docs](https://lokalise.github.io/elixir-lokalise-api/api/getting-started#cursor-pagination).**

```elixir
{:ok, keys} = ElixirLokaliseApi.Keys.all(project_id, page: 2, limit: 3)

Expand Down
2 changes: 2 additions & 0 deletions docs/api/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

[Doc](https://developers.lokalise.com/reference/list-all-translations)

**This endpoint also supports cursor pagination which is now a recommended approach, especially for fetching large amounts of data. Please [learn more in the Pagination docs](https://lokalise.github.io/elixir-lokalise-api/api/getting-started#cursor-pagination).**

```elixir
{:ok, translations} = ElixirLokaliseApi.Translations.all(@project_id, filter_is_reviewed: 0, page: 2, limit: 1)

Expand Down
12 changes: 6 additions & 6 deletions lib/elixir_lokalise_api.ex
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
defmodule ElixirLokaliseApi do
@moduledoc """
`ElixirLokaliseApi` is an official client (interface) for the Lokalise APIv2.
Learn more about Lokalise API at
[https://developers.lokalise.com/reference/lokalise-rest-api](https://developers.lokalise.com/reference/lokalise-rest-api).
To get started, you will need an API token that can be generated in your
Lokalise profile.
This token should be stored in your config file, for example `dev.exs`:
config :elixir_lokalise_api, api_token: {:system, "LOKALISE_API_TOKEN"}
Next, use one of the endpoints to send requests, for example:
{:ok, project} = ElixirLokaliseApi.Projects.find("123.abc")
"""
end
1 change: 1 addition & 0 deletions lib/elixir_lokalise_api/collections/keys.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ defmodule ElixirLokaliseApi.Collection.Keys do
page_count: nil,
per_page_limit: nil,
current_page: nil,
next_cursor: nil,
errors: []
end
3 changes: 2 additions & 1 deletion lib/elixir_lokalise_api/collections/translations.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ defmodule ElixirLokaliseApi.Collection.Translations do
total_count: nil,
page_count: nil,
per_page_limit: nil,
current_page: nil
current_page: nil,
next_cursor: nil
end
2 changes: 1 addition & 1 deletion lib/elixir_lokalise_api/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule ElixirLokaliseApi.Config do
@doc """
Returns package version
"""
def version, do: from_env(:version, "2.1.0")
def version, do: from_env(:version, "3.1.0")

@doc """
Returns the base URL of the Lokalise APIv2 or OAuth2
Expand Down
Loading

0 comments on commit 8dacb64

Please sign in to comment.