tornapi-typescript 5.9.0 → 6.0.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.ts CHANGED
@@ -10,51 +10,30 @@
10
10
  export type RaceClassEnum = "A" | "B" | "C" | "D" | "E";
11
11
 
12
12
  export type MissionDifficultyEnum =
13
- | "Very easy"
14
- | "Easy"
15
- | "Medium"
16
- | "Hard"
17
- | "Very hard"
18
- | "Expert";
13
+ "Very easy" | "Easy" | "Medium" | "Hard" | "Very hard" | "Expert";
19
14
 
20
15
  export type MissionStatusEnum =
21
- | "Accepted"
22
- | "Available"
23
- | "Failed"
24
- | "Completed";
16
+ "Accepted" | "Available" | "Failed" | "Completed";
25
17
 
26
18
  export type MissionRewardUpgrade = "Item" | "Ammo" | "Upgrade";
27
19
 
28
20
  export type UserDonatorStatusEnum = "Donator" | "Subscriber";
29
21
 
30
22
  export type UserMessageTypeEnum =
31
- | "Company newsletter"
32
- | "Faction newsletter"
33
- | "Warning"
34
- | "User message";
23
+ "Company newsletter" | "Faction newsletter" | "Warning" | "User message";
35
24
 
36
25
  export type JobTypeEnum =
37
- | "Army"
38
- | "Casino"
39
- | "Education"
40
- | "Grocer"
41
- | "Law"
42
- | "Medical";
26
+ "Army" | "Casino" | "Education" | "Grocer" | "Law" | "Medical";
43
27
 
44
28
  export type UserMaritalStatusEnum = "Engaged" | "Newlywed" | "Married";
45
29
 
46
30
  export type UserLastActionStatusEnum = "Online" | "Idle" | "Offline";
47
31
 
48
32
  export type UserPlaneImageTypeEnum =
49
- | "private_jet"
50
- | "light_aircraft"
51
- | "airliner";
33
+ "private_jet" | "light_aircraft" | "airliner";
52
34
 
53
35
  export type UserFlyMethodEnum =
54
- | "Private"
55
- | "Business"
56
- | "Airstrip"
57
- | "Standard";
36
+ "Private" | "Business" | "Airstrip" | "Standard";
58
37
 
59
38
  export type UserStatusStateEnum =
60
39
  | "Abroad"
@@ -1014,7 +993,7 @@ export type FactionTerritoryEnum =
1014
993
  | "FAD"
1015
994
  | "FAE"
1016
995
  | "FAF"
1017
- | "FAG"
996
+ | "XAG"
1018
997
  | "FBA"
1019
998
  | "FBB"
1020
999
  | "FBC"
@@ -4427,9 +4406,7 @@ export type FactionPositionAbilityEnum =
4427
4406
  | "Booster Loaning";
4428
4407
 
4429
4408
  export type FactionOrganizedCrimePayoutType =
4430
- | "balance"
4431
- | "wallet"
4432
- | "inventory";
4409
+ "balance" | "wallet" | "inventory";
4433
4410
 
4434
4411
  export type TornRacketType = "Item" | "Points" | "Money";
4435
4412
 
@@ -4448,19 +4425,10 @@ export type FactionNewsCategory =
4448
4425
  | "giveFunds";
4449
4426
 
4450
4427
  export type CompanyNewsCategory =
4451
- | "main"
4452
- | "funds"
4453
- | "training"
4454
- | "employees"
4455
- | "all";
4428
+ "main" | "funds" | "training" | "employees" | "all";
4456
4429
 
4457
4430
  export type FactionRankEnum =
4458
- | "Unranked"
4459
- | "Bronze"
4460
- | "Silver"
4461
- | "Gold"
4462
- | "Platinum"
4463
- | "Diamond";
4431
+ "Unranked" | "Bronze" | "Silver" | "Gold" | "Platinum" | "Diamond";
4464
4432
 
4465
4433
  export type UserCrimeUniquesRewardAmmoEnum = "standard" | "special";
4466
4434
 
@@ -4485,21 +4453,11 @@ export type TornHofCategory =
4485
4453
  export type TornFactionHofCategory = "respect" | "chains" | "rank";
4486
4454
 
4487
4455
  export type TornOrganizedCrimePositionId =
4488
- | "P1"
4489
- | "P2"
4490
- | "P3"
4491
- | "P4"
4492
- | "P5"
4493
- | "P6";
4456
+ "P1" | "P2" | "P3" | "P4" | "P5" | "P6";
4494
4457
 
4495
4458
  /** This field is now available in 'position_info' object as 'id' field.<br>This field will be removed on 1st of June 2026. */
4496
4459
  export type TornOrganizedCrimePositionIdDeprecated =
4497
- | "P1"
4498
- | "P2"
4499
- | "P3"
4500
- | "P4"
4501
- | "P5"
4502
- | "P6";
4460
+ "P1" | "P2" | "P3" | "P4" | "P5" | "P6";
4503
4461
 
4504
4462
  export type FactionTerritoryWarResultEnum =
4505
4463
  | "success_assault"
@@ -4550,11 +4508,7 @@ export type JobPositionArmyEnum =
4550
4508
  | "General";
4551
4509
 
4552
4510
  export type JobPositionGrocerEnum =
4553
- | "Bagboy"
4554
- | "Price Labeler"
4555
- | "Cashier"
4556
- | "Food Delivery"
4557
- | "Manager";
4511
+ "Bagboy" | "Price Labeler" | "Cashier" | "Food Delivery" | "Manager";
4558
4512
 
4559
4513
  export type WeaponBonusEnum =
4560
4514
  | "Any"
@@ -4730,10 +4684,7 @@ export type RaceCarUpgradeSubCategory =
4730
4684
  | "Pads";
4731
4685
 
4732
4686
  export type ApplicationStatusEnum =
4733
- | "accepted"
4734
- | "declined"
4735
- | "withdrawn"
4736
- | "active";
4687
+ "accepted" | "declined" | "withdrawn" | "active";
4737
4688
 
4738
4689
  export type FactionRankedWarsCategoryEnum = "all" | "ongoing";
4739
4690
 
@@ -4746,11 +4697,7 @@ export type FactionTerritoryWarsCategoryEnum = "finsihed" | "ongoing";
4746
4697
  export type TradeCategoryEnum = "finished" | "ongoing";
4747
4698
 
4748
4699
  export type FactionCrimeUserOutcome =
4749
- | "Successful"
4750
- | "Failed"
4751
- | "Jailed"
4752
- | "Injured"
4753
- | "Hospitalized";
4700
+ "Successful" | "Failed" | "Jailed" | "Injured" | "Hospitalized";
4754
4701
 
4755
4702
  export type FactionCrimeUserItemOutcomeEnum = "user" | "faction";
4756
4703
 
@@ -4911,21 +4858,15 @@ export type HonorRarityEnum =
4911
4858
 
4912
4859
  export type AwardCrimesVersionEnum = "v1" | "v2";
4913
4860
 
4861
+ export type CompanySearchParameter = string;
4862
+
4914
4863
  export type Parameters = string;
4915
4864
 
4916
4865
  export type ReviveSetting =
4917
- | "Everyone"
4918
- | "Friends & faction"
4919
- | "No one"
4920
- | "Unknown";
4866
+ "Everyone" | "Friends & faction" | "No one" | "Unknown";
4921
4867
 
4922
4868
  export type FactionWarfareTypeEnum =
4923
- | "ranked"
4924
- | "territory"
4925
- | "raid"
4926
- | "chain"
4927
- | "chainOngoing"
4928
- | "db";
4869
+ "ranked" | "territory" | "raid" | "chain" | "chainOngoing" | "db";
4929
4870
 
4930
4871
  export type PropertyModificationEnum =
4931
4872
  | "Hot Tub"
@@ -4946,18 +4887,10 @@ export type PropertyModificationEnum =
4946
4887
  | "Superior Interior Modification";
4947
4888
 
4948
4889
  export type PropertyStaffEnum =
4949
- | "Maid"
4950
- | "Guard"
4951
- | "Doctor"
4952
- | "Pilot"
4953
- | "Butler";
4890
+ "Maid" | "Guard" | "Doctor" | "Pilot" | "Butler";
4954
4891
 
4955
4892
  export type FactionCrimeStatusEnum =
4956
- | "Recruiting"
4957
- | "Planning"
4958
- | "Successful"
4959
- | "Failure"
4960
- | "Expired";
4893
+ "Recruiting" | "Planning" | "Successful" | "Failure" | "Expired";
4961
4894
 
4962
4895
  export type AttackActionEnum =
4963
4896
  | "attackerhosp"
@@ -4990,11 +4923,7 @@ export type AttackActionEnum =
4990
4923
  | "won";
4991
4924
 
4992
4925
  export type TornItemAmmoTypeEnum =
4993
- | "Standard"
4994
- | "Hollow Point"
4995
- | "Piercing"
4996
- | "Tracer"
4997
- | "Incendiary";
4926
+ "Standard" | "Hollow Point" | "Piercing" | "Tracer" | "Incendiary";
4998
4927
 
4999
4928
  export type TornItemWeaponTypeEnum =
5000
4929
  | "Heavy artillery"
@@ -5010,10 +4939,7 @@ export type TornItemWeaponTypeEnum =
5010
4939
  | "Mechanical";
5011
4940
 
5012
4941
  export type TornItemWeaponCategoryEnum =
5013
- | "Melee"
5014
- | "Secondary"
5015
- | "Primary"
5016
- | "Temporary";
4942
+ "Melee" | "Secondary" | "Primary" | "Temporary";
5017
4943
 
5018
4944
  export type MedalTypeEnum =
5019
4945
  | "combat"
@@ -5551,6 +5477,11 @@ export interface ErrorCategorySelectionUnavailableForInteractionLogs {
5551
5477
  error: string;
5552
5478
  }
5553
5479
 
5480
+ export interface ErrorFileDoesNotExist {
5481
+ code: 30;
5482
+ error: string;
5483
+ }
5484
+
5554
5485
  export type ApiError =
5555
5486
  | ErrorUnknown
5556
5487
  | ErrorKeyEmpty
@@ -5581,7 +5512,8 @@ export type ApiError =
5581
5512
  | ErrorOnlyCategoryOrStatsAllowed
5582
5513
  | ErrorMustMigrateToOrganizedCrimesV2
5583
5514
  | ErrorIncorrectLogId
5584
- | ErrorCategorySelectionUnavailableForInteractionLogs;
5515
+ | ErrorCategorySelectionUnavailableForInteractionLogs
5516
+ | ErrorFileDoesNotExist;
5585
5517
 
5586
5518
  export interface UserItemMod {
5587
5519
  id: ItemModId;
@@ -7722,6 +7654,7 @@ export interface FactionSearch {
7722
7654
  name: string;
7723
7655
  respect: number;
7724
7656
  members: number;
7657
+ members_max: number;
7725
7658
  leader: FactionSearchLeader;
7726
7659
  co_leader: FactionSearchLeader | null;
7727
7660
  image: string | null;
@@ -8259,9 +8192,6 @@ export interface FactionCrimeReward {
8259
8192
  export interface FactionCrimeSlot {
8260
8193
  position: string;
8261
8194
  position_info: FactionSlotPositionInfo;
8262
- position_id?: TornOrganizedCrimePositionIdDeprecated;
8263
- /** This field is now available in 'position_info' object as 'number' field.<br>This field will be removed on 1st of June 2026. */
8264
- position_number?: number;
8265
8195
  item_requirement: {
8266
8196
  id: ItemId;
8267
8197
  /** Shows if the item is reusable or consumed during the crime.<br><b>Important note: There may be alternative paths which won't consume the item, even if the item is non-reusable.</b> */
@@ -8397,10 +8327,7 @@ export interface FactionRankedWarReportResponse {
8397
8327
  };
8398
8328
  }
8399
8329
 
8400
- /**
8401
- * The following selections will fallback to API v1 and may change at any time: 'companies', 'search'.
8402
- * * The following selections are not available in API v2: 'details'.
8403
- */
8330
+ /** The following selections are not available in API v2: 'details'. */
8404
8331
  export type CompanySelectionName = string;
8405
8332
 
8406
8333
  export interface CompanyLookupResponse {
@@ -8415,6 +8342,11 @@ export interface CompaniesResponse {
8415
8342
  _metadata: RequestMetadataWithLinksAndTotal;
8416
8343
  }
8417
8344
 
8345
+ export interface CompaniesSearchResponse {
8346
+ search: CompanySearchProfile[];
8347
+ _metadata: RequestMetadataWithLinks;
8348
+ }
8349
+
8418
8350
  export interface CompanyProfileResponse {
8419
8351
  profile: CompanyProfile;
8420
8352
  }
@@ -8433,7 +8365,6 @@ export interface CompanyProfileExtended extends CompanyProfile {
8433
8365
  efficiency: number;
8434
8366
  environment: number;
8435
8367
  trains: number;
8436
- applications_allowed: boolean;
8437
8368
  advertisement_budget: number;
8438
8369
  upgrades: CompanyUpgrades;
8439
8370
  value: number;
@@ -8450,13 +8381,28 @@ export interface CompanyProfile {
8450
8381
  name: string;
8451
8382
  created_at: number;
8452
8383
  days_old: number;
8453
- image: string;
8384
+ image: string | null;
8454
8385
  type: CompanyType;
8455
8386
  rating: number;
8456
8387
  director: CompanyDirector;
8457
8388
  employees: CompanyEmployees;
8458
8389
  income: CompanyIncome;
8459
8390
  customers: CompanyCustomers;
8391
+ applications_allowed: boolean;
8392
+ }
8393
+
8394
+ export interface CompanySearchProfile {
8395
+ id: CompanyId;
8396
+ name: string;
8397
+ created_at: number;
8398
+ days_old: number;
8399
+ image: string | null;
8400
+ type: CompanyType;
8401
+ rating: number;
8402
+ employees: CompanyEmployees;
8403
+ income: CompanyIncome;
8404
+ customers: CompanyCustomers;
8405
+ applications_allowed: boolean;
8460
8406
  }
8461
8407
 
8462
8408
  export interface CompanyType {
@@ -8488,9 +8434,7 @@ export interface CompanyCustomers {
8488
8434
 
8489
8435
  export interface CompanyEmployeesResponse {
8490
8436
  employees: (
8491
- | CompanyEmployee
8492
- | CompanyEmployeeExtended
8493
- | CompanyEmployeeFull
8437
+ CompanyEmployee | CompanyEmployeeExtended | CompanyEmployeeFull
8494
8438
  )[];
8495
8439
  }
8496
8440
 
@@ -9069,7 +9013,7 @@ export interface RacingRaceDetails extends Race {
9069
9013
  }
9070
9014
 
9071
9015
  export type UserRaceDetails = RacingRaceDetails & {
9072
- skill_gain: number;
9016
+ skill_gain: number | null;
9073
9017
  };
9074
9018
 
9075
9019
  export interface RacingRaceDetailsResponse {
@@ -9266,7 +9210,6 @@ export interface TornOrganizedCrimeScope {
9266
9210
  }
9267
9211
 
9268
9212
  export interface TornOrganizedCrimeSlot {
9269
- id?: TornOrganizedCrimePositionIdDeprecated;
9270
9213
  position_info: FactionSlotPositionInfo;
9271
9214
  name: string;
9272
9215
  required_item: TornOrganizedCrimeRequiredItem | null;
@@ -9472,7 +9415,8 @@ export interface Bounty {
9472
9415
 
9473
9416
  export interface AttackLogSummary {
9474
9417
  id: UserId | null;
9475
- name: /** Name of the participant, could be null in stealthed attacks. */
9418
+ name:
9419
+ /** Name of the participant, could be null in stealthed attacks. */
9476
9420
  string | null;
9477
9421
  hits: number;
9478
9422
  misses: number;
@@ -10140,10 +10084,7 @@ export interface UserV1 extends BaseSchema {
10140
10084
  Duke: {
10141
10085
  title: string;
10142
10086
  status:
10143
- | "notAccepted"
10144
- | "accepted"
10145
- | "failed"
10146
- | "completed";
10087
+ "notAccepted" | "accepted" | "failed" | "completed";
10147
10088
  }[];
10148
10089
  };
10149
10090
  };
@@ -10870,10 +10811,7 @@ export interface FactionV1 extends BaseSchema {
10870
10811
  message: string;
10871
10812
  expires: number;
10872
10813
  status:
10873
- | "active"
10874
- | "declined"
10875
- | "withdrawn"
10876
- | "accepted";
10814
+ "active" | "declined" | "withdrawn" | "accepted";
10877
10815
  };
10878
10816
  };
10879
10817
  };
@@ -11738,10 +11676,7 @@ export interface CompanyV1 extends BaseSchema {
11738
11676
  message: string;
11739
11677
  expires: number;
11740
11678
  status:
11741
- | "active"
11742
- | "declined"
11743
- | "withdrawn"
11744
- | "accepted";
11679
+ "active" | "declined" | "withdrawn" | "accepted";
11745
11680
  };
11746
11681
  };
11747
11682
  };
@@ -13072,12 +13007,7 @@ export interface UserV2 extends BaseSchema {
13072
13007
  forumposts: {
13073
13008
  response: UserForumPostsResponse;
13074
13009
  params:
13075
- | "striptags"
13076
- | "limit"
13077
- | "sort"
13078
- | "from"
13079
- | "to"
13080
- | "timestamp";
13010
+ "striptags" | "limit" | "sort" | "from" | "to" | "timestamp";
13081
13011
  };
13082
13012
  forumsubscribedthreads: {
13083
13013
  response: UserForumSubscribedThreadsResponse;
@@ -13126,12 +13056,7 @@ export interface UserV2 extends BaseSchema {
13126
13056
  list: {
13127
13057
  response: UserListResponse;
13128
13058
  params:
13129
- | "cat"
13130
- | "striptags"
13131
- | "limit"
13132
- | "offset"
13133
- | "sort"
13134
- | "timestamp";
13059
+ "cat" | "striptags" | "limit" | "offset" | "sort" | "timestamp";
13135
13060
  };
13136
13061
  log: {
13137
13062
  response: UserLogsResponse;
@@ -13215,12 +13140,7 @@ export interface UserV2 extends BaseSchema {
13215
13140
  reports: {
13216
13141
  response: ReportsResponse;
13217
13142
  params:
13218
- | "cat"
13219
- | "target"
13220
- | "limit"
13221
- | "offset"
13222
- | "sort"
13223
- | "timestamp";
13143
+ "cat" | "target" | "limit" | "offset" | "sort" | "timestamp";
13224
13144
  };
13225
13145
  revives: {
13226
13146
  response: RevivesResponse;
@@ -13386,12 +13306,7 @@ export interface FactionV2 extends BaseSchema {
13386
13306
  reports: {
13387
13307
  response: ReportsResponse;
13388
13308
  params:
13389
- | "cat"
13390
- | "target"
13391
- | "limit"
13392
- | "offset"
13393
- | "sort"
13394
- | "timestamp";
13309
+ "cat" | "target" | "limit" | "offset" | "sort" | "timestamp";
13395
13310
  };
13396
13311
  revives: {
13397
13312
  response: RevivesResponse;
@@ -13490,6 +13405,14 @@ export interface CompanyV2 extends BaseSchema {
13490
13405
  response: CompanyProfileResponseMixed;
13491
13406
  params: "striptags" | "timestamp";
13492
13407
  };
13408
+ search: {
13409
+ response: CompaniesSearchResponse;
13410
+ params: "name" | "filters" | "limit" | "offset" | "timestamp";
13411
+ };
13412
+ snapshot: {
13413
+ response: null;
13414
+ params: "timestamp";
13415
+ };
13493
13416
  stock: {
13494
13417
  response: CompanyStockResponse;
13495
13418
  params: "timestamp";
@@ -13572,20 +13495,12 @@ export interface MarketV2 extends BaseSchema {
13572
13495
  properties: {
13573
13496
  response: MarketPropertiesResponse;
13574
13497
  params:
13575
- | "propertyTypeId"
13576
- | "offset"
13577
- | "limit"
13578
- | "sort"
13579
- | "timestamp";
13498
+ "propertyTypeId" | "offset" | "limit" | "sort" | "timestamp";
13580
13499
  };
13581
13500
  rentals: {
13582
13501
  response: MarketRentalsResponse;
13583
13502
  params:
13584
- | "propertyTypeId"
13585
- | "offset"
13586
- | "limit"
13587
- | "sort"
13588
- | "timestamp";
13503
+ "propertyTypeId" | "offset" | "limit" | "sort" | "timestamp";
13589
13504
  };
13590
13505
  lookup: {
13591
13506
  response: MarketLookupResponse;