tornapi-typescript 5.3.0 → 5.5.0

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.
package/dist/index.ts CHANGED
@@ -4364,10 +4364,7 @@ export type FactionStatEnum =
4364
4364
  | "attacksdamaging"
4365
4365
  | "attacksrunaway"
4366
4366
  | "highestterritories"
4367
- | "territoryrespect"
4368
- | "membersamount"
4369
- | "factionage"
4370
- | "upgradesamount";
4367
+ | "territoryrespect";
4371
4368
 
4372
4369
  export type FactionBranchStateEnum = "war" | "peace";
4373
4370
 
@@ -4484,8 +4481,14 @@ export type TornOrganizedCrimePositionId =
4484
4481
  | "P5"
4485
4482
  | "P6";
4486
4483
 
4484
+ /** This field is now available in 'position_info' object as 'id' field.<br>This field will be removed on 1st of June 2026. */
4487
4485
  export type TornOrganizedCrimePositionIdDeprecated =
4488
- TornOrganizedCrimePositionId;
4486
+ | "P1"
4487
+ | "P2"
4488
+ | "P3"
4489
+ | "P4"
4490
+ | "P5"
4491
+ | "P6";
4489
4492
 
4490
4493
  export type FactionTerritoryWarResultEnum =
4491
4494
  | "success_assault"
@@ -4776,6 +4779,10 @@ export type ItemUid = number;
4776
4779
 
4777
4780
  export type UserId = number;
4778
4781
 
4782
+ export type TradeId = number;
4783
+
4784
+ export type StockId = number;
4785
+
4779
4786
  export type DiscordId = string;
4780
4787
 
4781
4788
  export type UserDiscordPathId = UserId | DiscordId;
@@ -5070,7 +5077,7 @@ export type TornItemArmorCoveragePartEnum =
5070
5077
  | "Foot"
5071
5078
  | "Head";
5072
5079
 
5073
- export interface AttackPlayerFaction {
5080
+ export interface UserFactionBasic {
5074
5081
  id: FactionId;
5075
5082
  name: string;
5076
5083
  }
@@ -5079,7 +5086,7 @@ export interface AttackPlayer {
5079
5086
  id: UserId;
5080
5087
  name: string;
5081
5088
  level: number;
5082
- faction: AttackPlayerFaction | null;
5089
+ faction: UserFactionBasic | null;
5083
5090
  }
5084
5091
 
5085
5092
  export interface AttackPlayerSimplified {
@@ -5512,8 +5519,121 @@ export type ApiError =
5512
5519
  | ErrorIncorrectLogId
5513
5520
  | ErrorCategorySelectionUnavailableForInteractionLogs;
5514
5521
 
5522
+ export interface UserTradesResponse {
5523
+ trades: UserTrade[];
5524
+ _metadata: RequestMetadataWithLinks;
5525
+ }
5526
+
5527
+ export interface UserTradeResponse {
5528
+ trade: UserTradeDetailed;
5529
+ }
5530
+
5531
+ export interface UserTrade {
5532
+ id: TradeId;
5533
+ timestamp: number;
5534
+ user: UserTradeParticipant;
5535
+ trader: UserTradeParticipant;
5536
+ }
5537
+
5538
+ export interface UserTradeParticipant {
5539
+ id: UserId;
5540
+ name: string;
5541
+ summary: string[];
5542
+ }
5543
+
5544
+ export interface UserTradeDetailed extends UserTrade {
5545
+ items: TradeItem[];
5546
+ }
5547
+
5548
+ export interface TradeItemNap {
5549
+ user_id: UserId;
5550
+ type: "NAP";
5551
+ details: {
5552
+ days: number;
5553
+ factions: UserFactionBasic[];
5554
+ };
5555
+ }
5556
+
5557
+ export interface TradeItemMoney {
5558
+ user_id: UserId;
5559
+ type: "Money";
5560
+ details: {
5561
+ amount: number;
5562
+ };
5563
+ }
5564
+
5565
+ export interface TradeItemFaction {
5566
+ user_id: UserId;
5567
+ type: "Faction";
5568
+ details: {
5569
+ id: FactionId;
5570
+ name: string;
5571
+ respect: number;
5572
+ };
5573
+ }
5574
+
5575
+ export interface TradeItemProperty {
5576
+ user_id: UserId;
5577
+ type: "Property";
5578
+ details: {
5579
+ id: PropertyId;
5580
+ happiness: number;
5581
+ };
5582
+ }
5583
+
5584
+ export interface TradeItemCompany {
5585
+ user_id: UserId;
5586
+ type: "Company";
5587
+ details: {
5588
+ id: CompanyId;
5589
+ name: string;
5590
+ value: string;
5591
+ };
5592
+ }
5593
+
5594
+ export interface TradeItemItem {
5595
+ user_id: UserId;
5596
+ type: "Item";
5597
+ details: {
5598
+ id: ItemId;
5599
+ uid: ItemUid | null;
5600
+ amount: number;
5601
+ };
5602
+ }
5603
+
5604
+ export type TradeItem =
5605
+ | TradeItemMoney
5606
+ | TradeItemItem
5607
+ | TradeItemFaction
5608
+ | TradeItemCompany
5609
+ | TradeItemProperty
5610
+ | TradeItemNap;
5611
+
5612
+ export interface UserStockTransaction {
5613
+ id: number;
5614
+ shares: number;
5615
+ price: number;
5616
+ timestamp: number;
5617
+ }
5618
+
5619
+ export interface UserStock {
5620
+ id: StockId;
5621
+ shares: number;
5622
+ transactions: UserStockTransaction[];
5623
+ bonus: {
5624
+ available: boolean;
5625
+ increment: number;
5626
+ progress: number;
5627
+ frequency: number;
5628
+ };
5629
+ }
5630
+
5631
+ export interface UserStocksResponse {
5632
+ stocks: UserStock[];
5633
+ }
5634
+
5515
5635
  export interface UserOrganizedCrimesResponse {
5516
- organizedcrimes?: FactionCrime[];
5636
+ organizedcrimes: FactionCrime[];
5517
5637
  _metadata: RequestMetadataWithLinks;
5518
5638
  }
5519
5639
 
@@ -6408,7 +6528,7 @@ export interface UserListResponse {
6408
6528
  _metadata: RequestMetadataWithLinks;
6409
6529
  }
6410
6530
 
6411
- /** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','gym','inventory','networth','perks','stocks'. */
6531
+ /** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','gym','inventory','networth','perks'. */
6412
6532
  export type UserSelectionName = string;
6413
6533
 
6414
6534
  export interface UserLookupResponse {
@@ -8660,6 +8780,65 @@ export interface PropertyLookupResponse {
8660
8780
  selections: PropertySelectionName[];
8661
8781
  }
8662
8782
 
8783
+ export interface TornStock {
8784
+ id: StockId;
8785
+ name: string;
8786
+ acronym: string;
8787
+ images: {
8788
+ logo: string;
8789
+ full: string;
8790
+ };
8791
+ market: {
8792
+ price: number;
8793
+ cap: number;
8794
+ shares: number;
8795
+ investors: number;
8796
+ };
8797
+ bonus: {
8798
+ passive: boolean;
8799
+ frequency: number;
8800
+ requirement: number;
8801
+ description: string;
8802
+ };
8803
+ }
8804
+
8805
+ export interface TornStockPerformance {
8806
+ change: number;
8807
+ change_percentage: number;
8808
+ start: number;
8809
+ end: number;
8810
+ high: number;
8811
+ low: number;
8812
+ }
8813
+
8814
+ export interface TornStockHistory {
8815
+ price: number;
8816
+ change: number;
8817
+ timestamp: number;
8818
+ }
8819
+
8820
+ export interface TornStockDetailed extends TornStock {
8821
+ chart: {
8822
+ performance: {
8823
+ last_hour: TornStockPerformance;
8824
+ last_day: TornStockPerformance;
8825
+ last_week: TornStockPerformance;
8826
+ last_month: TornStockPerformance;
8827
+ last_year: TornStockPerformance;
8828
+ all_time: TornStockPerformance;
8829
+ };
8830
+ history: TornStockHistory[];
8831
+ };
8832
+ }
8833
+
8834
+ export interface TornStocksResponse {
8835
+ stocks: TornStock[];
8836
+ }
8837
+
8838
+ export interface TornStockDetailedResponse {
8839
+ stocks: TornStockDetailed;
8840
+ }
8841
+
8663
8842
  export interface TornEliminationTeamLeader extends BasicUser {
8664
8843
  active: boolean;
8665
8844
  }
@@ -9146,7 +9325,7 @@ export interface TornFactionTreeResponse {
9146
9325
  }
9147
9326
 
9148
9327
  /**
9149
- * The following selections will fallback to API v1 and may change at any time: 'bank','cards','cityshops','companies','competition','gyms','itemdetails','itemstats','organisedcrimes','pawnshop','pokertables','rockpaperscissors','searchforcash','shoplifting','stats','stocks'.
9328
+ * The following selections will fallback to API v1 and may change at any time: 'bank','cards','cityshops','companies','competition','gyms','itemdetails','itemstats','organisedcrimes','pawnshop','pokertables','rockpaperscissors','searchforcash','shoplifting','stats'.
9150
9329
  * * The following selections are not available in API v2: 'dirtybombs','raidreport','raids', 'chainreport', 'rackets', 'rankedwarreport', 'rankedwars', 'territorynames', 'territorywarreport', 'territorywars'.
9151
9330
  */
9152
9331
  export type TornSelectionName = string;
@@ -12727,6 +12906,24 @@ export interface UserV2 extends BaseSchema {
12727
12906
  response: UserSkillsResponse;
12728
12907
  params: "timestamp";
12729
12908
  };
12909
+ stocks: {
12910
+ response: UserStocksResponse;
12911
+ params: "timestamp";
12912
+ };
12913
+ trades: {
12914
+ response: UserTradesResponse;
12915
+ params:
12916
+ | "striptags"
12917
+ | "limit"
12918
+ | "sort"
12919
+ | "to"
12920
+ | "from"
12921
+ | "timestamp";
12922
+ };
12923
+ trade: {
12924
+ response: UserTradeResponse;
12925
+ params: "id" | "striptags" | "timestamp";
12926
+ };
12730
12927
  travel: {
12731
12928
  response: UserTravelResponse;
12732
12929
  params: "timestamp";
@@ -13158,6 +13355,10 @@ export interface TornV2 extends BaseSchema {
13158
13355
  response: TornProperties;
13159
13356
  params: "timestamp";
13160
13357
  };
13358
+ stocks: {
13359
+ response: TornStocksResponse;
13360
+ params: "timestamp";
13361
+ };
13161
13362
  subcrimes: {
13162
13363
  response: TornSubcrimesResponse;
13163
13364
  params: "crimeId" | "timestamp";