steamutils 1.2.17 → 1.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
4
+ <serverData>
5
+ <paths name="steamsupport">
6
+ <serverdata>
7
+ <mappings>
8
+ <mapping local="$PROJECT_DIR$" web="/" />
9
+ </mappings>
10
+ </serverdata>
11
+ </paths>
12
+ <paths name="steamsupportui">
13
+ <serverdata>
14
+ <mappings>
15
+ <mapping local="$PROJECT_DIR$" web="/" />
16
+ </mappings>
17
+ </serverdata>
18
+ </paths>
19
+ </serverData>
20
+ </component>
21
+ </project>
@@ -2,8 +2,8 @@
2
2
  <module type="WEB_MODULE" version="4">
3
3
  <component name="NewModuleRootManager">
4
4
  <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
5
  <excludeFolder url="file://$MODULE_DIR$/temp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
7
  <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
8
  </content>
9
9
  <orderEntry type="inheritedJdk" />
package/.idea/vcs.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <project version="4">
3
3
  <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
5
  </component>
6
6
  </project>
package/SteamClient.js CHANGED
@@ -139,8 +139,8 @@ function SteamClient({
139
139
 
140
140
  function callGCCallback(name, ...arg) {
141
141
  if (gcCallback[name]) {
142
- for (let id in gcCallback[name]) {
143
- gcCallback[name][id]?.apply(null, arg)
142
+ for (const id in gcCallback[name]) {
143
+ gcCallback[name][id]?.(...arg)
144
144
  }
145
145
  }
146
146
  }
package/index.js CHANGED
@@ -5771,6 +5771,36 @@ class SteamUser {
5771
5771
  }
5772
5772
  }
5773
5773
 
5774
+ async acceptTradeOffer(tradeOfferID, partnerSteamId) {
5775
+ if (!partnerSteamId) {
5776
+ try {
5777
+ partnerSteamId = (await this._httpRequest({
5778
+ url: `tradeoffer/${tradeOfferID}`,
5779
+ }))?.data?.split(`var g_ulTradePartnerSteamID = '`)?.[1]?.split(`';`)[0]
5780
+ } catch (e) {
5781
+ }
5782
+ }
5783
+ if (!partnerSteamId) {
5784
+ console.error("Missing partner ID")
5785
+ return
5786
+ }
5787
+
5788
+ const result = await this._httpRequest({
5789
+ url: `tradeoffer/${tradeOfferID}/accept`,
5790
+ method: 'POST',
5791
+ data: `sessionid=${this._sessionid}&serverid=1&tradeofferid=${tradeOfferID}&partner=${partnerSteamId}&captcha=`,
5792
+ headers: {
5793
+ "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
5794
+ Referer: `https://steamcommunity.com/tradeoffer/${tradeOfferID}/`
5795
+ }
5796
+ })
5797
+
5798
+ return result?.data
5799
+ const successExample = {
5800
+ "tradeid": "4726012948246770347"
5801
+ }
5802
+ }
5803
+
5774
5804
  async getTradeOffer() {
5775
5805
  const result = await this._httpRequest({
5776
5806
  url: `${this._myProfile}/tradeoffers/`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.4.0",
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>