restforce 5.0.1 → 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 +29 -0
- data/README.md +2 -2
- data/lib/restforce/collection.rb +2 -2
- data/lib/restforce/concerns/base.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 +217 -0
- data/lib/restforce/mash.rb +7 -2
- data/lib/restforce/middleware.rb +2 -0
- data/lib/restforce/middleware/logger.rb +8 -7
- data/lib/restforce/version.rb +1 -1
- data/restforce.gemspec +4 -3
- data/spec/integration/abstract_client_spec.rb +4 -4
- data/spec/unit/middleware/authentication_spec.rb +4 -0
- metadata +13 -12
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,32 @@
|
|
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
|
+
|
7
|
+
## 5.0.5 (Feb 17, 2021)
|
8
|
+
|
9
|
+
* Handle the `CANNOT_EXECUTE_FLOW_TRIGGER` error returned by Salesforce (@almusavi, @timrogers)
|
10
|
+
|
11
|
+
## 5.0.4 (Jan 18, 2021)
|
12
|
+
|
13
|
+
* Handle the `INVALID_QUERY_LOCATOR` error returned by Salesforce
|
14
|
+
* Handle the `INVALID_OPERATION_WITH_EXPIRED_PASSWORD` error returned by Salesforce
|
15
|
+
* Handle the `FIELD_INTEGRITY_EXCEPTION` error returned by Salesforce
|
16
|
+
* Handle the `FORBIDDEN` error returned by Salesforce
|
17
|
+
* Handle the `ILLEGAL_QUERY_PARAMETER_VALUE` error returned by Salesforce
|
18
|
+
* Handle the `JSON_PARSER_ERROR` error returned by Salesforce
|
19
|
+
|
20
|
+
## 5.0.3 (Sep 8, 2020)
|
21
|
+
|
22
|
+
* Handle the undocumented `EXCEEDED_MAX_SEMIJOIN_SUBSELECTS` error returned by Salesforce (@embertel, @timrogers)
|
23
|
+
|
24
|
+
## 5.0.2 (Sep 6, 2020)
|
25
|
+
|
26
|
+
* Handle the undocumented `REQUEST_LIMIT_EXCEEDED` error returned by Salesforce (@wkirkby, @timrogers)
|
27
|
+
* Handle the undocumented `SERVER_UNAVAILABLE` error returned by Salesforce (@wkirkby, @timrogers)
|
28
|
+
* 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)
|
29
|
+
|
1
30
|
## 5.0.1 (Aug 13, 2020)
|
2
31
|
|
3
32
|
* Handle the undocumented `API_CURRENTLY_DISABLED` error returned by Salesforce (@ruipserra, @timrogers)
|
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.6'
|
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
|
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
|
@@ -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?
|
@@ -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,183 +14,387 @@ 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 ApexError < ResponseError; end
|
21
|
+
|
18
22
|
class ApiCurrentlyDisabled < ResponseError; end
|
23
|
+
|
24
|
+
class ApiDisabledForOrg < ResponseError; end
|
25
|
+
|
19
26
|
class AssigneeTypeRequired < ResponseError; end
|
27
|
+
|
20
28
|
class BadCustomEntityParentDomain < ResponseError; end
|
29
|
+
|
21
30
|
class BccNotAllowedIfBccComplianceEnabled < ResponseError; end
|
31
|
+
|
22
32
|
class BccSelfNotAllowedIfBccComplianceEnabled < ResponseError; end
|
33
|
+
|
23
34
|
class CannotCascadeProductActive < ResponseError; end
|
35
|
+
|
24
36
|
class CannotChangeFieldTypeOfApexReferencedField < ResponseError; end
|
37
|
+
|
25
38
|
class CannotCreateAnotherManagedPackage < ResponseError; end
|
39
|
+
|
26
40
|
class CannotDeactivateDivision < ResponseError; end
|
41
|
+
|
27
42
|
class CannotDeleteLastDatedConversionRate < ResponseError; end
|
43
|
+
|
28
44
|
class CannotDeleteManagedObject < ResponseError; end
|
45
|
+
|
29
46
|
class CannotDisableLastAdmin < ResponseError; end
|
47
|
+
|
30
48
|
class CannotEnableIpRestrictRequests < ResponseError; end
|
49
|
+
|
50
|
+
class CannotExecuteFlowTrigger < ResponseError; end
|
51
|
+
|
31
52
|
class CannotInsertUpdateActivateEntity < ResponseError; end
|
53
|
+
|
32
54
|
class CannotModifyManagedObject < ResponseError; end
|
55
|
+
|
33
56
|
class CannotRenameApexReferencedField < ResponseError; end
|
57
|
+
|
34
58
|
class CannotRenameApexReferencedObject < ResponseError; end
|
59
|
+
|
35
60
|
class CannotReparentRecord < ResponseError; end
|
61
|
+
|
36
62
|
class CannotResolveName < ResponseError; end
|
63
|
+
|
37
64
|
class CannotUpdateConvertedLead < ResponseError; end
|
65
|
+
|
38
66
|
class CantDisableCorpCurrency < ResponseError; end
|
67
|
+
|
39
68
|
class CantUnsetCorpCurrency < ResponseError; end
|
69
|
+
|
40
70
|
class ChildShareFailsParent < ResponseError; end
|
71
|
+
|
41
72
|
class CircularDependency < ResponseError; end
|
73
|
+
|
42
74
|
class CommunityNotAccessible < ResponseError; end
|
75
|
+
|
43
76
|
class CustomClobFieldLimitExceeded < ResponseError; end
|
77
|
+
|
44
78
|
class CustomEntityOrFieldLimit < ResponseError; end
|
79
|
+
|
45
80
|
class CustomFieldIndexLimitExceeded < ResponseError; end
|
81
|
+
|
46
82
|
class CustomIndexExists < ResponseError; end
|
83
|
+
|
47
84
|
class CustomLinkLimitExceeded < ResponseError; end
|
85
|
+
|
48
86
|
class CustomMetadataLimitExceeded < ResponseError; end
|
87
|
+
|
49
88
|
class CustomSettingsLimitExceeded < ResponseError; end
|
89
|
+
|
50
90
|
class CustomTabLimitExceeded < ResponseError; end
|
91
|
+
|
51
92
|
class DeleteFailed < ResponseError; end
|
93
|
+
|
52
94
|
class DependencyExists < ResponseError; end
|
95
|
+
|
53
96
|
class DuplicateCaseSolution < ResponseError; end
|
97
|
+
|
54
98
|
class DuplicateCustomEntityDefinition < ResponseError; end
|
99
|
+
|
55
100
|
class DuplicateCustomTabMotif < ResponseError; end
|
101
|
+
|
56
102
|
class DuplicateDeveloperName < ResponseError; end
|
103
|
+
|
57
104
|
class DuplicatesDetected < ResponseError; end
|
105
|
+
|
58
106
|
class DuplicateExternalId < ResponseError; end
|
107
|
+
|
59
108
|
class DuplicateMasterLabel < ResponseError; end
|
109
|
+
|
60
110
|
class DuplicateSenderDisplayName < ResponseError; end
|
111
|
+
|
61
112
|
class DuplicateUsername < ResponseError; end
|
113
|
+
|
62
114
|
class DuplicateValue < ResponseError; end
|
115
|
+
|
63
116
|
class EmailAddressBounced < ResponseError; end
|
117
|
+
|
64
118
|
class EmailNotProcessedDueToPriorError < ResponseError; end
|
119
|
+
|
65
120
|
class EmailOptedOut < ResponseError; end
|
121
|
+
|
66
122
|
class EmailTemplateFormulaError < ResponseError; end
|
123
|
+
|
67
124
|
class EmailTemplateMergefieldAccessError < ResponseError; end
|
125
|
+
|
68
126
|
class EmailTemplateMergefieldError < ResponseError; end
|
127
|
+
|
69
128
|
class EmailTemplateMergefieldValueError < ResponseError; end
|
129
|
+
|
70
130
|
class EmailTemplateProcessingError < ResponseError; end
|
131
|
+
|
71
132
|
class EmptyScontrolFileName < ResponseError; end
|
133
|
+
|
72
134
|
class EntityFailedIflastmodifiedOnUpdate < ResponseError; end
|
135
|
+
|
73
136
|
class EntityIsArchived < ResponseError; end
|
137
|
+
|
74
138
|
class EntityIsDeleted < ResponseError; end
|
139
|
+
|
75
140
|
class EntityIsLocked < ResponseError; end
|
141
|
+
|
76
142
|
class EnvironmentHubMembershipConflict < ResponseError; end
|
143
|
+
|
77
144
|
class ErrorInMailer < ResponseError; end
|
145
|
+
|
146
|
+
class ExceededMaxSemijoinSubselects < ResponseError; end
|
147
|
+
|
78
148
|
class FailedActivation < ResponseError; end
|
149
|
+
|
79
150
|
class FieldCustomValidationException < ResponseError; end
|
151
|
+
|
80
152
|
class FieldFilterValidationException < ResponseError; end
|
153
|
+
|
154
|
+
class FieldIntegrityException < ResponseError; end
|
155
|
+
|
81
156
|
class FilteredLookupLimitExceeded < ResponseError; end
|
157
|
+
|
158
|
+
class Forbidden < ResponseError; end
|
159
|
+
|
82
160
|
class HtmlFileUploadNotAllowed < ResponseError; end
|
161
|
+
|
162
|
+
class IllegalQueryParameterValue < ResponseError; end
|
163
|
+
|
83
164
|
class ImageTooLarge < ResponseError; end
|
165
|
+
|
84
166
|
class InactiveOwnerOrUser < ResponseError; end
|
167
|
+
|
85
168
|
class InsertUpdateDeleteNotAllowedDuringMaintenance < ResponseError; end
|
169
|
+
|
86
170
|
class InsufficientAccessOnCrossReferenceEntity < ResponseError; end
|
171
|
+
|
87
172
|
class InsufficientAccessOrReadonly < ResponseError; end
|
173
|
+
|
88
174
|
class InvalidAccessLevel < ResponseError; end
|
175
|
+
|
89
176
|
class InvalidArgumentType < ResponseError; end
|
177
|
+
|
90
178
|
class InvalidAssigneeType < ResponseError; end
|
179
|
+
|
91
180
|
class InvalidAssignmentRule < ResponseError; end
|
181
|
+
|
92
182
|
class InvalidBatchOperation < ResponseError; end
|
183
|
+
|
93
184
|
class InvalidContentType < ResponseError; end
|
185
|
+
|
94
186
|
class InvalidCreditCardInfo < ResponseError; end
|
187
|
+
|
95
188
|
class InvalidCrossReferenceKey < ResponseError; end
|
189
|
+
|
96
190
|
class InvalidCrossReferenceTypeForField < ResponseError; end
|
191
|
+
|
97
192
|
class InvalidCurrencyConvRate < ResponseError; end
|
193
|
+
|
98
194
|
class InvalidCurrencyCorpRate < ResponseError; end
|
195
|
+
|
99
196
|
class InvalidCurrencyIso < ResponseError; end
|
197
|
+
|
100
198
|
class InvalidEmailAddress < ResponseError; end
|
199
|
+
|
101
200
|
class InvalidEmptyKeyOwner < ResponseError; end
|
201
|
+
|
102
202
|
class InvalidEventSubscription < ResponseError; end
|
203
|
+
|
103
204
|
class InvalidField < ResponseError; end
|
205
|
+
|
104
206
|
class InvalidFieldForInsertUpdate < ResponseError; end
|
207
|
+
|
105
208
|
class InvalidFieldWhenUsingTemplate < ResponseError; end
|
209
|
+
|
106
210
|
class InvalidFilterAction < ResponseError; end
|
211
|
+
|
107
212
|
class InvalidIdField < ResponseError; end
|
213
|
+
|
108
214
|
class InvalidInetAddress < ResponseError; end
|
215
|
+
|
109
216
|
class InvalidLineitemCloneState < ResponseError; end
|
217
|
+
|
110
218
|
class InvalidMasterOrTranslatedSolution < ResponseError; end
|
219
|
+
|
111
220
|
class InvalidMessageIdReference < ResponseError; end
|
221
|
+
|
112
222
|
class InvalidOperation < ResponseError; end
|
223
|
+
|
224
|
+
class InvalidOperationWithExpiredPassword < ResponseError; end
|
225
|
+
|
113
226
|
class InvalidOperator < ResponseError; end
|
227
|
+
|
114
228
|
class InvalidOrNullForRestrictedPicklist < ResponseError; end
|
229
|
+
|
115
230
|
class InvalidQueryFilterOperator < ResponseError; end
|
231
|
+
|
232
|
+
class InvalidQueryLocator < ResponseError; end
|
233
|
+
|
116
234
|
class InvalidPartnerNetworkStatus < ResponseError; end
|
235
|
+
|
117
236
|
class InvalidPersonAccountOperation < ResponseError; end
|
237
|
+
|
118
238
|
class InvalidReadOnlyUserDml < ResponseError; end
|
239
|
+
|
119
240
|
class InvalidSaveAsActivityFlag < ResponseError; end
|
241
|
+
|
120
242
|
class InvalidSessionId < ResponseError; end
|
243
|
+
|
121
244
|
class InvalidStatus < ResponseError; end
|
245
|
+
|
122
246
|
class InvalidType < ResponseError; end
|
247
|
+
|
123
248
|
class InvalidTypeForOperation < ResponseError; end
|
249
|
+
|
124
250
|
class InvalidTypeOnFieldInRecord < ResponseError; end
|
251
|
+
|
125
252
|
class IpRangeLimitExceeded < ResponseError; end
|
253
|
+
|
126
254
|
class JigsawImportLimitExceeded < ResponseError; end
|
255
|
+
|
256
|
+
class JsonParserError < ResponseError; end
|
257
|
+
|
127
258
|
class LicenseLimitExceeded < ResponseError; end
|
259
|
+
|
128
260
|
class LightPortalUserException < ResponseError; end
|
261
|
+
|
129
262
|
class LimitExceeded < ResponseError; end
|
263
|
+
|
130
264
|
class LoginChallengeIssued < ResponseError; end
|
265
|
+
|
131
266
|
class LoginChallengePending < ResponseError; end
|
267
|
+
|
132
268
|
class LoginMustUseSecurityToken < ResponseError; end
|
269
|
+
|
133
270
|
class MalformedId < ResponseError; end
|
271
|
+
|
134
272
|
class MalformedQuery < ResponseError; end
|
273
|
+
|
135
274
|
class ManagerNotDefined < ResponseError; end
|
275
|
+
|
136
276
|
class MassmailRetryLimitExceeded < ResponseError; end
|
277
|
+
|
137
278
|
class MassMailLimitExceeded < ResponseError; end
|
279
|
+
|
138
280
|
class MaximumCcemailsExceeded < ResponseError; end
|
281
|
+
|
139
282
|
class MaximumDashboardComponentsExceeded < ResponseError; end
|
283
|
+
|
140
284
|
class MaximumHierarchyLevelsReached < ResponseError; end
|
285
|
+
|
141
286
|
class MaximumSizeOfAttachment < ResponseError; end
|
287
|
+
|
142
288
|
class MaximumSizeOfDocument < ResponseError; end
|
289
|
+
|
143
290
|
class MaxActionsPerRuleExceeded < ResponseError; end
|
291
|
+
|
144
292
|
class MaxActiveRulesExceeded < ResponseError; end
|
293
|
+
|
145
294
|
class MaxApprovalStepsExceeded < ResponseError; end
|
295
|
+
|
146
296
|
class MaxFormulasPerRuleExceeded < ResponseError; end
|
297
|
+
|
147
298
|
class MaxRulesExceeded < ResponseError; end
|
299
|
+
|
148
300
|
class MaxRuleEntriesExceeded < ResponseError; end
|
301
|
+
|
149
302
|
class MaxTaskDescriptionExceeded < ResponseError; end
|
303
|
+
|
150
304
|
class MaxTmRulesExceeded < ResponseError; end
|
305
|
+
|
151
306
|
class MaxTmRuleItemsExceeded < ResponseError; end
|
307
|
+
|
152
308
|
class MergeFailed < ResponseError; end
|
309
|
+
|
310
|
+
class MethodNotAllowed < ResponseError; end
|
311
|
+
|
153
312
|
class MissingArgument < ResponseError; end
|
313
|
+
|
154
314
|
class NonuniqueShippingAddress < ResponseError; end
|
315
|
+
|
155
316
|
class NoApplicableProcess < ResponseError; end
|
317
|
+
|
156
318
|
class NoAttachmentPermission < ResponseError; end
|
319
|
+
|
157
320
|
class NoInactiveDivisionMembers < ResponseError; end
|
321
|
+
|
158
322
|
class NoMassMailPermission < ResponseError; end
|
323
|
+
|
159
324
|
class NumberOutsideValidRange < ResponseError; end
|
325
|
+
|
160
326
|
class NumHistoryFieldsBySobjectExceeded < ResponseError; end
|
327
|
+
|
161
328
|
class OpWithInvalidUserTypeException < ResponseError; end
|
329
|
+
|
162
330
|
class OptedOutOfMassMail < ResponseError; end
|
331
|
+
|
163
332
|
class PackageLicenseRequired < ResponseError; end
|
333
|
+
|
164
334
|
class PlatformEventEncryptionError < ResponseError; end
|
335
|
+
|
165
336
|
class PlatformEventPublishingUnavailable < ResponseError; end
|
337
|
+
|
166
338
|
class PlatformEventPublishFailed < ResponseError; end
|
339
|
+
|
167
340
|
class PortalUserAlreadyExistsForContact < ResponseError; end
|
341
|
+
|
168
342
|
class PrivateContactOnAsset < ResponseError; end
|
343
|
+
|
169
344
|
class RecordInUseByWorkflow < ResponseError; end
|
345
|
+
|
346
|
+
class RequestLimitExceeded < ResponseError; end
|
347
|
+
|
170
348
|
class RequestRunningTooLong < ResponseError; end
|
349
|
+
|
171
350
|
class RequiredFieldMissing < ResponseError; end
|
351
|
+
|
172
352
|
class SelfReferenceFromTrigger < ResponseError; end
|
353
|
+
|
354
|
+
class ServerUnavailable < ResponseError; end
|
355
|
+
|
173
356
|
class ShareNeededForChildOwner < ResponseError; end
|
357
|
+
|
174
358
|
class SingleEmailLimitExceeded < ResponseError; end
|
359
|
+
|
175
360
|
class StandardPriceNotDefined < ResponseError; end
|
361
|
+
|
176
362
|
class StorageLimitExceeded < ResponseError; end
|
363
|
+
|
177
364
|
class StringTooLong < ResponseError; end
|
365
|
+
|
178
366
|
class TabsetLimitExceeded < ResponseError; end
|
367
|
+
|
179
368
|
class TemplateNotActive < ResponseError; end
|
369
|
+
|
180
370
|
class TerritoryRealignInProgress < ResponseError; end
|
371
|
+
|
181
372
|
class TextDataOutsideSupportedCharset < ResponseError; end
|
373
|
+
|
182
374
|
class TooManyApexRequests < ResponseError; end
|
375
|
+
|
183
376
|
class TooManyEnumValue < ResponseError; end
|
377
|
+
|
184
378
|
class TransferRequiresRead < ResponseError; end
|
379
|
+
|
185
380
|
class UnableToLockRow < ResponseError; end
|
381
|
+
|
186
382
|
class UnavailableRecordtypeException < ResponseError; end
|
383
|
+
|
187
384
|
class UndeleteFailed < ResponseError; end
|
385
|
+
|
188
386
|
class UnknownException < ResponseError; end
|
387
|
+
|
189
388
|
class UnspecifiedEmailAddress < ResponseError; end
|
389
|
+
|
190
390
|
class UnsupportedApexTriggerOperation < ResponseError; end
|
391
|
+
|
191
392
|
class UnverifiedSenderAddress < ResponseError; end
|
393
|
+
|
192
394
|
class WeblinkSizeLimitExceeded < ResponseError; end
|
395
|
+
|
193
396
|
class WeblinkUrlInvalid < ResponseError; end
|
397
|
+
|
194
398
|
class WrongControllerType < ResponseError; end
|
195
399
|
|
196
400
|
# Maps `errorCode`s returned from Salesforce to the exception class
|
@@ -198,7 +402,9 @@ module Restforce
|
|
198
402
|
ERROR_EXCEPTION_CLASSES = {
|
199
403
|
"ALL_OR_NONE_OPERATION_ROLLED_BACK" => AllOrNoneOperationRolledBack,
|
200
404
|
"ALREADY_IN_PROCESS" => AlreadyInProcess,
|
405
|
+
"APEX_ERROR" => ApexError,
|
201
406
|
"API_CURRENTLY_DISABLED" => ApiCurrentlyDisabled,
|
407
|
+
"API_DISABLED_FOR_ORG" => ApiDisabledForOrg,
|
202
408
|
"ASSIGNEE_TYPE_REQUIRED" => AssigneeTypeRequired,
|
203
409
|
"BAD_CUSTOM_ENTITY_PARENT_DOMAIN" => BadCustomEntityParentDomain,
|
204
410
|
"BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED" =>
|
@@ -215,6 +421,7 @@ module Restforce
|
|
215
421
|
"CANNOT_DELETE_MANAGED_OBJECT" => CannotDeleteManagedObject,
|
216
422
|
"CANNOT_DISABLE_LAST_ADMIN" => CannotDisableLastAdmin,
|
217
423
|
"CANNOT_ENABLE_IP_RESTRICT_REQUESTS" => CannotEnableIpRestrictRequests,
|
424
|
+
"CANNOT_EXECUTE_FLOW_TRIGGER" => CannotExecuteFlowTrigger,
|
218
425
|
"CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY" => CannotInsertUpdateActivateEntity,
|
219
426
|
"CANNOT_MODIFY_MANAGED_OBJECT" => CannotModifyManagedObject,
|
220
427
|
"CANNOT_RENAME_APEX_REFERENCED_FIELD" => CannotRenameApexReferencedField,
|
@@ -264,11 +471,15 @@ module Restforce
|
|
264
471
|
"ENTITY_IS_LOCKED" => EntityIsLocked,
|
265
472
|
"ENVIRONMENT_HUB_MEMBERSHIP_CONFLICT" => EnvironmentHubMembershipConflict,
|
266
473
|
"ERROR_IN_MAILER" => ErrorInMailer,
|
474
|
+
"EXCEEDED_MAX_SEMIJOIN_SUBSELECTS" => ExceededMaxSemijoinSubselects,
|
267
475
|
"FAILED_ACTIVATION" => FailedActivation,
|
268
476
|
"FIELD_CUSTOM_VALIDATION_EXCEPTION" => FieldCustomValidationException,
|
269
477
|
"FIELD_FILTER_VALIDATION_EXCEPTION" => FieldFilterValidationException,
|
478
|
+
"FIELD_INTEGRITY_EXCEPTION" => FieldIntegrityException,
|
270
479
|
"FILTERED_LOOKUP_LIMIT_EXCEEDED" => FilteredLookupLimitExceeded,
|
480
|
+
"FORBIDDEN" => Forbidden,
|
271
481
|
"HTML_FILE_UPLOAD_NOT_ALLOWED" => HtmlFileUploadNotAllowed,
|
482
|
+
"ILLEGAL_QUERY_PARAMETER_VALUE" => IllegalQueryParameterValue,
|
272
483
|
"IMAGE_TOO_LARGE" => ImageTooLarge,
|
273
484
|
"INACTIVE_OWNER_OR_USER" => InactiveOwnerOrUser,
|
274
485
|
"INSERT_UPDATE_DELETE_NOT_ALLOWED_DURING_MAINTENANCE" =>
|
@@ -301,10 +512,12 @@ module Restforce
|
|
301
512
|
"INVALID_MASTER_OR_TRANSLATED_SOLUTION" => InvalidMasterOrTranslatedSolution,
|
302
513
|
"INVALID_MESSAGE_ID_REFERENCE" => InvalidMessageIdReference,
|
303
514
|
"INVALID_OPERATION" => InvalidOperation,
|
515
|
+
"INVALID_OPERATION_WITH_EXPIRED_PASSWORD" => InvalidOperationWithExpiredPassword,
|
304
516
|
"INVALID_OPERATOR" => InvalidOperator,
|
305
517
|
"INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST" =>
|
306
518
|
InvalidOrNullForRestrictedPicklist,
|
307
519
|
"INVALID_QUERY_FILTER_OPERATOR" => InvalidQueryFilterOperator,
|
520
|
+
"INVALID_QUERY_LOCATOR" => InvalidQueryLocator,
|
308
521
|
"INVALID_PARTNER_NETWORK_STATUS" => InvalidPartnerNetworkStatus,
|
309
522
|
"INVALID_PERSON_ACCOUNT_OPERATION" => InvalidPersonAccountOperation,
|
310
523
|
"INVALID_READ_ONLY_USER_DML" => InvalidReadOnlyUserDml,
|
@@ -316,6 +529,7 @@ module Restforce
|
|
316
529
|
"INVALID_TYPE_ON_FIELD_IN_RECORD" => InvalidTypeOnFieldInRecord,
|
317
530
|
"IP_RANGE_LIMIT_EXCEEDED" => IpRangeLimitExceeded,
|
318
531
|
"JIGSAW_IMPORT_LIMIT_EXCEEDED" => JigsawImportLimitExceeded,
|
532
|
+
"JSON_PARSER_ERROR" => JsonParserError,
|
319
533
|
"LICENSE_LIMIT_EXCEEDED" => LicenseLimitExceeded,
|
320
534
|
"LIGHT_PORTAL_USER_EXCEPTION" => LightPortalUserException,
|
321
535
|
"LIMIT_EXCEEDED" => LimitExceeded,
|
@@ -342,6 +556,7 @@ module Restforce
|
|
342
556
|
"MAX_TM_RULES_EXCEEDED" => MaxTmRulesExceeded,
|
343
557
|
"MAX_TM_RULE_ITEMS_EXCEEDED" => MaxTmRuleItemsExceeded,
|
344
558
|
"MERGE_FAILED" => MergeFailed,
|
559
|
+
"METHOD_NOT_ALLOWED" => MethodNotAllowed,
|
345
560
|
"MISSING_ARGUMENT" => MissingArgument,
|
346
561
|
"NONUNIQUE_SHIPPING_ADDRESS" => NonuniqueShippingAddress,
|
347
562
|
"NO_APPLICABLE_PROCESS" => NoApplicableProcess,
|
@@ -359,9 +574,11 @@ module Restforce
|
|
359
574
|
"PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT" => PortalUserAlreadyExistsForContact,
|
360
575
|
"PRIVATE_CONTACT_ON_ASSET" => PrivateContactOnAsset,
|
361
576
|
"RECORD_IN_USE_BY_WORKFLOW" => RecordInUseByWorkflow,
|
577
|
+
"REQUEST_LIMIT_EXCEEDED" => RequestLimitExceeded,
|
362
578
|
"REQUEST_RUNNING_TOO_LONG" => RequestRunningTooLong,
|
363
579
|
"REQUIRED_FIELD_MISSING" => RequiredFieldMissing,
|
364
580
|
"SELF_REFERENCE_FROM_TRIGGER" => SelfReferenceFromTrigger,
|
581
|
+
"SERVER_UNAVAILABLE" => ServerUnavailable,
|
365
582
|
"SHARE_NEEDED_FOR_CHILD_OWNER" => ShareNeededForChildOwner,
|
366
583
|
"SINGLE_EMAIL_LIMIT_EXCEEDED" => SingleEmailLimitExceeded,
|
367
584
|
"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
|
|
@@ -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,13 +30,14 @@ 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
|
|
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.17.0'
|
39
|
+
gem.add_development_dependency 'simplecov', '~> 0.21.2'
|
40
|
+
gem.add_development_dependency 'webmock', '~> 3.13.0'
|
40
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=" \
|
@@ -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.6
|
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-06-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.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:
|
143
|
+
version: 1.17.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.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.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"
|
@@ -319,7 +320,7 @@ licenses:
|
|
319
320
|
metadata:
|
320
321
|
source_code_uri: https://github.com/restforce/restforce
|
321
322
|
changelog_uri: https://github.com/restforce/restforce/blob/master/CHANGELOG.md
|
322
|
-
post_install_message:
|
323
|
+
post_install_message:
|
323
324
|
rdoc_options: []
|
324
325
|
require_paths:
|
325
326
|
- lib
|
@@ -334,8 +335,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
334
335
|
- !ruby/object:Gem::Version
|
335
336
|
version: '0'
|
336
337
|
requirements: []
|
337
|
-
rubygems_version: 3.
|
338
|
-
signing_key:
|
338
|
+
rubygems_version: 3.2.5
|
339
|
+
signing_key:
|
339
340
|
specification_version: 4
|
340
341
|
summary: A lightweight Ruby client for the Salesforce REST API
|
341
342
|
test_files:
|