fakturoid 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/README.md +39 -0
- data/lib/fakturoid/api/webhook.rb +34 -0
- data/lib/fakturoid/api.rb +5 -0
- data/lib/fakturoid/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7602cad1387db4cc12302ec8a91713532f0a3c45430446873e9d7d8fa55954f0
|
4
|
+
data.tar.gz: f3921c67c2a260b6520d56f793b60dfb40a61929516c85ec083e1847b1288bf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d35907aa669e52de1559daf1d0abf83f4c83d32171572306fd99123b4af04751133f6b1e95c97c157b018a1d25aee877a344d5faa78995514fe93d71240591cc
|
7
|
+
data.tar.gz: 3832aa4a685948593f0f12424fa9ce9797e85304d67c563482b96e4d420d7ade48212967cca5a1ce4f508a671f0c6d8ea9a5e8919b2bf646096024aa416e423a
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.3
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -716,6 +716,38 @@ Toggle a todo completion:
|
|
716
716
|
response = client.todos.toggle_completion(todo_id)
|
717
717
|
```
|
718
718
|
|
719
|
+
### [Webhook Resource](https://www.fakturoid.cz/api/v3/webhooks)
|
720
|
+
|
721
|
+
Get a list of all webhooks:
|
722
|
+
|
723
|
+
```ruby
|
724
|
+
response = client.webhooks.all
|
725
|
+
```
|
726
|
+
|
727
|
+
Get a single webhook:
|
728
|
+
|
729
|
+
```ruby
|
730
|
+
response = client.webhooks.find(webhook_id)
|
731
|
+
```
|
732
|
+
|
733
|
+
Create a webhook:
|
734
|
+
|
735
|
+
```ruby
|
736
|
+
response = client.webhooks.create(webhook_url: "https://example.com/webhook", events: %w[invoice_created])
|
737
|
+
```
|
738
|
+
|
739
|
+
Update a webhook:
|
740
|
+
|
741
|
+
```ruby
|
742
|
+
response = client.webhooks.update(webhook_id, webhook_url: "https://example.com/webhook")
|
743
|
+
```
|
744
|
+
|
745
|
+
Delete a webhook:
|
746
|
+
|
747
|
+
```ruby
|
748
|
+
response = client.webhooks.delete(webhook_id)
|
749
|
+
```
|
750
|
+
|
719
751
|
## Handling Errors
|
720
752
|
|
721
753
|
The Fakturoid gem raises exceptions if server responds with an error.
|
@@ -750,6 +782,13 @@ All exceptions except `ConfigurationError` contain following attributes:
|
|
750
782
|
</tbody>
|
751
783
|
</table>
|
752
784
|
|
785
|
+
## Contributing
|
786
|
+
|
787
|
+
- Make a pull request with requested changes.
|
788
|
+
- Make sure the pull request is as small as possible. If you encounter something that should be changed but is unrelated,
|
789
|
+
please make a separate pull request for that.
|
790
|
+
- Do not change the version number inside the pull request – this will be done after it is merged.
|
791
|
+
|
753
792
|
## Development
|
754
793
|
|
755
794
|
```sh
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Fakturoid
|
4
|
+
module Api
|
5
|
+
class Webhook
|
6
|
+
include Base
|
7
|
+
|
8
|
+
def all(params = {})
|
9
|
+
request_params = Utils.permit_params(params, :page)
|
10
|
+
|
11
|
+
perform_request(HTTP_GET, "webhooks.json", request_params: request_params)
|
12
|
+
end
|
13
|
+
|
14
|
+
def find(id)
|
15
|
+
Utils.validate_numerical_id(id)
|
16
|
+
perform_request(HTTP_GET, "webhooks/#{id}.json")
|
17
|
+
end
|
18
|
+
|
19
|
+
def create(payload = {})
|
20
|
+
perform_request(HTTP_POST, "webhooks.json", payload: payload)
|
21
|
+
end
|
22
|
+
|
23
|
+
def update(id, payload = {})
|
24
|
+
Utils.validate_numerical_id(id)
|
25
|
+
perform_request(HTTP_PATCH, "webhooks/#{id}.json", payload: payload)
|
26
|
+
end
|
27
|
+
|
28
|
+
def delete(id)
|
29
|
+
Utils.validate_numerical_id(id)
|
30
|
+
perform_request(HTTP_DELETE, "webhooks/#{id}.json")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/fakturoid/api.rb
CHANGED
@@ -20,6 +20,7 @@ require_relative "api/recurring_generator"
|
|
20
20
|
require_relative "api/subject"
|
21
21
|
require_relative "api/todo"
|
22
22
|
require_relative "api/user"
|
23
|
+
require_relative "api/webhook"
|
23
24
|
|
24
25
|
module Fakturoid
|
25
26
|
module Api
|
@@ -90,5 +91,9 @@ module Fakturoid
|
|
90
91
|
def users
|
91
92
|
@users ||= User.new(self)
|
92
93
|
end
|
94
|
+
|
95
|
+
def webhooks
|
96
|
+
@webhooks ||= Webhook.new(self)
|
97
|
+
end
|
93
98
|
end
|
94
99
|
end
|
data/lib/fakturoid/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fakturoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eda Riedl
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2024-
|
14
|
+
date: 2024-07-15 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- lib/fakturoid/api/subject.rb
|
160
160
|
- lib/fakturoid/api/todo.rb
|
161
161
|
- lib/fakturoid/api/user.rb
|
162
|
+
- lib/fakturoid/api/webhook.rb
|
162
163
|
- lib/fakturoid/client.rb
|
163
164
|
- lib/fakturoid/config.rb
|
164
165
|
- lib/fakturoid/oauth.rb
|
@@ -199,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
200
|
- !ruby/object:Gem::Version
|
200
201
|
version: '0'
|
201
202
|
requirements: []
|
202
|
-
rubygems_version: 3.5.
|
203
|
+
rubygems_version: 3.5.13
|
203
204
|
signing_key:
|
204
205
|
specification_version: 4
|
205
206
|
summary: Ruby client for web based invoicing service www.fakturoid.cz
|