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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2203f8b9ae950234d3958741f0d12bf04455bd7019889b51818cf66181dac9fa
|
|
4
|
+
data.tar.gz: 0d10131b2114b532e9131e5f7339434e85347094dfdf2f34310782f054442f43
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
|
|
@@ -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
|
-
#
|
|
16
|
-
|
|
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
|
data/lib/toptranslation_api.rb
CHANGED
|
@@ -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.
|
|
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:
|
|
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: '
|
|
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: '
|
|
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:
|
|
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: []
|