tornapi-typescript 5.1.3 → 5.2.1

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.d.ts CHANGED
@@ -71,6 +71,7 @@ export type RaceTrackId = number;
71
71
  export type RaceCarId = number;
72
72
  export type RaceCarUpgradeId = number;
73
73
  export type ItemId = number;
74
+ export type AuctionListingId = number;
74
75
  export type ItemModId = number;
75
76
  export type AmmoId = number;
76
77
  export type RankedWarId = number;
@@ -643,11 +644,11 @@ export interface UserMoneyResponse {
643
644
  interest_rate: number;
644
645
  until: number;
645
646
  invested_at: number;
646
- };
647
+ } | null;
647
648
  faction: {
648
649
  money: number;
649
650
  points: number;
650
- };
651
+ } | null;
651
652
  daily_networth: number;
652
653
  };
653
654
  }
@@ -2041,6 +2042,7 @@ export interface FactionBasic {
2041
2042
  is_enlisted: boolean | null;
2042
2043
  rank: FactionRank;
2043
2044
  best_chain: number;
2045
+ note?: string;
2044
2046
  }
2045
2047
  export interface FactionBasicResponse {
2046
2048
  basic: FactionBasic;
@@ -2548,6 +2550,26 @@ export interface KeyInfoResponse {
2548
2550
  };
2549
2551
  }
2550
2552
  export type KeySelectionName = string;
2553
+ export interface AuctionHouseStackableItem {
2554
+ id: ItemId;
2555
+ uid: ItemUid;
2556
+ name: string;
2557
+ type: TornItemTypeEnum;
2558
+ }
2559
+ export interface AuctionHouseListing {
2560
+ id: AuctionListingId;
2561
+ seller: BasicUser;
2562
+ buyer: BasicUser;
2563
+ /** Timestamp when the auction ended. */
2564
+ timestamp: number;
2565
+ price: number;
2566
+ bids: number;
2567
+ item: AuctionHouseStackableItem | TornItemDetails;
2568
+ }
2569
+ export interface AuctionHouseResponse {
2570
+ auctionhouse: AuctionHouseListing[];
2571
+ _metadata: RequestMetadataWithLinks;
2572
+ }
2551
2573
  export interface BasicProperty {
2552
2574
  id: PropertyTypeId;
2553
2575
  name: string;
@@ -6688,7 +6710,7 @@ export interface UserV2 extends BaseSchema {
6688
6710
  };
6689
6711
  reports: {
6690
6712
  response: ReportsResponse;
6691
- params: "cat" | "target" | "limit" | "offset" | "timestamp";
6713
+ params: "cat" | "target" | "limit" | "offset" | "sort" | "timestamp";
6692
6714
  };
6693
6715
  revives: {
6694
6716
  response: RevivesResponse;
@@ -6812,7 +6834,7 @@ export interface FactionV2 extends BaseSchema {
6812
6834
  };
6813
6835
  reports: {
6814
6836
  response: ReportsResponse;
6815
- params: "cat" | "target" | "limit" | "offset" | "timestamp";
6837
+ params: "cat" | "target" | "limit" | "offset" | "sort" | "timestamp";
6816
6838
  };
6817
6839
  revives: {
6818
6840
  response: RevivesResponse;
@@ -6910,6 +6932,14 @@ export interface KeyV2 extends BaseSchema {
6910
6932
  }
6911
6933
  export interface MarketV2 extends BaseSchema {
6912
6934
  selections: {
6935
+ auctionhouselisting: {
6936
+ response: AuctionHouseListing;
6937
+ params: "id" | "timestamp";
6938
+ };
6939
+ auctionhouse: {
6940
+ response: AuctionHouseResponse;
6941
+ params: "id" | "limit" | "sort" | "from" | "to" | "timestamp";
6942
+ };
6913
6943
  bazaar: {
6914
6944
  response: BazaarResponse;
6915
6945
  params: "cat" | "timestamp";
package/dist/index.ts CHANGED
@@ -4757,6 +4757,8 @@ export type RaceCarUpgradeId = number;
4757
4757
 
4758
4758
  export type ItemId = number;
4759
4759
 
4760
+ export type AuctionListingId = number;
4761
+
4760
4762
  export type ItemModId = number;
4761
4763
 
4762
4764
  export type AmmoId = number;
@@ -5660,11 +5662,11 @@ export interface UserMoneyResponse {
5660
5662
  interest_rate: number;
5661
5663
  until: number;
5662
5664
  invested_at: number;
5663
- };
5665
+ } | null;
5664
5666
  faction: {
5665
5667
  money: number;
5666
5668
  points: number;
5667
- };
5669
+ } | null;
5668
5670
  daily_networth: number;
5669
5671
  };
5670
5672
  }
@@ -7545,6 +7547,7 @@ export interface FactionBasic {
7545
7547
  is_enlisted: boolean | null;
7546
7548
  rank: FactionRank;
7547
7549
  best_chain: number;
7550
+ note?: string;
7548
7551
  }
7549
7552
 
7550
7553
  export interface FactionBasicResponse {
@@ -8124,6 +8127,29 @@ export interface KeyInfoResponse {
8124
8127
 
8125
8128
  export type KeySelectionName = string;
8126
8129
 
8130
+ export interface AuctionHouseStackableItem {
8131
+ id: ItemId;
8132
+ uid: ItemUid;
8133
+ name: string;
8134
+ type: TornItemTypeEnum;
8135
+ }
8136
+
8137
+ export interface AuctionHouseListing {
8138
+ id: AuctionListingId;
8139
+ seller: BasicUser;
8140
+ buyer: BasicUser;
8141
+ /** Timestamp when the auction ended. */
8142
+ timestamp: number;
8143
+ price: number;
8144
+ bids: number;
8145
+ item: AuctionHouseStackableItem | TornItemDetails;
8146
+ }
8147
+
8148
+ export interface AuctionHouseResponse {
8149
+ auctionhouse: AuctionHouseListing[];
8150
+ _metadata: RequestMetadataWithLinks;
8151
+ }
8152
+
8127
8153
  export interface BasicProperty {
8128
8154
  id: PropertyTypeId;
8129
8155
  name: string;
@@ -12460,7 +12486,13 @@ export interface UserV2 extends BaseSchema {
12460
12486
  };
12461
12487
  reports: {
12462
12488
  response: ReportsResponse;
12463
- params: "cat" | "target" | "limit" | "offset" | "timestamp";
12489
+ params:
12490
+ | "cat"
12491
+ | "target"
12492
+ | "limit"
12493
+ | "offset"
12494
+ | "sort"
12495
+ | "timestamp";
12464
12496
  };
12465
12497
  revives: {
12466
12498
  response: RevivesResponse;
@@ -12612,7 +12644,13 @@ export interface FactionV2 extends BaseSchema {
12612
12644
  };
12613
12645
  reports: {
12614
12646
  response: ReportsResponse;
12615
- params: "cat" | "target" | "limit" | "offset" | "timestamp";
12647
+ params:
12648
+ | "cat"
12649
+ | "target"
12650
+ | "limit"
12651
+ | "offset"
12652
+ | "sort"
12653
+ | "timestamp";
12616
12654
  };
12617
12655
  revives: {
12618
12656
  response: RevivesResponse;
@@ -12731,6 +12769,14 @@ export interface KeyV2 extends BaseSchema {
12731
12769
  }
12732
12770
  export interface MarketV2 extends BaseSchema {
12733
12771
  selections: {
12772
+ auctionhouselisting: {
12773
+ response: AuctionHouseListing;
12774
+ params: "id" | "timestamp";
12775
+ };
12776
+ auctionhouse: {
12777
+ response: AuctionHouseResponse;
12778
+ params: "id" | "limit" | "sort" | "from" | "to" | "timestamp";
12779
+ };
12734
12780
  bazaar: {
12735
12781
  response: BazaarResponse;
12736
12782
  params: "cat" | "timestamp";
package/dist/openapi.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "Torn API",
5
5
  "description": "\n * The development of Torn's API v2 is still ongoing.\n * If selections remain unaltered, they will default to the API v1 version.\n * Unlike API v1, API v2 accepts both selections and IDs as path and query parameters.\n * If any discrepancies or errors are found, please submit a [bug report](https://www.torn.com/forums.php#/p=forums&f=19&b=0&a=0) on the Torn Forums.\n * In case you're using bots to check for changes on openapi.json file, make sure to specificy a custom user-agent header - CloudFlare sometimes prevents requests from default user-agents.",
6
- "version": "5.1.3"
6
+ "version": "5.2.1"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -2846,6 +2846,9 @@
2846
2846
  {
2847
2847
  "$ref": "#/components/parameters/ApiOffset"
2848
2848
  },
2849
+ {
2850
+ "$ref": "#/components/parameters/ApiSortDesc"
2851
+ },
2849
2852
  {
2850
2853
  "$ref": "#/components/parameters/ApiTimestamp"
2851
2854
  },
@@ -5015,6 +5018,9 @@
5015
5018
  {
5016
5019
  "$ref": "#/components/parameters/ApiOffset"
5017
5020
  },
5021
+ {
5022
+ "$ref": "#/components/parameters/ApiSortDesc"
5023
+ },
5018
5024
  {
5019
5025
  "$ref": "#/components/parameters/ApiTimestamp"
5020
5026
  },
@@ -5341,7 +5347,7 @@
5341
5347
  "tags": [
5342
5348
  "Faction"
5343
5349
  ],
5344
- "summary": "Get a list of your faction's territories",
5350
+ "summary": "Get a list territory ownership",
5345
5351
  "description": "Requires public access key. <br>",
5346
5352
  "operationId": "bf56fb8aba4d6810e9b96402e25b931d",
5347
5353
  "parameters": [
@@ -6684,6 +6690,165 @@
6684
6690
  "x-stability": "Stable"
6685
6691
  }
6686
6692
  },
6693
+ "/market/{id}/auctionhouselisting": {
6694
+ "get": {
6695
+ "tags": [
6696
+ "Market"
6697
+ ],
6698
+ "summary": "Get specific item auction house listings",
6699
+ "description": "Requires public access key. <br>",
6700
+ "operationId": "c28901b60d97e6ddf7d07d7a195f022a",
6701
+ "parameters": [
6702
+ {
6703
+ "name": "id",
6704
+ "in": "path",
6705
+ "description": "Listing id",
6706
+ "required": true,
6707
+ "schema": {
6708
+ "$ref": "#/components/schemas/AuctionListingId"
6709
+ }
6710
+ },
6711
+ {
6712
+ "$ref": "#/components/parameters/ApiTimestamp"
6713
+ },
6714
+ {
6715
+ "$ref": "#/components/parameters/ApiComment"
6716
+ },
6717
+ {
6718
+ "$ref": "#/components/parameters/ApiKeyPublic"
6719
+ }
6720
+ ],
6721
+ "responses": {
6722
+ "200": {
6723
+ "description": "Successful operation",
6724
+ "content": {
6725
+ "application/json": {
6726
+ "schema": {
6727
+ "$ref": "#/components/schemas/AuctionHouseListing"
6728
+ }
6729
+ }
6730
+ }
6731
+ }
6732
+ },
6733
+ "security": [
6734
+ {
6735
+ "api_key": []
6736
+ }
6737
+ ],
6738
+ "x-stability": "Unstable"
6739
+ }
6740
+ },
6741
+ "/market/{id}/auctionhouse": {
6742
+ "get": {
6743
+ "tags": [
6744
+ "Market"
6745
+ ],
6746
+ "summary": "Get specific item auction house listings",
6747
+ "description": "Requires public access key. <br>",
6748
+ "operationId": "54c84ce84920ff49fac183f7ab7480cb",
6749
+ "parameters": [
6750
+ {
6751
+ "name": "id",
6752
+ "in": "path",
6753
+ "description": "Item id",
6754
+ "required": true,
6755
+ "schema": {
6756
+ "$ref": "#/components/schemas/ItemId"
6757
+ }
6758
+ },
6759
+ {
6760
+ "$ref": "#/components/parameters/ApiLimit100Default20"
6761
+ },
6762
+ {
6763
+ "$ref": "#/components/parameters/ApiSort"
6764
+ },
6765
+ {
6766
+ "$ref": "#/components/parameters/ApiFrom"
6767
+ },
6768
+ {
6769
+ "$ref": "#/components/parameters/ApiTo"
6770
+ },
6771
+ {
6772
+ "$ref": "#/components/parameters/ApiTimestamp"
6773
+ },
6774
+ {
6775
+ "$ref": "#/components/parameters/ApiComment"
6776
+ },
6777
+ {
6778
+ "$ref": "#/components/parameters/ApiKeyPublic"
6779
+ }
6780
+ ],
6781
+ "responses": {
6782
+ "200": {
6783
+ "description": "Successful operation",
6784
+ "content": {
6785
+ "application/json": {
6786
+ "schema": {
6787
+ "$ref": "#/components/schemas/AuctionHouseResponse"
6788
+ }
6789
+ }
6790
+ }
6791
+ }
6792
+ },
6793
+ "security": [
6794
+ {
6795
+ "api_key": []
6796
+ }
6797
+ ],
6798
+ "x-stability": "Unstable"
6799
+ }
6800
+ },
6801
+ "/market/auctionhouse": {
6802
+ "get": {
6803
+ "tags": [
6804
+ "Market"
6805
+ ],
6806
+ "summary": "Get auction house listings",
6807
+ "description": "Requires public access key. <br>",
6808
+ "operationId": "635ca1ff9b7062b8d8e0bf00252479cd",
6809
+ "parameters": [
6810
+ {
6811
+ "$ref": "#/components/parameters/ApiLimit100Default20"
6812
+ },
6813
+ {
6814
+ "$ref": "#/components/parameters/ApiSort"
6815
+ },
6816
+ {
6817
+ "$ref": "#/components/parameters/ApiFrom"
6818
+ },
6819
+ {
6820
+ "$ref": "#/components/parameters/ApiTo"
6821
+ },
6822
+ {
6823
+ "$ref": "#/components/parameters/ApiTimestamp"
6824
+ },
6825
+ {
6826
+ "$ref": "#/components/parameters/ApiComment"
6827
+ },
6828
+ {
6829
+ "$ref": "#/components/parameters/ApiKeyPublic"
6830
+ }
6831
+ ],
6832
+ "responses": {
6833
+ "200": {
6834
+ "description": "Successful operation",
6835
+ "content": {
6836
+ "application/json": {
6837
+ "schema": {
6838
+ "$ref": "#/components/schemas/AuctionHouseResponse"
6839
+ }
6840
+ }
6841
+ }
6842
+ }
6843
+ },
6844
+ "security": [
6845
+ {
6846
+ "api_key": []
6847
+ }
6848
+ ],
6849
+ "x-stability": "Unstable"
6850
+ }
6851
+ },
6687
6852
  "/market/bazaar": {
6688
6853
  "get": {
6689
6854
  "tags": [
@@ -7068,6 +7233,9 @@
7068
7233
  {
7069
7234
  "$ref": "#/components/schemas/ItemId"
7070
7235
  },
7236
+ {
7237
+ "$ref": "#/components/schemas/AuctionListingId"
7238
+ },
7071
7239
  {
7072
7240
  "$ref": "#/components/schemas/PropertyTypeId"
7073
7241
  }
@@ -7154,6 +7322,12 @@
7154
7322
  {
7155
7323
  "$ref": "#/components/schemas/MarketRentalsResponse"
7156
7324
  },
7325
+ {
7326
+ "$ref": "#/components/schemas/AuctionHouseResponse"
7327
+ },
7328
+ {
7329
+ "$ref": "#/components/schemas/AuctionHouseListing"
7330
+ },
7157
7331
  {
7158
7332
  "$ref": "#/components/schemas/MarketPropertiesResponse"
7159
7333
  },
@@ -14391,6 +14565,10 @@
14391
14565
  "type": "integer",
14392
14566
  "format": "int64"
14393
14567
  },
14568
+ "AuctionListingId": {
14569
+ "type": "integer",
14570
+ "format": "int32"
14571
+ },
14394
14572
  "ItemModId": {
14395
14573
  "type": "integer",
14396
14574
  "format": "int32"
@@ -17352,59 +17530,73 @@
17352
17530
  "format": "int64"
17353
17531
  },
17354
17532
  "city_bank": {
17355
- "required": [
17356
- "amount",
17357
- "profit",
17358
- "duration",
17359
- "interest_rate",
17360
- "until",
17361
- "invested_at"
17362
- ],
17363
- "properties": {
17364
- "amount": {
17365
- "type": "integer",
17366
- "format": "int64"
17367
- },
17368
- "profit": {
17369
- "type": "integer",
17370
- "format": "int64"
17371
- },
17372
- "duration": {
17373
- "description": "Initial duration in days.",
17374
- "type": "integer",
17375
- "format": "int32"
17376
- },
17377
- "interest_rate": {
17378
- "type": "number",
17379
- "format": "float"
17380
- },
17381
- "until": {
17382
- "type": "integer",
17383
- "format": "int64"
17533
+ "oneOf": [
17534
+ {
17535
+ "required": [
17536
+ "amount",
17537
+ "profit",
17538
+ "duration",
17539
+ "interest_rate",
17540
+ "until",
17541
+ "invested_at"
17542
+ ],
17543
+ "properties": {
17544
+ "amount": {
17545
+ "type": "integer",
17546
+ "format": "int64"
17547
+ },
17548
+ "profit": {
17549
+ "type": "integer",
17550
+ "format": "int64"
17551
+ },
17552
+ "duration": {
17553
+ "description": "Initial duration in days.",
17554
+ "type": "integer",
17555
+ "format": "int32"
17556
+ },
17557
+ "interest_rate": {
17558
+ "type": "number",
17559
+ "format": "float"
17560
+ },
17561
+ "until": {
17562
+ "type": "integer",
17563
+ "format": "int64"
17564
+ },
17565
+ "invested_at": {
17566
+ "type": "integer",
17567
+ "format": "int32"
17568
+ }
17569
+ },
17570
+ "type": "object"
17384
17571
  },
17385
- "invested_at": {
17386
- "type": "integer",
17387
- "format": "int32"
17572
+ {
17573
+ "type": "null"
17388
17574
  }
17389
- },
17390
- "type": "object"
17575
+ ]
17391
17576
  },
17392
17577
  "faction": {
17393
- "required": [
17394
- "money",
17395
- "points"
17396
- ],
17397
- "properties": {
17398
- "money": {
17399
- "type": "integer",
17400
- "format": "int64"
17578
+ "oneOf": [
17579
+ {
17580
+ "required": [
17581
+ "money",
17582
+ "points"
17583
+ ],
17584
+ "properties": {
17585
+ "money": {
17586
+ "type": "integer",
17587
+ "format": "int64"
17588
+ },
17589
+ "points": {
17590
+ "type": "integer",
17591
+ "format": "int64"
17592
+ }
17593
+ },
17594
+ "type": "object"
17401
17595
  },
17402
- "points": {
17403
- "type": "integer",
17404
- "format": "int64"
17596
+ {
17597
+ "type": "null"
17405
17598
  }
17406
- },
17407
- "type": "object"
17599
+ ]
17408
17600
  },
17409
17601
  "daily_networth": {
17410
17602
  "type": "integer",
@@ -24291,6 +24483,9 @@
24291
24483
  "best_chain": {
24292
24484
  "type": "integer",
24293
24485
  "format": "int32"
24486
+ },
24487
+ "note": {
24488
+ "type": "string"
24294
24489
  }
24295
24490
  },
24296
24491
  "type": "object"
@@ -26768,6 +26963,93 @@
26768
26963
  }
26769
26964
  ]
26770
26965
  },
26966
+ "AuctionHouseStackableItem": {
26967
+ "required": [
26968
+ "id",
26969
+ "uid",
26970
+ "name",
26971
+ "type"
26972
+ ],
26973
+ "properties": {
26974
+ "id": {
26975
+ "$ref": "#/components/schemas/ItemId"
26976
+ },
26977
+ "uid": {
26978
+ "$ref": "#/components/schemas/ItemUid"
26979
+ },
26980
+ "name": {
26981
+ "type": "string"
26982
+ },
26983
+ "type": {
26984
+ "$ref": "#/components/schemas/TornItemTypeEnum"
26985
+ }
26986
+ },
26987
+ "type": "object"
26988
+ },
26989
+ "AuctionHouseListing": {
26990
+ "required": [
26991
+ "id",
26992
+ "seller",
26993
+ "buyer",
26994
+ "timestamp",
26995
+ "price",
26996
+ "bids",
26997
+ "item"
26998
+ ],
26999
+ "properties": {
27000
+ "id": {
27001
+ "$ref": "#/components/schemas/AuctionListingId"
27002
+ },
27003
+ "seller": {
27004
+ "$ref": "#/components/schemas/BasicUser"
27005
+ },
27006
+ "buyer": {
27007
+ "$ref": "#/components/schemas/BasicUser"
27008
+ },
27009
+ "timestamp": {
27010
+ "description": "Timestamp when the auction ended.",
27011
+ "type": "integer",
27012
+ "format": "int32"
27013
+ },
27014
+ "price": {
27015
+ "type": "integer",
27016
+ "format": "int32"
27017
+ },
27018
+ "bids": {
27019
+ "type": "integer",
27020
+ "format": "int32"
27021
+ },
27022
+ "item": {
27023
+ "oneOf": [
27024
+ {
27025
+ "$ref": "#/components/schemas/AuctionHouseStackableItem"
27026
+ },
27027
+ {
27028
+ "$ref": "#/components/schemas/TornItemDetails"
27029
+ }
27030
+ ]
27031
+ }
27032
+ },
27033
+ "type": "object"
27034
+ },
27035
+ "AuctionHouseResponse": {
27036
+ "required": [
27037
+ "auctionhouse",
27038
+ "_metadata"
27039
+ ],
27040
+ "properties": {
27041
+ "auctionhouse": {
27042
+ "type": "array",
27043
+ "items": {
27044
+ "$ref": "#/components/schemas/AuctionHouseListing"
27045
+ }
27046
+ },
27047
+ "_metadata": {
27048
+ "$ref": "#/components/schemas/RequestMetadataWithLinks"
27049
+ }
27050
+ },
27051
+ "type": "object"
27052
+ },
26771
27053
  "BasicProperty": {
26772
27054
  "required": [
26773
27055
  "id",
@@ -27430,7 +27712,9 @@
27430
27712
  "rentals",
27431
27713
  "lookup",
27432
27714
  "timestamp",
27433
- "pointsmarket"
27715
+ "pointsmarket",
27716
+ "auctionhouse",
27717
+ "auctionhouselisting"
27434
27718
  ]
27435
27719
  },
27436
27720
  {
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "5.1.3",
4
+ "version": "5.2.1",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },
8
8
  "devDependencies": {
9
9
  "@scalar/openapi-types": "^0.5.3",
10
- "@types/node": "^24.10.4",
11
- "prettier": "^3.7.4",
10
+ "@types/node": "^24.10.9",
11
+ "prettier": "^3.8.1",
12
12
  "typeconv": "^2.3.1",
13
13
  "typescript": "^5.9.3"
14
14
  },