cirro-ruby-client 2.6.0 → 2.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +2 -2
- data/.rubocop.yml +3 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +75 -55
- data/lib/cirro_io/client/gig.rb +1 -1
- data/lib/cirro_io/client/gig_invitation.rb +1 -1
- data/lib/cirro_io/client/version.rb +1 -1
- data/lib/cirro_io_v2/client.rb +2 -1
- data/lib/cirro_io_v2/errors/client_error.rb +29 -0
- data/lib/cirro_io_v2/request_clients/base.rb +2 -0
- data/lib/cirro_io_v2/resources/gig.rb +2 -1
- data/lib/cirro_io_v2/resources/gig_invitation.rb +1 -1
- data/lib/cirro_io_v2/resources/gig_result.rb +1 -1
- data/lib/cirro_io_v2/resources/gig_time_activity.rb +1 -1
- data/lib/cirro_io_v2/resources/notification_configuration.rb +1 -1
- data/lib/cirro_io_v2/resources/notification_layout.rb +1 -1
- data/lib/cirro_io_v2/resources/notification_template.rb +1 -1
- data/lib/cirro_io_v2/resources/notification_topic.rb +1 -1
- data/lib/cirro_io_v2/resources/notification_topic_preference.rb +1 -1
- data/lib/cirro_io_v2/resources/payout.rb +1 -1
- data/lib/cirro_io_v2/responses/responses.rb +3 -0
- 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: 92c3a2334f236e91ae517d02d24f53712be09bd4d339d288b46835d5b26e85a3
|
4
|
+
data.tar.gz: 653f51aecb055e375c508a925ad331c3684d05b609b74c9dae46e9e98f90b40b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
40
|
+
- image: cimg/ruby:3.2.2-node
|
41
41
|
steps:
|
42
42
|
- checkout
|
43
43
|
- run:
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cirro-ruby-client (2.6.
|
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.
|
15
|
-
activesupport (= 7.
|
16
|
-
activesupport (7.
|
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.
|
25
|
-
public_suffix (>= 2.0.2, <
|
26
|
-
ast (2.4.
|
27
|
-
base64 (0.
|
28
|
-
bigdecimal (3.1.
|
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.
|
32
|
+
concurrent-ruby (1.2.3)
|
31
33
|
connection_pool (2.4.1)
|
32
|
-
crack (0.
|
33
|
-
|
34
|
-
|
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.
|
37
|
-
i18n (>= 1.
|
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
|
44
|
-
i18n (1.
|
47
|
+
hashdiff (1.1.0)
|
48
|
+
i18n (1.14.1)
|
45
49
|
concurrent-ruby (~> 1.0)
|
46
|
-
|
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.
|
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.
|
56
|
-
multipart-post (2.
|
57
|
-
mutex_m (0.
|
58
|
-
parallel (1.
|
59
|
-
parser (
|
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
|
-
|
68
|
+
racc
|
69
|
+
pry (0.14.2)
|
62
70
|
coderay (~> 1.1)
|
63
71
|
method_source (~> 1.0)
|
64
|
-
public_suffix (
|
65
|
-
|
66
|
-
|
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 (
|
69
|
-
rexml (3.2.
|
70
|
-
rspec (3.
|
71
|
-
rspec-core (~> 3.
|
72
|
-
rspec-expectations (~> 3.
|
73
|
-
rspec-mocks (~> 3.
|
74
|
-
rspec-core (3.
|
75
|
-
rspec-support (~> 3.
|
76
|
-
rspec-expectations (3.
|
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.
|
79
|
-
rspec-mocks (3.
|
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.
|
82
|
-
rspec-support (3.
|
83
|
-
rubocop (
|
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 (>=
|
96
|
+
parser (>= 3.3.0.2)
|
86
97
|
rainbow (>= 2.2.2, < 4.0)
|
87
|
-
regexp_parser (>= 1.
|
88
|
-
rexml
|
89
|
-
rubocop-ast (>=
|
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 (>=
|
92
|
-
rubocop-ast (
|
93
|
-
parser (>= 2.
|
94
|
-
rubocop-
|
95
|
-
rubocop (~>
|
96
|
-
|
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 (
|
101
|
-
webmock (3.
|
102
|
-
addressable (>= 2.
|
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
|
data/lib/cirro_io/client/gig.rb
CHANGED
@@ -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
|
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:
|
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
|
|
data/lib/cirro_io_v2/client.rb
CHANGED
@@ -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:
|
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
|
@@ -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
|
-
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
5
|
+
response = client.request_client.request(:get, resource_root, params:)
|
6
6
|
Responses::PayoutListResponse.new(response.body)
|
7
7
|
end
|
8
8
|
|
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.
|
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:
|
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.
|
171
|
+
rubygems_version: 3.4.19
|
171
172
|
signing_key:
|
172
173
|
specification_version: 4
|
173
174
|
summary: Ruby client library for Cirro API
|