tornapi-typescript 5.2.3 → 5.3.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 CHANGED
@@ -39,6 +39,7 @@ export type RaceStatusEnum = "open" | "in_progress" | "finished";
39
39
  export type TornHofCategory = "level" | "busts" | "rank" | "traveltime" | "workstats" | "networth" | "revives" | "defends" | "offences" | "attacks" | "awards" | "racingwins" | "racingpoints" | "racingskill";
40
40
  export type TornFactionHofCategory = "respect" | "chains" | "rank";
41
41
  export type TornOrganizedCrimePositionId = "P1" | "P2" | "P3" | "P4" | "P5" | "P6";
42
+ export type TornOrganizedCrimePositionIdDeprecated = TornOrganizedCrimePositionId;
42
43
  export type FactionTerritoryWarResultEnum = "success_assault" | "fail_assault" | "end_with_nap" | "end_with_destroy_attack" | "end_with_destroy_defense" | "end_with_peace_treaty";
43
44
  export type FactionAttackResult = "None" | "Attacked" | "Mugged" | "Hospitalized" | "Arrested" | "Looted" | "Lost" | "Stalemate" | "Assist" | "Escape" | "Timeout" | "Special" | "Bounty" | "Interrupted";
44
45
  export type RaceCarUpgradeCategory = "Aerodynamics" | "Brakes" | "Engine" | "Exhaust and Induction" | "Fuel" | "Safety" | "Suspension" | "Transmission" | "Weight Reduction" | "Wheels and Tyres";
@@ -483,6 +484,10 @@ export interface ErrorCategorySelectionUnavailableForInteractionLogs {
483
484
  error: string;
484
485
  }
485
486
  export type ApiError = ErrorUnknown | ErrorKeyEmpty | ErrorIncorrectKey | ErrorWrongType | ErrorWrongFields | ErrorTooManyRequests | ErrorIncorrectId | ErrorIncorrectIdEntityRelation | ErrorIpBlocked | ErrorApiDisabled | ErrorKeyOwnerInFederalJail | ErrorKeyChangeCooldown | ErrorKeyReadError | ErrorKeyTemporaryDisabled | ErrorDailyReadLimitReached | ErrorLogUnavailable | ErrorAccessLevelTooLow | ErrorBackendError | ErrorApiKeyPaused | ErrorMustMigrateToCrimesV2 | ErrorRaceNotFinished | ErrorIncorrectCategory | ErrorOnlyAvailableInApiV1 | ErrorOnlyAvailableInApiV2 | ErrorClosedTemporarily | ErrorInvalidStatRequested | ErrorOnlyCategoryOrStatsAllowed | ErrorMustMigrateToOrganizedCrimesV2 | ErrorIncorrectLogId | ErrorCategorySelectionUnavailableForInteractionLogs;
487
+ export interface UserOrganizedCrimesResponse {
488
+ organizedcrimes?: FactionCrime[];
489
+ _metadata: RequestMetadataWithLinks;
490
+ }
486
491
  export type UserEquipment = TornItemDetails & {
487
492
  slot: number;
488
493
  };
@@ -1170,6 +1175,7 @@ export interface UserCalendarResponse {
1170
1175
  }
1171
1176
  export interface UserBountiesResponse {
1172
1177
  bounties: Bounty[];
1178
+ bounties_timestamp: number;
1173
1179
  }
1174
1180
  export interface UserJobRanks {
1175
1181
  army: JobPositionArmyEnum;
@@ -1854,6 +1860,11 @@ export interface FactionRaidReport {
1854
1860
  aggressor: FactionRaidReportFaction;
1855
1861
  defender: FactionRaidReportFaction;
1856
1862
  }
1863
+ export interface FactionSlotPositionInfo {
1864
+ id: TornOrganizedCrimePositionId;
1865
+ label: string;
1866
+ number: number;
1867
+ }
1857
1868
  export interface FactionRaidReportFaction {
1858
1869
  id: FactionId;
1859
1870
  name: string;
@@ -2405,8 +2416,10 @@ export interface FactionCrimeReward {
2405
2416
  }
2406
2417
  export interface FactionCrimeSlot {
2407
2418
  position: string;
2408
- position_id: TornOrganizedCrimePositionId;
2409
- position_number: number;
2419
+ position_info: FactionSlotPositionInfo;
2420
+ position_id?: TornOrganizedCrimePositionIdDeprecated;
2421
+ /** This field is now available in 'position_info' object as 'number' field.<br>This field will be removed on 1st of June 2026. */
2422
+ position_number?: number;
2410
2423
  item_requirement: {
2411
2424
  id: ItemId;
2412
2425
  /** 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> */
@@ -2709,6 +2722,7 @@ export interface MarketRentalDetails {
2709
2722
  }
2710
2723
  export interface MarketRentalsResponse {
2711
2724
  rentals: MarketRentalDetails;
2725
+ rentals_timestamp: number;
2712
2726
  _metadata: RequestMetadataWithLinks;
2713
2727
  }
2714
2728
  export interface MarketPropertyDetails {
@@ -2723,6 +2737,7 @@ export interface MarketPropertyDetails {
2723
2737
  }
2724
2738
  export interface MarketPropertiesResponse {
2725
2739
  properties: MarketPropertyDetails;
2740
+ properties_timestamp: number;
2726
2741
  _metadata: RequestMetadataWithLinks;
2727
2742
  }
2728
2743
  export interface BazaarWeekly {
@@ -3055,7 +3070,8 @@ export interface TornOrganizedCrimeScope {
3055
3070
  return: number;
3056
3071
  }
3057
3072
  export interface TornOrganizedCrimeSlot {
3058
- id: TornOrganizedCrimePositionId;
3073
+ id?: TornOrganizedCrimePositionIdDeprecated;
3074
+ position_info: FactionSlotPositionInfo;
3059
3075
  name: string;
3060
3076
  required_item: TornOrganizedCrimeRequiredItem | null;
3061
3077
  }
@@ -3267,6 +3283,7 @@ export interface AttackLogResponse {
3267
3283
  }
3268
3284
  export interface TornBountiesResponse {
3269
3285
  bounties: Bounty[];
3286
+ bounties_timestamp: number;
3270
3287
  _metadata: RequestMetadataWithLinks;
3271
3288
  }
3272
3289
  export interface TornItemAmmo {
@@ -6801,6 +6818,10 @@ export interface UserV2 extends BaseSchema {
6801
6818
  response: UserOrganizedCrimeResponse;
6802
6819
  params: "timestamp";
6803
6820
  };
6821
+ organizedcrimes: {
6822
+ response: UserOrganizedCrimesResponse;
6823
+ params: "timestamp";
6824
+ };
6804
6825
  personalstats: {
6805
6826
  response: UserPersonalStatsResponse;
6806
6827
  params: "cat" | "stat" | "timestamp";
package/dist/index.ts CHANGED
@@ -4484,6 +4484,9 @@ export type TornOrganizedCrimePositionId =
4484
4484
  | "P5"
4485
4485
  | "P6";
4486
4486
 
4487
+ export type TornOrganizedCrimePositionIdDeprecated =
4488
+ TornOrganizedCrimePositionId;
4489
+
4487
4490
  export type FactionTerritoryWarResultEnum =
4488
4491
  | "success_assault"
4489
4492
  | "fail_assault"
@@ -5509,6 +5512,11 @@ export type ApiError =
5509
5512
  | ErrorIncorrectLogId
5510
5513
  | ErrorCategorySelectionUnavailableForInteractionLogs;
5511
5514
 
5515
+ export interface UserOrganizedCrimesResponse {
5516
+ organizedcrimes?: FactionCrime[];
5517
+ _metadata: RequestMetadataWithLinks;
5518
+ }
5519
+
5512
5520
  export type UserEquipment = TornItemDetails & {
5513
5521
  slot: number;
5514
5522
  };
@@ -6326,6 +6334,7 @@ export interface UserCalendarResponse {
6326
6334
 
6327
6335
  export interface UserBountiesResponse {
6328
6336
  bounties: Bounty[];
6337
+ bounties_timestamp: number;
6329
6338
  }
6330
6339
 
6331
6340
  export interface UserJobRanks {
@@ -7372,6 +7381,12 @@ export interface FactionRaidReport {
7372
7381
  defender: FactionRaidReportFaction;
7373
7382
  }
7374
7383
 
7384
+ export interface FactionSlotPositionInfo {
7385
+ id: TornOrganizedCrimePositionId;
7386
+ label: string;
7387
+ number: number;
7388
+ }
7389
+
7375
7390
  export interface FactionRaidReportFaction {
7376
7391
  id: FactionId;
7377
7392
  name: string;
@@ -8006,8 +8021,10 @@ export interface FactionCrimeReward {
8006
8021
 
8007
8022
  export interface FactionCrimeSlot {
8008
8023
  position: string;
8009
- position_id: TornOrganizedCrimePositionId;
8010
- position_number: number;
8024
+ position_info: FactionSlotPositionInfo;
8025
+ position_id?: TornOrganizedCrimePositionIdDeprecated;
8026
+ /** This field is now available in 'position_info' object as 'number' field.<br>This field will be removed on 1st of June 2026. */
8027
+ position_number?: number;
8011
8028
  item_requirement: {
8012
8029
  id: ItemId;
8013
8030
  /** 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> */
@@ -8352,6 +8369,7 @@ export interface MarketRentalDetails {
8352
8369
 
8353
8370
  export interface MarketRentalsResponse {
8354
8371
  rentals: MarketRentalDetails;
8372
+ rentals_timestamp: number;
8355
8373
  _metadata: RequestMetadataWithLinks;
8356
8374
  }
8357
8375
 
@@ -8368,6 +8386,7 @@ export interface MarketPropertyDetails {
8368
8386
 
8369
8387
  export interface MarketPropertiesResponse {
8370
8388
  properties: MarketPropertyDetails;
8389
+ properties_timestamp: number;
8371
8390
  _metadata: RequestMetadataWithLinks;
8372
8391
  }
8373
8392
 
@@ -8760,7 +8779,8 @@ export interface TornOrganizedCrimeScope {
8760
8779
  }
8761
8780
 
8762
8781
  export interface TornOrganizedCrimeSlot {
8763
- id: TornOrganizedCrimePositionId;
8782
+ id?: TornOrganizedCrimePositionIdDeprecated;
8783
+ position_info: FactionSlotPositionInfo;
8764
8784
  name: string;
8765
8785
  required_item: TornOrganizedCrimeRequiredItem | null;
8766
8786
  }
@@ -9009,6 +9029,7 @@ export interface AttackLogResponse {
9009
9029
 
9010
9030
  export interface TornBountiesResponse {
9011
9031
  bounties: Bounty[];
9032
+ bounties_timestamp: number;
9012
9033
  _metadata: RequestMetadataWithLinks;
9013
9034
  }
9014
9035
 
@@ -12638,6 +12659,10 @@ export interface UserV2 extends BaseSchema {
12638
12659
  response: UserOrganizedCrimeResponse;
12639
12660
  params: "timestamp";
12640
12661
  };
12662
+ organizedcrimes: {
12663
+ response: UserOrganizedCrimesResponse;
12664
+ params: "timestamp";
12665
+ };
12641
12666
  personalstats: {
12642
12667
  response: UserPersonalStatsResponse;
12643
12668
  params: "cat" | "stat" | "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": "5.2.3"
6
+ "version": "5.3.0"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -2243,6 +2243,45 @@
2243
2243
  "x-stability": "Stable"
2244
2244
  }
2245
2245
  },
2246
+ "/user/organizedcrimes": {
2247
+ "get": {
2248
+ "tags": [
2249
+ "User"
2250
+ ],
2251
+ "summary": "Get available slots for organized crimes with status 'Recruiting'",
2252
+ "description": "Requires minimal access key. <br>Unlike 'faction' -> 'crimes', this selection only shows empty slots, and only for crimes with the 'Recruiting' status.",
2253
+ "operationId": "getMyAvailableOrganizedCrimes",
2254
+ "parameters": [
2255
+ {
2256
+ "$ref": "#/components/parameters/ApiTimestamp"
2257
+ },
2258
+ {
2259
+ "$ref": "#/components/parameters/ApiComment"
2260
+ },
2261
+ {
2262
+ "$ref": "#/components/parameters/ApiKeyMinimal"
2263
+ }
2264
+ ],
2265
+ "responses": {
2266
+ "200": {
2267
+ "description": "Successful operation",
2268
+ "content": {
2269
+ "application/json": {
2270
+ "schema": {
2271
+ "$ref": "#/components/schemas/UserOrganizedCrimesResponse"
2272
+ }
2273
+ }
2274
+ }
2275
+ }
2276
+ },
2277
+ "security": [
2278
+ {
2279
+ "api_key": []
2280
+ }
2281
+ ],
2282
+ "x-stability": "Stable"
2283
+ }
2284
+ },
2246
2285
  "/user/personalstats": {
2247
2286
  "get": {
2248
2287
  "tags": [
@@ -14195,6 +14234,15 @@
14195
14234
  "P6"
14196
14235
  ]
14197
14236
  },
14237
+ "TornOrganizedCrimePositionIdDeprecated": {
14238
+ "description": "This field is now available in 'position_info' object as 'id' field.<br>This field will be removed on 1st of June 2026.",
14239
+ "deprecated": true,
14240
+ "allOf": [
14241
+ {
14242
+ "$ref": "#/components/schemas/TornOrganizedCrimePositionId"
14243
+ }
14244
+ ]
14245
+ },
14198
14246
  "FactionTerritoryWarResultEnum": {
14199
14247
  "type": "string",
14200
14248
  "enum": [
@@ -16825,6 +16873,24 @@
16825
16873
  }
16826
16874
  ]
16827
16875
  },
16876
+ "UserOrganizedCrimesResponse": {
16877
+ "required": [
16878
+ "crimes",
16879
+ "_metadata"
16880
+ ],
16881
+ "properties": {
16882
+ "organizedcrimes": {
16883
+ "type": "array",
16884
+ "items": {
16885
+ "$ref": "#/components/schemas/FactionCrime"
16886
+ }
16887
+ },
16888
+ "_metadata": {
16889
+ "$ref": "#/components/schemas/RequestMetadataWithLinks"
16890
+ }
16891
+ },
16892
+ "type": "object"
16893
+ },
16828
16894
  "UserEquipment": {
16829
16895
  "allOf": [
16830
16896
  {
@@ -20161,7 +20227,8 @@
20161
20227
  },
20162
20228
  "UserBountiesResponse": {
20163
20229
  "required": [
20164
- "bounties"
20230
+ "bounties",
20231
+ "bounties_timestamp"
20165
20232
  ],
20166
20233
  "properties": {
20167
20234
  "bounties": {
@@ -20169,6 +20236,10 @@
20169
20236
  "items": {
20170
20237
  "$ref": "#/components/schemas/Bounty"
20171
20238
  }
20239
+ },
20240
+ "bounties_timestamp": {
20241
+ "type": "integer",
20242
+ "format": "int32"
20172
20243
  }
20173
20244
  },
20174
20245
  "type": "object"
@@ -23758,6 +23829,26 @@
23758
23829
  },
23759
23830
  "type": "object"
23760
23831
  },
23832
+ "FactionSlotPositionInfo": {
23833
+ "required": [
23834
+ "id",
23835
+ "label",
23836
+ "number"
23837
+ ],
23838
+ "properties": {
23839
+ "id": {
23840
+ "$ref": "#/components/schemas/TornOrganizedCrimePositionId"
23841
+ },
23842
+ "label": {
23843
+ "type": "string"
23844
+ },
23845
+ "number": {
23846
+ "type": "integer",
23847
+ "format": "int32"
23848
+ }
23849
+ },
23850
+ "type": "object"
23851
+ },
23761
23852
  "FactionRaidReportFaction": {
23762
23853
  "required": [
23763
23854
  "id",
@@ -26254,8 +26345,7 @@
26254
26345
  "FactionCrimeSlot": {
26255
26346
  "required": [
26256
26347
  "position",
26257
- "position_id",
26258
- "position_number",
26348
+ "position_info",
26259
26349
  "item_requirement",
26260
26350
  "user",
26261
26351
  "checkpoint_pass_rate"
@@ -26264,12 +26354,17 @@
26264
26354
  "position": {
26265
26355
  "type": "string"
26266
26356
  },
26357
+ "position_info": {
26358
+ "$ref": "#/components/schemas/FactionSlotPositionInfo"
26359
+ },
26267
26360
  "position_id": {
26268
- "$ref": "#/components/schemas/TornOrganizedCrimePositionId"
26361
+ "$ref": "#/components/schemas/TornOrganizedCrimePositionIdDeprecated"
26269
26362
  },
26270
26363
  "position_number": {
26364
+ "description": "This field is now available in 'position_info' object as 'number' field.<br>This field will be removed on 1st of June 2026.",
26271
26365
  "type": "integer",
26272
- "format": "int32"
26366
+ "format": "int32",
26367
+ "deprecated": true
26273
26368
  },
26274
26369
  "item_requirement": {
26275
26370
  "description": "Details of item required for the slot, if applicable.",
@@ -27791,12 +27886,17 @@
27791
27886
  "MarketRentalsResponse": {
27792
27887
  "required": [
27793
27888
  "rentals",
27889
+ "rentals_timestamp",
27794
27890
  "_metadata"
27795
27891
  ],
27796
27892
  "properties": {
27797
27893
  "rentals": {
27798
27894
  "$ref": "#/components/schemas/MarketRentalDetails"
27799
27895
  },
27896
+ "rentals_timestamp": {
27897
+ "type": "integer",
27898
+ "format": "int32"
27899
+ },
27800
27900
  "_metadata": {
27801
27901
  "$ref": "#/components/schemas/RequestMetadataWithLinks"
27802
27902
  }
@@ -27855,12 +27955,17 @@
27855
27955
  "MarketPropertiesResponse": {
27856
27956
  "required": [
27857
27957
  "properties",
27958
+ "properties_timestamp",
27858
27959
  "_metadata"
27859
27960
  ],
27860
27961
  "properties": {
27861
27962
  "properties": {
27862
27963
  "$ref": "#/components/schemas/MarketPropertyDetails"
27863
27964
  },
27965
+ "properties_timestamp": {
27966
+ "type": "integer",
27967
+ "format": "int32"
27968
+ },
27864
27969
  "_metadata": {
27865
27970
  "$ref": "#/components/schemas/RequestMetadataWithLinks"
27866
27971
  }
@@ -29538,13 +29643,16 @@
29538
29643
  },
29539
29644
  "TornOrganizedCrimeSlot": {
29540
29645
  "required": [
29541
- "id",
29646
+ "position_info",
29542
29647
  "name",
29543
29648
  "required_item"
29544
29649
  ],
29545
29650
  "properties": {
29546
29651
  "id": {
29547
- "$ref": "#/components/schemas/TornOrganizedCrimePositionId"
29652
+ "$ref": "#/components/schemas/TornOrganizedCrimePositionIdDeprecated"
29653
+ },
29654
+ "position_info": {
29655
+ "$ref": "#/components/schemas/FactionSlotPositionInfo"
29548
29656
  },
29549
29657
  "name": {
29550
29658
  "type": "string"
@@ -30595,6 +30703,7 @@
30595
30703
  "TornBountiesResponse": {
30596
30704
  "required": [
30597
30705
  "bounties",
30706
+ "bounties_timestamp",
30598
30707
  "_metadata"
30599
30708
  ],
30600
30709
  "properties": {
@@ -30604,6 +30713,10 @@
30604
30713
  "$ref": "#/components/schemas/Bounty"
30605
30714
  }
30606
30715
  },
30716
+ "bounties_timestamp": {
30717
+ "type": "integer",
30718
+ "format": "int32"
30719
+ },
30607
30720
  "_metadata": {
30608
30721
  "$ref": "#/components/schemas/RequestMetadataWithLinks"
30609
30722
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "5.2.3",
4
+ "version": "5.3.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.3",
10
- "@types/node": "^24.10.10",
10
+ "@types/node": "^24.10.13",
11
11
  "prettier": "^3.8.1",
12
12
  "typeconv": "^2.3.1",
13
13
  "typescript": "^5.9.3"