cirro-ruby-client 2.6.0 → 2.6.2

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: 93e1ca8595f2f1ff48cc01d83faa7be967f4797cf33dc4f6c6ad203797cee42a
4
- data.tar.gz: 4d51c8839890602de955cbca846c15fabc90ad0d99d13917ff42d213b8833d1a
3
+ metadata.gz: 92c3a2334f236e91ae517d02d24f53712be09bd4d339d288b46835d5b26e85a3
4
+ data.tar.gz: 653f51aecb055e375c508a925ad331c3684d05b609b74c9dae46e9e98f90b40b
5
5
  SHA512:
6
- metadata.gz: 2adc621e4ef3438f5b6b8d44abc5d6f8dae9f38b71d4e6222931d8c7dd9cf7940a33d82e83712198a624a04d8f1f7f674a4c00ebc691a8a14e00d48492d0cf0f
7
- data.tar.gz: 6a060fd02e69e0bfbc3fd7be45305a9748b22f8af21e2142928d18a20a8e2aa41e40788e4d043a2e62f181d76ac1c245721144fd208383bc8592c41d39c53c9a
6
+ metadata.gz: 87f11b8066c38e5a3d8a6de3060e9c5b3d092c4632dbc608f0d5b80d776b610a56cd4a4b3739a4900115f36c3c6456a079d832c3335f608e17e7a90c191374ab
7
+ data.tar.gz: dfab1116f62d4bb445893798ec9af98547bb9d6a124965d714fb5a6bdf63e6712c40141adcffa45e02d04c9edbc06d3373a313d26af81ab287133286bb99ae2b
data/.circleci/config.yml CHANGED
@@ -12,7 +12,7 @@ infra_container_registry_auth:
12
12
  jobs:
13
13
  test:
14
14
  docker:
15
- - image: cimg/ruby:2.7.1-node
15
+ - image: cimg/ruby:3.2.2-node
16
16
  environment:
17
17
  - RAILS_ENV=test
18
18
  - RACK_ENV=test
@@ -37,7 +37,7 @@ jobs:
37
37
 
38
38
  deploy:
39
39
  docker:
40
- - image: cimg/ruby:2.7.1-node
40
+ - image: cimg/ruby:3.2.2-node
41
41
  steps:
42
42
  - checkout
43
43
  - run:
data/.rubocop.yml CHANGED
@@ -100,6 +100,9 @@ Lint/RaiseException:
100
100
  Lint/StructNewOverride:
101
101
  Enabled: true
102
102
 
103
+ Lint/MissingSuper:
104
+ Enabled: false
105
+
103
106
  Style/HashEachMethods:
104
107
  Enabled: true
105
108
 
data/Gemfile CHANGED
@@ -3,6 +3,8 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in cirro-ruby-client.gemspec
4
4
  gemspec
5
5
 
6
+ ruby '3.2.2'
7
+
6
8
  gem 'rake', '~> 12.0'
7
9
  gem 'rspec', '~> 3.0'
8
10
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cirro-ruby-client (2.6.0)
4
+ cirro-ruby-client (2.6.2)
5
5
  activesupport
6
6
  faraday (< 1.2.0)
7
7
  faraday_middleware
@@ -11,9 +11,11 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activemodel (7.0.6)
15
- activesupport (= 7.0.6)
16
- activesupport (7.0.6)
14
+ activemodel (7.1.3.2)
15
+ activesupport (= 7.1.3.2)
16
+ activesupport (7.1.3.2)
17
+ base64
18
+ bigdecimal
17
19
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
20
  connection_pool (>= 2.2.5)
19
21
  drb
@@ -21,85 +23,100 @@ GEM
21
23
  minitest (>= 5.1)
22
24
  mutex_m
23
25
  tzinfo (~> 2.0)
24
- addressable (2.8.0)
25
- public_suffix (>= 2.0.2, < 5.0)
26
- ast (2.4.1)
27
- base64 (0.1.1)
28
- bigdecimal (3.1.4)
26
+ addressable (2.8.6)
27
+ public_suffix (>= 2.0.2, < 6.0)
28
+ ast (2.4.2)
29
+ base64 (0.2.0)
30
+ bigdecimal (3.1.6)
29
31
  coderay (1.1.3)
30
- concurrent-ruby (1.1.10)
32
+ concurrent-ruby (1.2.3)
31
33
  connection_pool (2.4.1)
32
- crack (0.4.4)
33
- diff-lcs (1.4.4)
34
- drb (2.1.1)
34
+ crack (1.0.0)
35
+ bigdecimal
36
+ rexml
37
+ diff-lcs (1.5.1)
38
+ drb (2.2.0)
35
39
  ruby2_keywords
36
- faker (2.14.0)
37
- i18n (>= 1.6, < 2)
40
+ faker (3.2.3)
41
+ i18n (>= 1.8.11, < 2)
38
42
  faraday (1.1.0)
39
43
  multipart-post (>= 1.2, < 3)
40
44
  ruby2_keywords
41
45
  faraday_middleware (1.2.0)
42
46
  faraday (~> 1.0)
43
- hashdiff (1.0.1)
44
- i18n (1.10.0)
47
+ hashdiff (1.1.0)
48
+ i18n (1.14.1)
45
49
  concurrent-ruby (~> 1.0)
46
- json_api_client (1.21.1)
50
+ json (2.7.1)
51
+ json_api_client (1.22.0)
47
52
  activemodel (>= 3.2.0)
48
53
  activesupport (>= 3.2.0)
49
54
  addressable (~> 2.2)
50
55
  faraday (>= 0.15.2, < 2.0)
51
56
  faraday_middleware (>= 0.9.0, < 2.0)
52
57
  rack (>= 0.2)
53
- jwt (2.7.1)
58
+ jwt (2.8.0)
59
+ base64
60
+ language_server-protocol (3.17.0.3)
54
61
  method_source (1.0.0)
55
- minitest (5.19.0)
56
- multipart-post (2.3.0)
57
- mutex_m (0.1.2)
58
- parallel (1.19.2)
59
- parser (2.7.2.0)
62
+ minitest (5.22.2)
63
+ multipart-post (2.4.0)
64
+ mutex_m (0.2.0)
65
+ parallel (1.24.0)
66
+ parser (3.3.0.5)
60
67
  ast (~> 2.4.1)
61
- pry (0.13.1)
68
+ racc
69
+ pry (0.14.2)
62
70
  coderay (~> 1.1)
63
71
  method_source (~> 1.0)
64
- public_suffix (4.0.6)
65
- rack (3.0.8)
66
- rainbow (3.0.0)
72
+ public_suffix (5.0.4)
73
+ racc (1.7.3)
74
+ rack (3.0.9.1)
75
+ rainbow (3.1.1)
67
76
  rake (12.3.3)
68
- regexp_parser (1.8.1)
69
- rexml (3.2.4)
70
- rspec (3.9.0)
71
- rspec-core (~> 3.9.0)
72
- rspec-expectations (~> 3.9.0)
73
- rspec-mocks (~> 3.9.0)
74
- rspec-core (3.9.3)
75
- rspec-support (~> 3.9.3)
76
- rspec-expectations (3.9.2)
77
+ regexp_parser (2.9.0)
78
+ rexml (3.2.6)
79
+ rspec (3.13.0)
80
+ rspec-core (~> 3.13.0)
81
+ rspec-expectations (~> 3.13.0)
82
+ rspec-mocks (~> 3.13.0)
83
+ rspec-core (3.13.0)
84
+ rspec-support (~> 3.13.0)
85
+ rspec-expectations (3.13.0)
77
86
  diff-lcs (>= 1.2.0, < 2.0)
78
- rspec-support (~> 3.9.0)
79
- rspec-mocks (3.9.1)
87
+ rspec-support (~> 3.13.0)
88
+ rspec-mocks (3.13.0)
80
89
  diff-lcs (>= 1.2.0, < 2.0)
81
- rspec-support (~> 3.9.0)
82
- rspec-support (3.9.3)
83
- rubocop (0.92.0)
90
+ rspec-support (~> 3.13.0)
91
+ rspec-support (3.13.1)
92
+ rubocop (1.60.2)
93
+ json (~> 2.3)
94
+ language_server-protocol (>= 3.17.0)
84
95
  parallel (~> 1.10)
85
- parser (>= 2.7.1.5)
96
+ parser (>= 3.3.0.2)
86
97
  rainbow (>= 2.2.2, < 4.0)
87
- regexp_parser (>= 1.7)
88
- rexml
89
- rubocop-ast (>= 0.5.0)
98
+ regexp_parser (>= 1.8, < 3.0)
99
+ rexml (>= 3.2.5, < 4.0)
100
+ rubocop-ast (>= 1.30.0, < 2.0)
90
101
  ruby-progressbar (~> 1.7)
91
- unicode-display_width (>= 1.4.0, < 2.0)
92
- rubocop-ast (0.7.1)
93
- parser (>= 2.7.1.5)
94
- rubocop-rspec (1.43.2)
95
- rubocop (~> 0.87)
96
- ruby-progressbar (1.10.1)
102
+ unicode-display_width (>= 2.4.0, < 3.0)
103
+ rubocop-ast (1.30.0)
104
+ parser (>= 3.2.1.0)
105
+ rubocop-capybara (2.20.0)
106
+ rubocop (~> 1.41)
107
+ rubocop-factory_bot (2.25.1)
108
+ rubocop (~> 1.41)
109
+ rubocop-rspec (2.26.1)
110
+ rubocop (~> 1.40)
111
+ rubocop-capybara (~> 2.17)
112
+ rubocop-factory_bot (~> 2.22)
113
+ ruby-progressbar (1.13.0)
97
114
  ruby2_keywords (0.0.5)
98
115
  tzinfo (2.0.6)
99
116
  concurrent-ruby (~> 1.0)
100
- unicode-display_width (1.7.0)
101
- webmock (3.9.1)
102
- addressable (>= 2.3.6)
117
+ unicode-display_width (2.5.0)
118
+ webmock (3.23.0)
119
+ addressable (>= 2.8.0)
103
120
  crack (>= 0.3.2)
104
121
  hashdiff (>= 0.4.0, < 2.0.0)
105
122
 
@@ -116,5 +133,8 @@ DEPENDENCIES
116
133
  rubocop-rspec
117
134
  webmock
118
135
 
136
+ RUBY VERSION
137
+ ruby 3.2.2p53
138
+
119
139
  BUNDLED WITH
120
140
  2.3.20
@@ -9,7 +9,7 @@ module CirroIO
9
9
  has_many :gig_time_activities
10
10
 
11
11
  def bulk_create_with(worker_filter, gig_tasks)
12
- payload = { data: { attributes: attributes, relationships: {} } }
12
+ payload = { data: { attributes:, relationships: {} } }
13
13
  payload[:data][:relationships][:gig_tasks] = gig_tasks.map(&:attributes)
14
14
  payload[:data][:relationships][:worker_filter] = worker_filter.attributes
15
15
 
@@ -7,7 +7,7 @@ module CirroIO
7
7
  has_one :app_worker
8
8
 
9
9
  def bulk_create_with(worker_filter, auto_accept: false)
10
- payload = { data: { attributes: attributes.merge(worker_filter: worker_filter.attributes, auto_accept: auto_accept) } }
10
+ payload = { data: { attributes: attributes.merge(worker_filter: worker_filter.attributes, auto_accept:) } }
11
11
 
12
12
  response = self.class.custom_post("bulk/gigs/#{gig.id}/gig_invitations", format_to_dashed_keys(payload))
13
13
 
@@ -1,7 +1,7 @@
1
1
  # rubocop:disable Style/MutableConstant
2
2
  module CirroIO
3
3
  module Client
4
- VERSION = '2.6.0'
4
+ VERSION = '2.6.2'
5
5
  end
6
6
  end
7
7
  # rubocop:enable Style/MutableConstant
@@ -1,6 +1,7 @@
1
1
  require 'cirro_io/client/version'
2
2
  require 'cirro_io_v2/errors/http_error'
3
3
  require 'cirro_io_v2/errors/response_not_json_error'
4
+ require 'cirro_io_v2/errors/client_error'
4
5
 
5
6
  require 'cirro_io_v2/request_clients/base'
6
7
  require 'cirro_io_v2/request_clients/jwt'
@@ -53,7 +54,7 @@ module CirroIOV2
53
54
  private_key = OpenSSL::PKey::RSA.new(File.read(@options[:private_key_path])) if @options[:private_key_path]
54
55
  @request_client = RequestClients::Jwt.new(base_url: "#{@options[:site]}/#{@options[:api_version]}",
55
56
  client_id: @options[:client_id],
56
- private_key: private_key)
57
+ private_key:)
57
58
  else
58
59
  raise ArgumentError, 'Options: ":auth_type" must be ":jwt"'
59
60
  end
@@ -0,0 +1,29 @@
1
+ require 'forwardable'
2
+
3
+ module CirroIOV2
4
+ module Errors
5
+ class ClientError < StandardError
6
+ extend Forwardable
7
+
8
+ def_instance_delegators :@faraday_error, :response, :full_message
9
+
10
+ attr_reader :faraday_error
11
+
12
+ # this error class is intended to be used ONLY for 4xx errors
13
+ # https://www.rubydoc.info/github/lostisland/faraday/Faraday/ClientError
14
+
15
+ def initialize(faraday_error)
16
+ @faraday_error = faraday_error
17
+ end
18
+
19
+ def message
20
+ puts faraday_error.response.inspect
21
+ faraday_error.response.then do |response|
22
+ return response.inspect if ENV.fetch('DEBUG_CIRRO_RUBY_CLIENT', false)
23
+
24
+ faraday_error.response[:body].presence || faraday_error.try[:message]
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -11,6 +11,8 @@ module CirroIOV2
11
11
  response
12
12
  rescue Faraday::ParsingError => e
13
13
  raise Errors::ResponseNotJsonError, e
14
+ rescue Faraday::ClientError => e
15
+ raise Errors::ClientError, e
14
16
  end
15
17
 
16
18
  def make_request(*args)
@@ -40,7 +40,8 @@ module CirroIOV2
40
40
  response = client.request_client.request(:post, "#{resource_root}/#{id}/invite", body: params)
41
41
 
42
42
  return Responses::GigInvitationResponse.new(response.body) if response.body['object'] == 'gig_invitation'
43
- return Responses::GigInvitationListResponse.new(response.body) if response.body['object'] == 'list'
43
+
44
+ Responses::GigInvitationListResponse.new(response.body) if response.body['object'] == 'list'
44
45
  end
45
46
  end
46
47
  end
@@ -2,7 +2,7 @@ module CirroIOV2
2
2
  module Resources
3
3
  class GigInvitation < Base
4
4
  def list(params = nil)
5
- response = client.request_client.request(:get, resource_root, params: params)
5
+ response = client.request_client.request(:get, resource_root, params:)
6
6
  Responses::GigInvitationListResponse.new(response.body)
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ module CirroIOV2
2
2
  module Resources
3
3
  class GigResult < Base
4
4
  def list(params = nil)
5
- response = client.request_client.request(:get, resource_root, params: params)
5
+ response = client.request_client.request(:get, resource_root, params:)
6
6
  Responses::GigResultListResponse.new(response.body)
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ module CirroIOV2
2
2
  module Resources
3
3
  class GigTimeActivity < Base
4
4
  def list(params = nil)
5
- response = client.request_client.request(:get, resource_root, params: params)
5
+ response = client.request_client.request(:get, resource_root, params:)
6
6
  Responses::GigTimeActivityListResponse.new(response.body)
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ module CirroIOV2
2
2
  module Resources
3
3
  class NotificationConfiguration < Base
4
4
  def list(params = nil)
5
- response = client.request_client.request(:get, resource_root, params: params)
5
+ response = client.request_client.request(:get, resource_root, params:)
6
6
  Responses::NotificationConfigurationListResponse.new(response.body)
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module CirroIOV2
2
2
  module Resources
3
3
  class NotificationLayout < Base
4
4
  def list(params = nil)
5
- response = client.request_client.request(:get, resource_root, params: params)
5
+ response = client.request_client.request(:get, resource_root, params:)
6
6
  Responses::NotificationLayoutListResponse.new(response.body)
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ module CirroIOV2
2
2
  module Resources
3
3
  class NotificationTemplate < Base
4
4
  def list(params = nil)
5
- response = client.request_client.request(:get, resource_root, params: params)
5
+ response = client.request_client.request(:get, resource_root, params:)
6
6
  Responses::NotificationTemplateListResponse.new(response.body)
7
7
  end
8
8
 
@@ -16,7 +16,7 @@ module CirroIOV2
16
16
  end
17
17
 
18
18
  def list(params = nil)
19
- response = client.request_client.request(:get, resource_root, params: params)
19
+ response = client.request_client.request(:get, resource_root, params:)
20
20
  Responses::NotificationTopicListResponse.new(response.body)
21
21
  end
22
22
 
@@ -6,7 +6,7 @@ module CirroIOV2
6
6
  end
7
7
 
8
8
  def list(params = nil)
9
- response = client.request_client.request(:get, resource_root, params: params)
9
+ response = client.request_client.request(:get, resource_root, params:)
10
10
  Responses::NotificationTopicPreferenceListResponse.new(response.body)
11
11
  end
12
12
  end
@@ -2,7 +2,7 @@ module CirroIOV2
2
2
  module Resources
3
3
  class Payout < Base
4
4
  def list(params = nil)
5
- response = client.request_client.request(:get, resource_root, params: params)
5
+ response = client.request_client.request(:get, resource_root, params:)
6
6
  Responses::PayoutListResponse.new(response.body)
7
7
  end
8
8
 
@@ -68,7 +68,10 @@ module CirroIOV2
68
68
  :seats_min,
69
69
  :seats_max,
70
70
  :invitation_mode,
71
+ :invitation_multiplier,
72
+ :invitation_frequency,
71
73
  :filter_query,
74
+ :sort_query,
72
75
  :tasks,
73
76
  :notification_payload,
74
77
  :invitation_notification_topic,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cirro-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cirro Dev Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-17 00:00:00.000000000 Z
11
+ date: 2024-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -122,6 +122,7 @@ files:
122
122
  - lib/cirro_io/client/version.rb
123
123
  - lib/cirro_io/client/worker_filter.rb
124
124
  - lib/cirro_io_v2/client.rb
125
+ - lib/cirro_io_v2/errors/client_error.rb
125
126
  - lib/cirro_io_v2/errors/http_error.rb
126
127
  - lib/cirro_io_v2/errors/response_not_json_error.rb
127
128
  - lib/cirro_io_v2/request_clients/base.rb
@@ -167,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
168
  - !ruby/object:Gem::Version
168
169
  version: '0'
169
170
  requirements: []
170
- rubygems_version: 3.1.3
171
+ rubygems_version: 3.4.19
171
172
  signing_key:
172
173
  specification_version: 4
173
174
  summary: Ruby client library for Cirro API