tornapi-typescript 5.5.3 → 5.6.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.d.ts +294 -263
- package/dist/index.ts +403 -323
- package/dist/openapi.json +203 -12
- package/package.json +5 -5
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.
|
|
6
|
+
"version": "5.6.0"
|
|
7
7
|
},
|
|
8
8
|
"servers": [
|
|
9
9
|
{
|
|
@@ -336,7 +336,7 @@
|
|
|
336
336
|
"User"
|
|
337
337
|
],
|
|
338
338
|
"summary": "Get bounties placed on you",
|
|
339
|
-
"description": "Requires public access key. <br>",
|
|
339
|
+
"description": "<b>Globally cached selection.</b><br><br>Requires public access key. <br>",
|
|
340
340
|
"operationId": "getMyBounties",
|
|
341
341
|
"parameters": [
|
|
342
342
|
{
|
|
@@ -1530,6 +1530,60 @@
|
|
|
1530
1530
|
"x-stability": "Stable"
|
|
1531
1531
|
}
|
|
1532
1532
|
},
|
|
1533
|
+
"/user/inventory": {
|
|
1534
|
+
"get": {
|
|
1535
|
+
"tags": [
|
|
1536
|
+
"User"
|
|
1537
|
+
],
|
|
1538
|
+
"summary": "Get your inventory",
|
|
1539
|
+
"description": "<b>Cached selection (1 hour per category).</b><br><br>Requires limited access key. <br>",
|
|
1540
|
+
"operationId": "getMyInventory",
|
|
1541
|
+
"parameters": [
|
|
1542
|
+
{
|
|
1543
|
+
"name": "cat",
|
|
1544
|
+
"in": "query",
|
|
1545
|
+
"description": "Items category",
|
|
1546
|
+
"required": false,
|
|
1547
|
+
"schema": {
|
|
1548
|
+
"$ref": "#/components/schemas/TornInventoryItemType"
|
|
1549
|
+
}
|
|
1550
|
+
},
|
|
1551
|
+
{
|
|
1552
|
+
"$ref": "#/components/parameters/ApiOffset"
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
"$ref": "#/components/parameters/ApiLimit250Default20"
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
"$ref": "#/components/parameters/ApiTimestamp"
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
"$ref": "#/components/parameters/ApiComment"
|
|
1562
|
+
},
|
|
1563
|
+
{
|
|
1564
|
+
"$ref": "#/components/parameters/ApiKeyLimited"
|
|
1565
|
+
}
|
|
1566
|
+
],
|
|
1567
|
+
"responses": {
|
|
1568
|
+
"200": {
|
|
1569
|
+
"description": "Successful operation",
|
|
1570
|
+
"content": {
|
|
1571
|
+
"application/json": {
|
|
1572
|
+
"schema": {
|
|
1573
|
+
"$ref": "#/components/schemas/UserInventoryResponse"
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
},
|
|
1579
|
+
"security": [
|
|
1580
|
+
{
|
|
1581
|
+
"api_key": []
|
|
1582
|
+
}
|
|
1583
|
+
],
|
|
1584
|
+
"x-stability": "Stable"
|
|
1585
|
+
}
|
|
1586
|
+
},
|
|
1533
1587
|
"/user/itemmarket": {
|
|
1534
1588
|
"get": {
|
|
1535
1589
|
"tags": [
|
|
@@ -2858,7 +2912,7 @@
|
|
|
2858
2912
|
"User"
|
|
2859
2913
|
],
|
|
2860
2914
|
"summary": "Get your reports",
|
|
2861
|
-
"description": "Requires limited access key. <br>\
|
|
2915
|
+
"description": "Requires limited access key. <br>\nThe limit is set to 25 when requesting any category other than 'stats'.<br>\nWhen requesting the 'stats' category, limit can be increased up to 100.",
|
|
2862
2916
|
"operationId": "getMyReports",
|
|
2863
2917
|
"parameters": [
|
|
2864
2918
|
{
|
|
@@ -3542,6 +3596,9 @@
|
|
|
3542
3596
|
{
|
|
3543
3597
|
"$ref": "#/components/schemas/RacingRaceTypeEnum"
|
|
3544
3598
|
},
|
|
3599
|
+
{
|
|
3600
|
+
"$ref": "#/components/schemas/TornInventoryItemType"
|
|
3601
|
+
},
|
|
3545
3602
|
{
|
|
3546
3603
|
"$ref": "#/components/schemas/TradeCategoryEnum"
|
|
3547
3604
|
}
|
|
@@ -3765,6 +3822,9 @@
|
|
|
3765
3822
|
{
|
|
3766
3823
|
"$ref": "#/components/schemas/UserLookupResponse"
|
|
3767
3824
|
},
|
|
3825
|
+
{
|
|
3826
|
+
"$ref": "#/components/schemas/UserInventoryResponse"
|
|
3827
|
+
},
|
|
3768
3828
|
{
|
|
3769
3829
|
"$ref": "#/components/schemas/TimestampResponse"
|
|
3770
3830
|
}
|
|
@@ -4457,6 +4517,9 @@
|
|
|
4457
4517
|
]
|
|
4458
4518
|
}
|
|
4459
4519
|
},
|
|
4520
|
+
{
|
|
4521
|
+
"$ref": "#/components/parameters/ApiLimit100Default20"
|
|
4522
|
+
},
|
|
4460
4523
|
{
|
|
4461
4524
|
"$ref": "#/components/parameters/ApiOffset"
|
|
4462
4525
|
},
|
|
@@ -5192,7 +5255,7 @@
|
|
|
5192
5255
|
"Faction"
|
|
5193
5256
|
],
|
|
5194
5257
|
"summary": "Get faction reports",
|
|
5195
|
-
"description": "Requires limited access key. <br>\
|
|
5258
|
+
"description": "Requires limited access key. <br>\nThe limit is set to 25 when requesting any category other than 'stats'.<br>\nWhen requesting the 'stats' category, limit can be increased up to 100.",
|
|
5196
5259
|
"operationId": "getMyFactionReports",
|
|
5197
5260
|
"parameters": [
|
|
5198
5261
|
{
|
|
@@ -7152,7 +7215,7 @@
|
|
|
7152
7215
|
"Market"
|
|
7153
7216
|
],
|
|
7154
7217
|
"summary": "Get item market listings",
|
|
7155
|
-
"description": "Requires public access key. <br>",
|
|
7218
|
+
"description": "<b>Globally cached selection.</b><br><br>Requires public access key. <br>",
|
|
7156
7219
|
"operationId": "getMarketItemMarketItem",
|
|
7157
7220
|
"parameters": [
|
|
7158
7221
|
{
|
|
@@ -7215,7 +7278,7 @@
|
|
|
7215
7278
|
"Market"
|
|
7216
7279
|
],
|
|
7217
7280
|
"summary": "Get properties market listings",
|
|
7218
|
-
"description": "Requires public access key. <br>",
|
|
7281
|
+
"description": "<b>Globally cached selection.</b><br><br>Requires public access key. <br>",
|
|
7219
7282
|
"operationId": "getMarketProperties",
|
|
7220
7283
|
"parameters": [
|
|
7221
7284
|
{
|
|
@@ -7272,7 +7335,7 @@
|
|
|
7272
7335
|
"Market"
|
|
7273
7336
|
],
|
|
7274
7337
|
"summary": "Get properties rental listings",
|
|
7275
|
-
"description": "Requires public access key. <br>",
|
|
7338
|
+
"description": "<b>Globally cached selection.</b><br><br>Requires public access key. <br>",
|
|
7276
7339
|
"operationId": "getMarketPropertiesRental",
|
|
7277
7340
|
"parameters": [
|
|
7278
7341
|
{
|
|
@@ -8298,7 +8361,7 @@
|
|
|
8298
8361
|
"Torn"
|
|
8299
8362
|
],
|
|
8300
8363
|
"summary": "Get bounties",
|
|
8301
|
-
"description": "Requires public key. <br>",
|
|
8364
|
+
"description": "<b>Globally cached selection.</b><br><br>Requires public key. <br>",
|
|
8302
8365
|
"operationId": "getTornBounties",
|
|
8303
8366
|
"parameters": [
|
|
8304
8367
|
{
|
|
@@ -15369,6 +15432,36 @@
|
|
|
15369
15432
|
"Weapon"
|
|
15370
15433
|
]
|
|
15371
15434
|
},
|
|
15435
|
+
"TornInventoryItemType": {
|
|
15436
|
+
"type": "string",
|
|
15437
|
+
"enum": [
|
|
15438
|
+
"Collectible",
|
|
15439
|
+
"Clothing",
|
|
15440
|
+
"Other",
|
|
15441
|
+
"Tool",
|
|
15442
|
+
"Melee",
|
|
15443
|
+
"Defensive",
|
|
15444
|
+
"Material",
|
|
15445
|
+
"Car",
|
|
15446
|
+
"Primary",
|
|
15447
|
+
"Secondary",
|
|
15448
|
+
"Book",
|
|
15449
|
+
"Special",
|
|
15450
|
+
"Supply Pack",
|
|
15451
|
+
"Temporary",
|
|
15452
|
+
"Enhancer",
|
|
15453
|
+
"Artifact",
|
|
15454
|
+
"Flower",
|
|
15455
|
+
"Booster",
|
|
15456
|
+
"Medical",
|
|
15457
|
+
"Candy",
|
|
15458
|
+
"Jewelry",
|
|
15459
|
+
"Alcohol",
|
|
15460
|
+
"Plushie",
|
|
15461
|
+
"Drug",
|
|
15462
|
+
"Energy Drink"
|
|
15463
|
+
]
|
|
15464
|
+
},
|
|
15372
15465
|
"TornItemArmorCoveragePartEnum": {
|
|
15373
15466
|
"type": "string",
|
|
15374
15467
|
"enum": [
|
|
@@ -17166,6 +17259,79 @@
|
|
|
17166
17259
|
},
|
|
17167
17260
|
"type": "object"
|
|
17168
17261
|
},
|
|
17262
|
+
"UserInventoryItem": {
|
|
17263
|
+
"required": [
|
|
17264
|
+
"id",
|
|
17265
|
+
"amount",
|
|
17266
|
+
"equipped",
|
|
17267
|
+
"name",
|
|
17268
|
+
"faction_owned",
|
|
17269
|
+
"uid"
|
|
17270
|
+
],
|
|
17271
|
+
"properties": {
|
|
17272
|
+
"id": {
|
|
17273
|
+
"$ref": "#/components/schemas/ItemId"
|
|
17274
|
+
},
|
|
17275
|
+
"amount": {
|
|
17276
|
+
"type": "integer",
|
|
17277
|
+
"format": "int64"
|
|
17278
|
+
},
|
|
17279
|
+
"equipped": {
|
|
17280
|
+
"type": "boolean"
|
|
17281
|
+
},
|
|
17282
|
+
"name": {
|
|
17283
|
+
"type": "string"
|
|
17284
|
+
},
|
|
17285
|
+
"faction_owned": {
|
|
17286
|
+
"type": "boolean"
|
|
17287
|
+
},
|
|
17288
|
+
"uid": {
|
|
17289
|
+
"oneOf": [
|
|
17290
|
+
{
|
|
17291
|
+
"$ref": "#/components/schemas/ItemUid"
|
|
17292
|
+
},
|
|
17293
|
+
{
|
|
17294
|
+
"type": "null"
|
|
17295
|
+
}
|
|
17296
|
+
]
|
|
17297
|
+
}
|
|
17298
|
+
},
|
|
17299
|
+
"type": "object"
|
|
17300
|
+
},
|
|
17301
|
+
"UserInventory": {
|
|
17302
|
+
"required": [
|
|
17303
|
+
"items",
|
|
17304
|
+
"timestamp"
|
|
17305
|
+
],
|
|
17306
|
+
"properties": {
|
|
17307
|
+
"items": {
|
|
17308
|
+
"type": "array",
|
|
17309
|
+
"items": {
|
|
17310
|
+
"$ref": "#/components/schemas/UserInventoryItem"
|
|
17311
|
+
}
|
|
17312
|
+
},
|
|
17313
|
+
"timestamp": {
|
|
17314
|
+
"type": "integer",
|
|
17315
|
+
"format": "int32"
|
|
17316
|
+
}
|
|
17317
|
+
},
|
|
17318
|
+
"type": "object"
|
|
17319
|
+
},
|
|
17320
|
+
"UserInventoryResponse": {
|
|
17321
|
+
"required": [
|
|
17322
|
+
"inventory",
|
|
17323
|
+
"_metadata"
|
|
17324
|
+
],
|
|
17325
|
+
"properties": {
|
|
17326
|
+
"inventory": {
|
|
17327
|
+
"$ref": "#/components/schemas/UserInventory"
|
|
17328
|
+
},
|
|
17329
|
+
"_metadata": {
|
|
17330
|
+
"$ref": "#/components/schemas/RequestMetadataWithLinksAndTotal"
|
|
17331
|
+
}
|
|
17332
|
+
},
|
|
17333
|
+
"type": "object"
|
|
17334
|
+
},
|
|
17169
17335
|
"UserTradeResponse": {
|
|
17170
17336
|
"required": [
|
|
17171
17337
|
"trade"
|
|
@@ -20946,6 +21112,11 @@
|
|
|
20946
21112
|
"bounties_timestamp": {
|
|
20947
21113
|
"type": "integer",
|
|
20948
21114
|
"format": "int32"
|
|
21115
|
+
},
|
|
21116
|
+
"bounties_delay": {
|
|
21117
|
+
"description": "The minimum amount of time needed before the cache timestamp can change.",
|
|
21118
|
+
"type": "integer",
|
|
21119
|
+
"format": "int32"
|
|
20949
21120
|
}
|
|
20950
21121
|
},
|
|
20951
21122
|
"type": "object"
|
|
@@ -21251,7 +21422,7 @@
|
|
|
21251
21422
|
"UserSelectionName": {
|
|
21252
21423
|
"oneOf": [
|
|
21253
21424
|
{
|
|
21254
|
-
"description": "The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','gym','
|
|
21425
|
+
"description": "The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','gym','networth','perks'.",
|
|
21255
21426
|
"type": "string",
|
|
21256
21427
|
"enum": [
|
|
21257
21428
|
"ammo",
|
|
@@ -21279,6 +21450,7 @@
|
|
|
21279
21450
|
"hof",
|
|
21280
21451
|
"honors",
|
|
21281
21452
|
"icons",
|
|
21453
|
+
"inventory",
|
|
21282
21454
|
"itemmarket",
|
|
21283
21455
|
"job",
|
|
21284
21456
|
"jobpoints",
|
|
@@ -21318,7 +21490,6 @@
|
|
|
21318
21490
|
"display",
|
|
21319
21491
|
"education",
|
|
21320
21492
|
"gym",
|
|
21321
|
-
"inventory",
|
|
21322
21493
|
"networth",
|
|
21323
21494
|
"perks"
|
|
21324
21495
|
]
|
|
@@ -26998,8 +27169,8 @@
|
|
|
26998
27169
|
},
|
|
26999
27170
|
"percentage": {
|
|
27000
27171
|
"description": "Total percentage split between all participants.",
|
|
27001
|
-
"type": "
|
|
27002
|
-
"format": "
|
|
27172
|
+
"type": "number",
|
|
27173
|
+
"format": "float"
|
|
27003
27174
|
},
|
|
27004
27175
|
"paid_by": {
|
|
27005
27176
|
"$ref": "#/components/schemas/UserId"
|
|
@@ -28607,6 +28778,11 @@
|
|
|
28607
28778
|
"type": "integer",
|
|
28608
28779
|
"format": "int32"
|
|
28609
28780
|
},
|
|
28781
|
+
"rentals_delay": {
|
|
28782
|
+
"description": "The minimum amount of time needed before the cache timestamp can change.",
|
|
28783
|
+
"type": "integer",
|
|
28784
|
+
"format": "int32"
|
|
28785
|
+
},
|
|
28610
28786
|
"_metadata": {
|
|
28611
28787
|
"$ref": "#/components/schemas/RequestMetadataWithLinks"
|
|
28612
28788
|
}
|
|
@@ -28676,6 +28852,11 @@
|
|
|
28676
28852
|
"type": "integer",
|
|
28677
28853
|
"format": "int32"
|
|
28678
28854
|
},
|
|
28855
|
+
"properties_delay": {
|
|
28856
|
+
"description": "The minimum amount of time needed before the cache timestamp can change.",
|
|
28857
|
+
"type": "integer",
|
|
28858
|
+
"format": "int32"
|
|
28859
|
+
},
|
|
28679
28860
|
"_metadata": {
|
|
28680
28861
|
"$ref": "#/components/schemas/RequestMetadataWithLinks"
|
|
28681
28862
|
}
|
|
@@ -29160,6 +29341,11 @@
|
|
|
29160
29341
|
"description": "Timestamp when the data was globally cached at.",
|
|
29161
29342
|
"type": "integer",
|
|
29162
29343
|
"format": "int32"
|
|
29344
|
+
},
|
|
29345
|
+
"cache_delay": {
|
|
29346
|
+
"description": "The minimum amount of time needed before the cache timestamp can change.",
|
|
29347
|
+
"type": "integer",
|
|
29348
|
+
"format": "int32"
|
|
29163
29349
|
}
|
|
29164
29350
|
},
|
|
29165
29351
|
"type": "object"
|
|
@@ -31661,6 +31847,11 @@
|
|
|
31661
31847
|
"type": "integer",
|
|
31662
31848
|
"format": "int32"
|
|
31663
31849
|
},
|
|
31850
|
+
"bounties_delay": {
|
|
31851
|
+
"description": "The minimum amount of time needed before the cache timestamp can change.",
|
|
31852
|
+
"type": "integer",
|
|
31853
|
+
"format": "int32"
|
|
31854
|
+
},
|
|
31664
31855
|
"_metadata": {
|
|
31665
31856
|
"$ref": "#/components/schemas/RequestMetadataWithLinks"
|
|
31666
31857
|
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tornapi-typescript",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.6.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"generate-types": "tsc && node build/index.js"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@scalar/openapi-types": "^0.
|
|
10
|
-
"@types/node": "^24.12.
|
|
11
|
-
"prettier": "^3.8.
|
|
9
|
+
"@scalar/openapi-types": "^0.7.0",
|
|
10
|
+
"@types/node": "^24.12.2",
|
|
11
|
+
"prettier": "^3.8.2",
|
|
12
12
|
"typeconv": "^2.3.1",
|
|
13
|
-
"typescript": "^
|
|
13
|
+
"typescript": "^6.0.2"
|
|
14
14
|
},
|
|
15
15
|
"main": "./dist/index.js",
|
|
16
16
|
"types": "./dist/index.d.ts",
|