All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Level one options capability. See #38 by @ryanblenis
- Method
getPositions()
to client. See #40 by @kevinsherman - Optional fields, positions and orders, to
getAccount()
andgetAccounts()
.
- [Breaking] Return error response body instead of AxiosError. See #27 by @marknokes
- Missing
frequency
jsdoc property ingetPriceHistory()
.
frequencyType
jsdoc property values ingetPriceHistory()
. Thank you @kevinsherman!
- Jsdoc comments everywhere 🎉.
- API documentation. See API.md.
- Script to generate API documentation from jsdoc comments.
- Script to generate type declarations from jsdoc comments.
- Dev dependencies:
- @rollup/plugin-babel: 5.2.3
- @rollup/plugin-commonjs: 17.1.0
- @rollup/plugin-json: 4.1.0
- @rollup/plugin-node-resolve: 11.1.1
- @types/ws: 7.4.0
- eslint-plugin-jsdoc: 31.6.0
- jsdoc: 3.6.6
- jsdoc-to-markdown: 6.0.1
- jsdoc-ts-utils: 1.1.2
- change-case: 4.1.2
- Rewired a lot of parts of the api client to allow for a cleaner file structure. Everything works just as before with
the exception of
TDAccount
andTDStreamer
interfaces, which have been moved back to the main module. - Improved type declarations. See index.d.ts.
- Fixed browser distribution.
- Fixed bug with
td.streamer()
not being able to retrieveuserPrincipals
correctly when enabling the full axios response option. Thanks to @kjanoudi for catching this! - Moved
debug
package fromdevDependencies
todependencies
. - Bump
ws
from 7.4.2 to 7.4.3
- Rollup dev dependency to build a browser distribution. See
dist/index.min.js
.
- Bump
axios
from 0.19.2 to 0.21.1 - Bump
axios-mock-adapter
from 1.18.2 to 1.19.0 - Bump
debug
from 4.2.0 to 4.3.1
TDAmeritrade.isAccessTokenExpired(): boolean
to determine whether the access token is expired or not. Will return true if no access token exists.TDAmeritrade.isRefreshTokenExpired(): boolean
to determine whether the refresh token is expired or not. Will return true if no refresh token exists.TDAmeritrade.authorize(): Promise
to bootstrap a local web server for oauth2 authorization. Will request access token and update config if authorization is successful.TDAmeritrade.login(): Promise
to automatically authorize or refresh the access token depending on whether the access and/or refresh token exist and are not expired. Depends on.authorize()
,.getAccessToken()
,.refreshAccessToken()
,.isAccessTokenExpired()
and.isRefreshTokenExpired()
.TDAmeritrade.on(eventName:'login'|'token')
to subscribe to events. Thelogin
event fires once.authorize()
is done bootstrapping the local web server and provides aurl
argument which can be used to authorize our td app. Thetoken
event fires everytime the access token is renewed, by either using.getAccessToken()
or.refreshAccessToken()
, and provides atoken
argument containing the newly received token info.TDAmeritrade.streamer(): Promise<TDStreamer>
to help instantiate a newTDStreamer
instance. Depends on.getUserPrincipals()
.TDAmeritrade.account(accountId:string): TDAccount
to help instantiate a newTDAccount
instance. A reference to theTDAmeritrade.config
will be passed on to theTDAccount
instance. This helps keep access token updates in sync.TDAmeritrade.config.refreshAndRetry: boolean
(default: true) option to automatically refresh the access token on a 401 response and retry the request. This will also update the config with the newly received token.TDAmeritrade.config.sslKey: string
option to hold the path to the ssl key file.TDAmeritrade.config.sslCert: string
option to hold the path to the ssl certificate file.
- Renamed
TDAmeritrade.authenticate()
toTDAmeritrade.getAccessToken()
. - Renamed
TDAmeritrade.refreshToken()
toTDAmeritrade.refreshAccessToken()
. - Moved
TDStreamer
from exports toTDAmeritrade.TDStreamer
. - Moved
TDAccount
from exports toTDAmeritrade.TDAccount
. - Test suites from using an http and websocket server to completely use mocks. Only
node.spec.js
test suite runs a live http server during testing on port8443
and uses a pre-generated self-signed ssl certificate, found in./tests/setup/
.
- The npm scripts used for oauth2 authorization and token retrieval. Use the
TDAmeritrade.login()
method now instead.