Skip to content

9.0.0

Choose a tag to compare

@oschwald oschwald released this 29 Jun 19:49
Immutable release. Only release title and notes can be modified.
29de693
  • Breaking Dropped support for Node.js 18 and 20. The minimum supported version is
    now 22.
  • Breaking Dropped commonjs support. The package is now only available as an ES module.
  • Breaking Errors from the web service client are now thrown as
    WebServiceError instances, which extend Error, rather than as plain
    objects. The code, error, status, and url properties are preserved,
    so existing field access continues to work, but the thrown value is now an
    Error. The original error is now preserved as the standard cause
    property (for example, the network error behind a FETCH_ERROR). The
    WebServiceError and ArgumentError classes and the WebServiceClientError
    type are now exported from the package.
  • Breaking The WebServiceClient constructor now takes an options object as
    its third argument ({ timeout, host, fetcher }) instead of positional
    timeout and host arguments. For backward compatibility a number may still
    be passed and is treated as the timeout; callers that passed host
    positionally must change to { host }, and passing a fourth positional
    argument now throws an ArgumentError rather than being silently ignored. The
    new fetcher option accepts a custom fetch implementation, useful for
    routing requests through a proxy or custom dispatcher, or for testing. The
    WebServiceClientOptions type is exported from the package.
  • The code property on WebServiceError and the WebServiceClientError
    interface is now typed as WebServiceErrorCode
    (ClientErrorCode | (string & {})) instead of string, providing
    autocompletion for the client-generated codes while still accepting any code
    returned by the web service. The ClientErrorCode and WebServiceErrorCode
    types are exported from the package.
  • ArgumentError now accepts an optional cause and forwards it to Error.
  • customInputs on Transaction may now be provided as a plain object mapping
    keys to values, in addition to an array of CustomInput instances.
  • Removed the validator dependency. Email and domain validation now use
    built-in regex helpers, and the order referrer URI is validated with the
    URL constructor (restricted to http/https). Validation of a few
    uncommon email edge cases may differ slightly.
  • Fixed a bug where serializing a Transaction (e.g. when sending a request)
    mutated the Billing, Shipping, CreditCard, and Order objects passed
    to it.
  • Added the input /device/tracking_token. This is the token generated by
    the Device Tracking Add-on
    for explicit device linking. You may provide this by providing
    trackingToken to Device.
  • Added FatZebra to the Processor enum.
  • Added CLEAR to the Tag enum for use with the Report Transaction API.