node-steamcommunity icon indicating copy to clipboard operation
node-steamcommunity copied to clipboard

v4

Open DoctorMcKay opened this issue 6 years ago • 16 comments

Breaking Changes

  • Now requires Node.js v14 or later
  • Removed deprecated getInventoryHistory method
  • Removed deprecated confirmation checker
  • Removed deprecated getWebApiOauthToken method
  • Removed chat support (all chat, including webchat goes through CMs now)
  • SteamCommunity.ConfirmationType is now accessible as SteamCommunity.EConfirmationType
  • Removed deprecated behavior in SteamCommunity constructor where the first argument could be localAddress rather than an options object
  • Removed request dependency
    • httpRequest has new behavior now
    • Pre- and post- HTTP request hooks have new behavior now
    • httpRequestGet and httpRequestPost have been removed
  • Changes to TOTP tags used for confirmations
    • getConfirmations now uses 'list' instead of 'conf'
    • getConfirmationOfferID now uses 'detail' instead of 'details'
    • respondToConfirmation and CConfirmation#respond now use 'reject' and 'accept' instead of 'cancel' and 'allow'
    • acceptAllConfirmations now uses list and accept
  • login now 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

DoctorMcKay avatar Sep 24 '19 08:09 DoctorMcKay

How about: TODO - merge or close open pull requests

Revadike avatar Oct 14 '19 02:10 Revadike

C'mon dude, you can do this! Don't give up

ghost avatar May 04 '21 20:05 ghost

Other TODO suggestions:

  • [x] Merge or close open pull requests
  • [ ] Replace deprecated request module (I recommend got)
  • [x] Use ESLint for 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.

Revadike avatar May 19 '21 22:05 Revadike

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.

Revadike avatar Jul 22 '21 08:07 Revadike

How do you feel about converting the prototypes to classes?

Revadike avatar Jul 29 '21 14:07 Revadike

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?

DoctorMcKay avatar Jul 30 '21 01:07 DoctorMcKay

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?

Revadike avatar Jul 30 '21 01:07 Revadike

Would class Friends extends SteamCommunity work?

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.

DoctorMcKay avatar Jul 30 '21 01:07 DoctorMcKay

Yeah, it seems you still need to use prototyping to extend the main SteamCommunity class.

Revadike avatar Jul 30 '21 01:07 Revadike

What about adding declaration files for better ide autocompletion and inline documentation? If you prefer translating the code to typescript, i can help too.

arthurfiorette avatar Sep 25 '21 14:09 arthurfiorette

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.

Revadike avatar Oct 13 '21 18:10 Revadike

https://github.com/DoctorMcKay/node-steamcommunity/issues/282 for TODO :)

Revadike avatar Mar 02 '22 02:03 Revadike

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?

joekiller avatar Dec 29 '22 06:12 joekiller

Other TODO suggestions:

  • [ ] Replace deprecated request module (I recommend got)

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.

Revadike avatar Apr 25 '23 06:04 Revadike

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.

DoctorMcKay avatar Apr 25 '23 07:04 DoctorMcKay