clicksign-api 1.1.0 → 1.1.4.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -5
- data/Gemfile.lock +2 -2
- data/lib/clicksign/api/document.rb +5 -0
- data/lib/clicksign/api/requests.rb +8 -0
- data/lib/clicksign/api/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3df69ceb1c08c6411ce3ed4cab0912a63038c01d49f55a45ae05f046a88a0f2f
|
4
|
+
data.tar.gz: 49bc96cf8c1f9bd1312c7144e2da82b56fe938aa8acbe93a450af6219f53e6ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e0bdd9f9e064ccaf6958367857aca6794dd13882a98334838d5f960508479977b0fc2991f7f0d0b68d96757d97cc66bc0c82353e4d147bbf8e712346de5ead3
|
7
|
+
data.tar.gz: 17ae913e31d97eb98f5c30e3adff8ba3e1f32d5dd20e9c84beee3f974a41f055400682dfbbdae7076ebf2b5e071fa2aee79b66ed66c22202d4f2501355b02e8b
|
data/CHANGELOG.md
CHANGED
@@ -1,15 +1,25 @@
|
|
1
1
|
# Clicksign::API 1.1.0 (Octuber 29, 2021)
|
2
2
|
|
3
3
|
Add support to multiple credentials.
|
4
|
-
This is useful to work with different
|
4
|
+
This is useful to work with different environments, providing flexibility.
|
5
5
|
For example, applications have different tokens for each environment.
|
6
6
|
Other useful case, occurs working with multiple companies.
|
7
7
|
|
8
|
-
The credentials should be a hash.
|
8
|
+
The credentials should be a hash.
|
9
|
+
It is possible use a `.yml` file to configure the authentication tokens.
|
10
|
+
The `.yml` file can get the tokens using environment variables.
|
11
|
+
Now all requests receive token parameter, that represents the key associated with the token.
|
12
|
+
|
13
|
+
## Examples:
|
14
|
+
|
15
|
+
YML file
|
16
|
+
```yml
|
17
|
+
key.production: 'CLICKSIGN_ACCESS_TOKEN_PRODUCTION'
|
18
|
+
key.sandbox: 'CLICKSIGN_ACCESS_TOKEN_SANDBOX'
|
19
|
+
```
|
9
20
|
|
10
21
|
Request:
|
11
22
|
```ruby
|
12
23
|
file = File.open('/path/to/file/local/file.pdf', 'r')
|
13
|
-
response = Clicksign::API::Document.create(params: { path: '/path/to/file/on/clicksign.pdf', file: file }, token: 'key.production')
|
14
|
-
|
15
|
-
```
|
24
|
+
response = Clicksign::API::Document.create( params: { path: '/path/to/file/on/clicksign.pdf', file: file }, token: 'key.production')
|
25
|
+
```
|
data/Gemfile.lock
CHANGED
@@ -12,9 +12,14 @@ module Clicksign
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def find(token:, params:)
|
15
|
+
params = params.transform_keys(&:to_sym)
|
15
16
|
get(REQUEST_PATH + params[:key], token)
|
16
17
|
end
|
17
18
|
|
19
|
+
def cancel(token:, params: {})
|
20
|
+
patch("#{REQUEST_PATH}#{params[:key]}/cancel", body(params), token)
|
21
|
+
end
|
22
|
+
|
18
23
|
def body(params)
|
19
24
|
params = params.transform_keys(&:to_sym)
|
20
25
|
|
@@ -16,6 +16,14 @@ module Clicksign
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
def patch(request_path, body, token)
|
20
|
+
conn.patch do |req|
|
21
|
+
req.url request_path, { access_token: Clicksign::API.credentials[token] }
|
22
|
+
req.headers['Content-Type'] = 'application/json'
|
23
|
+
req.body = body.to_json
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
19
27
|
def conn
|
20
28
|
@conn ||= Faraday.new(url: Clicksign::API.url)
|
21
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clicksign-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francisco Martins
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -194,11 +194,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
194
|
version: '0'
|
195
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
|
-
- - "
|
197
|
+
- - ">"
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version:
|
199
|
+
version: 1.3.1
|
200
200
|
requirements: []
|
201
|
-
rubygems_version: 3.
|
201
|
+
rubygems_version: 3.0.8
|
202
202
|
signing_key:
|
203
203
|
specification_version: 4
|
204
204
|
summary: Clicksign API ruby interface
|