Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refreshToken and types #23

Closed
wants to merge 3 commits into from
Closed

refreshToken and types #23

wants to merge 3 commits into from

Conversation

kevinsherman
Copy link
Contributor

resolves knicola/tdameritradejs #22

Per documentation at: https://developer.tdameritrade.com/price-history/apis/get/marketdata/%7Bsymbol%7D/pricehistory

The values for frequencyType should be: 'minute' | 'daily' | 'weekly' | 'monthly'
Remove 'access_type' from URLSearchParams
Copy link
Owner

@knicola knicola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again thank you for taking the time to contribute. Unfortunately, I can't accept the PR as is because it:

  1. Leaves failing tests behind (npm tests) and must also be changed.
  2. Cripples td.login() which is expected to renew the refresh token as well.

Perhaps a better approach would be to add a way to renew the access and refresh tokens separately OR even better with the same method only renew the access token and renew both once the refresh token reaches close to its expiration day. Though to be fair, I am not convinced it'll add much value. What do you think?

@@ -955,7 +955,7 @@ export type PriceHistoryQuery = {
* - `year` : daily, weekly, monthly*
* - `ytd` : daily, weekly*
*/
frequencyType: 'day'|'month'|'year'|'ytd';
frequencyType: 'minute'|'daily'|'weekly'|'monthly';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The types should be changed in the jsdoc comments rather than the type declarations file because the declarations are generated using the npm types script. See package.json and the script. Also, I wouldn't mind this being a separate PR.

make start/end dates optional
@kevinsherman
Copy link
Contributor Author

Baby steps! Thank you for the feedback... I'll make the changes you identified and re-submit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants