node-steamcommunity
node-steamcommunity copied to clipboard
v4
Breaking Changes
- Now requires Node.js v14 or later
- Removed deprecated
getInventoryHistorymethod- Use GetTradeHistory instead
- Removed deprecated confirmation checker
- Use acceptConfirmationForObject as needed instead
- Removed deprecated
getWebApiOauthTokenmethod - Removed chat support (all chat, including webchat goes through CMs now)
SteamCommunity.ConfirmationTypeis now accessible asSteamCommunity.EConfirmationType- Removed deprecated behavior in
SteamCommunityconstructor where the first argument could belocalAddressrather than anoptionsobject - Removed
requestdependencyhttpRequesthas new behavior now- Pre- and post- HTTP request hooks have new behavior now
httpRequestGetandhttpRequestPosthave been removed
- Changes to TOTP tags used for confirmations
getConfirmationsnow uses 'list' instead of 'conf'getConfirmationOfferIDnow uses 'detail' instead of 'details'respondToConfirmationandCConfirmation#respondnow use 'reject' and 'accept' instead of 'cancel' and 'allow'acceptAllConfirmationsnow useslistandaccept
loginnow uses steam-session internally, and only returns a promise (no callback support)
TODO
- ~~Code cleanup~~
- Promise support for everything
- Make sure examples are up to date
- ~~Switch from request to axios or got~~
- Figure out why promise rejection stack traces are sometimes useless
How about: TODO - merge or close open pull requests
C'mon dude, you can do this! Don't give up
Other TODO suggestions:
- [x] Merge or close open pull requests
- [ ] Replace deprecated
requestmodule (I recommendgot) - [x] Use
ESLintfor formatting (My ESLint config) - [x] Use ES6 syntax and features (you're already adding this, but was not yet on the list)
I could perhaps help out, but only if it's going to be accepted. I hate having my PR's rejected.
I highly suggest setting up ESLint, so you don't have to format each file manually. ESLint can format on-save and fix formatting rules.
How do you feel about converting the prototypes to classes?
How do you feel about converting the prototypes to classes?
I'm thinking about it. I don't really see much reason not to.
Is there a way to split a class across multiple files (without some kind of preprocessing), or will I need to keep using SteamCommunity.prototype in the component files, like in steam-user?
How do you feel about converting the prototypes to classes?
I'm thinking about it. I don't really see much reason not to.
Is there a way to split a class across multiple files (without some kind of preprocessing), or will I need to keep using SteamCommunity.prototype in the component files, like in steam-user?
Would class Friends extends SteamCommunity work?
Would
class Friends extends SteamCommunitywork?
No, that would just mean that you get a Friends class that has the base SteamCommunity methods (like login), but nothing else like groups functionality.
Yeah, it seems you still need to use prototyping to extend the main SteamCommunity class.
What about adding declaration files for better ide autocompletion and inline documentation? If you prefer translating the code to typescript, i can help too.
What about adding declaration files for better ide autocompletion and inline documentation? If you prefer translating the code to typescript, i can help too.
I think I saw someone make @types/steamcommunity did you check that? It may be/get outdated, though.
https://github.com/DoctorMcKay/node-steamcommunity/issues/282 for TODO :)
Trade history only goes back to ~Jan 2012 while InventoryHistory goes back further. I know it's a hangover but perhaps forever deprecated instead of deleted?
Other TODO suggestions:
- [ ] Replace deprecated
requestmodule (I recommendgot)
While got is a nice library, I never use it anymore. I simply use node-fetch, which is eventually going to be native module to node. It's just easier to use the same syntax everywhere. You can copy as fetch in browser dev tools. And if you're worried about cookie support, I just use fetch-cookie or you can use one of the many other similar libraries. You can support proxies by passing an agent in the request options.
https://github.com/DoctorMcKay/node-stdlib/blob/master/src/lib/http/client/HttpClient.ts
I just made this today because I'm tired of not having full control over the HTTP stack. I don't want to get invested in some library and then find out that I can't do something like streamed uploads or whatever.