restforce 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/restforce/collection.rb +2 -2
- data/lib/restforce/concerns/picklists.rb +1 -1
- data/lib/restforce/config.rb +1 -1
- data/lib/restforce/error_code.rb +4 -0
- data/lib/restforce/mash.rb +7 -2
- data/lib/restforce/middleware.rb +2 -0
- data/lib/restforce/middleware/logger.rb +3 -2
- data/lib/restforce/version.rb +1 -1
- data/restforce.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b5b0552d40edc08c24070cfcd8b34b359e8240a2121dd5cb4e50e15bd99b873
|
4
|
+
data.tar.gz: 85b8a63c6e37474344d266c11d578ba7a2f0d9fdc11afcb1275a76eb29e5e2b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 493fe598b73948b072723a4d9f158aaa62191cb7556c40a36952a75b26a9fe128f2ae0c0cdef29720bde0f47dcfe1515e7149379d3c0d924f7f86d9fa4d5569f
|
7
|
+
data.tar.gz: 253579496be482255d6b384035c9394f2f122262b482472e45f30590be3d760975e9490eafea2531ad56c9bf1fa7a23b28a6fd21e9dbf5a5828482bf1a26037c
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 5.0.2 (Sep 6, 2020)
|
2
|
+
|
3
|
+
* Handle the undocumented `REQUEST_LIMIT_EXCEEDED` error returned by Salesforce (@wkirkby, @timrogers)
|
4
|
+
* Handle the undocumented `SERVER_UNAVAILABLE` error returned by Salesforce (@wkirkby, @timrogers)
|
5
|
+
* Refactor the library to be compatible with Rubocop 0.90's cops (this shouldn't introduce any noticeable changes see #569 for detailed changes) (@timrogers)
|
6
|
+
|
1
7
|
## 5.0.1 (Aug 13, 2020)
|
2
8
|
|
3
9
|
* Handle the undocumented `API_CURRENTLY_DISABLED` error returned by Salesforce (@ruipserra, @timrogers)
|
data/README.md
CHANGED
data/lib/restforce/collection.rb
CHANGED
@@ -12,12 +12,12 @@ module Restforce
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# Yield each value on each page.
|
15
|
-
def each
|
15
|
+
def each(&block)
|
16
16
|
@raw_page['records'].each { |record| yield Restforce::Mash.build(record, @client) }
|
17
17
|
|
18
18
|
np = next_page
|
19
19
|
while np
|
20
|
-
np.current_page.each
|
20
|
+
np.current_page.each(&block)
|
21
21
|
np = np.next_page
|
22
22
|
end
|
23
23
|
end
|
data/lib/restforce/config.rb
CHANGED
@@ -151,7 +151,7 @@ module Restforce
|
|
151
151
|
option :request_headers
|
152
152
|
|
153
153
|
# Set a logger for when Restforce.log is set to true, defaulting to STDOUT
|
154
|
-
option :logger, default: ::Logger.new(
|
154
|
+
option :logger, default: ::Logger.new($stdout)
|
155
155
|
|
156
156
|
# Set a log level for logging when Restforce.log is set to true, defaulting to :debug
|
157
157
|
option :log_level, default: :debug
|
data/lib/restforce/error_code.rb
CHANGED
@@ -167,9 +167,11 @@ module Restforce
|
|
167
167
|
class PortalUserAlreadyExistsForContact < ResponseError; end
|
168
168
|
class PrivateContactOnAsset < ResponseError; end
|
169
169
|
class RecordInUseByWorkflow < ResponseError; end
|
170
|
+
class RequestLimitExceeded < ResponseError; end
|
170
171
|
class RequestRunningTooLong < ResponseError; end
|
171
172
|
class RequiredFieldMissing < ResponseError; end
|
172
173
|
class SelfReferenceFromTrigger < ResponseError; end
|
174
|
+
class ServerUnavailable < ResponseError; end
|
173
175
|
class ShareNeededForChildOwner < ResponseError; end
|
174
176
|
class SingleEmailLimitExceeded < ResponseError; end
|
175
177
|
class StandardPriceNotDefined < ResponseError; end
|
@@ -359,9 +361,11 @@ module Restforce
|
|
359
361
|
"PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT" => PortalUserAlreadyExistsForContact,
|
360
362
|
"PRIVATE_CONTACT_ON_ASSET" => PrivateContactOnAsset,
|
361
363
|
"RECORD_IN_USE_BY_WORKFLOW" => RecordInUseByWorkflow,
|
364
|
+
"REQUEST_LIMIT_EXCEEDED" => RequestLimitExceeded,
|
362
365
|
"REQUEST_RUNNING_TOO_LONG" => RequestRunningTooLong,
|
363
366
|
"REQUIRED_FIELD_MISSING" => RequiredFieldMissing,
|
364
367
|
"SELF_REFERENCE_FROM_TRIGGER" => SelfReferenceFromTrigger,
|
368
|
+
"SERVER_UNAVAILABLE" => ServerUnavailable,
|
365
369
|
"SHARE_NEEDED_FOR_CHILD_OWNER" => ShareNeededForChildOwner,
|
366
370
|
"SINGLE_EMAIL_LIMIT_EXCEEDED" => SingleEmailLimitExceeded,
|
367
371
|
"STANDARD_PRICE_NOT_DEFINED" => StandardPriceNotDefined,
|
data/lib/restforce/mash.rb
CHANGED
@@ -11,9 +11,10 @@ module Restforce
|
|
11
11
|
# appropriate Restforce::Collection, Restforce::SObject and
|
12
12
|
# Restforce::Mash objects.
|
13
13
|
def build(val, client)
|
14
|
-
|
14
|
+
case val
|
15
|
+
when Array
|
15
16
|
val.collect { |a_val| self.build(a_val, client) }
|
16
|
-
|
17
|
+
when Hash
|
17
18
|
self.klass(val).new(val, client)
|
18
19
|
else
|
19
20
|
val
|
@@ -55,6 +56,9 @@ module Restforce
|
|
55
56
|
self.class.new(self, @client, self.default)
|
56
57
|
end
|
57
58
|
|
59
|
+
# The #convert_value method and its signature are part of Hashie::Mash's API, so we
|
60
|
+
# can't unilaterally decide to change `duping` to be a keyword argument
|
61
|
+
# rubocop:disable Style/OptionalBooleanParameter
|
58
62
|
def convert_value(val, duping = false)
|
59
63
|
case val
|
60
64
|
when self.class
|
@@ -68,5 +72,6 @@ module Restforce
|
|
68
72
|
val
|
69
73
|
end
|
70
74
|
end
|
75
|
+
# rubocop:enable Style/OptionalBooleanParameter
|
71
76
|
end
|
72
77
|
end
|
data/lib/restforce/middleware.rb
CHANGED
@@ -11,7 +11,7 @@ module Restforce
|
|
11
11
|
@options = options
|
12
12
|
@logger = logger || begin
|
13
13
|
require 'logger'
|
14
|
-
::Logger.new(
|
14
|
+
::Logger.new($stdout)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -36,7 +36,8 @@ module Restforce
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def dump(hash)
|
39
|
-
|
39
|
+
dumped_pairs = hash.map { |k, v| " #{k}: #{v.inspect}" }.join("\n")
|
40
|
+
"\n#{dumped_pairs}"
|
40
41
|
end
|
41
42
|
end
|
42
43
|
end
|
data/lib/restforce/version.rb
CHANGED
data/restforce.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |gem|
|
|
34
34
|
gem.add_development_dependency 'faye' unless RUBY_PLATFORM == 'java'
|
35
35
|
gem.add_development_dependency 'rspec', '~> 2.14.0'
|
36
36
|
gem.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
|
37
|
-
gem.add_development_dependency 'rubocop', '~> 0.
|
38
|
-
gem.add_development_dependency 'simplecov', '~> 0.
|
37
|
+
gem.add_development_dependency 'rubocop', '~> 0.90.0'
|
38
|
+
gem.add_development_dependency 'simplecov', '~> 0.19.0'
|
39
39
|
gem.add_development_dependency 'webmock', '~> 3.8.3'
|
40
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Rogers
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-09-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -133,28 +133,28 @@ dependencies:
|
|
133
133
|
requirements:
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: 0.
|
136
|
+
version: 0.90.0
|
137
137
|
type: :development
|
138
138
|
prerelease: false
|
139
139
|
version_requirements: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
141
|
- - "~>"
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version: 0.
|
143
|
+
version: 0.90.0
|
144
144
|
- !ruby/object:Gem::Dependency
|
145
145
|
name: simplecov
|
146
146
|
requirement: !ruby/object:Gem::Requirement
|
147
147
|
requirements:
|
148
148
|
- - "~>"
|
149
149
|
- !ruby/object:Gem::Version
|
150
|
-
version: 0.
|
150
|
+
version: 0.19.0
|
151
151
|
type: :development
|
152
152
|
prerelease: false
|
153
153
|
version_requirements: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
155
|
- - "~>"
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version: 0.
|
157
|
+
version: 0.19.0
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
159
|
name: webmock
|
160
160
|
requirement: !ruby/object:Gem::Requirement
|