esignatur 1.2.5 → 2.0.0
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/.github/workflows/ruby.yml +18 -0
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +15 -0
- data/Gemfile.lock +105 -76
- data/README.md +4 -4
- data/esignatur.gemspec +4 -2
- data/lib/esignatur/api.rb +7 -3
- data/lib/esignatur/client.rb +6 -3
- data/lib/esignatur/order.rb +7 -8
- data/lib/esignatur/orders.rb +3 -13
- data/lib/esignatur/pades.rb +6 -1
- data/lib/esignatur/source_document.rb +5 -2
- data/lib/esignatur/user.rb +33 -0
- data/lib/esignatur/version.rb +1 -1
- data/lib/esignatur.rb +1 -0
- metadata +38 -9
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a56c57363333c59a1972939e7ccbc231181b43dda62d0dbb6442d40cb96c68de
|
|
4
|
+
data.tar.gz: 17ecb9323250da140550e27469c5a68b520622682173c465ba10429f03dc755b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68608247f8c74cb620de3d2ee6e31d0e45b6d24647ef8bf918a5cf0d2535d27add8effed9e34b93a81fef01f65eceb4333b3a07e426b20393ca657fa9f9b91bf
|
|
7
|
+
data.tar.gz: 331c02edcb43f96d856fcea4bccbbdb1d89d53886fb02ca22d18267fd962618f60c0416889859bc3e034c30758933db7501d8b5b2c4118aa18423d389db7f39c
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: Ruby
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
jobs:
|
|
4
|
+
specs:
|
|
5
|
+
strategy:
|
|
6
|
+
matrix:
|
|
7
|
+
ruby-version: ['3.0', '3.2', '3.3']
|
|
8
|
+
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
env:
|
|
11
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v2
|
|
14
|
+
- uses: ruby/setup-ruby@v1
|
|
15
|
+
with:
|
|
16
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
17
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
18
|
+
- run: bundle exec rake
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
3.2.1
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
* Added/Changed/Deprecated/Removed/Fixed/Security: YOUR CHANGE HERE
|
|
11
|
+
|
|
12
|
+
## [2.0.0](2024-01-30)
|
|
13
|
+
|
|
14
|
+
* Added: CHANGELOG.md
|
|
15
|
+
* Changed: creator_id won't be passed in request body, but it will always included in the headers
|
data/Gemfile.lock
CHANGED
|
@@ -1,101 +1,130 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
esignatur (
|
|
5
|
-
activesupport (>=
|
|
4
|
+
esignatur (2.0.0)
|
|
5
|
+
activesupport (>= 4.0)
|
|
6
6
|
faraday (>= 0.10)
|
|
7
|
+
json (>= 2.6.2)
|
|
8
|
+
rexml (>= 3.2)
|
|
7
9
|
|
|
8
10
|
GEM
|
|
9
11
|
remote: https://rubygems.org/
|
|
10
12
|
specs:
|
|
11
|
-
activesupport (
|
|
13
|
+
activesupport (7.1.3)
|
|
14
|
+
base64
|
|
15
|
+
bigdecimal
|
|
12
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
connection_pool (>= 2.2.5)
|
|
18
|
+
drb
|
|
19
|
+
i18n (>= 1.6, < 2)
|
|
20
|
+
minitest (>= 5.1)
|
|
21
|
+
mutex_m
|
|
22
|
+
tzinfo (~> 2.0)
|
|
23
|
+
addressable (2.8.6)
|
|
24
|
+
public_suffix (>= 2.0.2, < 6.0)
|
|
25
|
+
ast (2.4.2)
|
|
26
|
+
base64 (0.2.0)
|
|
27
|
+
bigdecimal (3.1.6)
|
|
28
|
+
byebug (11.1.3)
|
|
29
|
+
codecov (0.6.0)
|
|
30
|
+
simplecov (>= 0.15, < 0.22)
|
|
31
|
+
coderay (1.1.3)
|
|
32
|
+
concurrent-ruby (1.2.3)
|
|
33
|
+
connection_pool (2.4.1)
|
|
34
|
+
crack (0.4.6)
|
|
35
|
+
bigdecimal
|
|
36
|
+
rexml
|
|
37
|
+
diff-lcs (1.5.0)
|
|
38
|
+
docile (1.4.0)
|
|
39
|
+
drb (2.2.0)
|
|
40
|
+
ruby2_keywords
|
|
41
|
+
faraday (2.9.0)
|
|
42
|
+
faraday-net_http (>= 2.0, < 3.2)
|
|
43
|
+
faraday-net_http (3.1.0)
|
|
44
|
+
net-http
|
|
45
|
+
hashdiff (1.1.0)
|
|
46
|
+
i18n (1.14.1)
|
|
34
47
|
concurrent-ruby (~> 1.0)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
method_source (0.
|
|
38
|
-
minitest (5.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
json (2.7.1)
|
|
49
|
+
language_server-protocol (3.17.0.3)
|
|
50
|
+
method_source (1.0.0)
|
|
51
|
+
minitest (5.21.2)
|
|
52
|
+
mutex_m (0.2.0)
|
|
53
|
+
net-http (0.4.1)
|
|
54
|
+
uri
|
|
55
|
+
parallel (1.24.0)
|
|
56
|
+
parser (3.3.0.5)
|
|
57
|
+
ast (~> 2.4.1)
|
|
58
|
+
racc
|
|
59
|
+
pry (0.14.2)
|
|
60
|
+
coderay (~> 1.1)
|
|
61
|
+
method_source (~> 1.0)
|
|
62
|
+
pry-byebug (3.10.1)
|
|
63
|
+
byebug (~> 11.0)
|
|
64
|
+
pry (>= 0.13, < 0.15)
|
|
65
|
+
public_suffix (5.0.4)
|
|
66
|
+
racc (1.7.3)
|
|
67
|
+
rainbow (3.1.1)
|
|
68
|
+
rake (13.1.0)
|
|
69
|
+
regexp_parser (2.9.0)
|
|
70
|
+
rexml (3.2.6)
|
|
71
|
+
rspec (3.12.0)
|
|
72
|
+
rspec-core (~> 3.12.0)
|
|
73
|
+
rspec-expectations (~> 3.12.0)
|
|
74
|
+
rspec-mocks (~> 3.12.0)
|
|
75
|
+
rspec-core (3.12.2)
|
|
76
|
+
rspec-support (~> 3.12.0)
|
|
77
|
+
rspec-expectations (3.12.3)
|
|
60
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
61
|
-
rspec-support (~> 3.
|
|
62
|
-
rspec-mocks (3.
|
|
79
|
+
rspec-support (~> 3.12.0)
|
|
80
|
+
rspec-mocks (3.12.6)
|
|
63
81
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
64
|
-
rspec-support (~> 3.
|
|
65
|
-
rspec-support (3.
|
|
66
|
-
rubocop (
|
|
67
|
-
|
|
82
|
+
rspec-support (~> 3.12.0)
|
|
83
|
+
rspec-support (3.12.1)
|
|
84
|
+
rubocop (1.60.2)
|
|
85
|
+
json (~> 2.3)
|
|
86
|
+
language_server-protocol (>= 3.17.0)
|
|
68
87
|
parallel (~> 1.10)
|
|
69
|
-
parser (>= 2
|
|
70
|
-
powerpack (~> 0.1)
|
|
88
|
+
parser (>= 3.3.0.2)
|
|
71
89
|
rainbow (>= 2.2.2, < 4.0)
|
|
90
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
91
|
+
rexml (>= 3.2.5, < 4.0)
|
|
92
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
|
72
93
|
ruby-progressbar (~> 1.7)
|
|
73
|
-
unicode-display_width (
|
|
74
|
-
rubocop-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
94
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
95
|
+
rubocop-ast (1.30.0)
|
|
96
|
+
parser (>= 3.2.1.0)
|
|
97
|
+
rubocop-capybara (2.20.0)
|
|
98
|
+
rubocop (~> 1.41)
|
|
99
|
+
rubocop-factory_bot (2.25.1)
|
|
100
|
+
rubocop (~> 1.41)
|
|
101
|
+
rubocop-rspec (2.26.1)
|
|
102
|
+
rubocop (~> 1.40)
|
|
103
|
+
rubocop-capybara (~> 2.17)
|
|
104
|
+
rubocop-factory_bot (~> 2.22)
|
|
105
|
+
ruby-progressbar (1.13.0)
|
|
106
|
+
ruby2_keywords (0.0.5)
|
|
107
|
+
simplecov (0.21.2)
|
|
79
108
|
docile (~> 1.1)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
simplecov-html (0.
|
|
83
|
-
|
|
84
|
-
tzinfo (
|
|
85
|
-
|
|
86
|
-
unicode-display_width (
|
|
87
|
-
|
|
88
|
-
webmock (3.
|
|
89
|
-
addressable (>= 2.
|
|
109
|
+
simplecov-html (~> 0.11)
|
|
110
|
+
simplecov_json_formatter (~> 0.1)
|
|
111
|
+
simplecov-html (0.12.3)
|
|
112
|
+
simplecov_json_formatter (0.1.4)
|
|
113
|
+
tzinfo (2.0.6)
|
|
114
|
+
concurrent-ruby (~> 1.0)
|
|
115
|
+
unicode-display_width (2.5.0)
|
|
116
|
+
uri (0.13.0)
|
|
117
|
+
webmock (3.19.1)
|
|
118
|
+
addressable (>= 2.8.0)
|
|
90
119
|
crack (>= 0.3.2)
|
|
91
|
-
hashdiff
|
|
120
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
92
121
|
|
|
93
122
|
PLATFORMS
|
|
94
123
|
ruby
|
|
95
124
|
|
|
96
125
|
DEPENDENCIES
|
|
97
126
|
bundler (>= 1.16)
|
|
98
|
-
codecov (>= 0.
|
|
127
|
+
codecov (>= 0.2.0)
|
|
99
128
|
esignatur!
|
|
100
129
|
pry-byebug
|
|
101
130
|
rake (>= 10.0)
|
|
@@ -106,4 +135,4 @@ DEPENDENCIES
|
|
|
106
135
|
webmock (>= 3.4)
|
|
107
136
|
|
|
108
137
|
BUNDLED WITH
|
|
109
|
-
|
|
138
|
+
2.5.5
|
data/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Or install it yourself as:
|
|
|
26
26
|
## Usage
|
|
27
27
|
|
|
28
28
|
```ruby
|
|
29
|
-
esignatur = Esignatur::Client.new(api_key: your_api_key)
|
|
29
|
+
esignatur = Esignatur::Client.new(api_key: your_api_key, creator_id: your_creator_id)
|
|
30
30
|
|
|
31
31
|
esignatur.orders.where(modified_since: Date.new(2000, 1, 1))
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@ order = esignatur.orders.find(esignatur_order_id)
|
|
|
35
35
|
order = esignatur.orders.build
|
|
36
36
|
order.create(some_order_params) # creates order on esignatur side
|
|
37
37
|
order.status # returns Status object
|
|
38
|
-
order.cancel
|
|
38
|
+
order.cancel
|
|
39
39
|
|
|
40
40
|
pade_list = order.pades_list
|
|
41
41
|
pade_list.first.document_data # decoded body of the document
|
|
@@ -49,7 +49,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
49
49
|
|
|
50
50
|
## Contributing
|
|
51
51
|
|
|
52
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/samesystem/esignatur. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
53
53
|
|
|
54
54
|
## License
|
|
55
55
|
|
|
@@ -57,4 +57,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
57
57
|
|
|
58
58
|
## Code of Conduct
|
|
59
59
|
|
|
60
|
-
Everyone interacting in the Esignatur project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
|
60
|
+
Everyone interacting in the Esignatur project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/samesystem/esignatur/blob/master/CODE_OF_CONDUCT.md).
|
data/esignatur.gemspec
CHANGED
|
@@ -32,7 +32,9 @@ Gem::Specification.new do |spec|
|
|
|
32
32
|
spec.require_paths = ["lib"]
|
|
33
33
|
|
|
34
34
|
spec.add_dependency "faraday", ">= 0.10"
|
|
35
|
-
spec.add_dependency "activesupport", ">=
|
|
35
|
+
spec.add_dependency "activesupport", ">= 4.0"
|
|
36
|
+
spec.add_dependency "rexml", ">= 3.2"
|
|
37
|
+
spec.add_dependency "json", ">= 2.6.2"
|
|
36
38
|
|
|
37
39
|
spec.add_development_dependency "bundler", ">= 1.16"
|
|
38
40
|
spec.add_development_dependency "rake", ">= 10.0"
|
|
@@ -40,7 +42,7 @@ Gem::Specification.new do |spec|
|
|
|
40
42
|
spec.add_development_dependency "rubocop", '>= 0.57'
|
|
41
43
|
spec.add_development_dependency "rubocop-rspec", '>= 1.27'
|
|
42
44
|
spec.add_development_dependency "webmock", '>= 3.4'
|
|
43
|
-
spec.add_development_dependency "codecov", '>= 0.
|
|
45
|
+
spec.add_development_dependency "codecov", '>= 0.2.0'
|
|
44
46
|
spec.add_development_dependency "simplecov", '>= 0.16.1'
|
|
45
47
|
spec.add_development_dependency "pry-byebug"
|
|
46
48
|
end
|
data/lib/esignatur/api.rb
CHANGED
|
@@ -10,9 +10,12 @@ module Esignatur
|
|
|
10
10
|
|
|
11
11
|
DEFAULT_BASE_URL = 'https://api.esignatur.dk'
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
attr_reader :creator_id
|
|
14
|
+
|
|
15
|
+
def initialize(api_key:, creator_id:, base_url: DEFAULT_BASE_URL)
|
|
14
16
|
@api_key = api_key.to_s
|
|
15
17
|
@base_url = base_url
|
|
18
|
+
@creator_id = creator_id
|
|
16
19
|
end
|
|
17
20
|
|
|
18
21
|
def post(relative_url, data:, headers: {})
|
|
@@ -40,8 +43,9 @@ module Esignatur
|
|
|
40
43
|
{
|
|
41
44
|
'X-eSignatur-Id' => api_key,
|
|
42
45
|
'Accept' => 'application/json',
|
|
43
|
-
'Content-Type' => 'application/json'
|
|
44
|
-
|
|
46
|
+
'Content-Type' => 'application/json',
|
|
47
|
+
'X-eSignatur-CreatorId' => creator_id&.to_s
|
|
48
|
+
}.compact
|
|
45
49
|
end
|
|
46
50
|
end
|
|
47
51
|
end
|
data/lib/esignatur/client.rb
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
2
|
module Esignatur
|
|
4
3
|
# main API class
|
|
5
4
|
class Client
|
|
6
5
|
DEFAULT_BASE_URL = 'https://api.esignatur.dk'
|
|
7
6
|
|
|
8
|
-
def initialize(api_key:, base_url: DEFAULT_BASE_URL)
|
|
9
|
-
@api = Esignatur::Api.new(
|
|
7
|
+
def initialize(api_key:, creator_id:, base_url: DEFAULT_BASE_URL)
|
|
8
|
+
@api = Esignatur::Api.new(
|
|
9
|
+
api_key: api_key,
|
|
10
|
+
base_url: base_url,
|
|
11
|
+
creator_id: creator_id
|
|
12
|
+
)
|
|
10
13
|
end
|
|
11
14
|
|
|
12
15
|
def orders
|
data/lib/esignatur/order.rb
CHANGED
|
@@ -19,12 +19,14 @@ module Esignatur
|
|
|
19
19
|
@api = api
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
def create(attributes)
|
|
23
|
-
response = api_post('Order/Create', attributes)
|
|
22
|
+
def create(attributes = {}, **keyword_attributes)
|
|
23
|
+
response = api_post('Order/Create', attributes.merge(keyword_attributes))
|
|
24
|
+
|
|
24
25
|
if errors.empty?
|
|
25
26
|
body = response.json_body
|
|
26
27
|
@attributes = attributes.merge(id: body.fetch('OrderId')).merge(body)
|
|
27
28
|
end
|
|
29
|
+
|
|
28
30
|
self
|
|
29
31
|
end
|
|
30
32
|
|
|
@@ -36,14 +38,11 @@ module Esignatur
|
|
|
36
38
|
@status ||= Esignatur::Status.new(order: self, api: api).tap(&:fetch)
|
|
37
39
|
end
|
|
38
40
|
|
|
39
|
-
def cancel(attributes)
|
|
40
|
-
camelized_attributes = attributes.transform_keys(&:to_s).transform_keys(&:camelize)
|
|
41
|
-
creator_id = camelized_attributes.delete('CreatorId')
|
|
42
|
-
|
|
41
|
+
def cancel(attributes = {}, **keyword_attributes)
|
|
42
|
+
camelized_attributes = attributes.merge(keyword_attributes).transform_keys(&:to_s).transform_keys(&:camelize)
|
|
43
43
|
data = { 'OrderId' => id }.merge(camelized_attributes.compact)
|
|
44
|
-
headers = { 'X-eSignatur-CreatorId': creator_id }
|
|
45
44
|
|
|
46
|
-
api_post('Cancel/CancelOrder', data
|
|
45
|
+
api_post('Cancel/CancelOrder', data).success?
|
|
47
46
|
end
|
|
48
47
|
|
|
49
48
|
def pades_list
|
data/lib/esignatur/orders.rb
CHANGED
|
@@ -14,8 +14,8 @@ module Esignatur
|
|
|
14
14
|
@api = api
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
def create(attributes)
|
|
18
|
-
build.create(attributes)
|
|
17
|
+
def create(attributes = {}, **keyword_attributes)
|
|
18
|
+
build.create(attributes, **keyword_attributes)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def build
|
|
@@ -28,7 +28,7 @@ module Esignatur
|
|
|
28
28
|
|
|
29
29
|
def all
|
|
30
30
|
@all ||= begin
|
|
31
|
-
response = api_get("OrderInfo/OrdersForAdministrator/#{creator_id}", headers: headers_for_all_query)
|
|
31
|
+
response = api_get("OrderInfo/OrdersForAdministrator/#{api.creator_id}", headers: headers_for_all_query)
|
|
32
32
|
response.json_body.fetch('SignOrders').map do |raw_order|
|
|
33
33
|
order_attributes = raw_order.merge(id: raw_order.fetch('SignOrderId'))
|
|
34
34
|
Esignatur::Order.new(attributes: order_attributes, api: api)
|
|
@@ -52,15 +52,5 @@ module Esignatur
|
|
|
52
52
|
modified_since = scope[:modified_since]&.iso8601
|
|
53
53
|
modified_since ? { 'If-Modified-Since' => modified_since } : {}
|
|
54
54
|
end
|
|
55
|
-
|
|
56
|
-
def creator_id
|
|
57
|
-
scope.fetch(:creator_id) do
|
|
58
|
-
raise(
|
|
59
|
-
Esignatur::MissingAttributeError,
|
|
60
|
-
'You need to specify creator_id in order to fech orders. ' \
|
|
61
|
-
'You can do this with `esignatur.orders.where(creator_id: 123)`'
|
|
62
|
-
)
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
55
|
end
|
|
66
56
|
end
|
data/lib/esignatur/pades.rb
CHANGED
|
@@ -37,7 +37,12 @@ module Esignatur
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def fetch
|
|
40
|
-
response = api_post(
|
|
40
|
+
response = api_post(
|
|
41
|
+
'Pades/Download',
|
|
42
|
+
{
|
|
43
|
+
'Id' => order.id, 'AgreementId' => attributes['AgreementId']
|
|
44
|
+
}
|
|
45
|
+
)
|
|
41
46
|
@attributes = response.json_body if errors.empty?
|
|
42
47
|
self
|
|
43
48
|
end
|
|
@@ -22,8 +22,11 @@ module Esignatur
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def fetch
|
|
25
|
-
response = api_post(
|
|
26
|
-
|
|
25
|
+
response = api_post(
|
|
26
|
+
'SourceDocument/Download',
|
|
27
|
+
{ 'Id' => order.id, 'DocumentIndex' => 0 }
|
|
28
|
+
)
|
|
29
|
+
|
|
27
30
|
@attributes = response.json_body if errors.empty?
|
|
28
31
|
self
|
|
29
32
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'esignatur/api_resource'
|
|
4
|
+
|
|
5
|
+
module Esignatur
|
|
6
|
+
# esignatur user representation
|
|
7
|
+
# More info: https://api.esignatur.dk/Documentation/User
|
|
8
|
+
class User
|
|
9
|
+
include ApiResource
|
|
10
|
+
|
|
11
|
+
DEFAULT_BASE_URL = 'https://api.esignatur.dk'
|
|
12
|
+
|
|
13
|
+
def initialize(api_key:, base_url: DEFAULT_BASE_URL, creator_id:)
|
|
14
|
+
@api = Esignatur::Api.new(
|
|
15
|
+
api_key: api_key,
|
|
16
|
+
base_url: base_url,
|
|
17
|
+
creator_id: creator_id
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
@attributes = {}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def find_by(user_id:)
|
|
24
|
+
response = api_get("user/get/#{user_id}")
|
|
25
|
+
@attributes = response.json_body if errors.empty?
|
|
26
|
+
self
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
private
|
|
30
|
+
|
|
31
|
+
attr_reader :api, :attributes
|
|
32
|
+
end
|
|
33
|
+
end
|
data/lib/esignatur/version.rb
CHANGED
data/lib/esignatur.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: esignatur
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Povilas Jurcys
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-01-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -30,14 +30,42 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '4.0'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '4.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rexml
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '3.2'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '3.2'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: json
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: 2.6.2
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: 2.6.2
|
|
41
69
|
- !ruby/object:Gem::Dependency
|
|
42
70
|
name: bundler
|
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -128,14 +156,14 @@ dependencies:
|
|
|
128
156
|
requirements:
|
|
129
157
|
- - ">="
|
|
130
158
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 0.
|
|
159
|
+
version: 0.2.0
|
|
132
160
|
type: :development
|
|
133
161
|
prerelease: false
|
|
134
162
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
163
|
requirements:
|
|
136
164
|
- - ">="
|
|
137
165
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: 0.
|
|
166
|
+
version: 0.2.0
|
|
139
167
|
- !ruby/object:Gem::Dependency
|
|
140
168
|
name: simplecov
|
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -171,12 +199,13 @@ executables: []
|
|
|
171
199
|
extensions: []
|
|
172
200
|
extra_rdoc_files: []
|
|
173
201
|
files:
|
|
202
|
+
- ".github/workflows/ruby.yml"
|
|
174
203
|
- ".gitignore"
|
|
175
204
|
- ".hound"
|
|
176
205
|
- ".rspec"
|
|
177
206
|
- ".rubocop.yml"
|
|
178
207
|
- ".ruby-version"
|
|
179
|
-
-
|
|
208
|
+
- CHANGELOG.md
|
|
180
209
|
- CODE_OF_CONDUCT.md
|
|
181
210
|
- Gemfile
|
|
182
211
|
- Gemfile.lock
|
|
@@ -198,6 +227,7 @@ files:
|
|
|
198
227
|
- lib/esignatur/pades.rb
|
|
199
228
|
- lib/esignatur/source_document.rb
|
|
200
229
|
- lib/esignatur/status.rb
|
|
230
|
+
- lib/esignatur/user.rb
|
|
201
231
|
- lib/esignatur/version.rb
|
|
202
232
|
homepage: https://github.com/samesystem/esignatur
|
|
203
233
|
licenses:
|
|
@@ -218,8 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
218
248
|
- !ruby/object:Gem::Version
|
|
219
249
|
version: '0'
|
|
220
250
|
requirements: []
|
|
221
|
-
|
|
222
|
-
rubygems_version: 2.7.6
|
|
251
|
+
rubygems_version: 3.4.6
|
|
223
252
|
signing_key:
|
|
224
253
|
specification_version: 4
|
|
225
254
|
summary: ruby API client for esignatur.dk
|