tornapi-typescript 5.8.0 → 5.8.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.d.ts CHANGED
@@ -496,6 +496,15 @@ export interface ErrorCategorySelectionUnavailableForInteractionLogs {
496
496
  error: string;
497
497
  }
498
498
  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;
499
+ export interface UserItemMod {
500
+ id: ItemModId;
501
+ title: string;
502
+ equipped: boolean;
503
+ equipped_item_uid: ItemUid | null;
504
+ }
505
+ export interface UserItemModsResponse {
506
+ itemmods: UserItemMod[];
507
+ }
499
508
  export interface UserTradesResponse {
500
509
  trades: UserTrade[];
501
510
  _metadata: RequestMetadataWithLinks;
@@ -615,7 +624,18 @@ export interface UserOrganizedCrimesResponse {
615
624
  }
616
625
  export type UserEquipment = TornItemDetails & {
617
626
  slot: number;
627
+ mods: UserEquipmentItemMod[];
628
+ ammo: {
629
+ id: AmmoId;
630
+ name: string;
631
+ quantity: number;
632
+ type: TornItemAmmoTypeEnum;
633
+ };
618
634
  };
635
+ export interface UserEquipmentItemMod {
636
+ id: ItemModId;
637
+ name: string;
638
+ }
619
639
  export interface UserClothing {
620
640
  id: ItemId;
621
641
  name: string;
@@ -2736,18 +2756,20 @@ export interface CompanyCustomers {
2736
2756
  weekly: number;
2737
2757
  }
2738
2758
  export interface CompanyEmployeesResponse {
2739
- employees: (CompanyEmployee | CompanyEmployeeExtended)[];
2759
+ employees: (CompanyEmployee | CompanyEmployeeExtended | CompanyEmployeeFull)[];
2740
2760
  }
2741
2761
  export interface CompanyEmployeesResponseBasic {
2742
2762
  employees: CompanyEmployee[];
2743
2763
  }
2744
2764
  export interface CompanyEmployeeExtended extends CompanyEmployee {
2745
- joined_at: number;
2746
- wage: number;
2747
2765
  stats: CompanyEmployeeStats;
2748
2766
  effectiveness: CompanyEmployeeEffectiveness;
2749
- value: number | null;
2750
2767
  }
2768
+ export type CompanyEmployeeFull = CompanyEmployeeExtended & {
2769
+ joined_at: number;
2770
+ wage: number;
2771
+ value: number | null;
2772
+ };
2751
2773
  export interface CompanyEmployeeStats {
2752
2774
  manual_labor: number;
2753
2775
  intelligence: number;
@@ -2998,7 +3020,7 @@ export interface MarketRentalsResponse {
2998
3020
  rentals_timestamp: number;
2999
3021
  /** The minimum amount of time needed before the cache timestamp can change. */
3000
3022
  rentals_delay?: number;
3001
- _metadata: RequestMetadataWithLinks;
3023
+ _metadata: RequestMetadataWithLinksAndTotal;
3002
3024
  }
3003
3025
  export interface MarketPropertyDetails {
3004
3026
  listings: {
@@ -3015,7 +3037,7 @@ export interface MarketPropertiesResponse {
3015
3037
  properties_timestamp: number;
3016
3038
  /** The minimum amount of time needed before the cache timestamp can change. */
3017
3039
  properties_delay?: number;
3018
- _metadata: RequestMetadataWithLinks;
3040
+ _metadata: RequestMetadataWithLinksAndTotal;
3019
3041
  }
3020
3042
  export interface BazaarWeekly {
3021
3043
  busiest: BazaarWeeklyCustomers[];
@@ -3108,7 +3130,7 @@ export interface ItemMarket {
3108
3130
  }
3109
3131
  export interface MarketItemMarketResponse {
3110
3132
  itemmarket: ItemMarket;
3111
- _metadata: RequestMetadataWithLinks;
3133
+ _metadata: RequestMetadataWithLinksAndTotal;
3112
3134
  }
3113
3135
  /** The following selections will fallback to API v1 and may change at any time: 'pointsmarket'. */
3114
3136
  export type MarketSelectionName = string;
@@ -3633,6 +3655,7 @@ export interface TornItemAmmoResponse {
3633
3655
  export interface TornItemMods {
3634
3656
  id: ItemModId;
3635
3657
  name: string;
3658
+ image: string;
3636
3659
  description: string;
3637
3660
  /** Whether the upgrade fits on dual weapons. */
3638
3661
  dual_fit: boolean;
@@ -7104,6 +7127,10 @@ export interface UserV2 extends BaseSchema {
7104
7127
  response: UserItemMarketResponse;
7105
7128
  params: "offset" | "timestamp";
7106
7129
  };
7130
+ itemmods: {
7131
+ response: UserItemModsResponse;
7132
+ params: "timestamp";
7133
+ };
7107
7134
  job: {
7108
7135
  response: UserJobResponse;
7109
7136
  params: "timestamp";
package/dist/index.ts CHANGED
@@ -5576,6 +5576,17 @@ export type ApiError =
5576
5576
  | ErrorIncorrectLogId
5577
5577
  | ErrorCategorySelectionUnavailableForInteractionLogs;
5578
5578
 
5579
+ export interface UserItemMod {
5580
+ id: ItemModId;
5581
+ title: string;
5582
+ equipped: boolean;
5583
+ equipped_item_uid: ItemUid | null;
5584
+ }
5585
+
5586
+ export interface UserItemModsResponse {
5587
+ itemmods: UserItemMod[];
5588
+ }
5589
+
5579
5590
  export interface UserTradesResponse {
5580
5591
  trades: UserTrade[];
5581
5592
  _metadata: RequestMetadataWithLinks;
@@ -5721,8 +5732,20 @@ export interface UserOrganizedCrimesResponse {
5721
5732
 
5722
5733
  export type UserEquipment = TornItemDetails & {
5723
5734
  slot: number;
5735
+ mods: UserEquipmentItemMod[];
5736
+ ammo: {
5737
+ id: AmmoId;
5738
+ name: string;
5739
+ quantity: number;
5740
+ type: TornItemAmmoTypeEnum;
5741
+ };
5724
5742
  };
5725
5743
 
5744
+ export interface UserEquipmentItemMod {
5745
+ id: ItemModId;
5746
+ name: string;
5747
+ }
5748
+
5726
5749
  export interface UserClothing {
5727
5750
  id: ItemId;
5728
5751
  name: string;
@@ -8448,7 +8471,11 @@ export interface CompanyCustomers {
8448
8471
  }
8449
8472
 
8450
8473
  export interface CompanyEmployeesResponse {
8451
- employees: (CompanyEmployee | CompanyEmployeeExtended)[];
8474
+ employees: (
8475
+ | CompanyEmployee
8476
+ | CompanyEmployeeExtended
8477
+ | CompanyEmployeeFull
8478
+ )[];
8452
8479
  }
8453
8480
 
8454
8481
  export interface CompanyEmployeesResponseBasic {
@@ -8456,13 +8483,16 @@ export interface CompanyEmployeesResponseBasic {
8456
8483
  }
8457
8484
 
8458
8485
  export interface CompanyEmployeeExtended extends CompanyEmployee {
8459
- joined_at: number;
8460
- wage: number;
8461
8486
  stats: CompanyEmployeeStats;
8462
8487
  effectiveness: CompanyEmployeeEffectiveness;
8463
- value: number | null;
8464
8488
  }
8465
8489
 
8490
+ export type CompanyEmployeeFull = CompanyEmployeeExtended & {
8491
+ joined_at: number;
8492
+ wage: number;
8493
+ value: number | null;
8494
+ };
8495
+
8466
8496
  export interface CompanyEmployeeStats {
8467
8497
  manual_labor: number;
8468
8498
  intelligence: number;
@@ -8748,7 +8778,7 @@ export interface MarketRentalsResponse {
8748
8778
  rentals_timestamp: number;
8749
8779
  /** The minimum amount of time needed before the cache timestamp can change. */
8750
8780
  rentals_delay?: number;
8751
- _metadata: RequestMetadataWithLinks;
8781
+ _metadata: RequestMetadataWithLinksAndTotal;
8752
8782
  }
8753
8783
 
8754
8784
  export interface MarketPropertyDetails {
@@ -8767,7 +8797,7 @@ export interface MarketPropertiesResponse {
8767
8797
  properties_timestamp: number;
8768
8798
  /** The minimum amount of time needed before the cache timestamp can change. */
8769
8799
  properties_delay?: number;
8770
- _metadata: RequestMetadataWithLinks;
8800
+ _metadata: RequestMetadataWithLinksAndTotal;
8771
8801
  }
8772
8802
 
8773
8803
  export interface BazaarWeekly {
@@ -8881,7 +8911,7 @@ export interface ItemMarket {
8881
8911
 
8882
8912
  export interface MarketItemMarketResponse {
8883
8913
  itemmarket: ItemMarket;
8884
- _metadata: RequestMetadataWithLinks;
8914
+ _metadata: RequestMetadataWithLinksAndTotal;
8885
8915
  }
8886
8916
 
8887
8917
  /** The following selections will fallback to API v1 and may change at any time: 'pointsmarket'. */
@@ -9491,6 +9521,7 @@ export interface TornItemAmmoResponse {
9491
9521
  export interface TornItemMods {
9492
9522
  id: ItemModId;
9493
9523
  name: string;
9524
+ image: string;
9494
9525
  description: string;
9495
9526
  /** Whether the upgrade fits on dual weapons. */
9496
9527
  dual_fit: boolean;
@@ -13060,6 +13091,10 @@ export interface UserV2 extends BaseSchema {
13060
13091
  response: UserItemMarketResponse;
13061
13092
  params: "offset" | "timestamp";
13062
13093
  };
13094
+ itemmods: {
13095
+ response: UserItemModsResponse;
13096
+ params: "timestamp";
13097
+ };
13063
13098
  job: {
13064
13099
  response: UserJobResponse;
13065
13100
  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": "5.8.0"
6
+ "version": "5.8.1"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -1665,6 +1665,45 @@
1665
1665
  "x-stability": "Stable"
1666
1666
  }
1667
1667
  },
1668
+ "/user/itemmods": {
1669
+ "get": {
1670
+ "tags": [
1671
+ "User"
1672
+ ],
1673
+ "summary": "Get your information about available item mods",
1674
+ "description": "Requires minimal access key. <br>",
1675
+ "operationId": "getMyItemModsInformation",
1676
+ "parameters": [
1677
+ {
1678
+ "$ref": "#/components/parameters/ApiTimestamp"
1679
+ },
1680
+ {
1681
+ "$ref": "#/components/parameters/ApiComment"
1682
+ },
1683
+ {
1684
+ "$ref": "#/components/parameters/ApiKeyPublic"
1685
+ }
1686
+ ],
1687
+ "responses": {
1688
+ "200": {
1689
+ "description": "Successful operation",
1690
+ "content": {
1691
+ "application/json": {
1692
+ "schema": {
1693
+ "$ref": "#/components/schemas/UserItemModsResponse"
1694
+ }
1695
+ }
1696
+ }
1697
+ }
1698
+ },
1699
+ "security": [
1700
+ {
1701
+ "api_key": []
1702
+ }
1703
+ ],
1704
+ "x-stability": "Stable"
1705
+ }
1706
+ },
1668
1707
  "/user/job": {
1669
1708
  "get": {
1670
1709
  "tags": [
@@ -3801,6 +3840,9 @@
3801
3840
  {
3802
3841
  "$ref": "#/components/schemas/UserOrganizedCrimeResponse"
3803
3842
  },
3843
+ {
3844
+ "$ref": "#/components/schemas/UserItemModsResponse"
3845
+ },
3804
3846
  {
3805
3847
  "$ref": "#/components/schemas/AttacksResponse"
3806
3848
  },
@@ -6439,7 +6481,7 @@
6439
6481
  "Company"
6440
6482
  ],
6441
6483
  "summary": "Get my company's employees",
6442
- "description": "Requires public access key. <br>When using Limited, Custom or Full access API keys, the response will be of type CompanyEmployeeExtended, otherwise it will be of type CompanyEmployee.",
6484
+ "description": "Requires public access key. <br>When using Limited, Custom or Full access API keys, the response will be:<br>\n * for director: CompanyEmployeeFull\n * for employee: CompanyEmployeeExtended\n * anyone else: CompanyEmployee.",
6443
6485
  "operationId": "getMyCompanyEmployees",
6444
6486
  "parameters": [
6445
6487
  {
@@ -17770,6 +17812,50 @@
17770
17812
  }
17771
17813
  ]
17772
17814
  },
17815
+ "UserItemMod": {
17816
+ "required": [
17817
+ "id",
17818
+ "title",
17819
+ "equipped",
17820
+ "equipped_item_uid"
17821
+ ],
17822
+ "properties": {
17823
+ "id": {
17824
+ "$ref": "#/components/schemas/ItemModId"
17825
+ },
17826
+ "title": {
17827
+ "type": "string"
17828
+ },
17829
+ "equipped": {
17830
+ "type": "boolean"
17831
+ },
17832
+ "equipped_item_uid": {
17833
+ "oneOf": [
17834
+ {
17835
+ "$ref": "#/components/schemas/ItemUid"
17836
+ },
17837
+ {
17838
+ "type": "null"
17839
+ }
17840
+ ]
17841
+ }
17842
+ },
17843
+ "type": "object"
17844
+ },
17845
+ "UserItemModsResponse": {
17846
+ "required": [
17847
+ "itemmods"
17848
+ ],
17849
+ "properties": {
17850
+ "itemmods": {
17851
+ "type": "array",
17852
+ "items": {
17853
+ "$ref": "#/components/schemas/UserItemMod"
17854
+ }
17855
+ }
17856
+ },
17857
+ "type": "object"
17858
+ },
17773
17859
  "UserTradesResponse": {
17774
17860
  "required": [
17775
17861
  "trades",
@@ -18324,18 +18410,65 @@
18324
18410
  },
18325
18411
  {
18326
18412
  "required": [
18327
- "slot"
18413
+ "slot",
18414
+ "ammo",
18415
+ "mods"
18328
18416
  ],
18329
18417
  "properties": {
18330
18418
  "slot": {
18331
18419
  "type": "integer",
18332
18420
  "format": "int32"
18421
+ },
18422
+ "mods": {
18423
+ "type": "array",
18424
+ "items": {
18425
+ "$ref": "#/components/schemas/UserEquipmentItemMod"
18426
+ }
18427
+ },
18428
+ "ammo": {
18429
+ "required": [
18430
+ "id",
18431
+ "name",
18432
+ "type",
18433
+ "quantity"
18434
+ ],
18435
+ "properties": {
18436
+ "id": {
18437
+ "$ref": "#/components/schemas/AmmoId"
18438
+ },
18439
+ "name": {
18440
+ "type": "string"
18441
+ },
18442
+ "quantity": {
18443
+ "type": "integer",
18444
+ "format": "int32"
18445
+ },
18446
+ "type": {
18447
+ "$ref": "#/components/schemas/TornItemAmmoTypeEnum"
18448
+ }
18449
+ },
18450
+ "type": "object"
18333
18451
  }
18334
18452
  },
18335
18453
  "type": "object"
18336
18454
  }
18337
18455
  ]
18338
18456
  },
18457
+ "UserEquipmentItemMod": {
18458
+ "required": [
18459
+ "id",
18460
+ "name"
18461
+ ],
18462
+ "properties": {
18463
+ "id": {
18464
+ "$ref": "#/components/schemas/ItemModId"
18465
+ },
18466
+ "name": {
18467
+ "type": "string"
18468
+ }
18469
+ },
18470
+ "type": "object"
18471
+ },
18339
18472
  "UserClothing": {
18340
18473
  "required": [
18341
18474
  "id",
@@ -22007,6 +22140,7 @@
22007
22140
  "icons",
22008
22141
  "inventory",
22009
22142
  "itemmarket",
22143
+ "itemmod",
22010
22144
  "job",
22011
22145
  "jobpoints",
22012
22146
  "jobranks",
@@ -28731,6 +28865,9 @@
28731
28865
  },
28732
28866
  {
28733
28867
  "$ref": "#/components/schemas/CompanyEmployeeExtended"
28868
+ },
28869
+ {
28870
+ "$ref": "#/components/schemas/CompanyEmployeeFull"
28734
28871
  }
28735
28872
  ]
28736
28873
  }
@@ -28757,12 +28894,32 @@
28757
28894
  {
28758
28895
  "$ref": "#/components/schemas/CompanyEmployee"
28759
28896
  },
28897
+ {
28898
+ "required": [
28899
+ "stats",
28900
+ "effectiveness"
28901
+ ],
28902
+ "properties": {
28903
+ "stats": {
28904
+ "$ref": "#/components/schemas/CompanyEmployeeStats"
28905
+ },
28906
+ "effectiveness": {
28907
+ "$ref": "#/components/schemas/CompanyEmployeeEffectiveness"
28908
+ }
28909
+ },
28910
+ "type": "object"
28911
+ }
28912
+ ]
28913
+ },
28914
+ "CompanyEmployeeFull": {
28915
+ "allOf": [
28916
+ {
28917
+ "$ref": "#/components/schemas/CompanyEmployeeExtended"
28918
+ },
28760
28919
  {
28761
28920
  "required": [
28762
28921
  "joined_at",
28763
28922
  "wage",
28764
- "stats",
28765
- "effectiveness",
28766
28923
  "value"
28767
28924
  ],
28768
28925
  "properties": {
@@ -28774,12 +28931,6 @@
28774
28931
  "type": "integer",
28775
28932
  "format": "int64"
28776
28933
  },
28777
- "stats": {
28778
- "$ref": "#/components/schemas/CompanyEmployeeStats"
28779
- },
28780
- "effectiveness": {
28781
- "$ref": "#/components/schemas/CompanyEmployeeEffectiveness"
28782
- },
28783
28934
  "value": {
28784
28935
  "description": "This value is null if you don't have a secretary.",
28785
28936
  "oneOf": [
@@ -30001,7 +30152,7 @@
30001
30152
  "format": "int32"
30002
30153
  },
30003
30154
  "_metadata": {
30004
- "$ref": "#/components/schemas/RequestMetadataWithLinks"
30155
+ "$ref": "#/components/schemas/RequestMetadataWithLinksAndTotal"
30005
30156
  }
30006
30157
  },
30007
30158
  "type": "object"
@@ -30075,7 +30226,7 @@
30075
30226
  "format": "int32"
30076
30227
  },
30077
30228
  "_metadata": {
30078
- "$ref": "#/components/schemas/RequestMetadataWithLinks"
30229
+ "$ref": "#/components/schemas/RequestMetadataWithLinksAndTotal"
30079
30230
  }
30080
30231
  },
30081
30232
  "type": "object"
@@ -30577,7 +30728,7 @@
30577
30728
  "$ref": "#/components/schemas/ItemMarket"
30578
30729
  },
30579
30730
  "_metadata": {
30580
- "$ref": "#/components/schemas/RequestMetadataWithLinks"
30731
+ "$ref": "#/components/schemas/RequestMetadataWithLinksAndTotal"
30581
30732
  }
30582
30733
  },
30583
30734
  "type": "object"
@@ -33121,6 +33272,7 @@
33121
33272
  "required": [
33122
33273
  "id",
33123
33274
  "name",
33275
+ "image",
33124
33276
  "description",
33125
33277
  "dual_fit",
33126
33278
  "weapons"
@@ -33132,6 +33284,9 @@
33132
33284
  "name": {
33133
33285
  "type": "string"
33134
33286
  },
33287
+ "image": {
33288
+ "type": "string"
33289
+ },
33135
33290
  "description": {
33136
33291
  "type": "string"
33137
33292
  },
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "5.8.0",
4
+ "version": "5.8.1",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },
8
8
  "devDependencies": {
9
9
  "@scalar/openapi-types": "^0.8.0",
10
- "@types/node": "^24.12.2",
10
+ "@types/node": "^24.12.3",
11
11
  "prettier": "^3.8.3",
12
12
  "typeconv": "^2.3.1",
13
13
  "typescript": "^6.0.3"