restforce 5.0.5 → 5.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +19 -0
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/restforce/concerns/base.rb +2 -2
- data/lib/restforce/error_code.rb +9 -0
- data/lib/restforce/middleware/logger.rb +5 -5
- data/lib/restforce/version.rb +1 -1
- data/restforce.gemspec +2 -2
- data/spec/integration/abstract_client_spec.rb +4 -4
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6644bf699621fb5414dce1dce275e5a265fca50305bcfca98864b6c1683f1687
|
4
|
+
data.tar.gz: 5ef0177a3a91dbe1637fc493b7f0bc478fca34c49e392abb1eccdf8bf951aa66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c7d3e8b58743f8d4ae6ae9255c2d89cc78b06a5e963350784ff3c884396bf1ef03fb986f2aba7bd231d8ae9af2f0b2af78a77c98fcb62356ac09b1411753e13
|
7
|
+
data.tar.gz: 5c8bb85fdcd28e5eba8d0939ef1868d42b99d079cddd056941ec7c4cf591d3789caa2b569cafeb8415a89755e567de1a93486dc9c18c5507275adad5631374cc
|
@@ -0,0 +1,19 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: bundler
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: daily
|
7
|
+
open-pull-requests-limit: 10
|
8
|
+
ignore:
|
9
|
+
- dependency-name: rubocop
|
10
|
+
versions:
|
11
|
+
- 1.10.0
|
12
|
+
- 1.11.0
|
13
|
+
- 1.12.0
|
14
|
+
- 1.12.1
|
15
|
+
- 1.9.0
|
16
|
+
- dependency-name: webmock
|
17
|
+
versions:
|
18
|
+
- 3.12.0
|
19
|
+
- 3.12.1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 5.0.6 (Jun 17, 2021)
|
2
|
+
|
3
|
+
* Handle the `API_DISABLED_FOR_ORG` error returned by Salesforce (@cmac)
|
4
|
+
* Handle the `METHOD_NOT_ALLOWED` error returned by Salesforce (@timrogers)
|
5
|
+
* Handle the `APEX_ERROR` error returned by Salesforce (@timrogers)
|
6
|
+
|
1
7
|
## 5.0.5 (Feb 17, 2021)
|
2
8
|
|
3
9
|
* Handle the `CANNOT_EXECUTE_FLOW_TRIGGER` error returned by Salesforce (@almusavi, @timrogers)
|
data/README.md
CHANGED
@@ -61,9 +61,9 @@ module Restforce
|
|
61
61
|
def initialize(opts = {})
|
62
62
|
raise ArgumentError, 'Please specify a hash of options' unless opts.is_a?(Hash)
|
63
63
|
|
64
|
-
@options =
|
64
|
+
@options = Restforce.configuration.options.map do |option|
|
65
65
|
[option, Restforce.configuration.send(option)]
|
66
|
-
end
|
66
|
+
end.to_h
|
67
67
|
|
68
68
|
@options.merge! opts
|
69
69
|
yield builder if block_given?
|
data/lib/restforce/error_code.rb
CHANGED
@@ -17,8 +17,12 @@ module Restforce
|
|
17
17
|
|
18
18
|
class AlreadyInProcess < ResponseError; end
|
19
19
|
|
20
|
+
class ApexError < ResponseError; end
|
21
|
+
|
20
22
|
class ApiCurrentlyDisabled < ResponseError; end
|
21
23
|
|
24
|
+
class ApiDisabledForOrg < ResponseError; end
|
25
|
+
|
22
26
|
class AssigneeTypeRequired < ResponseError; end
|
23
27
|
|
24
28
|
class BadCustomEntityParentDomain < ResponseError; end
|
@@ -303,6 +307,8 @@ module Restforce
|
|
303
307
|
|
304
308
|
class MergeFailed < ResponseError; end
|
305
309
|
|
310
|
+
class MethodNotAllowed < ResponseError; end
|
311
|
+
|
306
312
|
class MissingArgument < ResponseError; end
|
307
313
|
|
308
314
|
class NonuniqueShippingAddress < ResponseError; end
|
@@ -396,7 +402,9 @@ module Restforce
|
|
396
402
|
ERROR_EXCEPTION_CLASSES = {
|
397
403
|
"ALL_OR_NONE_OPERATION_ROLLED_BACK" => AllOrNoneOperationRolledBack,
|
398
404
|
"ALREADY_IN_PROCESS" => AlreadyInProcess,
|
405
|
+
"APEX_ERROR" => ApexError,
|
399
406
|
"API_CURRENTLY_DISABLED" => ApiCurrentlyDisabled,
|
407
|
+
"API_DISABLED_FOR_ORG" => ApiDisabledForOrg,
|
400
408
|
"ASSIGNEE_TYPE_REQUIRED" => AssigneeTypeRequired,
|
401
409
|
"BAD_CUSTOM_ENTITY_PARENT_DOMAIN" => BadCustomEntityParentDomain,
|
402
410
|
"BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED" =>
|
@@ -548,6 +556,7 @@ module Restforce
|
|
548
556
|
"MAX_TM_RULES_EXCEEDED" => MaxTmRulesExceeded,
|
549
557
|
"MAX_TM_RULE_ITEMS_EXCEEDED" => MaxTmRuleItemsExceeded,
|
550
558
|
"MERGE_FAILED" => MergeFailed,
|
559
|
+
"METHOD_NOT_ALLOWED" => MethodNotAllowed,
|
551
560
|
"MISSING_ARGUMENT" => MissingArgument,
|
552
561
|
"NONUNIQUE_SHIPPING_ADDRESS" => NonuniqueShippingAddress,
|
553
562
|
"NO_APPLICABLE_PROCESS" => NoApplicableProcess,
|
@@ -20,9 +20,9 @@ module Restforce
|
|
20
20
|
def call(env)
|
21
21
|
debug('request') do
|
22
22
|
dump url: env[:url].to_s,
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
method: env[:method],
|
24
|
+
headers: env[:request_headers],
|
25
|
+
body: env[:body]
|
26
26
|
end
|
27
27
|
super
|
28
28
|
end
|
@@ -30,8 +30,8 @@ module Restforce
|
|
30
30
|
def on_complete(env)
|
31
31
|
debug('response') do
|
32
32
|
dump status: env[:status].to_s,
|
33
|
-
|
34
|
-
|
33
|
+
headers: env[:response_headers],
|
34
|
+
body: env[:body]
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
data/lib/restforce/version.rb
CHANGED
data/restforce.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |gem|
|
|
35
35
|
gem.add_development_dependency 'rspec', '~> 2.14.0'
|
36
36
|
gem.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
|
37
37
|
|
38
|
-
gem.add_development_dependency 'rubocop', '~> 1.
|
38
|
+
gem.add_development_dependency 'rubocop', '~> 1.17.0'
|
39
39
|
gem.add_development_dependency 'simplecov', '~> 0.21.2'
|
40
|
-
gem.add_development_dependency 'webmock', '~> 3.
|
40
|
+
gem.add_development_dependency 'webmock', '~> 3.13.0'
|
41
41
|
end
|
@@ -437,11 +437,11 @@ shared_examples_for Restforce::AbstractClient do
|
|
437
437
|
@query = stub_api_request('query\?q=SELECT%20some,%20fields%20FROM%20object').
|
438
438
|
with(headers: { 'Authorization' => "OAuth #{oauth_token}" }).
|
439
439
|
to_return(status: 401,
|
440
|
-
|
441
|
-
|
440
|
+
body: fixture('expired_session_response'),
|
441
|
+
headers: { 'Content-Type' => 'application/json' }).then.
|
442
442
|
to_return(status: 200,
|
443
|
-
|
444
|
-
|
443
|
+
body: fixture('sobject/query_success_response'),
|
444
|
+
headers: { 'Content-Type' => 'application/json' })
|
445
445
|
|
446
446
|
@login = stub_login_request(
|
447
447
|
with_body: "grant_type=password&client_id=client_id&client_secret=" \
|
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.6
|
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: 2021-
|
12
|
+
date: 2021-06-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -133,14 +133,14 @@ dependencies:
|
|
133
133
|
requirements:
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: 1.
|
136
|
+
version: 1.17.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: 1.
|
143
|
+
version: 1.17.0
|
144
144
|
- !ruby/object:Gem::Dependency
|
145
145
|
name: simplecov
|
146
146
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,14 +161,14 @@ dependencies:
|
|
161
161
|
requirements:
|
162
162
|
- - "~>"
|
163
163
|
- !ruby/object:Gem::Version
|
164
|
-
version: 3.
|
164
|
+
version: 3.13.0
|
165
165
|
type: :development
|
166
166
|
prerelease: false
|
167
167
|
version_requirements: !ruby/object:Gem::Requirement
|
168
168
|
requirements:
|
169
169
|
- - "~>"
|
170
170
|
- !ruby/object:Gem::Version
|
171
|
-
version: 3.
|
171
|
+
version: 3.13.0
|
172
172
|
description: A lightweight Ruby client for the Salesforce REST API
|
173
173
|
email:
|
174
174
|
- me@timrogers.co.uk
|
@@ -179,6 +179,7 @@ extra_rdoc_files: []
|
|
179
179
|
files:
|
180
180
|
- ".circleci/config.yml"
|
181
181
|
- ".github/ISSUE_TEMPLATE/unhandled-salesforce-error.md"
|
182
|
+
- ".github/dependabot.yml"
|
182
183
|
- ".gitignore"
|
183
184
|
- ".rubocop.yml"
|
184
185
|
- ".rubocop_todo.yml"
|