mifiel 2.0.0 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2c4dce2300a5b45db18cf7f9d1627615416a2a26c523e5ac2f75619601f4505
4
- data.tar.gz: 9b77870339343d556247691b6d051e1abe75c06635738eb93b8ebf1dc2ff8dd7
3
+ metadata.gz: fba43da41b56717d0f34d2d23441a29685b1014eff732a8c7c3c2a886cbcf81f
4
+ data.tar.gz: a067295115e5ae373cb996708138bef64ed3f5a5f7406e3027df2f321ff13d3b
5
5
  SHA512:
6
- metadata.gz: 76ad57f5e80dcca88ae90354eba7c9ffd34ce4face32f40518f3af954e509ba2929a1d876ab367cbdebbc594482c8b7ccb6dceca51682ce94e5a2dc50be04830
7
- data.tar.gz: 899b2734c72b89781758f99842cbdde7a28424558a5a5e64f9e9d39123c2b361c304c0c2e5004ba79c4746b55a3342427e832f2d6587886d8d27a0c2612c7843
6
+ metadata.gz: 224c26fd5767508ffaddd0a8f824f6f70129728c7ff1d81834a33117a470d6e697b92d5a8b5f166f4679f57fe8619ef048936c9e45bd3a6717100b23dd427956
7
+ data.tar.gz: 6babe35d31fcc72e070079b5e718f47e2157254f33a40f01989685bcf2e0d91a4cd73bb2793183f65d090593e6adb852b25ab6d6de2b2056b379d5e8bb08edca
data/Appraisals CHANGED
@@ -1,12 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  appraise 'rails-7' do
4
- gem 'rails', '7'
4
+ gem 'rails', '~> 7.2.0'
5
+ # ActiveSupport 7.2 still calls JSON.generate(quirks_mode: true), which json 3 dropped.
6
+ gem 'json', '< 3'
5
7
  gem 'mutex_m'
6
8
  gem 'benchmark'
7
9
  gem 'ostruct'
8
10
  end
9
11
 
10
12
  appraise 'rails-8' do
11
- gem 'rails', '8'
13
+ # 8.0.x still passes quirks_mode; 8.1 removed it and works with json 3.
14
+ gem 'rails', '~> 8.1.0'
12
15
  end
data/README.md CHANGED
@@ -4,8 +4,16 @@
4
4
  [![Build Status][travis-image]][travis-url]
5
5
  [![Coverage Status][coveralls-image]][coveralls-url]
6
6
 
7
- Ruby SDK for [Mifiel](https://www.mifiel.com) API.
8
- Please read our [documentation](https://docs.mifiel.com/) for instructions on how to start using the API.
7
+ Ruby SDK for the [Mifiel](https://www.mifiel.com) API.
8
+
9
+ ## Documentation
10
+
11
+ API reference, guides, and examples:
12
+
13
+ - English: https://docs.mifiel.com/en/
14
+ - Español: https://docs.mifiel.com/es/
15
+
16
+ This README covers installation and client setup only.
9
17
 
10
18
  ## Installation
11
19
 
@@ -17,28 +25,35 @@ gem 'mifiel'
17
25
 
18
26
  And then execute:
19
27
 
20
- $ bundle
28
+ ```bash
29
+ bundle
30
+ ```
21
31
 
22
32
  Or install it yourself as:
23
33
 
24
- $ gem install mifiel
34
+ ```bash
35
+ gem install mifiel
36
+ ```
25
37
 
26
- ## Usage
38
+ ## Setup
27
39
 
28
- Follow the steps in our [documentation](https://docs.mifiel.com/) to create an account and get your access tokens, then you can configure the gem with:
40
+ 1. Create an account (production or [sandbox](https://app-sandbox.mifiel.com)).
41
+ 2. Generate an `APP_ID` and `APP_SECRET` in [Access Tokens](https://app-sandbox.mifiel.com/settings/access-tokens).
42
+ 3. Configure the gem:
29
43
 
30
44
  ```ruby
31
- Mifiel.config do |config|
32
- config.app_id = '<APP_ID>'
33
- config.app_secret = '<APP_SECRET>'
34
- # remove the next line when you wish to use the prod environment
35
- config.base_url = 'https://app-sandbox.mifiel.com/api/v1'
36
- end
45
+ Mifiel.config do |config|
46
+ config.app_id = '<APP_ID>'
47
+ config.app_secret = '<APP_SECRET>'
48
+ # Production is the default.
49
+ # For sandbox:
50
+ config.base_url = 'https://app-sandbox.mifiel.com/api/v1'
51
+ end
37
52
  ```
38
53
 
39
54
  ## Contributing
40
55
 
41
- 1. Fork it ( https://github.com/[my-github-username]/mifiel/fork )
56
+ 1. Fork it (https://github.com/Mifiel/ruby-api-client/fork)
42
57
  2. Create your feature branch (`git checkout -b my-new-feature`)
43
58
  3. Commit your changes (`git commit -am 'Add some feature'`)
44
59
  4. Push to the branch (`git push origin my-new-feature`)
@@ -2,7 +2,8 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "7"
5
+ gem "rails", "~> 7.2.0"
6
+ gem "json", "< 3"
6
7
  gem "mutex_m"
7
8
  gem "benchmark"
8
9
  gem "ostruct"
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "8"
5
+ gem "rails", "~> 8.1.0"
6
6
 
7
7
  group :development, :test do
8
8
  gem "coveralls", require: false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mifiel
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mifiel
4
+ # Account-level webhook subscriptions.
5
+ # @see https://docs.mifiel.com/en/#tag/Webhooks
6
+ class Webhook < Mifiel::Base
7
+ get :all, '/webhooks'
8
+ get :find, '/webhooks/:id'
9
+ post :create, '/webhooks'
10
+ delete :delete, '/webhooks/:id'
11
+
12
+ # Trigger delivery for this webhook.
13
+ #
14
+ # @param resource [String] UUID of the related resource included in the callback payload
15
+ # @param instant [Boolean] when true, deliver immediately once instead of enqueueing retries
16
+ def trigger(resource:, instant: false)
17
+ self.class.process_request(
18
+ "/webhooks/#{id}/trigger",
19
+ :post,
20
+ payload: { resource: resource, instant: instant },
21
+ )
22
+ end
23
+ end
24
+ end
data/lib/mifiel.rb CHANGED
@@ -9,6 +9,7 @@ module Mifiel
9
9
  autoload :Document, 'mifiel/document'
10
10
  autoload :Certificate, 'mifiel/certificate'
11
11
  autoload :Template, 'mifiel/template'
12
+ autoload :Webhook, 'mifiel/webhook'
12
13
  autoload :Config, 'mifiel/config'
13
14
  autoload :User, 'mifiel/user'
14
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mifiel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genaro Madrid
@@ -64,6 +64,7 @@ files:
64
64
  - lib/mifiel/template.rb
65
65
  - lib/mifiel/user.rb
66
66
  - lib/mifiel/version.rb
67
+ - lib/mifiel/webhook.rb
67
68
  - mifiel-ruby-api-client.sublime-project
68
69
  - mifiel.gemspec
69
70
  - mise.toml
@@ -96,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
97
  - !ruby/object:Gem::Version
97
98
  version: '0'
98
99
  requirements: []
99
- rubygems_version: 4.0.16
100
+ rubygems_version: 4.0.20
100
101
  specification_version: 4
101
102
  summary: Ruby SDK for mifiel.com.
102
103
  test_files: []