tornapi-typescript 4.6.0 → 4.7.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 +31 -1
- package/dist/index.ts +41 -10
- package/dist/openapi.json +192 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -360,6 +360,19 @@ export interface ReportsResponse {
|
|
|
360
360
|
_metadata: RequestMetadataWithLinks;
|
|
361
361
|
}
|
|
362
362
|
export type SelectionCategoryEnum = ReportTypeEnum | UserListEnum | PersonalStatsCategoryEnum | RacingRaceTypeEnum;
|
|
363
|
+
export type UserEquipment = TornItemDetails & {
|
|
364
|
+
slot: number;
|
|
365
|
+
};
|
|
366
|
+
export interface UserClothing {
|
|
367
|
+
id: ItemId;
|
|
368
|
+
name: string;
|
|
369
|
+
uid: ItemUid;
|
|
370
|
+
type: TornItemTypeEnum;
|
|
371
|
+
}
|
|
372
|
+
export interface UserEquipmentResponse {
|
|
373
|
+
equipment: UserEquipment[];
|
|
374
|
+
clothing: UserClothing[];
|
|
375
|
+
}
|
|
363
376
|
export interface UserDiscordResponse {
|
|
364
377
|
discord: {
|
|
365
378
|
discord_id: DiscordId;
|
|
@@ -1093,7 +1106,7 @@ export interface UserListResponse {
|
|
|
1093
1106
|
list: UserList[];
|
|
1094
1107
|
_metadata: RequestMetadataWithLinks;
|
|
1095
1108
|
}
|
|
1096
|
-
/** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','
|
|
1109
|
+
/** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','gym','inventory','networth','perks','stocks'. */
|
|
1097
1110
|
export type UserSelectionName = string;
|
|
1098
1111
|
export interface UserLookupResponse {
|
|
1099
1112
|
selections: UserSelectionName[];
|
|
@@ -2793,6 +2806,15 @@ export type PropertySelectionName = string;
|
|
|
2793
2806
|
export interface PropertyLookupResponse {
|
|
2794
2807
|
selections: PropertySelectionName[];
|
|
2795
2808
|
}
|
|
2809
|
+
export interface TornItemDetails extends ItemMarketListingItemDetails {
|
|
2810
|
+
id: ItemId;
|
|
2811
|
+
name: string;
|
|
2812
|
+
type: TornItemTypeEnum;
|
|
2813
|
+
sub_type: TornItemWeaponTypeEnum | null;
|
|
2814
|
+
}
|
|
2815
|
+
export interface TornItemDetailsResponse {
|
|
2816
|
+
itemdetails: TornItemDetails;
|
|
2817
|
+
}
|
|
2796
2818
|
export interface TornMerit {
|
|
2797
2819
|
id: MeritId;
|
|
2798
2820
|
name: string;
|
|
@@ -6496,6 +6518,10 @@ export interface UserV2 extends BaseSchema {
|
|
|
6496
6518
|
response: UserEnlistedCarsResponse;
|
|
6497
6519
|
params: "timestamp";
|
|
6498
6520
|
};
|
|
6521
|
+
equipment: {
|
|
6522
|
+
response: UserEquipmentResponse;
|
|
6523
|
+
params: "timestamp";
|
|
6524
|
+
};
|
|
6499
6525
|
events: {
|
|
6500
6526
|
response: UserEventsResponse;
|
|
6501
6527
|
params: "striptags" | "limit" | "from" | "to" | "timestamp";
|
|
@@ -6972,6 +6998,10 @@ export interface TornV2 extends BaseSchema {
|
|
|
6972
6998
|
response: TornItemAmmoResponse;
|
|
6973
6999
|
params: "timestamp";
|
|
6974
7000
|
};
|
|
7001
|
+
itemdetails: {
|
|
7002
|
+
response: TornItemDetailsResponse;
|
|
7003
|
+
params: "timestamp";
|
|
7004
|
+
};
|
|
6975
7005
|
itemmods: {
|
|
6976
7006
|
response: TornItemModsResponse;
|
|
6977
7007
|
params: "timestamp";
|
package/dist/index.ts
CHANGED
|
@@ -5323,6 +5323,22 @@ export type SelectionCategoryEnum =
|
|
|
5323
5323
|
| PersonalStatsCategoryEnum
|
|
5324
5324
|
| RacingRaceTypeEnum;
|
|
5325
5325
|
|
|
5326
|
+
export type UserEquipment = TornItemDetails & {
|
|
5327
|
+
slot: number;
|
|
5328
|
+
};
|
|
5329
|
+
|
|
5330
|
+
export interface UserClothing {
|
|
5331
|
+
id: ItemId;
|
|
5332
|
+
name: string;
|
|
5333
|
+
uid: ItemUid;
|
|
5334
|
+
type: TornItemTypeEnum;
|
|
5335
|
+
}
|
|
5336
|
+
|
|
5337
|
+
export interface UserEquipmentResponse {
|
|
5338
|
+
equipment: UserEquipment[];
|
|
5339
|
+
clothing: UserClothing[];
|
|
5340
|
+
}
|
|
5341
|
+
|
|
5326
5342
|
export interface UserDiscordResponse {
|
|
5327
5343
|
discord: {
|
|
5328
5344
|
discord_id: DiscordId;
|
|
@@ -5784,8 +5800,7 @@ export interface UserPropertyDetailsExtended extends UserPropertyBasicDetails {
|
|
|
5784
5800
|
status: "none" | "in_use";
|
|
5785
5801
|
}
|
|
5786
5802
|
|
|
5787
|
-
export interface UserPropertyDetailsExtendedWithRent
|
|
5788
|
-
extends UserPropertyBasicDetails {
|
|
5803
|
+
export interface UserPropertyDetailsExtendedWithRent extends UserPropertyBasicDetails {
|
|
5789
5804
|
used_by: BasicUser[];
|
|
5790
5805
|
status: "none" | "in_use";
|
|
5791
5806
|
rented_by?: BasicUser;
|
|
@@ -5795,8 +5810,7 @@ export interface UserPropertyDetails extends UserPropertyBasicDetails {
|
|
|
5795
5810
|
used_by: BasicUser[];
|
|
5796
5811
|
}
|
|
5797
5812
|
|
|
5798
|
-
export interface UserPropertyDetailsExtendedRented
|
|
5799
|
-
extends UserPropertyBasicDetails {
|
|
5813
|
+
export interface UserPropertyDetailsExtendedRented extends UserPropertyBasicDetails {
|
|
5800
5814
|
used_by: BasicUser[];
|
|
5801
5815
|
status: "rented";
|
|
5802
5816
|
cost: number;
|
|
@@ -5811,8 +5825,7 @@ export interface UserPropertyDetailsExtendedRented
|
|
|
5811
5825
|
} | null;
|
|
5812
5826
|
}
|
|
5813
5827
|
|
|
5814
|
-
export interface UserPropertyDetailsExtendedForRent
|
|
5815
|
-
extends UserPropertyBasicDetails {
|
|
5828
|
+
export interface UserPropertyDetailsExtendedForRent extends UserPropertyBasicDetails {
|
|
5816
5829
|
used_by: BasicUser[];
|
|
5817
5830
|
status: "for_rent";
|
|
5818
5831
|
cost: number;
|
|
@@ -5821,8 +5834,7 @@ export interface UserPropertyDetailsExtendedForRent
|
|
|
5821
5834
|
renter_asked?: BasicUser;
|
|
5822
5835
|
}
|
|
5823
5836
|
|
|
5824
|
-
export interface UserPropertyDetailsExtendedForSale
|
|
5825
|
-
extends UserPropertyBasicDetails {
|
|
5837
|
+
export interface UserPropertyDetailsExtendedForSale extends UserPropertyBasicDetails {
|
|
5826
5838
|
used_by: BasicUser[];
|
|
5827
5839
|
status: "for_sale";
|
|
5828
5840
|
cost: number;
|
|
@@ -6197,7 +6209,7 @@ export interface UserListResponse {
|
|
|
6197
6209
|
_metadata: RequestMetadataWithLinks;
|
|
6198
6210
|
}
|
|
6199
6211
|
|
|
6200
|
-
/** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','
|
|
6212
|
+
/** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','gym','inventory','networth','perks','stocks'. */
|
|
6201
6213
|
export type UserSelectionName = string;
|
|
6202
6214
|
|
|
6203
6215
|
export interface UserLookupResponse {
|
|
@@ -8413,6 +8425,17 @@ export interface PropertyLookupResponse {
|
|
|
8413
8425
|
selections: PropertySelectionName[];
|
|
8414
8426
|
}
|
|
8415
8427
|
|
|
8428
|
+
export interface TornItemDetails extends ItemMarketListingItemDetails {
|
|
8429
|
+
id: ItemId;
|
|
8430
|
+
name: string;
|
|
8431
|
+
type: TornItemTypeEnum;
|
|
8432
|
+
sub_type: TornItemWeaponTypeEnum | null;
|
|
8433
|
+
}
|
|
8434
|
+
|
|
8435
|
+
export interface TornItemDetailsResponse {
|
|
8436
|
+
itemdetails: TornItemDetails;
|
|
8437
|
+
}
|
|
8438
|
+
|
|
8416
8439
|
export interface TornMerit {
|
|
8417
8440
|
id: MeritId;
|
|
8418
8441
|
name: string;
|
|
@@ -8690,7 +8713,7 @@ export interface Bounty {
|
|
|
8690
8713
|
export interface AttackLogSummary {
|
|
8691
8714
|
id: UserId | null;
|
|
8692
8715
|
name: /** Name of the participant, could be null in stealthed attacks. */
|
|
8693
|
-
|
|
8716
|
+
string | null;
|
|
8694
8717
|
hits: number;
|
|
8695
8718
|
misses: number;
|
|
8696
8719
|
damage: number;
|
|
@@ -12239,6 +12262,10 @@ export interface UserV2 extends BaseSchema {
|
|
|
12239
12262
|
response: UserEnlistedCarsResponse;
|
|
12240
12263
|
params: "timestamp";
|
|
12241
12264
|
};
|
|
12265
|
+
equipment: {
|
|
12266
|
+
response: UserEquipmentResponse;
|
|
12267
|
+
params: "timestamp";
|
|
12268
|
+
};
|
|
12242
12269
|
events: {
|
|
12243
12270
|
response: UserEventsResponse;
|
|
12244
12271
|
params: "striptags" | "limit" | "from" | "to" | "timestamp";
|
|
@@ -12793,6 +12820,10 @@ export interface TornV2 extends BaseSchema {
|
|
|
12793
12820
|
response: TornItemAmmoResponse;
|
|
12794
12821
|
params: "timestamp";
|
|
12795
12822
|
};
|
|
12823
|
+
itemdetails: {
|
|
12824
|
+
response: TornItemDetailsResponse;
|
|
12825
|
+
params: "timestamp";
|
|
12826
|
+
};
|
|
12796
12827
|
itemmods: {
|
|
12797
12828
|
response: TornItemModsResponse;
|
|
12798
12829
|
params: "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": "4.
|
|
6
|
+
"version": "4.7.0"
|
|
7
7
|
},
|
|
8
8
|
"servers": [
|
|
9
9
|
{
|
|
@@ -795,6 +795,45 @@
|
|
|
795
795
|
"x-stability": "Stable"
|
|
796
796
|
}
|
|
797
797
|
},
|
|
798
|
+
"/user/equipment": {
|
|
799
|
+
"get": {
|
|
800
|
+
"tags": [
|
|
801
|
+
"User"
|
|
802
|
+
],
|
|
803
|
+
"summary": "Get your equipment & clothing",
|
|
804
|
+
"description": "Requires minimal access key.",
|
|
805
|
+
"operationId": "273c3a96077332793a1b6ffe21c10218",
|
|
806
|
+
"parameters": [
|
|
807
|
+
{
|
|
808
|
+
"$ref": "#/components/parameters/ApiTimestamp"
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"$ref": "#/components/parameters/ApiComment"
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"$ref": "#/components/parameters/ApiKeyMinimal"
|
|
815
|
+
}
|
|
816
|
+
],
|
|
817
|
+
"responses": {
|
|
818
|
+
"200": {
|
|
819
|
+
"description": "Successful operation",
|
|
820
|
+
"content": {
|
|
821
|
+
"application/json": {
|
|
822
|
+
"schema": {
|
|
823
|
+
"$ref": "#/components/schemas/UserEquipmentResponse"
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
},
|
|
829
|
+
"security": [
|
|
830
|
+
{
|
|
831
|
+
"api_key": []
|
|
832
|
+
}
|
|
833
|
+
],
|
|
834
|
+
"x-stability": "Unstable"
|
|
835
|
+
}
|
|
836
|
+
},
|
|
798
837
|
"/user/events": {
|
|
799
838
|
"get": {
|
|
800
839
|
"tags": [
|
|
@@ -8358,6 +8397,45 @@
|
|
|
8358
8397
|
"x-stability": "Stable"
|
|
8359
8398
|
}
|
|
8360
8399
|
},
|
|
8400
|
+
"/torn/itemdetails": {
|
|
8401
|
+
"get": {
|
|
8402
|
+
"tags": [
|
|
8403
|
+
"Torn"
|
|
8404
|
+
],
|
|
8405
|
+
"summary": "Get information about a specific item",
|
|
8406
|
+
"description": "Requires public key.",
|
|
8407
|
+
"operationId": "5767dbbbd08f6ce35b7c10922afaf6fc",
|
|
8408
|
+
"parameters": [
|
|
8409
|
+
{
|
|
8410
|
+
"$ref": "#/components/parameters/ApiTimestamp"
|
|
8411
|
+
},
|
|
8412
|
+
{
|
|
8413
|
+
"$ref": "#/components/parameters/ApiComment"
|
|
8414
|
+
},
|
|
8415
|
+
{
|
|
8416
|
+
"$ref": "#/components/parameters/ApiKeyPublic"
|
|
8417
|
+
}
|
|
8418
|
+
],
|
|
8419
|
+
"responses": {
|
|
8420
|
+
"200": {
|
|
8421
|
+
"description": "Successful operation",
|
|
8422
|
+
"content": {
|
|
8423
|
+
"application/json": {
|
|
8424
|
+
"schema": {
|
|
8425
|
+
"$ref": "#/components/schemas/TornItemDetailsResponse"
|
|
8426
|
+
}
|
|
8427
|
+
}
|
|
8428
|
+
}
|
|
8429
|
+
}
|
|
8430
|
+
},
|
|
8431
|
+
"security": [
|
|
8432
|
+
{
|
|
8433
|
+
"api_key": []
|
|
8434
|
+
}
|
|
8435
|
+
],
|
|
8436
|
+
"x-stability": "Unstable"
|
|
8437
|
+
}
|
|
8438
|
+
},
|
|
8361
8439
|
"/torn/itemmods": {
|
|
8362
8440
|
"get": {
|
|
8363
8441
|
"tags": [
|
|
@@ -15813,6 +15891,69 @@
|
|
|
15813
15891
|
}
|
|
15814
15892
|
]
|
|
15815
15893
|
},
|
|
15894
|
+
"UserEquipment": {
|
|
15895
|
+
"allOf": [
|
|
15896
|
+
{
|
|
15897
|
+
"$ref": "#/components/schemas/TornItemDetails"
|
|
15898
|
+
},
|
|
15899
|
+
{
|
|
15900
|
+
"required": [
|
|
15901
|
+
"slot"
|
|
15902
|
+
],
|
|
15903
|
+
"properties": {
|
|
15904
|
+
"slot": {
|
|
15905
|
+
"type": "integer",
|
|
15906
|
+
"format": "int32"
|
|
15907
|
+
}
|
|
15908
|
+
},
|
|
15909
|
+
"type": "object"
|
|
15910
|
+
}
|
|
15911
|
+
]
|
|
15912
|
+
},
|
|
15913
|
+
"UserClothing": {
|
|
15914
|
+
"required": [
|
|
15915
|
+
"id",
|
|
15916
|
+
"name",
|
|
15917
|
+
"uid",
|
|
15918
|
+
"type"
|
|
15919
|
+
],
|
|
15920
|
+
"properties": {
|
|
15921
|
+
"id": {
|
|
15922
|
+
"$ref": "#/components/schemas/ItemId"
|
|
15923
|
+
},
|
|
15924
|
+
"name": {
|
|
15925
|
+
"type": "string"
|
|
15926
|
+
},
|
|
15927
|
+
"uid": {
|
|
15928
|
+
"$ref": "#/components/schemas/ItemUid"
|
|
15929
|
+
},
|
|
15930
|
+
"type": {
|
|
15931
|
+
"$ref": "#/components/schemas/TornItemTypeEnum"
|
|
15932
|
+
}
|
|
15933
|
+
},
|
|
15934
|
+
"type": "object"
|
|
15935
|
+
},
|
|
15936
|
+
"UserEquipmentResponse": {
|
|
15937
|
+
"required": [
|
|
15938
|
+
"equipment",
|
|
15939
|
+
"clothing"
|
|
15940
|
+
],
|
|
15941
|
+
"properties": {
|
|
15942
|
+
"equipment": {
|
|
15943
|
+
"type": "array",
|
|
15944
|
+
"items": {
|
|
15945
|
+
"$ref": "#/components/schemas/UserEquipment"
|
|
15946
|
+
}
|
|
15947
|
+
},
|
|
15948
|
+
"clothing": {
|
|
15949
|
+
"type": "array",
|
|
15950
|
+
"items": {
|
|
15951
|
+
"$ref": "#/components/schemas/UserClothing"
|
|
15952
|
+
}
|
|
15953
|
+
}
|
|
15954
|
+
},
|
|
15955
|
+
"type": "object"
|
|
15956
|
+
},
|
|
15816
15957
|
"UserDiscordResponse": {
|
|
15817
15958
|
"required": [
|
|
15818
15959
|
"discord"
|
|
@@ -19374,7 +19515,7 @@
|
|
|
19374
19515
|
"UserSelectionName": {
|
|
19375
19516
|
"oneOf": [
|
|
19376
19517
|
{
|
|
19377
|
-
"description": "The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','
|
|
19518
|
+
"description": "The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','gym','inventory','networth','perks','stocks'.",
|
|
19378
19519
|
"type": "string",
|
|
19379
19520
|
"enum": [
|
|
19380
19521
|
"ammo",
|
|
@@ -19390,6 +19531,7 @@
|
|
|
19390
19531
|
"crimes",
|
|
19391
19532
|
"discord",
|
|
19392
19533
|
"enlistedcars",
|
|
19534
|
+
"equipment",
|
|
19393
19535
|
"events",
|
|
19394
19536
|
"faction",
|
|
19395
19537
|
"factionbalance",
|
|
@@ -19436,7 +19578,6 @@
|
|
|
19436
19578
|
"criminalrecord",
|
|
19437
19579
|
"display",
|
|
19438
19580
|
"education",
|
|
19439
|
-
"equipment",
|
|
19440
19581
|
"gym",
|
|
19441
19582
|
"inventory",
|
|
19442
19583
|
"networth",
|
|
@@ -27871,6 +28012,54 @@
|
|
|
27871
28012
|
},
|
|
27872
28013
|
"type": "object"
|
|
27873
28014
|
},
|
|
28015
|
+
"TornItemDetails": {
|
|
28016
|
+
"allOf": [
|
|
28017
|
+
{
|
|
28018
|
+
"$ref": "#/components/schemas/ItemMarketListingItemDetails"
|
|
28019
|
+
},
|
|
28020
|
+
{
|
|
28021
|
+
"required": [
|
|
28022
|
+
"id",
|
|
28023
|
+
"name",
|
|
28024
|
+
"type",
|
|
28025
|
+
"sub_type"
|
|
28026
|
+
],
|
|
28027
|
+
"properties": {
|
|
28028
|
+
"id": {
|
|
28029
|
+
"$ref": "#/components/schemas/ItemId"
|
|
28030
|
+
},
|
|
28031
|
+
"name": {
|
|
28032
|
+
"type": "string"
|
|
28033
|
+
},
|
|
28034
|
+
"type": {
|
|
28035
|
+
"$ref": "#/components/schemas/TornItemTypeEnum"
|
|
28036
|
+
},
|
|
28037
|
+
"sub_type": {
|
|
28038
|
+
"oneOf": [
|
|
28039
|
+
{
|
|
28040
|
+
"$ref": "#/components/schemas/TornItemWeaponTypeEnum"
|
|
28041
|
+
},
|
|
28042
|
+
{
|
|
28043
|
+
"type": "null"
|
|
28044
|
+
}
|
|
28045
|
+
]
|
|
28046
|
+
}
|
|
28047
|
+
},
|
|
28048
|
+
"type": "object"
|
|
28049
|
+
}
|
|
28050
|
+
]
|
|
28051
|
+
},
|
|
28052
|
+
"TornItemDetailsResponse": {
|
|
28053
|
+
"required": [
|
|
28054
|
+
"itemdetails"
|
|
28055
|
+
],
|
|
28056
|
+
"properties": {
|
|
28057
|
+
"itemdetails": {
|
|
28058
|
+
"$ref": "#/components/schemas/TornItemDetails"
|
|
28059
|
+
}
|
|
28060
|
+
},
|
|
28061
|
+
"type": "object"
|
|
28062
|
+
},
|
|
27874
28063
|
"TornMerit": {
|
|
27875
28064
|
"required": [
|
|
27876
28065
|
"id",
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tornapi-typescript",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.7.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"generate-types": "tsc && node build/index.js"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@scalar/openapi-types": "^0.5.1",
|
|
10
10
|
"@types/node": "^24.10.1",
|
|
11
|
-
"prettier": "^3.
|
|
11
|
+
"prettier": "^3.7.3",
|
|
12
12
|
"typeconv": "^2.3.1",
|
|
13
13
|
"typescript": "^5.9.3"
|
|
14
14
|
},
|