mailerlite-ruby 1.0.5 → 1.0.6

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: 102aeffa28b4e834a28a6e03482f93bbbcc051bae9fc460e4211556c747471d5
4
- data.tar.gz: cdb4915ff453305c4d1c839955589c0139fc38271aa7b65c1f1581ec3cb7714b
3
+ metadata.gz: 26476250e28b87cf289bba0eccaf6cb110569eb3a4b257a5c4a54ae2a26f1bdd
4
+ data.tar.gz: 1c8fa0e0cfe43eaf2984b7384dc5de09fc282431d9f916f774c011d33ce75c3f
5
5
  SHA512:
6
- metadata.gz: d992ce5751fb5509c94260284c943d35a4ce4ce39557e796b8930064886a9e57cf9e3956008d69f8b93650c03b7ef7809a6e3e6f175b06645dd0cecac990f895
7
- data.tar.gz: 54b4d12eafd3e6f2816dcfed36374a9d85d45562a1caf482fe67351150024fcc1631befa6050671009ef2031c451e9219d957a69e2530993db999caa231b7e1a
6
+ metadata.gz: 89df2ef7e930774ad86986d38de88653ee04dc899c91f93a5c96ce3d84a0a31121237233992d36ae5dbc2f4cc767c760707e9b4c8f31b9384db93139b893f45c
7
+ data.tar.gz: 12d1c9538bbb830ee4cc05a2e4b402a66bfd0b915b5849d9b532981b1b5ca40adfbe3216daf243c62021c1eaa4183dafd5a6bd72ee94748687b92beb9f496801
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [1.0.6] - 2024-12-06
2
+ - Page parameter to cursor pagination fix
3
+
1
4
  ## [1.0.5] - 2024-03-12
2
5
  - Update constant name
3
6
 
data/README.md CHANGED
@@ -105,7 +105,7 @@ require "mailerlite-ruby"
105
105
  # Intialize the class
106
106
  subscribers = MailerLite::Subscribers.new
107
107
 
108
- subscribers.fetch(filter: { status: 'active' })
108
+ subscribers.fetch(filter: { status: 'active' }, cursor: 'cursor')
109
109
  ```
110
110
 
111
111
  ### Create a subscriber
@@ -131,7 +131,7 @@ require "mailerlite-ruby"
131
131
  # Intialize the class
132
132
  subscribers = MailerLite::Subscribers.new
133
133
 
134
- subscribers.update(email:'some@email.com', fields: {'name': 'John', 'last_name': 'Doe'}, ip_address:'1.2.3.4', optin_ip:'1.2.3.4')
134
+ subscribers.update('some@email.com', fields: {'name': 'John', 'last_name': 'Doe'}, ip_address:'1.2.3.4', optin_ip:'1.2.3.4')
135
135
  ```
136
136
 
137
137
  ### Get a subscriber
@@ -176,7 +176,7 @@ require "mailerlite-ruby"
176
176
  # Intialize the class
177
177
  groups = MailerLite::Groups.new
178
178
 
179
- groups.list(limit:10, page:1, filter:{'name': 'My'}, sort:'name')
179
+ groups.get(limit:10, page:1, filter:{'name': 'My'}, sort:'name')
180
180
  ```
181
181
 
182
182
  ### Create a group
@@ -227,10 +227,10 @@ groups.delete(group_id)
227
227
  ```ruby
228
228
  require "mailerlite-ruby"
229
229
 
230
- # Intialize the class
230
+ # Initialize the class
231
231
  groups = MailerLite::Groups.new
232
232
 
233
- groups.get_subscribers(group_id:1234567, page:1, limit:10, filter:{'status': 'active'})
233
+ groups.get_subscribers(group_id: 1234567, cursor: 'cursor', limit: 10, filter: { 'status': 'active' })
234
234
  ```
235
235
 
236
236
  ### Assign subscriber to a group
@@ -483,7 +483,7 @@ require "mailerlite-ruby"
483
483
  campaigns = MailerLite::Campaigns.new
484
484
 
485
485
  campaigns.update(
486
- campaign_id: 1233455,
486
+ campaign_id: 1233455,
487
487
  name: "New Campaign Name",
488
488
  language_id: 2,
489
489
  emails: [{
@@ -703,7 +703,7 @@ webhooks.create(
703
703
  'subscriber.created',
704
704
  'subscriber.updated',
705
705
  'subscriber.unsubscribed'
706
- ],
706
+ ],
707
707
  url:'https://my-url.com',
708
708
  name: 'Webhook name'
709
709
  )
@@ -720,12 +720,12 @@ require "mailerlite-ruby"
720
720
  webhooks = MailerLite::Webhooks.new
721
721
 
722
722
  webhooks.update(
723
- webhook_id: 123456,
723
+ webhook_id: 123456,
724
724
  events:[
725
725
  'subscriber.created',
726
726
  'subscriber.updated',
727
727
  'subscriber.unsubscribed'
728
- ],
728
+ ],
729
729
  url:'https://my-url.com',
730
730
  name: 'Webhook name',
731
731
  enabled: false
@@ -784,7 +784,7 @@ campaigns.languages()
784
784
  # Testing
785
785
 
786
786
  ```bash
787
- bundle i
787
+ bundle i
788
788
  bundle exec rspec spec/*rspec.rb
789
789
  ```
790
790
 
@@ -794,7 +794,7 @@ The fixtures for the test have been recorded using vcr and are available in the
794
794
  # Generate Docs
795
795
 
796
796
  ```bash
797
- bundle i
797
+ bundle i
798
798
  bundle exec yardoc 'lib/**/*.rb'
799
799
  ```
800
800
 
@@ -54,12 +54,12 @@ module MailerLite
54
54
  # @param limit [Integer] the maximum number of subscribers to return
55
55
  # @param page [Integer] the page number of the results to return
56
56
  # @return [HTTP::Response] the response from the API
57
- def get_subscribers(group_id:, filter: {}, limit: nil, page: nil, sort: nil)
57
+ def get_subscribers(group_id:, filter: {}, limit: nil, cursor: nil, sort: nil)
58
58
  params = {}
59
59
  params['filter[status]'] = filter[:status] if filter.key?(:status)
60
60
  params['limit'] = limit if limit
61
61
  params['sort'] = sort if sort
62
- params['page'] = page if page
62
+ params['cursor'] = cursor if cursor
63
63
  client.http.get("#{MAILERLITE_API_URL}/groups/#{group_id}/subscribers", json: params.compact)
64
64
  end
65
65
 
@@ -18,11 +18,11 @@ module MailerLite
18
18
  # @param limit [Integer] the maximum number of subscribers to return
19
19
  # @param page [Integer] the page number of the results to return
20
20
  # @return [HTTP::Response] the response from the API
21
- def fetch(filter:, limit: nil, page: nil)
21
+ def fetch(filter:, limit: nil, cursor: nil)
22
22
  params = { 'filter[status]' => filter[:status] }
23
23
 
24
24
  params['limit'] = limit if limit
25
- params['page'] = page if page
25
+ params['cursor'] = cursor if cursor
26
26
  uri = URI("#{MAILERLITE_API_URL}/subscribers")
27
27
  uri.query = URI.encode_www_form(params.compact)
28
28
  client.http.get(uri)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MailerLite
4
- VERSION = '1.0.5'
4
+ VERSION = '1.0.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailerlite-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Milojević
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-03-12 00:00:00.000000000 Z
12
+ date: 2024-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  - !ruby/object:Gem::Version
299
299
  version: '0'
300
300
  requirements: []
301
- rubygems_version: 3.5.3
301
+ rubygems_version: 3.5.22
302
302
  signing_key:
303
303
  specification_version: 4
304
304
  summary: MailerLite's official Ruby SDK