steamutils 1.2.77 → 1.2.78

Sign up to get free protection for your applications and to get access to all the features.
package/SteamClient.js CHANGED
@@ -168,7 +168,7 @@ function SteamClient({
168
168
  delete e.callback
169
169
  }
170
170
  })
171
- _.remove(_events, e => e.once)
171
+ _.remove(_events, e => !e || e?.once)
172
172
  }
173
173
 
174
174
  function onEvent(name, callback, once, timeout) {
package/index.js CHANGED
@@ -15,7 +15,7 @@ import {getTableHasHeaders, table2json} from './cheerio.js'
15
15
  import {getJSObjectFronXML} from './xml2json.js'
16
16
  import axios from 'axios'
17
17
  import url from 'url'
18
- import * as cherrio from "cheerio";
18
+ import * as cheerio from "cheerio";
19
19
  import fs from "fs";
20
20
  import FormData from "form-data";
21
21
 
@@ -2427,7 +2427,7 @@ class SteamUser {
2427
2427
  }
2428
2428
 
2429
2429
  _parsePendingFriendList(html, selector) {
2430
- const $ = cherrio.load(html || '')
2430
+ const $ = cheerio.load(html || '')
2431
2431
  const data = []
2432
2432
  $(selector).each(function () {
2433
2433
  const el = $(this)
@@ -5691,7 +5691,7 @@ class SteamUser {
5691
5691
 
5692
5692
  async getTradeURL() {
5693
5693
  const result = await this._httpRequest(`${this.getMyProfileURL()}/tradeoffers/privacy`)
5694
- const $ = cherrio.load(result?.data || '')
5694
+ const $ = cheerio.load(result?.data || '')
5695
5695
  const trade_offer_access_url = $('#trade_offer_access_url').attr('value')
5696
5696
  return trade_offer_access_url
5697
5697
  }
@@ -5825,9 +5825,19 @@ class SteamUser {
5825
5825
  }
5826
5826
  const partnerSteamId = partner.split(`',`)[0].trim()
5827
5827
  let partnerName = partner.split(`', "`)[1].trim();
5828
+ const playerAvatar = $1.find('.playerAvatar')
5829
+ const avatar = playerAvatar.find('img')?.attr('src')
5830
+ const link = playerAvatar.find('a')?.attr('href')
5831
+ const header = $1.find('.tradeoffer_header').text().replaceAll(/\t/g, ' ').replaceAll(/\s+/g, ' ').trim()
5832
+ const active = $1.find('.tradeoffer_items_ctn').hasClass("active")
5833
+
5828
5834
  tradeOffers.push({
5829
5835
  tradeofferid, partner: {
5830
- steamId: partnerSteamId, name: partnerName
5836
+ steamId: partnerSteamId,
5837
+ name: partnerName,
5838
+ avatar,
5839
+ link,
5840
+ header,
5831
5841
  },
5832
5842
  })
5833
5843
  }
@@ -6061,7 +6071,7 @@ class SteamUser {
6061
6071
  url: `market/mylistings/render/?count=100`,
6062
6072
  }))?.data
6063
6073
  if (result?.success === true) {
6064
- const $ = cherrio.load(result.results_html)
6074
+ const $ = cheerio.load(result.results_html)
6065
6075
  const list = []
6066
6076
  $('.market_listing_row').each(function () {
6067
6077
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.77",
3
+ "version": "1.2.78",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.5.1",