restforce 5.0.0 → 5.0.5
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 +4 -4
- data/CHANGELOG.md +31 -0
- data/CONTRIBUTING.md +20 -0
- data/Dockerfile +31 -0
- data/README.md +5 -2
- data/docker-compose.yml +7 -0
- data/lib/restforce/collection.rb +2 -2
- data/lib/restforce/concerns/picklists.rb +1 -1
- data/lib/restforce/concerns/streaming.rb +1 -3
- data/lib/restforce/config.rb +1 -1
- data/lib/restforce/error_code.rb +214 -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 +4 -3
- data/spec/unit/middleware/authentication_spec.rb +4 -0
- metadata +14 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38acae68870155f93e38df159915fc242a663d02a4dbb252bb294c51763842e5
|
4
|
+
data.tar.gz: eeae1f3c32d469a435121baa0c9857b222cffea7055b4b3b50c84854191a5950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e75731e44bfb826364edd12410a159d59a20c16865c4e6134736ec0ca83b06266cf8f5455772c92628fd092be94e4efb042951bbd6456865fc24d8cd2f7e3b80
|
7
|
+
data.tar.gz: af8a20544ea4f628a162d8038b8515ca2bd0333bd92f3796cbd19fcd713abfa46043395ee56a858ab5f2568b85e1961097269ac56fc29417633ead0dcbcd46f8
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1
|
+
## 5.0.5 (Feb 17, 2021)
|
2
|
+
|
3
|
+
* Handle the `CANNOT_EXECUTE_FLOW_TRIGGER` error returned by Salesforce (@almusavi, @timrogers)
|
4
|
+
|
5
|
+
## 5.0.4 (Jan 18, 2021)
|
6
|
+
|
7
|
+
* Handle the `INVALID_QUERY_LOCATOR` error returned by Salesforce
|
8
|
+
* Handle the `INVALID_OPERATION_WITH_EXPIRED_PASSWORD` error returned by Salesforce
|
9
|
+
* Handle the `FIELD_INTEGRITY_EXCEPTION` error returned by Salesforce
|
10
|
+
* Handle the `FORBIDDEN` error returned by Salesforce
|
11
|
+
* Handle the `ILLEGAL_QUERY_PARAMETER_VALUE` error returned by Salesforce
|
12
|
+
* Handle the `JSON_PARSER_ERROR` error returned by Salesforce
|
13
|
+
|
14
|
+
## 5.0.3 (Sep 8, 2020)
|
15
|
+
|
16
|
+
* Handle the undocumented `EXCEEDED_MAX_SEMIJOIN_SUBSELECTS` error returned by Salesforce (@embertel, @timrogers)
|
17
|
+
|
18
|
+
## 5.0.2 (Sep 6, 2020)
|
19
|
+
|
20
|
+
* Handle the undocumented `REQUEST_LIMIT_EXCEEDED` error returned by Salesforce (@wkirkby, @timrogers)
|
21
|
+
* Handle the undocumented `SERVER_UNAVAILABLE` error returned by Salesforce (@wkirkby, @timrogers)
|
22
|
+
* 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)
|
23
|
+
|
24
|
+
## 5.0.1 (Aug 13, 2020)
|
25
|
+
|
26
|
+
* Handle the undocumented `API_CURRENTLY_DISABLED` error returned by Salesforce (@ruipserra, @timrogers)
|
27
|
+
* Handle the undocumented `MALFORMED_QUERY` error returned by Salesforce (@scottserok, @timrogers)
|
28
|
+
* Handle the undocumented `INVALID_QUERY_FILTER_OPERATOR` error returned by Salesforce (@Dantemss, @timrogers)
|
29
|
+
* Add documentation and scripts for running the
|
30
|
+
library's tests using Docker (@ryansch)
|
31
|
+
|
1
32
|
## 5.0.0 (Jul 10, 2020)
|
2
33
|
|
3
34
|
For instructions on upgrading from Restforce 4.x to 5.x, see our ["Upgrading from Restforce 4.x to 5.x"](https://github.com/restforce/restforce/blob/master/UPGRADING.md) guide.
|
data/CONTRIBUTING.md
CHANGED
@@ -35,3 +35,23 @@ Some things that will increase the chance that your pull request is accepted:
|
|
35
35
|
* Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
36
36
|
|
37
37
|
*Adapted from [factory_bot_rails's CONTRIBUTING.md](https://github.com/thoughtbot/factory_bot_rails/blob/master/CONTRIBUTING.md).*
|
38
|
+
|
39
|
+
## Docker
|
40
|
+
|
41
|
+
If you'd rather use a docker container to run the tests, you can use the following instructions.
|
42
|
+
|
43
|
+
To set up the container image:
|
44
|
+
|
45
|
+
`docker-compose build --pull`
|
46
|
+
|
47
|
+
To run specs:
|
48
|
+
|
49
|
+
`docker-compose run --rm restforce rspec`
|
50
|
+
|
51
|
+
To run rubocop:
|
52
|
+
|
53
|
+
`docker-compose run --rm restforce rubocop`
|
54
|
+
|
55
|
+
To reset the bundler cache:
|
56
|
+
|
57
|
+
`docker-compose down -v`
|
data/Dockerfile
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
FROM ruby:2.6.5-alpine
|
2
|
+
|
3
|
+
RUN apk add --no-cache \
|
4
|
+
ca-certificates \
|
5
|
+
wget \
|
6
|
+
openssl \
|
7
|
+
bash \
|
8
|
+
build-base \
|
9
|
+
git \
|
10
|
+
sqlite-dev \
|
11
|
+
tzdata \
|
12
|
+
tini
|
13
|
+
|
14
|
+
ENV LANG en_US.UTF-8
|
15
|
+
ENV LANGUAGE en_US:en
|
16
|
+
ENV LC_ALL en_US.UTF-8
|
17
|
+
|
18
|
+
ENV BUNDLER_VERSION 2.1.4
|
19
|
+
RUN gem install bundler -v ${BUNDLER_VERSION} -i /usr/local/lib/ruby/gems/$(ls /usr/local/lib/ruby/gems) --force
|
20
|
+
|
21
|
+
WORKDIR /srv
|
22
|
+
|
23
|
+
COPY Gemfile restforce.gemspec /srv/
|
24
|
+
COPY lib/restforce/version.rb /srv/lib/restforce/version.rb
|
25
|
+
|
26
|
+
RUN bundle install
|
27
|
+
|
28
|
+
COPY . /srv/
|
29
|
+
|
30
|
+
ENTRYPOINT ["/sbin/tini", "-g", "--", "bundle", "exec"]
|
31
|
+
CMD ["rspec"]
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ Features include:
|
|
25
25
|
|
26
26
|
Add this line to your application's Gemfile:
|
27
27
|
|
28
|
-
gem 'restforce', '~> 5.0.
|
28
|
+
gem 'restforce', '~> 5.0.5'
|
29
29
|
|
30
30
|
And then execute:
|
31
31
|
|
@@ -37,7 +37,7 @@ Or install it yourself as:
|
|
37
37
|
|
38
38
|
__As of version 5.0.0, this gem is only compatible with Ruby 2.5.0 and later.__ If you're using an earlier Ruby version:
|
39
39
|
|
40
|
-
* for Ruby 2.4, use version 4.
|
40
|
+
* for Ruby 2.4, use version 4.3.0 or earlier
|
41
41
|
* for Ruby 2.3, use version 3.2.0 or earlier
|
42
42
|
* for Ruby versions 2.2, 2.1 and 2.0, use version 2.5.3 or earlier
|
43
43
|
* for Ruby 1.9.3, use version 2.4.2
|
@@ -333,8 +333,11 @@ client.update('Account', Id: '0016000000MRatd', Name: 'Whizbang Corp')
|
|
333
333
|
```ruby
|
334
334
|
# Update the record with external `External__c` external ID set to '12'
|
335
335
|
client.upsert('Account', 'External__c', External__c: 12, Name: 'Foobar')
|
336
|
+
# => true or "RecordId"
|
336
337
|
```
|
337
338
|
|
339
|
+
The upsert method will return the record Id if included in the response body from the Salesforce API; otherwise, it returns true. Currently the Salesforce API only returns the Id for newly created records.
|
340
|
+
|
338
341
|
### destroy
|
339
342
|
|
340
343
|
```ruby
|
data/docker-compose.yml
ADDED
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
|
@@ -95,9 +95,7 @@ module Restforce
|
|
95
95
|
|
96
96
|
def replay_id(channel)
|
97
97
|
handler = @replay_handlers[channel]
|
98
|
-
if handler.is_a?(Integer)
|
99
|
-
handler # treat it as a scalar
|
100
|
-
elsif handler.respond_to?(:[])
|
98
|
+
if handler.respond_to?(:[]) && !handler.is_a?(Integer)
|
101
99
|
# Ask for the latest replayId for this channel
|
102
100
|
handler[channel]
|
103
101
|
else
|
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
@@ -14,180 +14,381 @@ module Restforce
|
|
14
14
|
# It is possible that we will be missing some errors, so we will handle this in
|
15
15
|
# at least a semi-graceful manner.
|
16
16
|
class AllOrNoneOperationRolledBack < ResponseError; end
|
17
|
+
|
17
18
|
class AlreadyInProcess < ResponseError; end
|
19
|
+
|
20
|
+
class ApiCurrentlyDisabled < ResponseError; end
|
21
|
+
|
18
22
|
class AssigneeTypeRequired < ResponseError; end
|
23
|
+
|
19
24
|
class BadCustomEntityParentDomain < ResponseError; end
|
25
|
+
|
20
26
|
class BccNotAllowedIfBccComplianceEnabled < ResponseError; end
|
27
|
+
|
21
28
|
class BccSelfNotAllowedIfBccComplianceEnabled < ResponseError; end
|
29
|
+
|
22
30
|
class CannotCascadeProductActive < ResponseError; end
|
31
|
+
|
23
32
|
class CannotChangeFieldTypeOfApexReferencedField < ResponseError; end
|
33
|
+
|
24
34
|
class CannotCreateAnotherManagedPackage < ResponseError; end
|
35
|
+
|
25
36
|
class CannotDeactivateDivision < ResponseError; end
|
37
|
+
|
26
38
|
class CannotDeleteLastDatedConversionRate < ResponseError; end
|
39
|
+
|
27
40
|
class CannotDeleteManagedObject < ResponseError; end
|
41
|
+
|
28
42
|
class CannotDisableLastAdmin < ResponseError; end
|
43
|
+
|
29
44
|
class CannotEnableIpRestrictRequests < ResponseError; end
|
45
|
+
|
46
|
+
class CannotExecuteFlowTrigger < ResponseError; end
|
47
|
+
|
30
48
|
class CannotInsertUpdateActivateEntity < ResponseError; end
|
49
|
+
|
31
50
|
class CannotModifyManagedObject < ResponseError; end
|
51
|
+
|
32
52
|
class CannotRenameApexReferencedField < ResponseError; end
|
53
|
+
|
33
54
|
class CannotRenameApexReferencedObject < ResponseError; end
|
55
|
+
|
34
56
|
class CannotReparentRecord < ResponseError; end
|
57
|
+
|
35
58
|
class CannotResolveName < ResponseError; end
|
59
|
+
|
36
60
|
class CannotUpdateConvertedLead < ResponseError; end
|
61
|
+
|
37
62
|
class CantDisableCorpCurrency < ResponseError; end
|
63
|
+
|
38
64
|
class CantUnsetCorpCurrency < ResponseError; end
|
65
|
+
|
39
66
|
class ChildShareFailsParent < ResponseError; end
|
67
|
+
|
40
68
|
class CircularDependency < ResponseError; end
|
69
|
+
|
41
70
|
class CommunityNotAccessible < ResponseError; end
|
71
|
+
|
42
72
|
class CustomClobFieldLimitExceeded < ResponseError; end
|
73
|
+
|
43
74
|
class CustomEntityOrFieldLimit < ResponseError; end
|
75
|
+
|
44
76
|
class CustomFieldIndexLimitExceeded < ResponseError; end
|
77
|
+
|
45
78
|
class CustomIndexExists < ResponseError; end
|
79
|
+
|
46
80
|
class CustomLinkLimitExceeded < ResponseError; end
|
81
|
+
|
47
82
|
class CustomMetadataLimitExceeded < ResponseError; end
|
83
|
+
|
48
84
|
class CustomSettingsLimitExceeded < ResponseError; end
|
85
|
+
|
49
86
|
class CustomTabLimitExceeded < ResponseError; end
|
87
|
+
|
50
88
|
class DeleteFailed < ResponseError; end
|
89
|
+
|
51
90
|
class DependencyExists < ResponseError; end
|
91
|
+
|
52
92
|
class DuplicateCaseSolution < ResponseError; end
|
93
|
+
|
53
94
|
class DuplicateCustomEntityDefinition < ResponseError; end
|
95
|
+
|
54
96
|
class DuplicateCustomTabMotif < ResponseError; end
|
97
|
+
|
55
98
|
class DuplicateDeveloperName < ResponseError; end
|
99
|
+
|
56
100
|
class DuplicatesDetected < ResponseError; end
|
101
|
+
|
57
102
|
class DuplicateExternalId < ResponseError; end
|
103
|
+
|
58
104
|
class DuplicateMasterLabel < ResponseError; end
|
105
|
+
|
59
106
|
class DuplicateSenderDisplayName < ResponseError; end
|
107
|
+
|
60
108
|
class DuplicateUsername < ResponseError; end
|
109
|
+
|
61
110
|
class DuplicateValue < ResponseError; end
|
111
|
+
|
62
112
|
class EmailAddressBounced < ResponseError; end
|
113
|
+
|
63
114
|
class EmailNotProcessedDueToPriorError < ResponseError; end
|
115
|
+
|
64
116
|
class EmailOptedOut < ResponseError; end
|
117
|
+
|
65
118
|
class EmailTemplateFormulaError < ResponseError; end
|
119
|
+
|
66
120
|
class EmailTemplateMergefieldAccessError < ResponseError; end
|
121
|
+
|
67
122
|
class EmailTemplateMergefieldError < ResponseError; end
|
123
|
+
|
68
124
|
class EmailTemplateMergefieldValueError < ResponseError; end
|
125
|
+
|
69
126
|
class EmailTemplateProcessingError < ResponseError; end
|
127
|
+
|
70
128
|
class EmptyScontrolFileName < ResponseError; end
|
129
|
+
|
71
130
|
class EntityFailedIflastmodifiedOnUpdate < ResponseError; end
|
131
|
+
|
72
132
|
class EntityIsArchived < ResponseError; end
|
133
|
+
|
73
134
|
class EntityIsDeleted < ResponseError; end
|
135
|
+
|
74
136
|
class EntityIsLocked < ResponseError; end
|
137
|
+
|
75
138
|
class EnvironmentHubMembershipConflict < ResponseError; end
|
139
|
+
|
76
140
|
class ErrorInMailer < ResponseError; end
|
141
|
+
|
142
|
+
class ExceededMaxSemijoinSubselects < ResponseError; end
|
143
|
+
|
77
144
|
class FailedActivation < ResponseError; end
|
145
|
+
|
78
146
|
class FieldCustomValidationException < ResponseError; end
|
147
|
+
|
79
148
|
class FieldFilterValidationException < ResponseError; end
|
149
|
+
|
150
|
+
class FieldIntegrityException < ResponseError; end
|
151
|
+
|
80
152
|
class FilteredLookupLimitExceeded < ResponseError; end
|
153
|
+
|
154
|
+
class Forbidden < ResponseError; end
|
155
|
+
|
81
156
|
class HtmlFileUploadNotAllowed < ResponseError; end
|
157
|
+
|
158
|
+
class IllegalQueryParameterValue < ResponseError; end
|
159
|
+
|
82
160
|
class ImageTooLarge < ResponseError; end
|
161
|
+
|
83
162
|
class InactiveOwnerOrUser < ResponseError; end
|
163
|
+
|
84
164
|
class InsertUpdateDeleteNotAllowedDuringMaintenance < ResponseError; end
|
165
|
+
|
85
166
|
class InsufficientAccessOnCrossReferenceEntity < ResponseError; end
|
167
|
+
|
86
168
|
class InsufficientAccessOrReadonly < ResponseError; end
|
169
|
+
|
87
170
|
class InvalidAccessLevel < ResponseError; end
|
171
|
+
|
88
172
|
class InvalidArgumentType < ResponseError; end
|
173
|
+
|
89
174
|
class InvalidAssigneeType < ResponseError; end
|
175
|
+
|
90
176
|
class InvalidAssignmentRule < ResponseError; end
|
177
|
+
|
91
178
|
class InvalidBatchOperation < ResponseError; end
|
179
|
+
|
92
180
|
class InvalidContentType < ResponseError; end
|
181
|
+
|
93
182
|
class InvalidCreditCardInfo < ResponseError; end
|
183
|
+
|
94
184
|
class InvalidCrossReferenceKey < ResponseError; end
|
185
|
+
|
95
186
|
class InvalidCrossReferenceTypeForField < ResponseError; end
|
187
|
+
|
96
188
|
class InvalidCurrencyConvRate < ResponseError; end
|
189
|
+
|
97
190
|
class InvalidCurrencyCorpRate < ResponseError; end
|
191
|
+
|
98
192
|
class InvalidCurrencyIso < ResponseError; end
|
193
|
+
|
99
194
|
class InvalidEmailAddress < ResponseError; end
|
195
|
+
|
100
196
|
class InvalidEmptyKeyOwner < ResponseError; end
|
197
|
+
|
101
198
|
class InvalidEventSubscription < ResponseError; end
|
199
|
+
|
102
200
|
class InvalidField < ResponseError; end
|
201
|
+
|
103
202
|
class InvalidFieldForInsertUpdate < ResponseError; end
|
203
|
+
|
104
204
|
class InvalidFieldWhenUsingTemplate < ResponseError; end
|
205
|
+
|
105
206
|
class InvalidFilterAction < ResponseError; end
|
207
|
+
|
106
208
|
class InvalidIdField < ResponseError; end
|
209
|
+
|
107
210
|
class InvalidInetAddress < ResponseError; end
|
211
|
+
|
108
212
|
class InvalidLineitemCloneState < ResponseError; end
|
213
|
+
|
109
214
|
class InvalidMasterOrTranslatedSolution < ResponseError; end
|
215
|
+
|
110
216
|
class InvalidMessageIdReference < ResponseError; end
|
217
|
+
|
111
218
|
class InvalidOperation < ResponseError; end
|
219
|
+
|
220
|
+
class InvalidOperationWithExpiredPassword < ResponseError; end
|
221
|
+
|
112
222
|
class InvalidOperator < ResponseError; end
|
223
|
+
|
113
224
|
class InvalidOrNullForRestrictedPicklist < ResponseError; end
|
225
|
+
|
226
|
+
class InvalidQueryFilterOperator < ResponseError; end
|
227
|
+
|
228
|
+
class InvalidQueryLocator < ResponseError; end
|
229
|
+
|
114
230
|
class InvalidPartnerNetworkStatus < ResponseError; end
|
231
|
+
|
115
232
|
class InvalidPersonAccountOperation < ResponseError; end
|
233
|
+
|
116
234
|
class InvalidReadOnlyUserDml < ResponseError; end
|
235
|
+
|
117
236
|
class InvalidSaveAsActivityFlag < ResponseError; end
|
237
|
+
|
118
238
|
class InvalidSessionId < ResponseError; end
|
239
|
+
|
119
240
|
class InvalidStatus < ResponseError; end
|
241
|
+
|
120
242
|
class InvalidType < ResponseError; end
|
243
|
+
|
121
244
|
class InvalidTypeForOperation < ResponseError; end
|
245
|
+
|
122
246
|
class InvalidTypeOnFieldInRecord < ResponseError; end
|
247
|
+
|
123
248
|
class IpRangeLimitExceeded < ResponseError; end
|
249
|
+
|
124
250
|
class JigsawImportLimitExceeded < ResponseError; end
|
251
|
+
|
252
|
+
class JsonParserError < ResponseError; end
|
253
|
+
|
125
254
|
class LicenseLimitExceeded < ResponseError; end
|
255
|
+
|
126
256
|
class LightPortalUserException < ResponseError; end
|
257
|
+
|
127
258
|
class LimitExceeded < ResponseError; end
|
259
|
+
|
128
260
|
class LoginChallengeIssued < ResponseError; end
|
261
|
+
|
129
262
|
class LoginChallengePending < ResponseError; end
|
263
|
+
|
130
264
|
class LoginMustUseSecurityToken < ResponseError; end
|
265
|
+
|
131
266
|
class MalformedId < ResponseError; end
|
267
|
+
|
268
|
+
class MalformedQuery < ResponseError; end
|
269
|
+
|
132
270
|
class ManagerNotDefined < ResponseError; end
|
271
|
+
|
133
272
|
class MassmailRetryLimitExceeded < ResponseError; end
|
273
|
+
|
134
274
|
class MassMailLimitExceeded < ResponseError; end
|
275
|
+
|
135
276
|
class MaximumCcemailsExceeded < ResponseError; end
|
277
|
+
|
136
278
|
class MaximumDashboardComponentsExceeded < ResponseError; end
|
279
|
+
|
137
280
|
class MaximumHierarchyLevelsReached < ResponseError; end
|
281
|
+
|
138
282
|
class MaximumSizeOfAttachment < ResponseError; end
|
283
|
+
|
139
284
|
class MaximumSizeOfDocument < ResponseError; end
|
285
|
+
|
140
286
|
class MaxActionsPerRuleExceeded < ResponseError; end
|
287
|
+
|
141
288
|
class MaxActiveRulesExceeded < ResponseError; end
|
289
|
+
|
142
290
|
class MaxApprovalStepsExceeded < ResponseError; end
|
291
|
+
|
143
292
|
class MaxFormulasPerRuleExceeded < ResponseError; end
|
293
|
+
|
144
294
|
class MaxRulesExceeded < ResponseError; end
|
295
|
+
|
145
296
|
class MaxRuleEntriesExceeded < ResponseError; end
|
297
|
+
|
146
298
|
class MaxTaskDescriptionExceeded < ResponseError; end
|
299
|
+
|
147
300
|
class MaxTmRulesExceeded < ResponseError; end
|
301
|
+
|
148
302
|
class MaxTmRuleItemsExceeded < ResponseError; end
|
303
|
+
|
149
304
|
class MergeFailed < ResponseError; end
|
305
|
+
|
150
306
|
class MissingArgument < ResponseError; end
|
307
|
+
|
151
308
|
class NonuniqueShippingAddress < ResponseError; end
|
309
|
+
|
152
310
|
class NoApplicableProcess < ResponseError; end
|
311
|
+
|
153
312
|
class NoAttachmentPermission < ResponseError; end
|
313
|
+
|
154
314
|
class NoInactiveDivisionMembers < ResponseError; end
|
315
|
+
|
155
316
|
class NoMassMailPermission < ResponseError; end
|
317
|
+
|
156
318
|
class NumberOutsideValidRange < ResponseError; end
|
319
|
+
|
157
320
|
class NumHistoryFieldsBySobjectExceeded < ResponseError; end
|
321
|
+
|
158
322
|
class OpWithInvalidUserTypeException < ResponseError; end
|
323
|
+
|
159
324
|
class OptedOutOfMassMail < ResponseError; end
|
325
|
+
|
160
326
|
class PackageLicenseRequired < ResponseError; end
|
327
|
+
|
161
328
|
class PlatformEventEncryptionError < ResponseError; end
|
329
|
+
|
162
330
|
class PlatformEventPublishingUnavailable < ResponseError; end
|
331
|
+
|
163
332
|
class PlatformEventPublishFailed < ResponseError; end
|
333
|
+
|
164
334
|
class PortalUserAlreadyExistsForContact < ResponseError; end
|
335
|
+
|
165
336
|
class PrivateContactOnAsset < ResponseError; end
|
337
|
+
|
166
338
|
class RecordInUseByWorkflow < ResponseError; end
|
339
|
+
|
340
|
+
class RequestLimitExceeded < ResponseError; end
|
341
|
+
|
167
342
|
class RequestRunningTooLong < ResponseError; end
|
343
|
+
|
168
344
|
class RequiredFieldMissing < ResponseError; end
|
345
|
+
|
169
346
|
class SelfReferenceFromTrigger < ResponseError; end
|
347
|
+
|
348
|
+
class ServerUnavailable < ResponseError; end
|
349
|
+
|
170
350
|
class ShareNeededForChildOwner < ResponseError; end
|
351
|
+
|
171
352
|
class SingleEmailLimitExceeded < ResponseError; end
|
353
|
+
|
172
354
|
class StandardPriceNotDefined < ResponseError; end
|
355
|
+
|
173
356
|
class StorageLimitExceeded < ResponseError; end
|
357
|
+
|
174
358
|
class StringTooLong < ResponseError; end
|
359
|
+
|
175
360
|
class TabsetLimitExceeded < ResponseError; end
|
361
|
+
|
176
362
|
class TemplateNotActive < ResponseError; end
|
363
|
+
|
177
364
|
class TerritoryRealignInProgress < ResponseError; end
|
365
|
+
|
178
366
|
class TextDataOutsideSupportedCharset < ResponseError; end
|
367
|
+
|
179
368
|
class TooManyApexRequests < ResponseError; end
|
369
|
+
|
180
370
|
class TooManyEnumValue < ResponseError; end
|
371
|
+
|
181
372
|
class TransferRequiresRead < ResponseError; end
|
373
|
+
|
182
374
|
class UnableToLockRow < ResponseError; end
|
375
|
+
|
183
376
|
class UnavailableRecordtypeException < ResponseError; end
|
377
|
+
|
184
378
|
class UndeleteFailed < ResponseError; end
|
379
|
+
|
185
380
|
class UnknownException < ResponseError; end
|
381
|
+
|
186
382
|
class UnspecifiedEmailAddress < ResponseError; end
|
383
|
+
|
187
384
|
class UnsupportedApexTriggerOperation < ResponseError; end
|
385
|
+
|
188
386
|
class UnverifiedSenderAddress < ResponseError; end
|
387
|
+
|
189
388
|
class WeblinkSizeLimitExceeded < ResponseError; end
|
389
|
+
|
190
390
|
class WeblinkUrlInvalid < ResponseError; end
|
391
|
+
|
191
392
|
class WrongControllerType < ResponseError; end
|
192
393
|
|
193
394
|
# Maps `errorCode`s returned from Salesforce to the exception class
|
@@ -195,6 +396,7 @@ module Restforce
|
|
195
396
|
ERROR_EXCEPTION_CLASSES = {
|
196
397
|
"ALL_OR_NONE_OPERATION_ROLLED_BACK" => AllOrNoneOperationRolledBack,
|
197
398
|
"ALREADY_IN_PROCESS" => AlreadyInProcess,
|
399
|
+
"API_CURRENTLY_DISABLED" => ApiCurrentlyDisabled,
|
198
400
|
"ASSIGNEE_TYPE_REQUIRED" => AssigneeTypeRequired,
|
199
401
|
"BAD_CUSTOM_ENTITY_PARENT_DOMAIN" => BadCustomEntityParentDomain,
|
200
402
|
"BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED" =>
|
@@ -211,6 +413,7 @@ module Restforce
|
|
211
413
|
"CANNOT_DELETE_MANAGED_OBJECT" => CannotDeleteManagedObject,
|
212
414
|
"CANNOT_DISABLE_LAST_ADMIN" => CannotDisableLastAdmin,
|
213
415
|
"CANNOT_ENABLE_IP_RESTRICT_REQUESTS" => CannotEnableIpRestrictRequests,
|
416
|
+
"CANNOT_EXECUTE_FLOW_TRIGGER" => CannotExecuteFlowTrigger,
|
214
417
|
"CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY" => CannotInsertUpdateActivateEntity,
|
215
418
|
"CANNOT_MODIFY_MANAGED_OBJECT" => CannotModifyManagedObject,
|
216
419
|
"CANNOT_RENAME_APEX_REFERENCED_FIELD" => CannotRenameApexReferencedField,
|
@@ -260,11 +463,15 @@ module Restforce
|
|
260
463
|
"ENTITY_IS_LOCKED" => EntityIsLocked,
|
261
464
|
"ENVIRONMENT_HUB_MEMBERSHIP_CONFLICT" => EnvironmentHubMembershipConflict,
|
262
465
|
"ERROR_IN_MAILER" => ErrorInMailer,
|
466
|
+
"EXCEEDED_MAX_SEMIJOIN_SUBSELECTS" => ExceededMaxSemijoinSubselects,
|
263
467
|
"FAILED_ACTIVATION" => FailedActivation,
|
264
468
|
"FIELD_CUSTOM_VALIDATION_EXCEPTION" => FieldCustomValidationException,
|
265
469
|
"FIELD_FILTER_VALIDATION_EXCEPTION" => FieldFilterValidationException,
|
470
|
+
"FIELD_INTEGRITY_EXCEPTION" => FieldIntegrityException,
|
266
471
|
"FILTERED_LOOKUP_LIMIT_EXCEEDED" => FilteredLookupLimitExceeded,
|
472
|
+
"FORBIDDEN" => Forbidden,
|
267
473
|
"HTML_FILE_UPLOAD_NOT_ALLOWED" => HtmlFileUploadNotAllowed,
|
474
|
+
"ILLEGAL_QUERY_PARAMETER_VALUE" => IllegalQueryParameterValue,
|
268
475
|
"IMAGE_TOO_LARGE" => ImageTooLarge,
|
269
476
|
"INACTIVE_OWNER_OR_USER" => InactiveOwnerOrUser,
|
270
477
|
"INSERT_UPDATE_DELETE_NOT_ALLOWED_DURING_MAINTENANCE" =>
|
@@ -297,9 +504,12 @@ module Restforce
|
|
297
504
|
"INVALID_MASTER_OR_TRANSLATED_SOLUTION" => InvalidMasterOrTranslatedSolution,
|
298
505
|
"INVALID_MESSAGE_ID_REFERENCE" => InvalidMessageIdReference,
|
299
506
|
"INVALID_OPERATION" => InvalidOperation,
|
507
|
+
"INVALID_OPERATION_WITH_EXPIRED_PASSWORD" => InvalidOperationWithExpiredPassword,
|
300
508
|
"INVALID_OPERATOR" => InvalidOperator,
|
301
509
|
"INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST" =>
|
302
510
|
InvalidOrNullForRestrictedPicklist,
|
511
|
+
"INVALID_QUERY_FILTER_OPERATOR" => InvalidQueryFilterOperator,
|
512
|
+
"INVALID_QUERY_LOCATOR" => InvalidQueryLocator,
|
303
513
|
"INVALID_PARTNER_NETWORK_STATUS" => InvalidPartnerNetworkStatus,
|
304
514
|
"INVALID_PERSON_ACCOUNT_OPERATION" => InvalidPersonAccountOperation,
|
305
515
|
"INVALID_READ_ONLY_USER_DML" => InvalidReadOnlyUserDml,
|
@@ -311,6 +521,7 @@ module Restforce
|
|
311
521
|
"INVALID_TYPE_ON_FIELD_IN_RECORD" => InvalidTypeOnFieldInRecord,
|
312
522
|
"IP_RANGE_LIMIT_EXCEEDED" => IpRangeLimitExceeded,
|
313
523
|
"JIGSAW_IMPORT_LIMIT_EXCEEDED" => JigsawImportLimitExceeded,
|
524
|
+
"JSON_PARSER_ERROR" => JsonParserError,
|
314
525
|
"LICENSE_LIMIT_EXCEEDED" => LicenseLimitExceeded,
|
315
526
|
"LIGHT_PORTAL_USER_EXCEPTION" => LightPortalUserException,
|
316
527
|
"LIMIT_EXCEEDED" => LimitExceeded,
|
@@ -318,6 +529,7 @@ module Restforce
|
|
318
529
|
"LOGIN_CHALLENGE_PENDING" => LoginChallengePending,
|
319
530
|
"LOGIN_MUST_USE_SECURITY_TOKEN" => LoginMustUseSecurityToken,
|
320
531
|
"MALFORMED_ID" => MalformedId,
|
532
|
+
"MALFORMED_QUERY" => MalformedQuery,
|
321
533
|
"MANAGER_NOT_DEFINED" => ManagerNotDefined,
|
322
534
|
"MASSMAIL_RETRY_LIMIT_EXCEEDED" => MassmailRetryLimitExceeded,
|
323
535
|
"MASS_MAIL_LIMIT_EXCEEDED" => MassMailLimitExceeded,
|
@@ -353,9 +565,11 @@ module Restforce
|
|
353
565
|
"PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT" => PortalUserAlreadyExistsForContact,
|
354
566
|
"PRIVATE_CONTACT_ON_ASSET" => PrivateContactOnAsset,
|
355
567
|
"RECORD_IN_USE_BY_WORKFLOW" => RecordInUseByWorkflow,
|
568
|
+
"REQUEST_LIMIT_EXCEEDED" => RequestLimitExceeded,
|
356
569
|
"REQUEST_RUNNING_TOO_LONG" => RequestRunningTooLong,
|
357
570
|
"REQUIRED_FIELD_MISSING" => RequiredFieldMissing,
|
358
571
|
"SELF_REFERENCE_FROM_TRIGGER" => SelfReferenceFromTrigger,
|
572
|
+
"SERVER_UNAVAILABLE" => ServerUnavailable,
|
359
573
|
"SHARE_NEEDED_FOR_CHILD_OWNER" => ShareNeededForChildOwner,
|
360
574
|
"SINGLE_EMAIL_LIMIT_EXCEEDED" => SingleEmailLimitExceeded,
|
361
575
|
"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,8 @@ 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
|
-
|
38
|
-
gem.add_development_dependency '
|
39
|
-
gem.add_development_dependency '
|
37
|
+
|
38
|
+
gem.add_development_dependency 'rubocop', '~> 1.9.1'
|
39
|
+
gem.add_development_dependency 'simplecov', '~> 0.21.2'
|
40
|
+
gem.add_development_dependency 'webmock', '~> 3.11.1'
|
40
41
|
end
|
@@ -8,7 +8,9 @@ describe Restforce::Middleware::Authentication do
|
|
8
8
|
proxy_uri: 'https://not-a-real-site.com',
|
9
9
|
authentication_retries: retries,
|
10
10
|
adapter: :net_http,
|
11
|
+
# rubocop:disable Naming/VariableNumber
|
11
12
|
ssl: { version: :TLSv1_2 } }
|
13
|
+
# rubocop:enable Naming/VariableNumber
|
12
14
|
end
|
13
15
|
|
14
16
|
describe '.authenticate!' do
|
@@ -88,7 +90,9 @@ describe Restforce::Middleware::Authentication do
|
|
88
90
|
end
|
89
91
|
|
90
92
|
it "should have SSL config set" do
|
93
|
+
# rubocop:disable Naming/VariableNumber
|
91
94
|
connection.ssl[:version].should eq(:TLSv1_2)
|
95
|
+
# rubocop:enable Naming/VariableNumber
|
92
96
|
end
|
93
97
|
end
|
94
98
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Rogers
|
8
8
|
- Eric J. Holmes
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-02-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -133,42 +133,42 @@ dependencies:
|
|
133
133
|
requirements:
|
134
134
|
- - "~>"
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
136
|
+
version: 1.9.1
|
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:
|
143
|
+
version: 1.9.1
|
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.21.2
|
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.21.2
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
159
|
name: webmock
|
160
160
|
requirement: !ruby/object:Gem::Requirement
|
161
161
|
requirements:
|
162
162
|
- - "~>"
|
163
163
|
- !ruby/object:Gem::Version
|
164
|
-
version: 3.
|
164
|
+
version: 3.11.1
|
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.11.1
|
172
172
|
description: A lightweight Ruby client for the Salesforce REST API
|
173
173
|
email:
|
174
174
|
- me@timrogers.co.uk
|
@@ -185,12 +185,14 @@ files:
|
|
185
185
|
- CHANGELOG.md
|
186
186
|
- CODE_OF_CONDUCT.md
|
187
187
|
- CONTRIBUTING.md
|
188
|
+
- Dockerfile
|
188
189
|
- Gemfile
|
189
190
|
- Guardfile
|
190
191
|
- LICENSE
|
191
192
|
- README.md
|
192
193
|
- Rakefile
|
193
194
|
- UPGRADING.md
|
195
|
+
- docker-compose.yml
|
194
196
|
- lib/restforce.rb
|
195
197
|
- lib/restforce/abstract_client.rb
|
196
198
|
- lib/restforce/attachment.rb
|
@@ -317,7 +319,7 @@ licenses:
|
|
317
319
|
metadata:
|
318
320
|
source_code_uri: https://github.com/restforce/restforce
|
319
321
|
changelog_uri: https://github.com/restforce/restforce/blob/master/CHANGELOG.md
|
320
|
-
post_install_message:
|
322
|
+
post_install_message:
|
321
323
|
rdoc_options: []
|
322
324
|
require_paths:
|
323
325
|
- lib
|
@@ -332,8 +334,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
332
334
|
- !ruby/object:Gem::Version
|
333
335
|
version: '0'
|
334
336
|
requirements: []
|
335
|
-
rubygems_version: 3.
|
336
|
-
signing_key:
|
337
|
+
rubygems_version: 3.2.5
|
338
|
+
signing_key:
|
337
339
|
specification_version: 4
|
338
340
|
summary: A lightweight Ruby client for the Salesforce REST API
|
339
341
|
test_files:
|