steamutils 1.4.16 → 1.4.18

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.
Files changed (3) hide show
  1. package/SteamClient.js +2638 -2630
  2. package/index.js +25 -4
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -3359,7 +3359,7 @@ export default class SteamUser {
3359
3359
  return groupList;
3360
3360
  const resultExample = [
3361
3361
  {
3362
- id: NatriGroupSteamID,
3362
+ id: "54645654",
3363
3363
  avatarHash: "71213b7e643da6216b1f8d8a381fc09b7c1932ef",
3364
3364
  avatar: "https://avatars.cloudflare.steamstatic.com/71213b7e643da6216b1f8d8a381fc09b7c1932ef.jpg",
3365
3365
  name: "♔⌒Natri",
@@ -3408,7 +3408,7 @@ export default class SteamUser {
3408
3408
  };
3409
3409
  const successExample = {
3410
3410
  results: "OK",
3411
- groupId: NatriGroupSteamID,
3411
+ groupId: "5464596",
3412
3412
  };
3413
3413
  }
3414
3414
 
@@ -6052,8 +6052,8 @@ export default class SteamUser {
6052
6052
  }
6053
6053
  const $ = cheerio.load(data);
6054
6054
  const text = StringUtils.cleanSpace($(".help_event_limiteduser .help_event_limiteduser_spend").text());
6055
- if (text?.startsWith("Amount Spent on Steam")) {
6056
- return text;
6055
+ if (text?.startsWith("Amount Spent on Steam:")) {
6056
+ return text.replaceAll("Amount Spent on Steam:", "").trim(); //$0.00 / $5.00 USD
6057
6057
  } else {
6058
6058
  return null;
6059
6059
  }
@@ -7300,6 +7300,27 @@ export default class SteamUser {
7300
7300
  }
7301
7301
  return tokens.some((token) => token.token_id == tokenId);
7302
7302
  }
7303
+
7304
+ async enumerateTokenLastSeenMs(accessToken, platform_type) {
7305
+ const tokens = (await this.enumerateTokens(accessToken))?.response?.refresh_tokens;
7306
+ if (!Array.isArray(tokens) || !tokens.length) {
7307
+ return null;
7308
+ }
7309
+ const platformTypeToken = tokens.filter(function (token) {
7310
+ return token.platform_type === platform_type;
7311
+ });
7312
+ if (!platformTypeToken.length) {
7313
+ return 0;
7314
+ }
7315
+ return (
7316
+ Math.max(
7317
+ ...platformTypeToken.map(function (token) {
7318
+ return token.last_seen?.time || token.first_seen?.time;
7319
+ }),
7320
+ ) * 1000
7321
+ );
7322
+ }
7323
+
7303
7324
  async queryRefreshTokenByID(accessToken, tokenId) {
7304
7325
  const Protos = helpers([
7305
7326
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.4.16",
3
+ "version": "1.4.18",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.6",