clicksign-api 1.1.0 → 1.1.4.alpha

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: 061bb74814df58a57be2fe91efc07adf51bced436abcc52c66d0845fa8a0d5c4
4
- data.tar.gz: f57a4fd5de30e9ab39ee4d6eb00226fe892c079a22e9536ffa0b7162ade253d9
3
+ metadata.gz: 3df69ceb1c08c6411ce3ed4cab0912a63038c01d49f55a45ae05f046a88a0f2f
4
+ data.tar.gz: 49bc96cf8c1f9bd1312c7144e2da82b56fe938aa8acbe93a450af6219f53e6ca
5
5
  SHA512:
6
- metadata.gz: b63752187adf661d6b62f09a6f7988385bb1e364677d1125f21cce5d8ff24e8ede765931a3ef8102e9be6b82ab0fd8556b38a45cadc8893baf4da5769784b856
7
- data.tar.gz: 562c3b925acee7c369ff5c3aadc961065c6c38cdbddc7c4add58805b3d72e0df6f720e12ea4ed659a35548ed8c616d7980efdb1c19c4e0565203fa376b06e2c1
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 accounts and environments, providing flexibility.
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clicksign-api (1.1.0)
4
+ clicksign-api (1.1.4.alpha)
5
5
  faraday
6
6
 
7
7
  GEM
@@ -87,4 +87,4 @@ DEPENDENCIES
87
87
  webmock (~> 3.0)
88
88
 
89
89
  BUNDLED WITH
90
- 2.2.29
90
+ 2.2.33
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Clicksign
2
2
  module API
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.4.alpha"
4
4
  end
5
5
  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.0
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: 2021-11-03 00:00:00.000000000 Z
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: '0'
199
+ version: 1.3.1
200
200
  requirements: []
201
- rubygems_version: 3.1.6
201
+ rubygems_version: 3.0.8
202
202
  signing_key:
203
203
  specification_version: 4
204
204
  summary: Clicksign API ruby interface