tornapi-typescript 0.0.4 → 0.0.6

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
@@ -178,6 +178,8 @@ export type WeaponBonusEnum =
178
178
  | "Wind-up"
179
179
  | "Wither";
180
180
 
181
+ export type UserListEnum = "Friends" | "Enemies" | "Targets";
182
+
181
183
  export type JobPositionCasinoEnum =
182
184
  | "Gaming Consultant"
183
185
  | "Marketing Manager"
@@ -281,6 +283,13 @@ export type FactionApplicationStatusEnum =
281
283
 
282
284
  export type FactionRankedWarsCategoryEnum = "all" | "ongoing";
283
285
 
286
+ export type FactionCrimeUserOutcome =
287
+ | "Successful"
288
+ | "Failed"
289
+ | "Jailed"
290
+ | "Injured"
291
+ | "Hospitalized";
292
+
284
293
  export type RaceId = number;
285
294
 
286
295
  export type RaceTrackId = number;
@@ -301,6 +310,13 @@ export type ItemUid = number;
301
310
 
302
311
  export type UserId = number;
303
312
 
313
+ export type UserIdNullable = number | null;
314
+
315
+ export type UserIdNullableDeprecated =
316
+ /** This field is replaced with the 'user.id' and will be removed on the 1st of May 2025. */
317
+ | number /** This field is replaced with the 'user.id' and will be removed on the 1st of May 2025. */
318
+ | null;
319
+
304
320
  export type ReviveId = number;
305
321
 
306
322
  export type LogId = number;
@@ -309,6 +325,8 @@ export type LogCategoryId = number;
309
325
 
310
326
  export type FactionId = number;
311
327
 
328
+ export type FactionIdNullable = number | null;
329
+
312
330
  export type FactionCrimeId = number;
313
331
 
314
332
  export type ChainId = number;
@@ -919,6 +937,7 @@ export interface FactionChainReportAttackerAttacks {
919
937
 
920
938
  export interface FactionCrimeUser {
921
939
  id: UserId;
940
+ outcome: FactionCrimeUserOutcome;
922
941
  /** The timestamp at which the user joined the slot. */
923
942
  joined_at: number;
924
943
  /** Current planning progress on the slot. */
@@ -942,23 +961,27 @@ export interface FactionCrimeReward {
942
961
  money: number;
943
962
  items: FactionCrimeRewardItem[];
944
963
  respect: number;
964
+ scope: number;
945
965
  payout: FactionCrimeRewardPayout | null;
946
966
  }
947
967
 
948
968
  export interface FactionCrimeSlot {
949
969
  position: string;
950
970
  item_requirement: {
951
- id?: ItemId;
971
+ id: ItemId;
952
972
  /** Shows if the item is reusable or consumed during the crime. */
953
- is_reusable?: boolean;
973
+ is_reusable: boolean;
954
974
  /** Shows if user has the required item. */
955
- is_available?: boolean;
975
+ is_available: boolean;
956
976
  } | null;
957
- user_id: UserId;
977
+ user_id: UserIdNullableDeprecated;
958
978
  user: FactionCrimeUser | null;
959
- /** This field is replaced with 'crime_pass_rate' field and will be removed on 1st of May 2025. */
979
+ /** This field is replaced with 'checkpoint_pass_rate' field and will be removed on 1st of May 2025. */
960
980
  success_chance: number;
981
+ /** This field is replaced with 'checkpoint_pass_rate' field and will be removed on 1st of May 2025. */
961
982
  crime_pass_rate: number;
983
+ /** Returns CPR for the player who joined the slot. If the slot is empty (availalbe), it shows your CPR for that slot. This value is 0 for expired crimes. */
984
+ checkpoint_pass_rate: number;
962
985
  }
963
986
 
964
987
  export interface FactionCrime {
@@ -1614,7 +1637,7 @@ export interface TornItemWeaponDetails {
1614
1637
  base_stats: TornItemBaseStats;
1615
1638
  category: TornItemWeaponCategoryEnum;
1616
1639
  ammo: {
1617
- "": AmmoId;
1640
+ id: AmmoId;
1618
1641
  name: string;
1619
1642
  magazine_rounds: number;
1620
1643
  rate_of_fire: {
@@ -2938,6 +2961,20 @@ export interface UserOrganizedCrimeResponse {
2938
2961
  organizedCrime: FactionCrime | null;
2939
2962
  }
2940
2963
 
2964
+ export interface UserList {
2965
+ id: UserId;
2966
+ name: string;
2967
+ level: number;
2968
+ faction_id: FactionId & (number | null);
2969
+ last_action: UserLastAction;
2970
+ status: UserStatus;
2971
+ }
2972
+
2973
+ export interface UserListResponse {
2974
+ list: UserList[];
2975
+ _metadata: RequestMetadataWithLinks;
2976
+ }
2977
+
2941
2978
  /** The following selections will fallback to API v1 and may change at any time: 'ammo','bars','basic','battlestats','bazaar','cooldowns','criminalrecord','discord','display','education','equipment','events','gym','honors','icons','inventory','jobpoints','log','medals','merits','messages','missions','money','networth','newevents','newmessages','notifications','perks','profile','properties','refills','reports','skills','stocks','travel','weaponexp','workstats'. */
2942
2979
  export type UserSelectionName =
2943
2980
  | "attacks"
@@ -2955,6 +2992,7 @@ export type UserSelectionName =
2955
2992
  | "hof"
2956
2993
  | "itemmarket"
2957
2994
  | "jobranks"
2995
+ | "list"
2958
2996
  | "lookup"
2959
2997
  | "organizedcrime"
2960
2998
  | "personalstats"
package/dist/openapi.json CHANGED
@@ -795,6 +795,53 @@
795
795
  ]
796
796
  }
797
797
  },
798
+ "/user/list": {
799
+ "get": {
800
+ "tags": [
801
+ "User",
802
+ "Unstable"
803
+ ],
804
+ "summary": "Get your friends, enemies or targets list",
805
+ "description": "Requires limited access key. <br>",
806
+ "parameters": [
807
+ {
808
+ "name": "cat",
809
+ "in": "query",
810
+ "description": "Select list type",
811
+ "required": true,
812
+ "schema": {
813
+ "$ref": "#/components/schemas/UserListEnum"
814
+ }
815
+ },
816
+ {
817
+ "$ref": "#/components/parameters/ApiLimit50"
818
+ },
819
+ {
820
+ "$ref": "#/components/parameters/ApiOffsetNoDefault"
821
+ },
822
+ {
823
+ "$ref": "#/components/parameters/ApiSortAsc"
824
+ }
825
+ ],
826
+ "responses": {
827
+ "200": {
828
+ "description": "Successful operation",
829
+ "content": {
830
+ "application/json": {
831
+ "schema": {
832
+ "$ref": "#/components/schemas/UserListResponse"
833
+ }
834
+ }
835
+ }
836
+ }
837
+ },
838
+ "security": [
839
+ {
840
+ "api_key": []
841
+ }
842
+ ]
843
+ }
844
+ },
798
845
  "/user/organizedcrime": {
799
846
  "get": {
800
847
  "tags": [
@@ -1310,6 +1357,9 @@
1310
1357
  {
1311
1358
  "$ref": "#/components/schemas/UserItemMarketResponse"
1312
1359
  },
1360
+ {
1361
+ "$ref": "#/components/schemas/UserListResponse"
1362
+ },
1313
1363
  {
1314
1364
  "$ref": "#/components/schemas/UserPersonalStatsResponse"
1315
1365
  },
@@ -4494,6 +4544,14 @@
4494
4544
  "Wither"
4495
4545
  ]
4496
4546
  },
4547
+ "UserListEnum": {
4548
+ "type": "string",
4549
+ "enum": [
4550
+ "Friends",
4551
+ "Enemies",
4552
+ "Targets"
4553
+ ]
4554
+ },
4497
4555
  "JobPositionCasinoEnum": {
4498
4556
  "type": "string",
4499
4557
  "enum": [
@@ -4623,6 +4681,16 @@
4623
4681
  "ongoing"
4624
4682
  ]
4625
4683
  },
4684
+ "FactionCrimeUserOutcome": {
4685
+ "type": "string",
4686
+ "enum": [
4687
+ "Successful",
4688
+ "Failed",
4689
+ "Jailed",
4690
+ "Injured",
4691
+ "Hospitalized"
4692
+ ]
4693
+ },
4626
4694
  "RaceId": {
4627
4695
  "type": "integer"
4628
4696
  },
@@ -4653,6 +4721,16 @@
4653
4721
  "UserId": {
4654
4722
  "type": "integer"
4655
4723
  },
4724
+ "UserIdNullable": {
4725
+ "type": "integer",
4726
+ "nullable": true
4727
+ },
4728
+ "UserIdNullableDeprecated": {
4729
+ "description": "This field is replaced with the 'user.id' and will be removed on the 1st of May 2025.",
4730
+ "type": "integer",
4731
+ "nullable": true,
4732
+ "deprecated": true
4733
+ },
4656
4734
  "ReviveId": {
4657
4735
  "type": "integer"
4658
4736
  },
@@ -4665,6 +4743,10 @@
4665
4743
  "FactionId": {
4666
4744
  "type": "integer"
4667
4745
  },
4746
+ "FactionIdNullable": {
4747
+ "type": "integer",
4748
+ "nullable": true
4749
+ },
4668
4750
  "FactionCrimeId": {
4669
4751
  "type": "integer"
4670
4752
  },
@@ -6458,6 +6540,9 @@
6458
6540
  "id": {
6459
6541
  "$ref": "#/components/schemas/UserId"
6460
6542
  },
6543
+ "outcome": {
6544
+ "$ref": "#/components/schemas/FactionCrimeUserOutcome"
6545
+ },
6461
6546
  "joined_at": {
6462
6547
  "description": "The timestamp at which the user joined the slot.",
6463
6548
  "type": "integer"
@@ -6471,11 +6556,16 @@
6471
6556
  "type": "object",
6472
6557
  "required": [
6473
6558
  "id",
6559
+ "outcome",
6474
6560
  "joined_at",
6475
6561
  "progress"
6476
6562
  ]
6477
6563
  },
6478
6564
  "FactionCrimeRewardItem": {
6565
+ "required": [
6566
+ "id",
6567
+ "quantity"
6568
+ ],
6479
6569
  "properties": {
6480
6570
  "id": {
6481
6571
  "$ref": "#/components/schemas/ItemId"
@@ -6484,13 +6574,15 @@
6484
6574
  "type": "integer"
6485
6575
  }
6486
6576
  },
6487
- "type": "object",
6488
- "required": [
6489
- "id",
6490
- "quantity"
6491
- ]
6577
+ "type": "object"
6492
6578
  },
6493
6579
  "FactionCrimeRewardPayout": {
6580
+ "required": [
6581
+ "type",
6582
+ "percentage",
6583
+ "paid_by",
6584
+ "paid_at"
6585
+ ],
6494
6586
  "properties": {
6495
6587
  "type": {
6496
6588
  "$ref": "#/components/schemas/FactionOrganizedCrimePayoutType"
@@ -6506,15 +6598,16 @@
6506
6598
  "type": "integer"
6507
6599
  }
6508
6600
  },
6509
- "type": "object",
6510
- "required": [
6511
- "type",
6512
- "percentage",
6513
- "paid_by",
6514
- "paid_at"
6515
- ]
6601
+ "type": "object"
6516
6602
  },
6517
6603
  "FactionCrimeReward": {
6604
+ "required": [
6605
+ "money",
6606
+ "items",
6607
+ "respect",
6608
+ "scope",
6609
+ "payout"
6610
+ ],
6518
6611
  "properties": {
6519
6612
  "money": {
6520
6613
  "type": "integer"
@@ -6528,6 +6621,9 @@
6528
6621
  "respect": {
6529
6622
  "type": "integer"
6530
6623
  },
6624
+ "scope": {
6625
+ "type": "integer"
6626
+ },
6531
6627
  "payout": {
6532
6628
  "description": "Details about the crime payouts. This field is null if the crime has not been paid via the automatic payouts system.",
6533
6629
  "allOf": [
@@ -6541,21 +6637,29 @@
6541
6637
  ]
6542
6638
  }
6543
6639
  },
6544
- "type": "object",
6545
- "required": [
6546
- "money",
6547
- "items",
6548
- "respect",
6549
- "payout"
6550
- ]
6640
+ "type": "object"
6551
6641
  },
6552
6642
  "FactionCrimeSlot": {
6643
+ "required": [
6644
+ "position",
6645
+ "item_requirement",
6646
+ "user_id",
6647
+ "user",
6648
+ "success_chance",
6649
+ "crime_pass_rate",
6650
+ "checkpoint_pass_rate"
6651
+ ],
6553
6652
  "properties": {
6554
6653
  "position": {
6555
6654
  "type": "string"
6556
6655
  },
6557
6656
  "item_requirement": {
6558
6657
  "description": "Details of item required for the slot, if applicable.",
6658
+ "required": [
6659
+ "id",
6660
+ "is_reusable",
6661
+ "is_available"
6662
+ ],
6559
6663
  "allOf": [
6560
6664
  {
6561
6665
  "properties": {
@@ -6580,7 +6684,7 @@
6580
6684
  ]
6581
6685
  },
6582
6686
  "user_id": {
6583
- "$ref": "#/components/schemas/UserId"
6687
+ "$ref": "#/components/schemas/UserIdNullableDeprecated"
6584
6688
  },
6585
6689
  "user": {
6586
6690
  "description": "Details about the user joined the slot, if any.",
@@ -6595,25 +6699,36 @@
6595
6699
  ]
6596
6700
  },
6597
6701
  "success_chance": {
6598
- "description": "This field is replaced with 'crime_pass_rate' field and will be removed on 1st of May 2025.",
6702
+ "description": "This field is replaced with 'checkpoint_pass_rate' field and will be removed on 1st of May 2025.",
6599
6703
  "type": "integer",
6600
6704
  "deprecated": true
6601
6705
  },
6602
6706
  "crime_pass_rate": {
6707
+ "description": "This field is replaced with 'checkpoint_pass_rate' field and will be removed on 1st of May 2025.",
6708
+ "type": "integer",
6709
+ "deprecated": true
6710
+ },
6711
+ "checkpoint_pass_rate": {
6712
+ "description": "Returns CPR for the player who joined the slot. If the slot is empty (availalbe), it shows your CPR for that slot. This value is 0 for expired crimes.",
6603
6713
  "type": "integer"
6604
6714
  }
6605
6715
  },
6606
- "type": "object",
6607
- "required": [
6608
- "position",
6609
- "item_requirement",
6610
- "user_id",
6611
- "user",
6612
- "success_chance",
6613
- "crime_pass_rate"
6614
- ]
6716
+ "type": "object"
6615
6717
  },
6616
6718
  "FactionCrime": {
6719
+ "required": [
6720
+ "id",
6721
+ "name",
6722
+ "difficulty",
6723
+ "status",
6724
+ "created_at",
6725
+ "planning_at",
6726
+ "ready_at",
6727
+ "expired_at",
6728
+ "executed_at",
6729
+ "slots",
6730
+ "rewards"
6731
+ ],
6617
6732
  "properties": {
6618
6733
  "id": {
6619
6734
  "$ref": "#/components/schemas/FactionCrimeId"
@@ -6669,20 +6784,7 @@
6669
6784
  ]
6670
6785
  }
6671
6786
  },
6672
- "type": "object",
6673
- "required": [
6674
- "id",
6675
- "name",
6676
- "difficulty",
6677
- "status",
6678
- "created_at",
6679
- "planning_at",
6680
- "ready_at",
6681
- "expired_at",
6682
- "executed_at",
6683
- "slots",
6684
- "rewards"
6685
- ]
6787
+ "type": "object"
6686
6788
  },
6687
6789
  "FactionCrimesResponse": {
6688
6790
  "properties": {
@@ -8732,7 +8834,7 @@
8732
8834
  },
8733
8835
  "ammo": {
8734
8836
  "properties": {
8735
- "": {
8837
+ "id": {
8736
8838
  "$ref": "#/components/schemas/AmmoId"
8737
8839
  },
8738
8840
  "name": {
@@ -8760,7 +8862,7 @@
8760
8862
  "type": "object",
8761
8863
  "nullable": true,
8762
8864
  "required": [
8763
- "",
8865
+ "id",
8764
8866
  "name",
8765
8867
  "magazine_rounds",
8766
8868
  "rate_of_fire"
@@ -12848,6 +12950,64 @@
12848
12950
  "organizedCrime"
12849
12951
  ]
12850
12952
  },
12953
+ "UserList": {
12954
+ "properties": {
12955
+ "id": {
12956
+ "$ref": "#/components/schemas/UserId"
12957
+ },
12958
+ "name": {
12959
+ "type": "string"
12960
+ },
12961
+ "level": {
12962
+ "type": "integer"
12963
+ },
12964
+ "faction_id": {
12965
+ "nullable": true,
12966
+ "allOf": [
12967
+ {
12968
+ "$ref": "#/components/schemas/FactionId"
12969
+ },
12970
+ {
12971
+ "type": "integer",
12972
+ "nullable": true
12973
+ }
12974
+ ]
12975
+ },
12976
+ "last_action": {
12977
+ "$ref": "#/components/schemas/UserLastAction"
12978
+ },
12979
+ "status": {
12980
+ "$ref": "#/components/schemas/UserStatus"
12981
+ }
12982
+ },
12983
+ "type": "object",
12984
+ "required": [
12985
+ "id",
12986
+ "name",
12987
+ "level",
12988
+ "faction_id",
12989
+ "last_action",
12990
+ "status"
12991
+ ]
12992
+ },
12993
+ "UserListResponse": {
12994
+ "properties": {
12995
+ "list": {
12996
+ "type": "array",
12997
+ "items": {
12998
+ "$ref": "#/components/schemas/UserList"
12999
+ }
13000
+ },
13001
+ "_metadata": {
13002
+ "$ref": "#/components/schemas/RequestMetadataWithLinks"
13003
+ }
13004
+ },
13005
+ "type": "object",
13006
+ "required": [
13007
+ "list",
13008
+ "_metadata"
13009
+ ]
13010
+ },
12851
13011
  "UserSelectionName": {
12852
13012
  "description": "The following selections will fallback to API v1 and may change at any time: 'ammo','bars','basic','battlestats','bazaar','cooldowns','criminalrecord','discord','display','education','equipment','events','gym','honors','icons','inventory','jobpoints','log','medals','merits','messages','missions','money','networth','newevents','newmessages','notifications','perks','profile','properties','refills','reports','skills','stocks','travel','weaponexp','workstats'.",
12853
13013
  "type": "string",
@@ -12867,6 +13027,7 @@
12867
13027
  "hof",
12868
13028
  "itemmarket",
12869
13029
  "jobranks",
13030
+ "list",
12870
13031
  "lookup",
12871
13032
  "organizedcrime",
12872
13033
  "personalstats",
@@ -12956,6 +13117,17 @@
12956
13117
  "type": "string"
12957
13118
  }
12958
13119
  },
13120
+ "ApiLimit50": {
13121
+ "name": "limit",
13122
+ "in": "query",
13123
+ "required": false,
13124
+ "schema": {
13125
+ "type": "integer",
13126
+ "default": 50,
13127
+ "maximum": 50,
13128
+ "minimum": 1
13129
+ }
13130
+ },
12959
13131
  "ApiLimit100": {
12960
13132
  "name": "limit",
12961
13133
  "in": "query",
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "0.0.4",
4
+ "version": "0.0.6",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },
8
8
  "devDependencies": {
9
- "@scalar/openapi-types": "^0.1.7",
10
- "@types/node": "^22.13.1",
11
- "prettier": "^3.5.1",
9
+ "@scalar/openapi-types": "^0.1.9",
10
+ "@types/node": "^22.13.10",
11
+ "prettier": "^3.5.3",
12
12
  "typeconv": "^2.3.1",
13
- "typescript": "^5.7.3"
13
+ "typescript": "^5.8.2"
14
14
  },
15
15
  "types": "./dist/index.d.ts",
16
16
  "files": [