toptranslation_api 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 700cce0881675c0dafc87f6b0164c4de80495fc146ff9487584c1c2d7d1abf02
4
- data.tar.gz: 23384b7748432e0d96ac60f45dba8e6e1c0219fe6c0ed53fdd70c54b7a2e3388
3
+ metadata.gz: 2203f8b9ae950234d3958741f0d12bf04455bd7019889b51818cf66181dac9fa
4
+ data.tar.gz: 0d10131b2114b532e9131e5f7339434e85347094dfdf2f34310782f054442f43
5
5
  SHA512:
6
- metadata.gz: 770ef06cea32101858e51b52c0ac6322315174ed484f01ee16809d44242a4d639d12bb18861cb9fbc4ffb0959605095a310ef0255749f595ec8361ea0409617a
7
- data.tar.gz: 710217d985fd2fd1094de9f4d3152cdb8452599b9b414303ad063c326ce6d1b818ef2fa1875a586d23e0c89e658574f35a5463edbea9f584a8c14ed33296e3ec
6
+ metadata.gz: c15130aab3700bc85ca36603bd5c284220d7bcf53f2676df0fd1a24d3ac58d11909aeb7c28613ad4ff3391e27bd2a6c6ea302feb0b21c63066f7fb291c0d7bd8
7
+ data.tar.gz: c919676a07082e1f63b453a69d7fedf8543ce8efe6c49a67a2fa25e1034c8ae56836da34aad307dd538618399a42f01b57c414861e128f5ff3011afc6bef25ff
@@ -38,20 +38,16 @@ module Toptranslation
38
38
  upload_file(file, uri, &block)
39
39
  end
40
40
 
41
- def sign_in!(options)
42
- return if @access_token
43
-
44
- sign_in_options = {
45
- email: options[:email],
46
- password: options[:password],
47
- application_id: 'pollux'
48
- }.merge(options)
49
-
50
- @access_token = post('/auth/sign_in', sign_in_options)['access_token']
51
-
52
- puts "# Requested access token #{@access_token}" if @verbose
53
-
54
- @access_token
41
+ # @deprecated Email/password sign-in was removed from the Toptranslation
42
+ # API (authentication moved to the auth service) — the endpoint this
43
+ # method used no longer exists. Initialize the client with a static
44
+ # access token instead.
45
+ def sign_in!(_options = {})
46
+ raise Toptranslation::SignInRemovedError,
47
+ 'sign_in! with email/password is no longer supported: the Toptranslation API ' \
48
+ 'removed POST /v2/auth/sign_in. Initialize the client with a static access ' \
49
+ "token instead: Toptranslation.new(access_token: '...'). Contact " \
50
+ 'support@toptranslation.com to obtain a token.'
55
51
  end
56
52
 
57
53
  private
@@ -111,14 +107,17 @@ module Toptranslation
111
107
  yield nil, total if block_given?
112
108
 
113
109
  FileUtils.mkpath(File.dirname(path))
114
- file = File.open(path, 'w')
115
- http.request_get(uri.request_uri) do |response|
116
- response.read_body do |data|
117
- file.write(data)
118
- yield data.length, total if block_given?
110
+ # Block-Form schließt die Datei, damit der Inhalt vollständig auf der
111
+ # Platte liegt; zurück kommt wie bisher das File-Objekt
112
+ File.open(path, 'w') do |file|
113
+ http.request_get(uri.request_uri) do |response|
114
+ response.read_body do |data|
115
+ file.write(data)
116
+ yield data.length, total if block_given?
117
+ end
119
118
  end
119
+ file
120
120
  end
121
- file
122
121
  end
123
122
  end
124
123
 
@@ -42,6 +42,5 @@ module Toptranslation::Resource
42
42
  end
43
43
  end
44
44
  end
45
-
46
45
  end
47
46
  end
@@ -12,8 +12,9 @@ module Toptranslation::Resource
12
12
  response = @connection.upload(filepath, type, &block)
13
13
 
14
14
  @document_store_id = response['identifier']
15
- # Document-Store v2 nennt das Feld token
16
- @document_token = response['token'] || response['document_token']
15
+ # attach_token hat eine längere Anhänge-Frist als token (1 h); ältere
16
+ # Document-Stores liefern nur token bzw. document_token
17
+ @document_token = response['attach_token'] || response['token'] || response['document_token']
17
18
  @sha1 = response['sha1']
18
19
 
19
20
  self
@@ -1,3 +1,3 @@
1
1
  module Toptranslation
2
- VERSION = '4.0.0'.freeze
2
+ VERSION = '4.2.0'.freeze
3
3
  end
@@ -20,6 +20,11 @@ require 'toptranslation/resource/upload'
20
20
  require 'toptranslation/resource/user'
21
21
 
22
22
  module Toptranslation
23
+ # Raised when the removed email/password sign-in is used — the API only
24
+ # accepts static access tokens since authentication moved to the
25
+ # Toptranslation auth service.
26
+ class SignInRemovedError < StandardError; end
27
+
23
28
  def self.new(options)
24
29
  Toptranslation::Client.new(options)
25
30
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toptranslation_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toptranslation GmbH
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-08-18 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: json
@@ -94,6 +93,20 @@ dependencies:
94
93
  - - ">="
95
94
  - !ruby/object:Gem::Version
96
95
  version: '0'
96
+ - !ruby/object:Gem::Dependency
97
+ name: rubocop-factory_bot
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: rubocop-rspec
99
112
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +127,14 @@ dependencies:
114
127
  requirements:
115
128
  - - "~>"
116
129
  - !ruby/object:Gem::Version
117
- version: '4.0'
130
+ version: '6.3'
118
131
  type: :development
119
132
  prerelease: false
120
133
  version_requirements: !ruby/object:Gem::Requirement
121
134
  requirements:
122
135
  - - "~>"
123
136
  - !ruby/object:Gem::Version
124
- version: '4.0'
137
+ version: '6.3'
125
138
  - !ruby/object:Gem::Dependency
126
139
  name: webmock
127
140
  requirement: !ruby/object:Gem::Requirement
@@ -167,7 +180,6 @@ licenses:
167
180
  - MIT
168
181
  metadata:
169
182
  rubygems_mfa_required: 'true'
170
- post_install_message:
171
183
  rdoc_options: []
172
184
  require_paths:
173
185
  - lib
@@ -182,8 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
194
  - !ruby/object:Gem::Version
183
195
  version: '0'
184
196
  requirements: []
185
- rubygems_version: 3.5.9
186
- signing_key:
197
+ rubygems_version: 4.0.16
187
198
  specification_version: 4
188
199
  summary: A ruby client for the Toptranslation API
189
200
  test_files: []