tornapi-typescript 3.0.20 → 4.0.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 +6 -10
- package/dist/index.ts +17 -11
- package/dist/openapi.json +27 -77
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -9,8 +9,9 @@ export type UserDonatorStatusEnum = "Donator" | "Subscriber";
|
|
|
9
9
|
export type JobTypeEnum = "Army" | "Casino" | "Education" | "Grocer" | "Law" | "Medical";
|
|
10
10
|
export type UserMaritalStatusEnum = "Engaged" | "Newlywed" | "Married";
|
|
11
11
|
export type UserPlaneImageTypeEnum = "private_jet" | "light_aircraft" | "airliner";
|
|
12
|
+
export type UserStatusStateEnum = "Abroad" | "Awoken" | "Dormant" | "Fallen" | "Federal" | "Hospital" | "Jail" | "Okay" | "Traveling";
|
|
12
13
|
export type UserRoleEnum = "Admin" | "Officer" | "Moderator" | "Helper" | "Tester" | "NPC" | "Committee" | "Reporter" | "Wiki Contributor" | "Wiki Editor" | "Civilian";
|
|
13
|
-
export type UserTitleEnum = "Alcoholic" | "Sharpshooter" | "Accomplice" | "Loser" | "Silent Killer" | "Killer" | "Merchant" | "Medalist" | "Tycoon" | "Damage Dealer" | "Slayer" | "Hired Gun" | "Egotist" | "Outcast" | "Punchbag" | "Tank" | "Antagonist" | "Druggy" | "Scavenger" | "Boxer" | "Importer" | "Looter" | "Samaritan" | "Felon" | "Socialite" | "Mercenary" | "Investor" | "Thief" | "One Hit Killer" | "Mobster" | "Addict" | "Bonds Agent" | "Buster" | "Hoarder" | "Racer" | "Soldier" | "Avenger" | "Healer" | "Booster" | "Intimidator" | "Trader" | "Jobsworth" | "Tourist" | "Nudist" | "Sage" | "Coward" | "Newcomer" | "Deserter";
|
|
14
|
+
export type UserTitleEnum = "Alcoholic" | "Sharpshooter" | "Accomplice" | "Loser" | "Silent Killer" | "Killer" | "Merchant" | "Medalist" | "Tycoon" | "Damage Dealer" | "Slayer" | "Hired Gun" | "Egotist" | "Outcast" | "Punchbag" | "Tank" | "Antagonist" | "Druggy" | "Scavenger" | "Boxer" | "Importer" | "Looter" | "Samaritan" | "Felon" | "Socialite" | "Mercenary" | "Investor" | "Thief" | "One Hit Killer" | "Mobster" | "Addict" | "Bonds Agent" | "Buster" | "Hoarder" | "Racer" | "Soldier" | "Avenger" | "Healer" | "Booster" | "Intimidator" | "Trader" | "Jobsworth" | "Tourist" | "Nudist" | "Sage" | "Coward" | "Newcomer" | "Deserter" | "Citizen";
|
|
14
15
|
export type UserRankEnum = "Absolute beginner" | "Beginner" | "Inexperienced" | "Rookie" | "Novice" | "Below average" | "Average" | "Reasonable" | "Above average" | "Competent" | "Highly competent" | "Veteran" | "Distinguished" | "Highly distinguished" | "Professional" | "Star" | "Master" | "Outstanding" | "Celebrity" | "Supreme" | "Idolized" | "Champion" | "Heroic" | "Legendary" | "Elite" | "Invincible";
|
|
15
16
|
export type UserRpsStatus = "scissors" | "rock" | "paper";
|
|
16
17
|
export type UserSkillSlugEnum = "hunting" | "racing" | "reviving" | "search_for_cash" | "bootlegging" | "graffiti" | "shoplifting" | "pickpocketing" | "card_skimming" | "burglary" | "hustling" | "disposal" | "cracking" | "forgery" | "scamming" | "arson";
|
|
@@ -1660,9 +1661,6 @@ export interface FactionTerritoryWarOngoing {
|
|
|
1660
1661
|
target: number;
|
|
1661
1662
|
factions: FactionTerritoryWarOngoingFaction[];
|
|
1662
1663
|
}
|
|
1663
|
-
export interface FactionTerritoryWarsResponse {
|
|
1664
|
-
territorywars: FactionTerritoryWarOngoing[] | FactionTerritoryWarFinished[];
|
|
1665
|
-
}
|
|
1666
1664
|
export interface FactionTerritoryWarsHistoryResponse {
|
|
1667
1665
|
territorywars: FactionTerritoryWarFinished[];
|
|
1668
1666
|
}
|
|
@@ -1819,7 +1817,7 @@ export interface UserLastAction {
|
|
|
1819
1817
|
export interface UserStatus {
|
|
1820
1818
|
description: string;
|
|
1821
1819
|
details: string | null;
|
|
1822
|
-
state: string;
|
|
1820
|
+
state: UserStatusStateEnum | string;
|
|
1823
1821
|
color: string;
|
|
1824
1822
|
until: number | null;
|
|
1825
1823
|
/** This field is replaced by the 'plane_image_type' field and will be removed on October 1st 2025. */
|
|
@@ -2348,9 +2346,7 @@ export interface KeyInfoResponse {
|
|
|
2348
2346
|
level: number;
|
|
2349
2347
|
type: ApiKeyAccessTypeEnum;
|
|
2350
2348
|
faction: boolean;
|
|
2351
|
-
faction_id?: FactionId | null;
|
|
2352
2349
|
company: boolean;
|
|
2353
|
-
company_id?: CompanyId | null;
|
|
2354
2350
|
log: {
|
|
2355
2351
|
/** Shows if key has custom log permissions enabled. */
|
|
2356
2352
|
custom_permissions: boolean;
|
|
@@ -6500,7 +6496,7 @@ export interface FactionV2 extends BaseSchema {
|
|
|
6500
6496
|
};
|
|
6501
6497
|
rankedwars: {
|
|
6502
6498
|
response: FactionRankedWarResponse;
|
|
6503
|
-
params: "
|
|
6499
|
+
params: "from" | "to" | "sort" | "timestamp";
|
|
6504
6500
|
};
|
|
6505
6501
|
rankedwarreport: {
|
|
6506
6502
|
response: FactionRankedWarReportResponse;
|
|
@@ -6535,8 +6531,8 @@ export interface FactionV2 extends BaseSchema {
|
|
|
6535
6531
|
params: "offset" | "limit" | "timestamp";
|
|
6536
6532
|
};
|
|
6537
6533
|
territorywars: {
|
|
6538
|
-
response:
|
|
6539
|
-
params: "
|
|
6534
|
+
response: FactionTerritoryWarsHistoryResponse;
|
|
6535
|
+
params: "from" | "to" | "sort" | "limit" | "timestamp";
|
|
6540
6536
|
};
|
|
6541
6537
|
territorywarreport: {
|
|
6542
6538
|
response: FactionTerritoryWarReportResponse;
|
package/dist/index.ts
CHANGED
|
@@ -26,6 +26,17 @@ export type UserPlaneImageTypeEnum =
|
|
|
26
26
|
| "light_aircraft"
|
|
27
27
|
| "airliner";
|
|
28
28
|
|
|
29
|
+
export type UserStatusStateEnum =
|
|
30
|
+
| "Abroad"
|
|
31
|
+
| "Awoken"
|
|
32
|
+
| "Dormant"
|
|
33
|
+
| "Fallen"
|
|
34
|
+
| "Federal"
|
|
35
|
+
| "Hospital"
|
|
36
|
+
| "Jail"
|
|
37
|
+
| "Okay"
|
|
38
|
+
| "Traveling";
|
|
39
|
+
|
|
29
40
|
export type UserRoleEnum =
|
|
30
41
|
| "Admin"
|
|
31
42
|
| "Officer"
|
|
@@ -87,7 +98,8 @@ export type UserTitleEnum =
|
|
|
87
98
|
| "Sage"
|
|
88
99
|
| "Coward"
|
|
89
100
|
| "Newcomer"
|
|
90
|
-
| "Deserter"
|
|
101
|
+
| "Deserter"
|
|
102
|
+
| "Citizen";
|
|
91
103
|
|
|
92
104
|
export type UserRankEnum =
|
|
93
105
|
| "Absolute beginner"
|
|
@@ -7059,10 +7071,6 @@ export interface FactionTerritoryWarOngoing {
|
|
|
7059
7071
|
factions: FactionTerritoryWarOngoingFaction[];
|
|
7060
7072
|
}
|
|
7061
7073
|
|
|
7062
|
-
export interface FactionTerritoryWarsResponse {
|
|
7063
|
-
territorywars: FactionTerritoryWarOngoing[] | FactionTerritoryWarFinished[];
|
|
7064
|
-
}
|
|
7065
|
-
|
|
7066
7074
|
export interface FactionTerritoryWarsHistoryResponse {
|
|
7067
7075
|
territorywars: FactionTerritoryWarFinished[];
|
|
7068
7076
|
}
|
|
@@ -7245,7 +7253,7 @@ export interface UserLastAction {
|
|
|
7245
7253
|
export interface UserStatus {
|
|
7246
7254
|
description: string;
|
|
7247
7255
|
details: string | null;
|
|
7248
|
-
state: string;
|
|
7256
|
+
state: UserStatusStateEnum | string;
|
|
7249
7257
|
color: string;
|
|
7250
7258
|
until: number | null;
|
|
7251
7259
|
/** This field is replaced by the 'plane_image_type' field and will be removed on October 1st 2025. */
|
|
@@ -7847,9 +7855,7 @@ export interface KeyInfoResponse {
|
|
|
7847
7855
|
level: number;
|
|
7848
7856
|
type: ApiKeyAccessTypeEnum;
|
|
7849
7857
|
faction: boolean;
|
|
7850
|
-
faction_id?: FactionId | null;
|
|
7851
7858
|
company: boolean;
|
|
7852
|
-
company_id?: CompanyId | null;
|
|
7853
7859
|
log: {
|
|
7854
7860
|
/** Shows if key has custom log permissions enabled. */
|
|
7855
7861
|
custom_permissions: boolean;
|
|
@@ -12208,7 +12214,7 @@ export interface FactionV2 extends BaseSchema {
|
|
|
12208
12214
|
};
|
|
12209
12215
|
rankedwars: {
|
|
12210
12216
|
response: FactionRankedWarResponse;
|
|
12211
|
-
params: "
|
|
12217
|
+
params: "from" | "to" | "sort" | "timestamp";
|
|
12212
12218
|
};
|
|
12213
12219
|
rankedwarreport: {
|
|
12214
12220
|
response: FactionRankedWarReportResponse;
|
|
@@ -12257,8 +12263,8 @@ export interface FactionV2 extends BaseSchema {
|
|
|
12257
12263
|
params: "offset" | "limit" | "timestamp";
|
|
12258
12264
|
};
|
|
12259
12265
|
territorywars: {
|
|
12260
|
-
response:
|
|
12261
|
-
params: "
|
|
12266
|
+
response: FactionTerritoryWarsHistoryResponse;
|
|
12267
|
+
params: "from" | "to" | "sort" | "limit" | "timestamp";
|
|
12262
12268
|
};
|
|
12263
12269
|
territorywarreport: {
|
|
12264
12270
|
response: FactionTerritoryWarReportResponse;
|
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": "
|
|
6
|
+
"version": "4.0.0"
|
|
7
7
|
},
|
|
8
8
|
"servers": [
|
|
9
9
|
{
|
|
@@ -1773,7 +1773,7 @@
|
|
|
1773
1773
|
"User"
|
|
1774
1774
|
],
|
|
1775
1775
|
"summary": "Get your personal stats",
|
|
1776
|
-
"description": "Requires public access key. <br>\n * UserPersonalStatsFull is returned only when this selection is requested with Limited, Full or Custom key access key.\n * UserPersonalStatsFullPublic is returned when the requested category is 'all'.\n * UserPersonalStatsPopular is returned when the requested category is 'popular'. Please try to use UserPersonalStatsPopular over UserPersonalStatsFullPublic wherever possible in order to reduce the server load.\n * Otherwise, UserPersonalStatsCategory is returned for the matched category.\n *
|
|
1776
|
+
"description": "Requires public access key. <br>\n * UserPersonalStatsFull is returned only when this selection is requested with Limited, Full or Custom key access key.\n * UserPersonalStatsFullPublic is returned when the requested category is 'all'.\n * UserPersonalStatsPopular is returned when the requested category is 'popular'. Please try to use UserPersonalStatsPopular over UserPersonalStatsFullPublic wherever possible in order to reduce the server load.\n * Otherwise, UserPersonalStatsCategory is returned for the matched category.\n * Historical stats can be fetched via 'stat' query parameter. It's only possible to pass up to 10 historical stats at once (the rest is trimmed). When requesting historical stats the response will be of type UserPersonalStatsHistoric.\n * Use 'timestamp' query parameter to get historical stats at the certain point in time. It's possible some historical stats didn't exist at the given timestamp, and for such stats you will not receive anything back.",
|
|
1777
1777
|
"operationId": "388e8008ae1c2645819af76d71ef92a5",
|
|
1778
1778
|
"parameters": [
|
|
1779
1779
|
{
|
|
@@ -4107,16 +4107,6 @@
|
|
|
4107
4107
|
"description": "Requires public access key. <br>",
|
|
4108
4108
|
"operationId": "4f5d624a86e2d389a7a738b6b3ce8c9e",
|
|
4109
4109
|
"parameters": [
|
|
4110
|
-
{
|
|
4111
|
-
"name": "cat",
|
|
4112
|
-
"in": "query",
|
|
4113
|
-
"description": "This parameter is deprecated. The ranked wars list can now instead be fetched via 'faction' -> 'warfare' endpoint. This functionality will be removed on 1st of September 2025.",
|
|
4114
|
-
"required": false,
|
|
4115
|
-
"deprecated": true,
|
|
4116
|
-
"schema": {
|
|
4117
|
-
"$ref": "#/components/schemas/FactionRankedWarsCategoryEnum"
|
|
4118
|
-
}
|
|
4119
|
-
},
|
|
4120
4110
|
{
|
|
4121
4111
|
"$ref": "#/components/parameters/ApiFrom"
|
|
4122
4112
|
},
|
|
@@ -4660,16 +4650,6 @@
|
|
|
4660
4650
|
"description": "Requires public access key. <br>",
|
|
4661
4651
|
"operationId": "0258963246159d1e3e54547c32aac7c8",
|
|
4662
4652
|
"parameters": [
|
|
4663
|
-
{
|
|
4664
|
-
"name": "cat",
|
|
4665
|
-
"in": "query",
|
|
4666
|
-
"description": "This parameter is deprecated. The territory wars list can now instead be fetched via 'faction' -> 'warfare' endpoint. This functionality will be removed on 1st of September 2025.",
|
|
4667
|
-
"required": false,
|
|
4668
|
-
"deprecated": true,
|
|
4669
|
-
"schema": {
|
|
4670
|
-
"$ref": "#/components/schemas/FactionTerritoryWarsCategoryEnum"
|
|
4671
|
-
}
|
|
4672
|
-
},
|
|
4673
4653
|
{
|
|
4674
4654
|
"$ref": "#/components/parameters/ApiFrom"
|
|
4675
4655
|
},
|
|
@@ -4698,7 +4678,7 @@
|
|
|
4698
4678
|
"content": {
|
|
4699
4679
|
"application/json": {
|
|
4700
4680
|
"schema": {
|
|
4701
|
-
"$ref": "#/components/schemas/
|
|
4681
|
+
"$ref": "#/components/schemas/FactionTerritoryWarsHistoryResponse"
|
|
4702
4682
|
}
|
|
4703
4683
|
}
|
|
4704
4684
|
}
|
|
@@ -5307,9 +5287,6 @@
|
|
|
5307
5287
|
{
|
|
5308
5288
|
"$ref": "#/components/schemas/FactionStatsResponse"
|
|
5309
5289
|
},
|
|
5310
|
-
{
|
|
5311
|
-
"$ref": "#/components/schemas/FactionTerritoryWarsResponse"
|
|
5312
|
-
},
|
|
5313
5290
|
{
|
|
5314
5291
|
"$ref": "#/components/schemas/FactionContributorsResponse"
|
|
5315
5292
|
},
|
|
@@ -8507,6 +8484,20 @@
|
|
|
8507
8484
|
"airliner"
|
|
8508
8485
|
]
|
|
8509
8486
|
},
|
|
8487
|
+
"UserStatusStateEnum": {
|
|
8488
|
+
"type": "string",
|
|
8489
|
+
"enum": [
|
|
8490
|
+
"Abroad",
|
|
8491
|
+
"Awoken",
|
|
8492
|
+
"Dormant",
|
|
8493
|
+
"Fallen",
|
|
8494
|
+
"Federal",
|
|
8495
|
+
"Hospital",
|
|
8496
|
+
"Jail",
|
|
8497
|
+
"Okay",
|
|
8498
|
+
"Traveling"
|
|
8499
|
+
]
|
|
8500
|
+
},
|
|
8510
8501
|
"UserRoleEnum": {
|
|
8511
8502
|
"type": "string",
|
|
8512
8503
|
"enum": [
|
|
@@ -8573,7 +8564,8 @@
|
|
|
8573
8564
|
"Sage",
|
|
8574
8565
|
"Coward",
|
|
8575
8566
|
"Newcomer",
|
|
8576
|
-
"Deserter"
|
|
8567
|
+
"Deserter",
|
|
8568
|
+
"Citizen"
|
|
8577
8569
|
]
|
|
8578
8570
|
},
|
|
8579
8571
|
"UserRankEnum": {
|
|
@@ -21529,31 +21521,6 @@
|
|
|
21529
21521
|
},
|
|
21530
21522
|
"type": "object"
|
|
21531
21523
|
},
|
|
21532
|
-
"FactionTerritoryWarsResponse": {
|
|
21533
|
-
"required": [
|
|
21534
|
-
"territorywars"
|
|
21535
|
-
],
|
|
21536
|
-
"properties": {
|
|
21537
|
-
"territorywars": {
|
|
21538
|
-
"description": "If the chosen category is 'ongoing' the response will be of 'FactionTerritoryWarOngoing' type, otherwise, the type will be 'FactionTerritoryWarFinished'.",
|
|
21539
|
-
"oneOf": [
|
|
21540
|
-
{
|
|
21541
|
-
"type": "array",
|
|
21542
|
-
"items": {
|
|
21543
|
-
"$ref": "#/components/schemas/FactionTerritoryWarOngoing"
|
|
21544
|
-
}
|
|
21545
|
-
},
|
|
21546
|
-
{
|
|
21547
|
-
"type": "array",
|
|
21548
|
-
"items": {
|
|
21549
|
-
"$ref": "#/components/schemas/FactionTerritoryWarFinished"
|
|
21550
|
-
}
|
|
21551
|
-
}
|
|
21552
|
-
]
|
|
21553
|
-
}
|
|
21554
|
-
},
|
|
21555
|
-
"type": "object"
|
|
21556
|
-
},
|
|
21557
21524
|
"FactionTerritoryWarsHistoryResponse": {
|
|
21558
21525
|
"required": [
|
|
21559
21526
|
"territorywars"
|
|
@@ -22243,7 +22210,14 @@
|
|
|
22243
22210
|
]
|
|
22244
22211
|
},
|
|
22245
22212
|
"state": {
|
|
22246
|
-
"
|
|
22213
|
+
"oneOf": [
|
|
22214
|
+
{
|
|
22215
|
+
"$ref": "#/components/schemas/UserStatusStateEnum"
|
|
22216
|
+
},
|
|
22217
|
+
{
|
|
22218
|
+
"type": "string"
|
|
22219
|
+
}
|
|
22220
|
+
]
|
|
22247
22221
|
},
|
|
22248
22222
|
"color": {
|
|
22249
22223
|
"type": "string"
|
|
@@ -24816,33 +24790,9 @@
|
|
|
24816
24790
|
"faction": {
|
|
24817
24791
|
"type": "boolean"
|
|
24818
24792
|
},
|
|
24819
|
-
"faction_id": {
|
|
24820
|
-
"description": "This field is replaced with 'user'.'faction_id' field and will be removed on 1st of September 2025. Populated only if 'faction' field is true.",
|
|
24821
|
-
"deprecated": true,
|
|
24822
|
-
"oneOf": [
|
|
24823
|
-
{
|
|
24824
|
-
"$ref": "#/components/schemas/FactionId"
|
|
24825
|
-
},
|
|
24826
|
-
{
|
|
24827
|
-
"type": "null"
|
|
24828
|
-
}
|
|
24829
|
-
]
|
|
24830
|
-
},
|
|
24831
24793
|
"company": {
|
|
24832
24794
|
"type": "boolean"
|
|
24833
24795
|
},
|
|
24834
|
-
"company_id": {
|
|
24835
|
-
"description": "This field is replaced with 'user'.'company_id' field and will be removed on 1st of September 2025. Populated only if 'company' field is true.",
|
|
24836
|
-
"deprecated": true,
|
|
24837
|
-
"oneOf": [
|
|
24838
|
-
{
|
|
24839
|
-
"$ref": "#/components/schemas/CompanyId"
|
|
24840
|
-
},
|
|
24841
|
-
{
|
|
24842
|
-
"type": "null"
|
|
24843
|
-
}
|
|
24844
|
-
]
|
|
24845
|
-
},
|
|
24846
24796
|
"log": {
|
|
24847
24797
|
"required": [
|
|
24848
24798
|
"custom_permissions",
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tornapi-typescript",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"generate-types": "tsc && node build/index.js"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@scalar/openapi-types": "^0.3.7",
|
|
10
|
-
"@types/node": "^22.18.
|
|
10
|
+
"@types/node": "^22.18.3",
|
|
11
11
|
"prettier": "^3.6.2",
|
|
12
12
|
"typeconv": "^2.3.1",
|
|
13
13
|
"typescript": "^5.9.2"
|