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 +4 -4
 - data/.rubocop.yml +8 -0
 - data/CHANGELOG.md +8 -1
 - data/README.md +11 -0
 - data/lib/active_call-zoho_sign.rb +2 -0
 - data/lib/zoho_sign/base_service.rb +2 -2
 - data/lib/zoho_sign/document/action/embed_token/get_service.rb +15 -12
 - data/lib/zoho_sign/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 9f5b979aa0e18b49ea40fa109aba4afd213e5c1935cde79c60b14b5ae700420a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5c06f8ad0695d64905affc7c84432e39977d1531ac3e1aa94fcd9761c7fd2537
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,5 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Active Call - Zoho Sign
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            [](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: ...
         
     | 
| 
         @@ -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 [ 
     | 
| 
      
 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 : 
     | 
| 
      
 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 
     | 
    
         
            -
               
     | 
| 
       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  
     | 
| 
      
 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( 
     | 
| 
      
 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. 
     | 
| 
       33 
     | 
    
         
            -
              #   service. 
     | 
| 
      
 35 
     | 
    
         
            +
              #   service.facade.sign_url
         
     | 
| 
      
 36 
     | 
    
         
            +
              #   service.sign_url
         
     | 
| 
       34 
37 
     | 
    
         
             
              #
         
     | 
| 
       35 
     | 
    
         
            -
              # POST /api/v1/requests/:request_id/actions/: 
     | 
| 
      
 38 
     | 
    
         
            +
              # POST /api/v1/requests/:request_id/actions/:action_id/embedtoken
         
     | 
| 
       36 
39 
     | 
    
         
             
              def call
         
     | 
| 
       37 
     | 
    
         
            -
                connection.post("/api/v1/requests/#{request_id}/actions/#{ 
     | 
| 
      
 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
         
     | 
    
        data/lib/zoho_sign/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2025-03-31 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: active_call
         
     |