clicksign-api 1.1.1 → 1.1.5.alpha

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4d73d8a0e57c13f35deb924e70f0cf2b55dec18ab4f1fe1b0ec72c9ecfe9a7d
4
- data.tar.gz: 384d5c4a557a563576cf75e45efdf360b8ba343a2ecf44231a1e0a66489c19b3
3
+ metadata.gz: 4bdd7d48a08c3225aae10eede4031c554eb0d0c8b5f3b3616957c8f502dc993a
4
+ data.tar.gz: cff82c8513c5632ebd1fa558046e380705dea1af3ca0b240630a4dd531506f94
5
5
  SHA512:
6
- metadata.gz: 217334cbbf14ddffa78d804806bff973ede762d3acb49d3ea6d4bb8ec94fc96bef0af2ba7fddcf8ba5906e49f9a0947883a6b4f00f6ea0d8c0bfbfce97953b76
7
- data.tar.gz: 4ef82bd3d37e148f3ad52104f1ccf6c766f700357112a6933262d112dadb2ee5ee34f5aa40d0d150928fe3f815144999aa144d6f675d705b8cd138820489f3b2
6
+ metadata.gz: fadaa99e33620656ddb50c71043b29a56c1c9e12b6278f4ee7fbf52d641e00742b9c6263cabc50555d069efb93c5e5bad5d177617f29be1ebbb7fff36f48bc85
7
+ data.tar.gz: a4f4ffbce2a7b44de28cdab8dccdb5fae54a4abcb12746860270333f72f50acc9df8205d6fbb49a4d26a5f846559a5625cb2d92d14433a5c1db08d34456d9666
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,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clicksign-api (1.1.1)
5
- faraday
4
+ clicksign-api (1.1.5.alpha)
5
+ faraday (= 1.8.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -87,4 +87,4 @@ DEPENDENCIES
87
87
  webmock (~> 3.0)
88
88
 
89
89
  BUNDLED WITH
90
- 2.2.29
90
+ 2.2.33
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency 'bundler', '~> 2.2'
25
25
  spec.add_development_dependency 'rake', '~> 13.0'
26
26
  spec.add_development_dependency 'rspec', '~> 3.0'
27
- spec.add_dependency 'faraday'
27
+ spec.add_dependency 'faraday', '1.8.0'
28
28
 
29
29
  spec.add_development_dependency 'simplecov', '~> 0.16'
30
30
  spec.add_development_dependency 'vcr', '~> 4.0'
@@ -16,6 +16,10 @@ module Clicksign
16
16
  get(REQUEST_PATH + params[:key], token)
17
17
  end
18
18
 
19
+ def cancel(token:, params: {})
20
+ patch("#{REQUEST_PATH}#{params[:key]}/cancel", body(params), token)
21
+ end
22
+
19
23
  def body(params)
20
24
  params = params.transform_keys(&:to_sym)
21
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.1"
3
+ VERSION = "1.1.5.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.1
4
+ version: 1.1.5.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-05 00:00:00.000000000 Z
11
+ date: 2022-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: faraday
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 1.8.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 1.8.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -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