- Add support for
faraday
v2.5.x and v2.6.x (@marcrohloff, @timrogers)
This version contains breaking changes. For help with upgrading, see UPGRADING.md
.
⚠️ Drop support for Ruby 2.6, since Ruby 2.6 has reached its end-of-life (@timrogers)⚠️ Drop compatability withfaraday
versions beforev1.1.0
(@timrogers)- Add support for
faraday
versionsv2.0.0
onwards (@timrogers)
This version was also released as v6.0.0.rc.1
on Aug 4 2022.
- Handle the
EXCEEDED_ID_LIMIT
error returned by the Salesforce API (@timrogers, @yashshah1)
- Add support for Faraday v1.9.x and v1.10.0 (@magni-, @timrogers)
- Follow redirects during authentication to support Lightning URLs (e.g.
*.lightning.force.com
instead of*.my.salesforce.com
) (@nhocki)
- Fix
Restforce::Collection#size
for Salesforce APIs that use thesize
property to return the total number of results, instead oftotalSize
(@kwong-yw)
- Add official support for Ruby 3.1 (@timrogers)
- Fix handling of responses from the Composite API (@robob27)
- Fix dependencies to correctly declare that the gem doesn't work with faraday
v1.9.0
or later (@timrogers)
- Handle the
MALFORMED_SEARCH
error returned by Salesforce (@timrogers)
- Handle the
OPERATION_TOO_LARGE
error returned by Salesforce (@timrogers) - Handle the
INVALID_SIGNUP_COUNTRY
error returned by Salesforce (@timrogers)
- Add support for Salesforce's Composite API and Composite Batch API (@meenie, @amacdougall)
- Improve the performance of counting numbers of query results with
Restforce::Collection#count
, avoiding unnecessary API requests (@jhass)
- Handle the
INVALID_REPLICATION_DATE
error returned by Salesforce (@michaelwnyc) - Handle the
BIG_OBJECT_UNSUPPORTED_OPERATION
error returned by Salesforce (@remon)
- Add official support for Ruby 3.0 (@timrogers)
- Drop support for Ruby 2.5, which has reached end-of-life (@timrogers)
- Handle the
QUERY_TIMEOUT
error returned by Salesforce (@timrogers) - Remove unnecessary development dependencies for the gem, which can just be in the project's
Gemfile
(@timrogers)
- Handle the
API_DISABLED_FOR_ORG
error returned by Salesforce (@cmac) - Handle the
METHOD_NOT_ALLOWED
error returned by Salesforce (@timrogers) - Handle the
APEX_ERROR
error returned by Salesforce (@timrogers)
- Handle the
CANNOT_EXECUTE_FLOW_TRIGGER
error returned by Salesforce (@almusavi, @timrogers)
- Handle the
INVALID_QUERY_LOCATOR
error returned by Salesforce - Handle the
INVALID_OPERATION_WITH_EXPIRED_PASSWORD
error returned by Salesforce - Handle the
FIELD_INTEGRITY_EXCEPTION
error returned by Salesforce - Handle the
FORBIDDEN
error returned by Salesforce - Handle the
ILLEGAL_QUERY_PARAMETER_VALUE
error returned by Salesforce - Handle the
JSON_PARSER_ERROR
error returned by Salesforce
- Handle the undocumented
EXCEEDED_MAX_SEMIJOIN_SUBSELECTS
error returned by Salesforce (@embertel, @timrogers)
- Handle the undocumented
REQUEST_LIMIT_EXCEEDED
error returned by Salesforce (@wkirkby, @timrogers) - Handle the undocumented
SERVER_UNAVAILABLE
error returned by Salesforce (@wkirkby, @timrogers) - 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)
- Handle the undocumented
API_CURRENTLY_DISABLED
error returned by Salesforce (@ruipserra, @timrogers) - Handle the undocumented
MALFORMED_QUERY
error returned by Salesforce (@scottserok, @timrogers) - Handle the undocumented
INVALID_QUERY_FILTER_OPERATOR
error returned by Salesforce (@Dantemss, @timrogers) - Add documentation and scripts for running the library's tests using Docker (@ryansch)
For instructions on upgrading from Restforce 4.x to 5.x, see our "Upgrading from Restforce 4.x to 5.x" guide.
⚠️ Define exception classes for Salesforce errors up-front instead of dynamically at runtime, running the risk that we might miss some errors which should be defined. If any errors are missed, they will be added in patch versions (e.g.5.0.1
). For more details on this change, see the "Upgrading from Restforce 4.x to 5.x" guide (@presidentbeef, @timrogers).⚠️ Deprecate support for Ruby 2.4, since Ruby 2.4 reached its end-of-life in April 2020 (@timrogers)⚠️ Change the ancestry ofRestforce::UnauthorizedError
so it inherits fromFaraday::ClientError
, notRestforce::Error
. This breaking change was required to expose the response body returned by the API as part of this error - see the non-breaking changes entry below for further details (@michaldbianchi).
- Add support for
lostisland/faraday
v1.x, whilst maintaining support for v0.9.x (@ryansch) - Add
#empty?
method toRestforce::Collection
, returning whether they are any items in a collection (@bubaflub) - Allow opting-in to caching on a per-call basis with
Restforce::Client#with_caching
(@swaincreates) - Expose the response body from Salesforce on
Restforce::UnauthorizedError
andRestforce::NotFoundError
(@michaeldbianchi) - Remove the unnecessary depending on the
json
gem, which has been part of the Ruby standard library since v1.9 (@vonTronje)
- Fix
NoMethodError: undefined method '[]' for nil:NilClass
error when generating objects to return (@apurkiss)
- Handle empty response bodies returned with authentication errors (@sylvandor)
- Fix Faraday deprecation warning in newer Faraday versions (
v0.17.1
onwards) caused by inheriting from a deprecated class
- Add support for platform events, CDC, generic events, etc. in the Streaming API (@nathanKramer)
- Add support for JWT authentication (@nathanKramer, @tagCincy)
- Deprecate support for Ruby 2.3, since Ruby 2.3 reached its end-of-life in March 2019. (This is the only breaking change included in this version.)
- Add support for the Batch API (@gaiottino, @teoulas)
- Return specific exceptions for errors that might be returned from Salesforce.com - instead of getting a generic
Faraday::Error::ClientError
, you might get something like aRestforce::EntityTooLargeError
(@boblail) - Expose the full response in exceptions' messages to make debugging easier (@boblail)
- Properly escape IDs with spaces in them when working with existing records (@pushups)
- Add support for replaying missed messages when using the Salesforce Streaming API (@andreimaxim, @drteeth, @panozzaj)
- Fix
NoMethodError
when upserting an existing record (@opti)
- Deprecate support for Ruby 2.0, 2.1 and 2.2, since even Ruby 2.2 reached its end-of-life in June 2018. (This is the only breaking change included in this version.)
- Fix
NoMethodError
when trying to upsert a record using aFixnum
as the external ID (@AlexandruCD) - Escape record IDs passed in to the client to identify records to find, delete, etc. (@jmdx)
- Stop relying on our middleware for Gzip compression if you're using
httpclient
, since Faraday enables this automatically usinghttpclient
's built-in support (@shivanshgaur) - Fix
get_updated
andget_deleted
API calls by removing the erroneous leading forward slash from the path (@scottolsen) - Fix unpacking of dependent picklist options (@parkm)
See the v2
branch for this release.
- Escape record IDs passed in to the client to identify records to find, delete, etc. (@jmdx, @apanzerj)
- Raise an error where a custom external ID field name is supplied to
upsert
andupsert!
, but it is missing from the provided attributes (@velveret) - Use the Restforce client's configured SSL options for authentication requests (@jvdp)
- Fix bug where
upsert
andupsert!
mutate the provided attributes, previously fixed in v1.5.3 (@velveret)
- Ensure
Restforce::Middleware::Logger
is the last Faraday middleware to be called so everything is properly logged (including the effects of theGzip
andCustomHeaders
middlewares which were previously running after it) (@jonnymacs) - Suppress Hashie warnings when using Hashie v3.5.0 or later (see #295 for details) (@janraasch)
- Allow setting custom headers, required by parts of the Salesforce API, by specifiying a
:request_headers
option when instantiating the client (@moskeyombus) - Add support for
upsert
ing using an ID (see the Salesforce docs for more details) (@ecbypi) - Relax
faraday
dependency to allow upgrading to Faraday 1.0 (@tinogomes, @alexluke)
(This should have been a minor version rather than a patch version, following format MAJOR.MINOR.PATCH, since we use Semantic Versioning and this adds functionality. Sorry! @timrogers)
- Deprecate support for Ruby 1.9, since official support was dropped nearly two years ago, and it's causing problems with keeping our dependencies up to date
- Securely hash Salesforce credentials used in cache keys, so they aren't stored in the clear (@atmos)
- Relax
json
dependency for users of Ruby 2.0.0 onwards to allow a much wider range of versions (@timrogers, with thanks to @ccutrer and @janraasch)
- Added support for pre-released versions of Ruby 2.4.0 by relaxing the
json
gem dependency (@timrogers, with thanks to @ccutrer)
- Added ability to download documents attached to records, behaving like attachments (@jhelbig)
- Allow the Salesforce API version to be specified with a
SALESFORCE_API_VERSION
environment variable (@jhelbig)
- Added support for
get_deleted
call (@adambird)
(This should have been a minor version rather than a patch version, following format MAJOR.MINOR.PATCH, since we use Semantic Versioning and this adds functionality. Sorry! @timrogers)
- Raise a
Faraday::Error::ClientError
for300
responses triggered by a conflicting external ID, providing access to the response, which contains an array of the conflicting IDs (@timrogers, @michaelminter) - Improve the consistency of
Faraday::Error::ClientError
s raised, so they all have a message with the same format (@timrogers)
- Raise a
Restforce::ServerError
when Salesforce responds with a500
due to an internal error (@greysteil) - Improving handling of response body in errors (@kuono)
- Always parse the JSON response before errors are raised to improve exceptions (@kouno)
- Added support for
get_updated
call (@web-connect) - Respect Faraday adapter option in authentication middleware (@stenlarsson)
- Added support for
query_all
,explain
andlimits
API calls (which require a newerapi_version
than the default of 26.0) (@theSteveMitchell, @zenchild) - Added support for
recent
API call (@davebrace) - Changed
PROXY_URI
environment variable toSALESFORCE_PROXY_URI
(with warning toSTDOUT
if the old variable is set) (@timrogers) - Implemented
version_guard
inRestforce::Concerns::API
to standardise behaviour of API calls which require a particular version of the Salesforce API (@zenchild) - Fixed bug with construction of
Faraday::Error::ClientError
exceptions (@debussyman) - Added support for specifying SSL options to be passed to Faraday (@jonathanrico)
- Added support for specifying a custom logger and log level (@ilyakatz)
- Improved experience for contributors to the gem with bootstrapping process (@rafalchmiel)
- Drop support for versions of Ruby earlier than 1.9.3, which were end-of-lifed long ago
- Take advantages of Ruby 1.9.3 syntax, and drop old Ruby 1.8 shims
- Enforce code style with Rubocop
- Fixed a bug with
update!
andupsert!
mutating provided attributes (@timrogers) - Added note about thread safety to
README.md
(@epbarger) - Improved documentation for
select
inREADME.md
(@theSteveMitchell) - Tweaked and improved consistency of
README.md
(@timrogers) - Pass through blocks given to
Restforce.new
(@jxa) - Add
#page_size
toRestforce::Collection
(@theSteveMitchell)
- Better autopagination performance #141 @th7
- Looser restrictions on hashie gem #123 @zenchild
- Upgrade faraday dependency to 0.9 #124 @zenchild
- Fixed a bug with HTTP 413 responses #75 @patronmanager
- Added support for the tooling API.
- Fixed a bug with EMSynchrony adapter.
- Added proxy support.
- Added support for lazily traversing paginated collections #61 by @nahiluhmot.
- Added support for proxies #60 by @wazoo.
-
Added ability to download attachments easily.
Example
attachment = client.query('select Id, Name, Body from Attachment').first File.open(attachment.Name, 'wb') { |f| f.write(attachment.Body) }
-
Added
url
method.Example
# Url to a record id client.url('0013000000rRz') # => https://na1.salesforce.com/0013000000rRz # Url to an object that responds to `to_sparam` record = Struct.new(:to_sparam).new('0013000000rRz') client.url('0013000000rRz') # => https://na1.salesforce.com/0013000000rRz
-
Added
picklist_values
method.Example
client.picklist_values('Account', 'Type') client.picklist_values('Automobile__c', 'Model__c', :valid_for => 'Honda')
-
Added CHANGELOG.md
-
Restforce::Client#inspect
now only prints out the options and not the Faraday connection. -
The Faraday adapter is now configurabled:
Example:
Restforce.configure do |config| config.adapter = :excon end
-
The http connection read/open timeout is now configurabled.
Example:
Restforce.configure do |config| config.timeout = 300 end
- Fixed typo in method call.
- Minor cleanup.
- Moved decoding of signed requests into it's own class.
username
,password
,security_token
,client_id
andclient_secret
options now obtain defaults from environment variables.- Add
head
verb.
- Default api version changed from 24.0 to 26.0.
- Fixed tests for streaming api to work with latest versions of faye.
- Added .find method to obtain all fields from an sobject.