Releases: ordercloud-api/ordercloud-javascript-sdk
Releases · ordercloud-api/ordercloud-javascript-sdk
add requestType to requestOptions and miscellaneous
New Features ✨
- Provide a value that can be used to identify the type of request. Useful for error logs.
- export OrderCloudError class
- use cjs module for main which is better for nodejs environemnts
Refactor ♻️
- set default timeout to 60 seconds
Fix: post/put/patch calls broken
Fix Bug(s) 🐛
- post/put/patch calls not getting token set
Feedback from beta users
New Feature(s) ✨
- You can use axios interceptors to intercept a request before it goes out to the API or to intercept a response before it gets handled by the SDK. This enables you to log, rewrite, or even retry calls.
- Add
Searchable<T>andSortable<T>typescript helpers that quickly give you searchable types by endpoint. For exampleSearchable<'Orders.List'>will give you the model expected forsearchOnandSortable<'Orders.List'>will give you the model
Bug Fixes 🐛
requestOptions.cancelTokennot working on non-auth methods- post methods that did not have a body weren't working (Orders.Submit for example)
- type errors when using filters
- document breaking changes
handle auth errors, add enum models, and enrich comments
New Features(s) ✨
- Add better comments to operations for better developer experiences. Includes summary, description, and link to api reference for the specific operation. If the IDE supports it (like vscode) you'll also see this information as you're typing.
- Add enum models. These were previously "inline" enums that were referenced as properties of another model. Now these models exist and can be imported on their own. This includes
ApiRoleandOrderDirectionto name a few
Bug Fixes 🐛
- update
OrderCloudErrorto handle auth errors. The schema for these types of errors is slightly different and wasn't being handled correctly. Now you can get themessageanderrorsfrom the exception just like you can for API errors.
:sparkles: Add cancel token and more
New Features ✨
- add axios CancelToken support
- add prefix cookie option
- add custom ordercloud error
Bugs 🐛
- fix return value on tokens
- fix return value on auth service
Fix post/put/patch calls failing
Not sending axios the correct body parameter
bind "this" for all class methods
this ensures "this" is never lost if context changes
ensure response model properties always exist and fix auth bug
Fixed Bugs 🐛
grant_typewas incorrect for elevated login as well as client credentials auth methods- response model properties are now typed to always exist since we know the API always returns a well-formed response. This wasn't true for nested properties because the built in typescript helper
Requiredonly went one level deep. We are now using a custom typeRequiredDeepthat accounts for nested properties as well.
Bug fixes and improvements
Fixes:
- error parsing jwt on server
- list calls fail if no options provided
Improvements
- Add options for cookies
- domain
- secure
- samesite
- add eslint to project
- add unit tests for server
- add helpeful error message when axios isn't loaded
Alpha Release V4
4.0.0-1 :bookmark: v4.0.0-1 alpha release