ruby-lokalise-api 7.1.1 → 8.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_lokalise_api/base_client.rb +2 -34
- data/lib/ruby_lokalise_api/client.rb +2 -31
- data/lib/ruby_lokalise_api/collections/base.rb +97 -70
- data/lib/ruby_lokalise_api/collections/branches.rb +11 -0
- data/lib/ruby_lokalise_api/collections/contributors.rb +10 -0
- data/lib/ruby_lokalise_api/collections/custom_translation_statuses.rb +10 -0
- data/lib/ruby_lokalise_api/collections/files.rb +10 -0
- data/lib/ruby_lokalise_api/collections/key_comments.rb +11 -0
- data/lib/ruby_lokalise_api/collections/keys.rb +10 -0
- data/lib/ruby_lokalise_api/collections/orders.rb +10 -0
- data/lib/ruby_lokalise_api/collections/payment_cards.rb +10 -0
- data/lib/ruby_lokalise_api/collections/project_comments.rb +12 -0
- data/lib/ruby_lokalise_api/collections/project_languages.rb +11 -0
- data/lib/ruby_lokalise_api/collections/projects.rb +10 -0
- data/lib/ruby_lokalise_api/collections/queued_processes.rb +11 -0
- data/lib/ruby_lokalise_api/collections/screenshots.rb +10 -0
- data/lib/ruby_lokalise_api/collections/segments.rb +10 -0
- data/lib/ruby_lokalise_api/collections/snapshots.rb +10 -0
- data/lib/ruby_lokalise_api/collections/system_languages.rb +11 -0
- data/lib/ruby_lokalise_api/collections/tasks.rb +10 -0
- data/lib/ruby_lokalise_api/collections/team_user_groups.rb +11 -0
- data/lib/ruby_lokalise_api/collections/team_users.rb +10 -0
- data/lib/ruby_lokalise_api/collections/teams.rb +10 -0
- data/lib/ruby_lokalise_api/collections/translation_providers.rb +10 -0
- data/lib/ruby_lokalise_api/collections/translations.rb +10 -0
- data/lib/ruby_lokalise_api/collections/webhooks.rb +10 -0
- data/lib/ruby_lokalise_api/concerns/attrs_loadable.rb +31 -0
- data/lib/ruby_lokalise_api/concerns/hash_accessible.rb +16 -0
- data/lib/ruby_lokalise_api/concerns/unsupportable.rb +16 -0
- data/lib/ruby_lokalise_api/connection.rb +18 -9
- data/lib/ruby_lokalise_api/data/collection_attributes.yml +52 -0
- data/lib/ruby_lokalise_api/data/{attributes.yml → resource_attributes.yml} +64 -6
- data/lib/ruby_lokalise_api/endpoints/base_endpoint.rb +66 -0
- data/lib/ruby_lokalise_api/endpoints/branches_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/contributors_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/custom_translation_statuses_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/files_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/jwts_endpoint.rb +15 -0
- data/lib/ruby_lokalise_api/endpoints/key_comments_endpoint.rb +17 -0
- data/lib/ruby_lokalise_api/endpoints/keys_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/main_endpoint.rb +25 -0
- data/lib/ruby_lokalise_api/endpoints/oauth2/oauth2_endpoint.rb +33 -0
- data/lib/ruby_lokalise_api/endpoints/orders_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/payment_cards_endpoint.rb +15 -0
- data/lib/ruby_lokalise_api/endpoints/project_comments_endpoint.rb +15 -0
- data/lib/ruby_lokalise_api/endpoints/project_languages_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/projects_endpoint.rb +15 -0
- data/lib/ruby_lokalise_api/endpoints/queued_processes_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/screenshots_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/segments_endpoint.rb +17 -0
- data/lib/ruby_lokalise_api/endpoints/snapshots_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/system_languages_endpoint.rb +15 -0
- data/lib/ruby_lokalise_api/endpoints/tasks_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/team_user_billing_details_endpoint.rb +15 -0
- data/lib/ruby_lokalise_api/endpoints/team_user_groups_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/team_users_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/teams_endpoint.rb +13 -0
- data/lib/ruby_lokalise_api/endpoints/translation_providers_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/translations_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/endpoints/webhooks_endpoint.rb +16 -0
- data/lib/ruby_lokalise_api/error.rb +1 -0
- data/lib/ruby_lokalise_api/generics.rb +25 -0
- data/lib/ruby_lokalise_api/json_handler.rb +1 -2
- data/lib/ruby_lokalise_api/oauth2/auth.rb +33 -39
- data/lib/ruby_lokalise_api/oauth2_client.rb +3 -0
- data/lib/ruby_lokalise_api/request.rb +66 -18
- data/lib/ruby_lokalise_api/resources/base.rb +41 -181
- data/lib/ruby_lokalise_api/resources/branch.rb +2 -21
- data/lib/ruby_lokalise_api/resources/comment.rb +11 -0
- data/lib/ruby_lokalise_api/resources/contributor.rb +1 -9
- data/lib/ruby_lokalise_api/resources/custom_translation_status.rb +1 -13
- data/lib/ruby_lokalise_api/resources/file.rb +2 -16
- data/lib/ruby_lokalise_api/resources/jwt.rb +2 -5
- data/lib/ruby_lokalise_api/resources/key.rb +5 -8
- data/lib/ruby_lokalise_api/resources/oauth2_refreshed_token.rb +9 -0
- data/lib/ruby_lokalise_api/resources/oauth2_token.rb +9 -0
- data/lib/ruby_lokalise_api/resources/order.rb +2 -9
- data/lib/ruby_lokalise_api/resources/payment_card.rb +2 -8
- data/lib/ruby_lokalise_api/resources/project.rb +85 -16
- data/lib/ruby_lokalise_api/resources/project_language.rb +2 -10
- data/lib/ruby_lokalise_api/resources/queued_process.rb +3 -10
- data/lib/ruby_lokalise_api/resources/screenshot.rb +1 -9
- data/lib/ruby_lokalise_api/resources/segment.rb +2 -11
- data/lib/ruby_lokalise_api/resources/snapshot.rb +3 -18
- data/lib/ruby_lokalise_api/resources/system_language.rb +2 -1
- data/lib/ruby_lokalise_api/resources/task.rb +1 -9
- data/lib/ruby_lokalise_api/resources/team.rb +2 -0
- data/lib/ruby_lokalise_api/resources/team_user.rb +1 -9
- data/lib/ruby_lokalise_api/resources/team_user_billing_details.rb +10 -5
- data/lib/ruby_lokalise_api/resources/team_user_group.rb +6 -14
- data/lib/ruby_lokalise_api/resources/translation.rb +2 -9
- data/lib/ruby_lokalise_api/resources/translation_provider.rb +2 -9
- data/lib/ruby_lokalise_api/resources/webhook.rb +2 -16
- data/lib/ruby_lokalise_api/response.rb +50 -0
- data/lib/ruby_lokalise_api/rest/branches.rb +52 -27
- data/lib/ruby_lokalise_api/rest/comments.rb +48 -23
- data/lib/ruby_lokalise_api/rest/contributors.rb +47 -23
- data/lib/ruby_lokalise_api/rest/custom_translation_statuses.rb +60 -36
- data/lib/ruby_lokalise_api/rest/files.rb +43 -24
- data/lib/ruby_lokalise_api/rest/jwts.rb +21 -0
- data/lib/ruby_lokalise_api/rest/keys.rb +67 -34
- data/lib/ruby_lokalise_api/rest/languages.rb +57 -28
- data/lib/ruby_lokalise_api/rest/orders.rb +36 -14
- data/lib/ruby_lokalise_api/rest/payment_cards.rb +29 -12
- data/lib/ruby_lokalise_api/rest/projects.rb +55 -32
- data/lib/ruby_lokalise_api/rest/queued_processes.rb +21 -13
- data/lib/ruby_lokalise_api/rest/screenshots.rb +45 -20
- data/lib/ruby_lokalise_api/rest/segments.rb +31 -18
- data/lib/ruby_lokalise_api/rest/snapshots.rb +34 -14
- data/lib/ruby_lokalise_api/rest/tasks.rb +41 -19
- data/lib/ruby_lokalise_api/rest/team_user_billing_details.rb +33 -12
- data/lib/ruby_lokalise_api/rest/team_user_groups.rb +82 -50
- data/lib/ruby_lokalise_api/rest/team_users.rb +35 -18
- data/lib/ruby_lokalise_api/rest/teams.rb +10 -5
- data/lib/ruby_lokalise_api/rest/translation_providers.rb +24 -9
- data/lib/ruby_lokalise_api/rest/translations.rb +28 -15
- data/lib/ruby_lokalise_api/rest/webhooks.rb +54 -30
- data/lib/ruby_lokalise_api/rest.rb +31 -0
- data/lib/ruby_lokalise_api/utils/attributes.rb +37 -0
- data/lib/ruby_lokalise_api/utils/classes.rb +24 -0
- data/lib/ruby_lokalise_api/utils/keys.rb +29 -0
- data/lib/ruby_lokalise_api/utils/loaders.rb +24 -0
- data/lib/ruby_lokalise_api/utils/strings.rb +20 -0
- data/lib/ruby_lokalise_api/version.rb +1 -1
- data/lib/ruby_lokalise_api.rb +6 -2
- data/ruby-lokalise-api.gemspec +2 -2
- metadata +76 -41
- data/lib/ruby_lokalise_api/base_request.rb +0 -73
- data/lib/ruby_lokalise_api/collections/branch.rb +0 -15
- data/lib/ruby_lokalise_api/collections/contributor.rb +0 -13
- data/lib/ruby_lokalise_api/collections/custom_translation_status.rb +0 -15
- data/lib/ruby_lokalise_api/collections/file.rb +0 -13
- data/lib/ruby_lokalise_api/collections/key.rb +0 -20
- data/lib/ruby_lokalise_api/collections/key_comment.rb +0 -14
- data/lib/ruby_lokalise_api/collections/order.rb +0 -13
- data/lib/ruby_lokalise_api/collections/payment_card.rb +0 -13
- data/lib/ruby_lokalise_api/collections/project.rb +0 -13
- data/lib/ruby_lokalise_api/collections/project_comment.rb +0 -13
- data/lib/ruby_lokalise_api/collections/project_language.rb +0 -13
- data/lib/ruby_lokalise_api/collections/queued_process.rb +0 -15
- data/lib/ruby_lokalise_api/collections/screenshot.rb +0 -13
- data/lib/ruby_lokalise_api/collections/segment.rb +0 -15
- data/lib/ruby_lokalise_api/collections/snapshot.rb +0 -13
- data/lib/ruby_lokalise_api/collections/system_language.rb +0 -13
- data/lib/ruby_lokalise_api/collections/task.rb +0 -13
- data/lib/ruby_lokalise_api/collections/team.rb +0 -13
- data/lib/ruby_lokalise_api/collections/team_user.rb +0 -13
- data/lib/ruby_lokalise_api/collections/team_user_group.rb +0 -15
- data/lib/ruby_lokalise_api/collections/translation.rb +0 -13
- data/lib/ruby_lokalise_api/collections/translation_provider.rb +0 -13
- data/lib/ruby_lokalise_api/collections/webhook.rb +0 -13
- data/lib/ruby_lokalise_api/oauth2/refresh.rb +0 -16
- data/lib/ruby_lokalise_api/oauth2/token.rb +0 -16
- data/lib/ruby_lokalise_api/resources/key_comment.rb +0 -19
- data/lib/ruby_lokalise_api/resources/project_comment.rb +0 -10
- data/lib/ruby_lokalise_api/rest/jwt.rb +0 -15
- data/lib/ruby_lokalise_api/utils/attribute_helpers.rb +0 -86
- data/lib/ruby_lokalise_api/utils/endpoint_helpers.rb +0 -14
- data/lib/ruby_lokalise_api/utils/string_utils.rb +0 -33
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubyLokaliseApi
|
4
|
+
module Utils
|
5
|
+
module Loaders
|
6
|
+
private
|
7
|
+
|
8
|
+
def endpoint(name:, client: self, params: {})
|
9
|
+
klass = RubyLokaliseApi.const_get "Endpoints::#{name}Endpoint"
|
10
|
+
klass.new client, params
|
11
|
+
end
|
12
|
+
|
13
|
+
def resource(name, data)
|
14
|
+
klass = RubyLokaliseApi.const_get "Resources::#{name}"
|
15
|
+
klass.new data
|
16
|
+
end
|
17
|
+
|
18
|
+
def collection(name, data)
|
19
|
+
klass = RubyLokaliseApi.const_get "Collections::#{name}"
|
20
|
+
klass.new data
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubyLokaliseApi
|
4
|
+
module Utils
|
5
|
+
module Strings
|
6
|
+
refine String do
|
7
|
+
# Initial code taken from Facets gem by Rubyworks
|
8
|
+
# https://github.com/rubyworks/facets/blob/master/lib/core/facets/string/snakecase.rb
|
9
|
+
def snakecase
|
10
|
+
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
|
11
|
+
gsub(/([a-z\d])([A-Z])/, '\1_\2').
|
12
|
+
tr('-', '_').
|
13
|
+
gsub(/\s/, '_').
|
14
|
+
gsub(/__+/, '_').
|
15
|
+
downcase
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/ruby_lokalise_api.rb
CHANGED
@@ -4,15 +4,19 @@ require 'zeitwerk'
|
|
4
4
|
require 'faraday'
|
5
5
|
require 'faraday/gzip'
|
6
6
|
require 'yaml'
|
7
|
-
require 'addressable'
|
7
|
+
require 'addressable/template'
|
8
8
|
|
9
9
|
loader = Zeitwerk::Loader.for_gem
|
10
10
|
loader.inflector.inflect(
|
11
11
|
'oauth2' => 'OAuth2',
|
12
|
-
'oauth2_client' => 'OAuth2Client'
|
12
|
+
'oauth2_client' => 'OAuth2Client',
|
13
|
+
'oauth2_endpoint' => 'OAuth2Endpoint',
|
14
|
+
'oauth2_token' => 'OAuth2Token',
|
15
|
+
'oauth2_refreshed_token' => 'OAuth2RefreshedToken'
|
13
16
|
)
|
14
17
|
loader.setup
|
15
18
|
|
19
|
+
# Official Ruby client for Lokalise APIv2
|
16
20
|
module RubyLokaliseApi
|
17
21
|
class << self
|
18
22
|
# Initializes a new Client object
|
data/ruby-lokalise-api.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.required_ruby_version = '>= 2.7'
|
16
16
|
|
17
17
|
spec.files = Dir['README.md', 'LICENSE',
|
18
|
-
'CHANGELOG.md', 'lib/**/*.rb', 'lib/ruby_lokalise_api/data
|
18
|
+
'CHANGELOG.md', 'lib/**/*.rb', 'lib/ruby_lokalise_api/data/*.yml',
|
19
19
|
'ruby-lokalise-api.gemspec', '.github/*.md',
|
20
20
|
'Gemfile', 'Rakefile']
|
21
21
|
spec.extra_rdoc_files = ['README.md']
|
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_development_dependency 'rubocop-rake', '~> 0.6'
|
37
37
|
spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
|
38
38
|
spec.add_development_dependency 'simplecov', '~> 0.21'
|
39
|
-
spec.add_development_dependency '
|
39
|
+
spec.add_development_dependency 'simplecov-lcov', '~> 0.8'
|
40
40
|
spec.add_development_dependency 'webmock', '~> 3.14'
|
41
41
|
spec.metadata = {
|
42
42
|
'rubygems_mfa_required' => 'true'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lokalise-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Krukowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -213,19 +213,19 @@ dependencies:
|
|
213
213
|
- !ruby/object:Gem::Version
|
214
214
|
version: '0.21'
|
215
215
|
- !ruby/object:Gem::Dependency
|
216
|
-
name:
|
216
|
+
name: simplecov-lcov
|
217
217
|
requirement: !ruby/object:Gem::Requirement
|
218
218
|
requirements:
|
219
219
|
- - "~>"
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version: '
|
221
|
+
version: '0.8'
|
222
222
|
type: :development
|
223
223
|
prerelease: false
|
224
224
|
version_requirements: !ruby/object:Gem::Requirement
|
225
225
|
requirements:
|
226
226
|
- - "~>"
|
227
227
|
- !ruby/object:Gem::Version
|
228
|
-
version: '
|
228
|
+
version: '0.8'
|
229
229
|
- !ruby/object:Gem::Dependency
|
230
230
|
name: webmock
|
231
231
|
requirement: !ruby/object:Gem::Requirement
|
@@ -259,53 +259,84 @@ files:
|
|
259
259
|
- Rakefile
|
260
260
|
- lib/ruby_lokalise_api.rb
|
261
261
|
- lib/ruby_lokalise_api/base_client.rb
|
262
|
-
- lib/ruby_lokalise_api/base_request.rb
|
263
262
|
- lib/ruby_lokalise_api/client.rb
|
264
263
|
- lib/ruby_lokalise_api/collections/base.rb
|
265
|
-
- lib/ruby_lokalise_api/collections/
|
266
|
-
- lib/ruby_lokalise_api/collections/
|
267
|
-
- lib/ruby_lokalise_api/collections/
|
268
|
-
- lib/ruby_lokalise_api/collections/
|
269
|
-
- lib/ruby_lokalise_api/collections/
|
270
|
-
- lib/ruby_lokalise_api/collections/
|
271
|
-
- lib/ruby_lokalise_api/collections/
|
272
|
-
- lib/ruby_lokalise_api/collections/
|
273
|
-
- lib/ruby_lokalise_api/collections/
|
274
|
-
- lib/ruby_lokalise_api/collections/
|
275
|
-
- lib/ruby_lokalise_api/collections/
|
276
|
-
- lib/ruby_lokalise_api/collections/
|
277
|
-
- lib/ruby_lokalise_api/collections/
|
278
|
-
- lib/ruby_lokalise_api/collections/
|
279
|
-
- lib/ruby_lokalise_api/collections/
|
280
|
-
- lib/ruby_lokalise_api/collections/
|
281
|
-
- lib/ruby_lokalise_api/collections/
|
282
|
-
- lib/ruby_lokalise_api/collections/
|
283
|
-
- lib/ruby_lokalise_api/collections/
|
284
|
-
- lib/ruby_lokalise_api/collections/
|
285
|
-
- lib/ruby_lokalise_api/collections/
|
286
|
-
- lib/ruby_lokalise_api/collections/
|
287
|
-
- lib/ruby_lokalise_api/collections/
|
264
|
+
- lib/ruby_lokalise_api/collections/branches.rb
|
265
|
+
- lib/ruby_lokalise_api/collections/contributors.rb
|
266
|
+
- lib/ruby_lokalise_api/collections/custom_translation_statuses.rb
|
267
|
+
- lib/ruby_lokalise_api/collections/files.rb
|
268
|
+
- lib/ruby_lokalise_api/collections/key_comments.rb
|
269
|
+
- lib/ruby_lokalise_api/collections/keys.rb
|
270
|
+
- lib/ruby_lokalise_api/collections/orders.rb
|
271
|
+
- lib/ruby_lokalise_api/collections/payment_cards.rb
|
272
|
+
- lib/ruby_lokalise_api/collections/project_comments.rb
|
273
|
+
- lib/ruby_lokalise_api/collections/project_languages.rb
|
274
|
+
- lib/ruby_lokalise_api/collections/projects.rb
|
275
|
+
- lib/ruby_lokalise_api/collections/queued_processes.rb
|
276
|
+
- lib/ruby_lokalise_api/collections/screenshots.rb
|
277
|
+
- lib/ruby_lokalise_api/collections/segments.rb
|
278
|
+
- lib/ruby_lokalise_api/collections/snapshots.rb
|
279
|
+
- lib/ruby_lokalise_api/collections/system_languages.rb
|
280
|
+
- lib/ruby_lokalise_api/collections/tasks.rb
|
281
|
+
- lib/ruby_lokalise_api/collections/team_user_groups.rb
|
282
|
+
- lib/ruby_lokalise_api/collections/team_users.rb
|
283
|
+
- lib/ruby_lokalise_api/collections/teams.rb
|
284
|
+
- lib/ruby_lokalise_api/collections/translation_providers.rb
|
285
|
+
- lib/ruby_lokalise_api/collections/translations.rb
|
286
|
+
- lib/ruby_lokalise_api/collections/webhooks.rb
|
287
|
+
- lib/ruby_lokalise_api/concerns/attrs_loadable.rb
|
288
|
+
- lib/ruby_lokalise_api/concerns/hash_accessible.rb
|
289
|
+
- lib/ruby_lokalise_api/concerns/unsupportable.rb
|
288
290
|
- lib/ruby_lokalise_api/connection.rb
|
289
|
-
- lib/ruby_lokalise_api/data/
|
291
|
+
- lib/ruby_lokalise_api/data/collection_attributes.yml
|
292
|
+
- lib/ruby_lokalise_api/data/resource_attributes.yml
|
293
|
+
- lib/ruby_lokalise_api/endpoints/base_endpoint.rb
|
294
|
+
- lib/ruby_lokalise_api/endpoints/branches_endpoint.rb
|
295
|
+
- lib/ruby_lokalise_api/endpoints/contributors_endpoint.rb
|
296
|
+
- lib/ruby_lokalise_api/endpoints/custom_translation_statuses_endpoint.rb
|
297
|
+
- lib/ruby_lokalise_api/endpoints/files_endpoint.rb
|
298
|
+
- lib/ruby_lokalise_api/endpoints/jwts_endpoint.rb
|
299
|
+
- lib/ruby_lokalise_api/endpoints/key_comments_endpoint.rb
|
300
|
+
- lib/ruby_lokalise_api/endpoints/keys_endpoint.rb
|
301
|
+
- lib/ruby_lokalise_api/endpoints/main_endpoint.rb
|
302
|
+
- lib/ruby_lokalise_api/endpoints/oauth2/oauth2_endpoint.rb
|
303
|
+
- lib/ruby_lokalise_api/endpoints/orders_endpoint.rb
|
304
|
+
- lib/ruby_lokalise_api/endpoints/payment_cards_endpoint.rb
|
305
|
+
- lib/ruby_lokalise_api/endpoints/project_comments_endpoint.rb
|
306
|
+
- lib/ruby_lokalise_api/endpoints/project_languages_endpoint.rb
|
307
|
+
- lib/ruby_lokalise_api/endpoints/projects_endpoint.rb
|
308
|
+
- lib/ruby_lokalise_api/endpoints/queued_processes_endpoint.rb
|
309
|
+
- lib/ruby_lokalise_api/endpoints/screenshots_endpoint.rb
|
310
|
+
- lib/ruby_lokalise_api/endpoints/segments_endpoint.rb
|
311
|
+
- lib/ruby_lokalise_api/endpoints/snapshots_endpoint.rb
|
312
|
+
- lib/ruby_lokalise_api/endpoints/system_languages_endpoint.rb
|
313
|
+
- lib/ruby_lokalise_api/endpoints/tasks_endpoint.rb
|
314
|
+
- lib/ruby_lokalise_api/endpoints/team_user_billing_details_endpoint.rb
|
315
|
+
- lib/ruby_lokalise_api/endpoints/team_user_groups_endpoint.rb
|
316
|
+
- lib/ruby_lokalise_api/endpoints/team_users_endpoint.rb
|
317
|
+
- lib/ruby_lokalise_api/endpoints/teams_endpoint.rb
|
318
|
+
- lib/ruby_lokalise_api/endpoints/translation_providers_endpoint.rb
|
319
|
+
- lib/ruby_lokalise_api/endpoints/translations_endpoint.rb
|
320
|
+
- lib/ruby_lokalise_api/endpoints/webhooks_endpoint.rb
|
290
321
|
- lib/ruby_lokalise_api/error.rb
|
322
|
+
- lib/ruby_lokalise_api/generics.rb
|
291
323
|
- lib/ruby_lokalise_api/json_handler.rb
|
292
324
|
- lib/ruby_lokalise_api/oauth2/auth.rb
|
293
|
-
- lib/ruby_lokalise_api/oauth2/refresh.rb
|
294
|
-
- lib/ruby_lokalise_api/oauth2/token.rb
|
295
325
|
- lib/ruby_lokalise_api/oauth2_client.rb
|
296
326
|
- lib/ruby_lokalise_api/request.rb
|
297
327
|
- lib/ruby_lokalise_api/resources/base.rb
|
298
328
|
- lib/ruby_lokalise_api/resources/branch.rb
|
329
|
+
- lib/ruby_lokalise_api/resources/comment.rb
|
299
330
|
- lib/ruby_lokalise_api/resources/contributor.rb
|
300
331
|
- lib/ruby_lokalise_api/resources/custom_translation_status.rb
|
301
332
|
- lib/ruby_lokalise_api/resources/file.rb
|
302
333
|
- lib/ruby_lokalise_api/resources/jwt.rb
|
303
334
|
- lib/ruby_lokalise_api/resources/key.rb
|
304
|
-
- lib/ruby_lokalise_api/resources/
|
335
|
+
- lib/ruby_lokalise_api/resources/oauth2_refreshed_token.rb
|
336
|
+
- lib/ruby_lokalise_api/resources/oauth2_token.rb
|
305
337
|
- lib/ruby_lokalise_api/resources/order.rb
|
306
338
|
- lib/ruby_lokalise_api/resources/payment_card.rb
|
307
339
|
- lib/ruby_lokalise_api/resources/project.rb
|
308
|
-
- lib/ruby_lokalise_api/resources/project_comment.rb
|
309
340
|
- lib/ruby_lokalise_api/resources/project_language.rb
|
310
341
|
- lib/ruby_lokalise_api/resources/queued_process.rb
|
311
342
|
- lib/ruby_lokalise_api/resources/screenshot.rb
|
@@ -320,12 +351,14 @@ files:
|
|
320
351
|
- lib/ruby_lokalise_api/resources/translation.rb
|
321
352
|
- lib/ruby_lokalise_api/resources/translation_provider.rb
|
322
353
|
- lib/ruby_lokalise_api/resources/webhook.rb
|
354
|
+
- lib/ruby_lokalise_api/response.rb
|
355
|
+
- lib/ruby_lokalise_api/rest.rb
|
323
356
|
- lib/ruby_lokalise_api/rest/branches.rb
|
324
357
|
- lib/ruby_lokalise_api/rest/comments.rb
|
325
358
|
- lib/ruby_lokalise_api/rest/contributors.rb
|
326
359
|
- lib/ruby_lokalise_api/rest/custom_translation_statuses.rb
|
327
360
|
- lib/ruby_lokalise_api/rest/files.rb
|
328
|
-
- lib/ruby_lokalise_api/rest/
|
361
|
+
- lib/ruby_lokalise_api/rest/jwts.rb
|
329
362
|
- lib/ruby_lokalise_api/rest/keys.rb
|
330
363
|
- lib/ruby_lokalise_api/rest/languages.rb
|
331
364
|
- lib/ruby_lokalise_api/rest/orders.rb
|
@@ -343,9 +376,11 @@ files:
|
|
343
376
|
- lib/ruby_lokalise_api/rest/translation_providers.rb
|
344
377
|
- lib/ruby_lokalise_api/rest/translations.rb
|
345
378
|
- lib/ruby_lokalise_api/rest/webhooks.rb
|
346
|
-
- lib/ruby_lokalise_api/utils/
|
347
|
-
- lib/ruby_lokalise_api/utils/
|
348
|
-
- lib/ruby_lokalise_api/utils/
|
379
|
+
- lib/ruby_lokalise_api/utils/attributes.rb
|
380
|
+
- lib/ruby_lokalise_api/utils/classes.rb
|
381
|
+
- lib/ruby_lokalise_api/utils/keys.rb
|
382
|
+
- lib/ruby_lokalise_api/utils/loaders.rb
|
383
|
+
- lib/ruby_lokalise_api/utils/strings.rb
|
349
384
|
- lib/ruby_lokalise_api/version.rb
|
350
385
|
- ruby-lokalise-api.gemspec
|
351
386
|
homepage: https://github.com/lokalise/ruby-lokalise-api
|
@@ -364,11 +399,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
364
399
|
version: '2.7'
|
365
400
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
366
401
|
requirements:
|
367
|
-
- - "
|
402
|
+
- - ">"
|
368
403
|
- !ruby/object:Gem::Version
|
369
|
-
version:
|
404
|
+
version: 1.3.1
|
370
405
|
requirements: []
|
371
|
-
rubygems_version: 3.4.
|
406
|
+
rubygems_version: 3.4.15
|
372
407
|
signing_key:
|
373
408
|
specification_version: 4
|
374
409
|
summary: Ruby interface to the Lokalise API
|
@@ -1,73 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyLokaliseApi
|
4
|
-
module BaseRequest
|
5
|
-
include RubyLokaliseApi::JsonHandler
|
6
|
-
include RubyLokaliseApi::Connection
|
7
|
-
|
8
|
-
def get(path, client, params = {})
|
9
|
-
respond_with(
|
10
|
-
connection(client).get(prepare(path), params),
|
11
|
-
client
|
12
|
-
)
|
13
|
-
end
|
14
|
-
|
15
|
-
def post(path, client, params = {})
|
16
|
-
respond_with(
|
17
|
-
connection(client).post(prepare(path), custom_dump(params)),
|
18
|
-
client
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
def put(path, client, params = {})
|
23
|
-
respond_with(
|
24
|
-
connection(client).put(prepare(path), custom_dump(params)),
|
25
|
-
client
|
26
|
-
)
|
27
|
-
end
|
28
|
-
|
29
|
-
def patch(path, client, params = {})
|
30
|
-
respond_with(
|
31
|
-
connection(client).patch(prepare(path), params.any? ? custom_dump(params) : nil),
|
32
|
-
client
|
33
|
-
)
|
34
|
-
end
|
35
|
-
|
36
|
-
def delete(path, client, params = {})
|
37
|
-
respond_with(
|
38
|
-
# Rubocop tries to replace `delete` with `gsub` but that's a different method here!
|
39
|
-
# rubocop:disable Style/CollectionMethods
|
40
|
-
connection(client).delete(prepare(path)) do |req|
|
41
|
-
# rubocop:enable Style/CollectionMethods
|
42
|
-
req.body = custom_dump params
|
43
|
-
end,
|
44
|
-
client
|
45
|
-
)
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
# Get rid of double slashes in the `path`, leading and trailing slash
|
51
|
-
def prepare(path)
|
52
|
-
path.delete_prefix('/').gsub(%r{//}, '/').gsub(%r{/+\z}, '')
|
53
|
-
end
|
54
|
-
|
55
|
-
def raise_on_error!(response, body)
|
56
|
-
return unless !response.success? || (body.respond_to?(:has_key?) && body.key?('error'))
|
57
|
-
|
58
|
-
respond_with_error(response.status, body)
|
59
|
-
end
|
60
|
-
|
61
|
-
def respond_with(response, _client)
|
62
|
-
body = custom_load response.body
|
63
|
-
raise_on_error! response, body
|
64
|
-
body
|
65
|
-
end
|
66
|
-
|
67
|
-
def respond_with_error(code, body)
|
68
|
-
raise(RubyLokaliseApi::Error, body['error'] || body) unless RubyLokaliseApi::Error::ERRORS.key? code
|
69
|
-
|
70
|
-
raise RubyLokaliseApi::Error::ERRORS[code].from_response(body)
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyLokaliseApi
|
4
|
-
module Collections
|
5
|
-
class Branch < Base
|
6
|
-
DATA_KEY_PLURAL = 'Branches'
|
7
|
-
|
8
|
-
class << self
|
9
|
-
def endpoint(project_id, *_args)
|
10
|
-
path_from projects: [project_id, 'branches']
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyLokaliseApi
|
4
|
-
module Collections
|
5
|
-
class CustomTranslationStatus < Base
|
6
|
-
DATA_KEY_PLURAL = 'CustomTranslationStatuses'
|
7
|
-
|
8
|
-
class << self
|
9
|
-
def endpoint(project_id, *_args)
|
10
|
-
path_from projects: [project_id, 'custom_translation_statuses']
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyLokaliseApi
|
4
|
-
module Collections
|
5
|
-
class Key < Base
|
6
|
-
# Destroys all keys in the collection
|
7
|
-
# @return [Hash]
|
8
|
-
def destroy_all
|
9
|
-
keys = collection.map(&:key_id)
|
10
|
-
RubyLokaliseApi::Resources::Key.destroy @client, @path, keys: keys
|
11
|
-
end
|
12
|
-
|
13
|
-
class << self
|
14
|
-
def endpoint(project_id, *_args)
|
15
|
-
path_from projects: [project_id, 'keys']
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyLokaliseApi
|
4
|
-
module Collections
|
5
|
-
class KeyComment < Base
|
6
|
-
class << self
|
7
|
-
def endpoint(project_id, key_id, *_args)
|
8
|
-
path_from projects: project_id,
|
9
|
-
keys: [key_id, 'comments']
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyLokaliseApi
|
4
|
-
module Collections
|
5
|
-
class QueuedProcess < Base
|
6
|
-
DATA_KEY_PLURAL = 'Processes'
|
7
|
-
|
8
|
-
class << self
|
9
|
-
def endpoint(project_id, *_args)
|
10
|
-
path_from projects: [project_id, 'processes']
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyLokaliseApi
|
4
|
-
module Collections
|
5
|
-
class Segment < Base
|
6
|
-
class << self
|
7
|
-
def endpoint(project_id, key_id, lang_iso, *_args)
|
8
|
-
path_from projects: project_id,
|
9
|
-
keys: key_id,
|
10
|
-
segments: lang_iso
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|