active_call-zoho_sign 0.1.2 → 0.1.4

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: 4e6bfddd2811ee821c10b0f03e640a1d5bd61fce4a1f55e710d94284c4428013
4
- data.tar.gz: 31222714f42fa31b5a8c90c59b1eae1e7f3e10103b3aac99e6ee3899d445c3ed
3
+ metadata.gz: 9f5b979aa0e18b49ea40fa109aba4afd213e5c1935cde79c60b14b5ae700420a
4
+ data.tar.gz: 5c06f8ad0695d64905affc7c84432e39977d1531ac3e1aa94fcd9761c7fd2537
5
5
  SHA512:
6
- metadata.gz: f0da06b096bad4445ba1985194968119a4c320d961fd9d70dce91efa80206677b0cbd718608e9acfc03f15114de2255509d2d8b7f5863095aecff511566193d5
7
- data.tar.gz: 46054e1c662f60ce7fe651dfc41bdbe3dc50f4009d94e2871c91230c8ac493e5600e63cae1b038332444759258a064aa3210336d8777485295a9da49acb17a2f
6
+ metadata.gz: f928364c2384f5b4437c1712d9d09185d1b187e7c1f52d2a04f29c4478b37e09172a5c3231b4bb79d071818a90a3bf909a7fbcde785619490c04b7ad6498611f
7
+ data.tar.gz: 0d57d5710f292b8659b90c82a95cb6ac40c34feae262726e945aef322522fb59dcf45a8fb9a050d44a612aea88359e62eb028e7184f8f9fd4287a9de8b581958
data/.rubocop.yml CHANGED
@@ -19,6 +19,9 @@ Layout/HashAlignment:
19
19
  EnforcedHashRocketStyle: table
20
20
  EnforcedColonStyle: table
21
21
 
22
+ Layout/LineLength:
23
+ AllowedPatterns: ['initialize']
24
+
22
25
  Lint/MissingSuper:
23
26
  Enabled: false
24
27
 
@@ -35,6 +38,7 @@ Metrics/ClassLength:
35
38
  Metrics/CyclomaticComplexity:
36
39
  Exclude:
37
40
  - lib/zoho_sign/document/list_service.rb
41
+ - lib/zoho_sign/template/list_service.rb
38
42
 
39
43
  Metrics/MethodLength:
40
44
  Enabled: false
@@ -43,6 +47,10 @@ Metrics/PerceivedComplexity:
43
47
  Exclude:
44
48
  - lib/zoho_sign/document/list_service.rb
45
49
 
50
+ Naming/FileName:
51
+ Exclude:
52
+ - lib/active_call-zoho_sign.rb
53
+
46
54
  Naming/MemoizedInstanceVariableName:
47
55
  EnforcedStyleForLeadingUnderscores: required
48
56
 
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
- ## [Unreleased]
1
+ ## [0.1.4] - 2025-03-31
2
+
3
+ - Sign a document embedded link fix.
4
+
5
+ ## [0.1.3] - 2025-03-25
6
+
7
+ - RubyGem badge
8
+ - Bug fix on method `forbidden?`
2
9
 
3
10
  ## [0.1.2] - 2025-03-25
4
11
 
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Active Call - Zoho Sign
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/active_call-zoho_sign.svg?icon=si%3Arubygems)](https://badge.fury.io/rb/active_call-zoho_sign)
4
+
3
5
  Zoho Sign exposes the [Zoho Sign API](https://www.zoho.com/sign/api) endpoints through service objects.
4
6
 
5
7
  ## Installation
@@ -281,6 +283,15 @@ service = ZohoSign::Document::UpdateService.call(
281
283
  service = ZohoSign::Document::DeleteService.call(id: '')
282
284
  ```
283
285
 
286
+ #### Sign a document.
287
+
288
+ A unique signing URL will be generated, which will be valid for two minutes. If the signing page is not open by then, a new link needs to be generated and it is a one-time usable URL.
289
+
290
+ ```ruby
291
+ service = ZohoSign::Document::Action::EmbedToken::GetService.call(request_id: '', action_id: '', host: '')
292
+ service.sign_url
293
+ ```
294
+
284
295
  ### Folders
285
296
 
286
297
  TODO: ...
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'zoho_sign'
@@ -78,7 +78,7 @@ class ZohoSign::BaseService < ActiveCall::Base
78
78
  end
79
79
 
80
80
  def forbidden?
81
- response.status == 403
81
+ return true if response.status == 403
82
82
  return false unless response.status == 400 && response.body.key?('code')
83
83
 
84
84
  # 4003: Access to view the document is denied.
@@ -93,7 +93,7 @@ class ZohoSign::BaseService < ActiveCall::Base
93
93
 
94
94
  # 4066: Invalid Request ID.
95
95
  # 20405: Invalid Template ID.
96
- return true if [4066, 20405].include?(response.body['code'])
96
+ return true if [4_066, 20_405].include?(response.body['code'])
97
97
 
98
98
  false
99
99
  end
@@ -1,25 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ZohoSign::Document::Action::EmbedToken::GetService < ZohoSign::BaseService
4
- attr_reader :id, :request_id, :host
4
+ attr_reader :request_id, :action_id, :host
5
+
6
+ validates :request_id, :action_id, :host, presence: true
5
7
 
6
8
  after_call :set_facade
7
9
 
8
10
  delegate_missing_to :@facade
9
11
 
10
- validates :id, :request_id, :host, presence: true
11
-
12
- def initialize(id:, request_id:, host:)
13
- @id = id
12
+ def initialize(request_id:, action_id:, host:)
14
13
  @request_id = request_id
14
+ @action_id = action_id
15
15
  @host = host
16
16
  end
17
17
 
18
- # Get a document.
18
+ # Get a signing URL.
19
+ #
20
+ # A unique signing URL will be generated, which will be valid for two minutes. If the signing page is not open by
21
+ # then, a new link needs to be generated and it is a one-time usable URL.
19
22
  #
20
23
  # ==== Examples
21
24
  #
22
- # service = ZohoSign::Document::Action::EmbedToken::GetService.call(id: '', request_id: '', host: '')
25
+ # service = ZohoSign::Document::Action::EmbedToken::GetService.call(request_id: '', action_id: '', host: '')
23
26
  #
24
27
  # service.success? # => true
25
28
  # service.errors # => #<ActiveModel::Errors []>
@@ -29,12 +32,12 @@ class ZohoSign::Document::Action::EmbedToken::GetService < ZohoSign::BaseService
29
32
  # service.response.body # => {}
30
33
  #
31
34
  # service.facade # => #<ZohoSign::Document::Action::EmbedToken::Facade ...>
32
- # service.facade.request_name
33
- # service.request_name
35
+ # service.facade.sign_url
36
+ # service.sign_url
34
37
  #
35
- # POST /api/v1/requests/:request_id/actions/:id/embedtoken
38
+ # POST /api/v1/requests/:request_id/actions/:action_id/embedtoken
36
39
  def call
37
- connection.post("/api/v1/requests/#{request_id}/actions/#{id}/embedtoken", **params)
40
+ connection.post("/api/v1/requests/#{request_id}/actions/#{action_id}/embedtoken", **params)
38
41
  end
39
42
 
40
43
  private
@@ -46,6 +49,6 @@ class ZohoSign::Document::Action::EmbedToken::GetService < ZohoSign::BaseService
46
49
  end
47
50
 
48
51
  def set_facade
49
- @facade = ZohoSign::Document::Action::EmbedToken.new(response.body)
52
+ @facade = ZohoSign::Document::Action::EmbedToken::Facade.new(response.body)
50
53
  end
51
54
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZohoSign
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_call-zoho_sign
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kobus Joubert
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-25 00:00:00.000000000 Z
11
+ date: 2025-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_call