Skip to content

Releases: trayio/threadneedle

REST support in global SOAP configuration

15 Feb 13:54
Compare
Choose a tag to compare
  • a method can be set to type: 'REST' while the global configuration is SOAP
  • none of the global configurations are inherited/processed for these methods

Migrate to using trayio/needle

08 Jul 13:59
247dba8
Compare
Choose a tag to compare
  • Needle dependency changed to use @trayio/needle

v1.13.0

29 Mar 16:37
39e7b9d
Compare
Choose a tag to compare

Error messages have been updated to include method name when the config passed in fails validation.

Logging and Method Function bugfix

08 Jun 10:31
54382e1
Compare
Choose a tag to compare
  • Threadneedle can now perform request flow logging normally done when NODE_ENV=development is set, by now using a dedicated environment flag THREADNEEDLE_ENABLE_LOGS=true
  • Function Methods had a bug where if they were non-async and threw an error, the error was not caught and formatted in the expected format by Threadneedle. This is now fixed.

v1.11.0

21 Jan 18:55
Compare
Choose a tag to compare
  • type flag has been introduced, while there is now a deprecation warning for the soap flag
  • the method property in REST configuration now accepts both mustaching and function
    • an error will be thrown if this doesn't resolve to a valid HTTP verb
  • url in REST configuration can now be an empty string (which assumes baseUrl is the endpoint)
    • if the complete URL resolves to an empty string, an error will be thrown
  • smartSubstitution is now exposed via require('@trayio/threadneedle/smartSubstitution'); for external usage

Patch: global before/beforeRequest modification should be passed on

01 Oct 16:43
Compare
Choose a tag to compare

A bug in the logic prevented the modified respective objects of the global before/beforeRequest from being passed on, if the method before/beforeRequest were functions which did not modify and therefore returned undefined, due the reference object being reused in this situation.

This is now fixed by updating the reference object if an object is returned, since at this point the explicitly returned object should passed on.

Patch: old reference behaviour is maintained outside of development mode

12 Sep 19:51
Compare
Choose a tag to compare

When run outside of development mode, the old reference behaviour for before and beforeRequest is maintained (but a console warning will still be logged).
An error will still be thrown in development mode for methods run which fail the check.

Deprecation of modification by reference

12 Sep 11:12
Compare
Choose a tag to compare

Main change (potentially breaking)

before and beforeRequest will now require their respective objects (params and request) to be returned if any modifications are to be passed on, instead of allowing modification by reference without having to return them.
This will throw an error in development mode, otherwise a console warning will be logged instead.

Other changes

  • url in global configuration will now invoke the same deprecation behaviour (error in development mode, console warn otherwise), in favour of baseUrl.
  • afterHeaders will check if the returned value is an object, (error in development mode, console warn otherwise).

Hash parameter support in Substitution

13 Aug 12:07
Compare
Choose a tag to compare

Substitution will now first detect if the parameters specified in the template begin with hash (#), and will render these with separately with dedicated logic, instead of allowing Mustache's specific behaviour of sections for hash parameters.

Check globals flag first before invoking global logic

28 Jun 17:58
Compare
Choose a tag to compare

This update gets the logic behind individual properties for REST and SOAP methods to first check the globals flag, before invoking the associated global logic/function.

  • If globals is false, then only the logic associated with the local/method is invoked.
  • If globals is true, then the execution order is maintained as before, i.e. global logic is invoked first, followed by local/method logic.