steamutils 1.2.59 → 1.2.60

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 (2) hide show
  1. package/index.js +75 -125
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -5517,132 +5517,82 @@ class SteamUser {
5517
5517
  const tradehistory_event_description_el = tradehistoryrow_el.find('.tradehistory_event_description')
5518
5518
  let description = tradehistory_event_description_el.text().trim()
5519
5519
  let tradePeople = null
5520
-
5521
- switch (description) {
5522
- case "You purchased an item on the Community Market.": {
5523
- break
5524
- }
5525
- case "You listed an item on the Community Market.": {
5526
- break
5527
- }
5528
- case "You canceled a listing on the Community Market. The item was returned to you.": {
5529
- break
5530
- }
5531
- case "Crafted": {
5532
- break
5533
- }
5534
- case "Earned a new rank and got a drop": {
5535
- break
5536
- }
5537
- case "Got an item drop": {
5538
- break
5539
- }
5540
- case "Random item drop": {
5541
- break
5542
- }
5543
- case "Purchased a gift": {
5544
- break
5545
- }
5546
- case "Earned by redeeming Steam Points": {
5547
- break
5548
- }
5549
- case "Earned by completing your Store Discovery Queue": {
5550
- break
5551
- }
5552
- case "Earned": {
5553
- break
5554
- }
5555
- case "Traded": {
5556
- break
5557
- }
5558
- case "Earned due to game play time": {
5559
- break
5560
- }
5561
- case "Listed on the Steam Community Market": {
5562
- break
5563
- }
5564
- case "Turned into Gems": {
5565
- break
5566
- }
5567
- case "Unpacked a booster pack": {
5568
- break
5569
- }
5570
- case "Purchased with Gems": {
5571
- break
5572
- }
5573
- case "Unpacked Gems from Sack": {
5574
- break
5575
- }
5576
- case "Earned by crafting": {
5577
- break
5578
- }
5579
- case "Used": {
5580
- break
5581
- }
5582
- case "Unsealed": {
5583
- break
5584
- }
5585
- case "Earned by sale purchases": {
5586
- break
5587
- }
5588
- case "Unlocked a container": {
5589
- break
5590
- }
5591
- case "Purchased from the store": {
5592
- break
5593
- }
5594
- case "You deleted": {
5595
- break
5596
- }
5597
- case "Found": {
5598
- break
5599
- }
5600
- case "Received from the Community Market": {
5601
- break
5602
- }
5603
- case "Exchanged one or more items for something different": {
5604
- break
5605
- }
5606
- case "Earned an item due to ownership of another game": {
5607
- break
5608
- }
5609
- case "Sticker applied": {
5610
- break
5611
- }
5612
- default: {
5613
- if (description.startsWith("You traded with ")) {
5614
- const peopleEl = tradehistory_event_description_el.find('a[href]')
5615
- tradePeople = {
5616
- name: peopleEl.text().trim(),
5617
- url: peopleEl.attr('href')
5618
- }
5619
- description = "You traded with"
5620
- } else if (description.startsWith("Gift sent to and redeemed by ")) {
5621
- const peopleEl = tradehistory_event_description_el.find('a[href]')
5622
- tradePeople = {
5623
- name: peopleEl.text().trim(),
5624
- url: peopleEl.attr('href')
5625
- }
5626
- description = "Gift sent to and redeemed by"
5627
- } else if (description.startsWith("Your trade with ") && description.endsWith(" was on hold, and the trade has now completed.")) {
5628
- const peopleEl = tradehistory_event_description_el.find('a[href]')
5629
- tradePeople = {
5630
- name: peopleEl.text().trim(),
5631
- url: peopleEl.attr('href')
5632
- }
5633
- description = "Your trade with friend was on hold, and the trade has now completed."
5634
- } else if (description.startsWith("You listed an item on the Community Market. The listing was placed on hold until")) {
5635
- //You listed an item on the Community Market. The listing was placed on hold until 24 Jan @ 3:06am.
5636
- description = "You listed an item on the Community Market. The listing was placed on hold until"
5637
- } else if (description.startsWith("Earned in ")) {
5638
- //Earned in PUBG: BATTLEGROUNDS
5639
- description = "Earned in game"
5640
- } else if (description.startsWith("Refunded a gift because the recipient,") && description.startsWith("declined")) {
5641
- //Refunded a gift because the recipient, Ava, declined
5642
- description = "Refunded a gift because the recipient declined"
5643
- } else {
5644
- console.log(description);
5520
+ const descriptions = [
5521
+ "You purchased an item on the Community Market.",
5522
+ "You listed an item on the Community Market.",
5523
+ "You canceled a listing on the Community Market. The item was returned to you.",
5524
+ "Crafted",
5525
+ "Earned a new rank and got a drop",
5526
+ "Got an item drop",
5527
+ "Random item drop",
5528
+ "Purchased a gift",
5529
+ "Earned by redeeming Steam Points",
5530
+ "Earned by completing your Store Discovery Queue",
5531
+ "Earned",
5532
+ "Traded",
5533
+ "Earned due to game play time",
5534
+ "Listed on the Steam Community Market",
5535
+ "Turned into Gems",
5536
+ "Unpacked a booster pack",
5537
+ "Purchased with Gems",
5538
+ "Unpacked Gems from Sack",
5539
+ "Earned by crafting",
5540
+ "Used",
5541
+ "Unsealed",
5542
+ "Earned by sale purchases",
5543
+ "Unlocked a container",
5544
+ "Purchased from the store",
5545
+ "You deleted",
5546
+ "Found",
5547
+ "Received from the Community Market",
5548
+ "Exchanged one or more items for something different",
5549
+ "Earned an item due to ownership of another game",
5550
+ "Sticker applied",
5551
+ "Subscription/Seasonal Item Grant"
5552
+ ];
5553
+
5554
+ if (!descriptions.includes(description)) {
5555
+ if (description.startsWith("You traded with ")) {
5556
+ const peopleEl = tradehistory_event_description_el.find('a[href]')
5557
+ tradePeople = {
5558
+ name: peopleEl.text().trim(),
5559
+ url: peopleEl.attr('href')
5645
5560
  }
5561
+ description = "You traded with"
5562
+ } else if (description.startsWith("Gift sent to and redeemed by ")) {
5563
+ const peopleEl = tradehistory_event_description_el.find('a[href]')
5564
+ tradePeople = {
5565
+ name: peopleEl.text().trim(),
5566
+ url: peopleEl.attr('href')
5567
+ }
5568
+ description = "Gift sent to and redeemed by"
5569
+ } else if (description.startsWith("Your trade with ") && description.endsWith(" was on hold, and the trade has now completed.")) {
5570
+ const peopleEl = tradehistory_event_description_el.find('a[href]')
5571
+ tradePeople = {
5572
+ name: peopleEl.text().trim(),
5573
+ url: peopleEl.attr('href')
5574
+ }
5575
+ description = "Your trade with friend was on hold, and the trade has now completed."
5576
+ } else if (description.startsWith("You listed an item on the Community Market. The listing was placed on hold until")) {
5577
+ //You listed an item on the Community Market. The listing was placed on hold until 24 Jan @ 3:06am.
5578
+ description = "You listed an item on the Community Market. The listing was placed on hold until"
5579
+ } else if (description.startsWith("Earned in ")) {
5580
+ //Earned in PUBG: BATTLEGROUNDS
5581
+ description = "Earned in game"
5582
+ } else if (description.startsWith("Refunded a gift because the recipient,") && description.startsWith("declined")) {
5583
+ //Refunded a gift because the recipient, Ava, declined
5584
+ description = "Refunded a gift because the recipient declined"
5585
+ } else if (description.startsWith("Your held trade with") && description.startsWith("was canceled. The items have been returned to you.")) {
5586
+ //Your held trade with TrQuBach96 was canceled. The items have been returned to you.
5587
+ const peopleEl = tradehistory_event_description_el.find('a[href]')
5588
+ tradePeople = {
5589
+ name: peopleEl.text().trim(),
5590
+ url: peopleEl.attr('href')
5591
+ }
5592
+ description = "Your held trade with person was canceled. The items have been returned to you."
5593
+ } else {
5594
+ console.log("== Description ==");
5595
+ console.log(description);
5646
5596
  }
5647
5597
  }
5648
5598
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.59",
3
+ "version": "1.2.60",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.5.1",