tornapi-typescript 5.8.0 → 5.9.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/README.md CHANGED
@@ -27,12 +27,12 @@ generated above.
27
27
 
28
28
  The V2 types are generated in the following way:
29
29
 
30
- * load [openapi specification](https://www.torn.com/swagger/openapi.json)
31
- * convert the specification to TypeScript definitions using [typeconv](https://github.com/grantila/typeconv)
32
- * clean the type definitions
33
- * remove all "[key: string]: any;", because typeconv adds it everywhere for some reason
34
- * remove all empty objects (caused by the above cleaning)
35
- * run through prettier to have it look decent
30
+ - load [openapi specification](https://www.torn.com/swagger/openapi.json)
31
+ - convert the specification to TypeScript definitions using [typeconv](https://github.com/grantila/typeconv)
32
+ - clean the type definitions
33
+ - remove all "[key: string]: any;", because typeconv adds it everywhere for some reason
34
+ - remove all empty objects (caused by the above cleaning)
35
+ - run through prettier to have it look decent
36
36
 
37
37
  ### V2 client
38
38
 
package/dist/index.d.ts CHANGED
@@ -33,6 +33,7 @@ export type FactionPositionAbilityEnum = "Medical Usage" | "Booster Usage" | "Dr
33
33
  export type FactionOrganizedCrimePayoutType = "balance" | "wallet" | "inventory";
34
34
  export type TornRacketType = "Item" | "Points" | "Money";
35
35
  export type FactionNewsCategory = "main" | "attack" | "armoryDeposit" | "armoryAction" | "territoryWar" | "rankedWar" | "territoryGain" | "chain" | "crime" | "membership" | "depositFunds" | "giveFunds";
36
+ export type CompanyNewsCategory = "main" | "funds" | "training" | "employees" | "all";
36
37
  export type FactionRankEnum = "Unranked" | "Bronze" | "Silver" | "Gold" | "Platinum" | "Diamond";
37
38
  export type UserCrimeUniquesRewardAmmoEnum = "standard" | "special";
38
39
  export type RaceStatusEnum = "open" | "in_progress" | "finished";
@@ -496,6 +497,15 @@ export interface ErrorCategorySelectionUnavailableForInteractionLogs {
496
497
  error: string;
497
498
  }
498
499
  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;
500
+ export interface UserItemMod {
501
+ id: ItemModId;
502
+ title: string;
503
+ equipped: boolean;
504
+ equipped_item_uid: ItemUid | null;
505
+ }
506
+ export interface UserItemModsResponse {
507
+ itemmods: UserItemMod[];
508
+ }
499
509
  export interface UserTradesResponse {
500
510
  trades: UserTrade[];
501
511
  _metadata: RequestMetadataWithLinks;
@@ -615,7 +625,18 @@ export interface UserOrganizedCrimesResponse {
615
625
  }
616
626
  export type UserEquipment = TornItemDetails & {
617
627
  slot: number;
628
+ mods: UserEquipmentItemMod[];
629
+ ammo: {
630
+ id: AmmoId;
631
+ name: string;
632
+ quantity: number;
633
+ type: TornItemAmmoTypeEnum;
634
+ };
618
635
  };
636
+ export interface UserEquipmentItemMod {
637
+ id: ItemModId;
638
+ name: string;
639
+ }
619
640
  export interface UserClothing {
620
641
  id: ItemId;
621
642
  name: string;
@@ -2150,6 +2171,7 @@ export interface FactionTerritoryWarReportResponse {
2150
2171
  }
2151
2172
  export interface FactionTerritoryOwnership {
2152
2173
  id: string;
2174
+ irradiated: boolean;
2153
2175
  owned_by: FactionId | null;
2154
2176
  acquired_at: number | null;
2155
2177
  }
@@ -2375,13 +2397,13 @@ export interface FactionWarsResponse {
2375
2397
  pacts: FactionPact[];
2376
2398
  wars: FactionWars;
2377
2399
  }
2378
- export interface FactionNews {
2400
+ export interface News {
2379
2401
  id: string;
2380
2402
  text: string;
2381
2403
  timestamp: number;
2382
2404
  }
2383
- export interface FactionNewsResponse {
2384
- news: FactionNews[];
2405
+ export interface NewsResponse {
2406
+ news: News[];
2385
2407
  _metadata: RequestMetadataWithLinks;
2386
2408
  }
2387
2409
  export interface FactionRaidsResponse {
@@ -2668,13 +2690,20 @@ export interface FactionRankedWarReportResponse {
2668
2690
  };
2669
2691
  }
2670
2692
  /**
2671
- * The following selections will fallback to API v1 and may change at any time: 'companies', 'news', 'search'.
2693
+ * The following selections will fallback to API v1 and may change at any time: 'companies', 'search'.
2672
2694
  * * The following selections are not available in API v2: 'details'.
2673
2695
  */
2674
2696
  export type CompanySelectionName = string;
2675
2697
  export interface CompanyLookupResponse {
2676
2698
  selections: CompanySelectionName[];
2677
2699
  }
2700
+ export interface CompaniesResponse {
2701
+ companies: CompanyProfile[];
2702
+ companies_timestamp: number;
2703
+ /** The minimum amount of time needed before the cache timestamp can change. */
2704
+ companies_delay: number;
2705
+ _metadata: RequestMetadataWithLinksAndTotal;
2706
+ }
2678
2707
  export interface CompanyProfileResponse {
2679
2708
  profile: CompanyProfile;
2680
2709
  }
@@ -2736,18 +2765,20 @@ export interface CompanyCustomers {
2736
2765
  weekly: number;
2737
2766
  }
2738
2767
  export interface CompanyEmployeesResponse {
2739
- employees: (CompanyEmployee | CompanyEmployeeExtended)[];
2768
+ employees: (CompanyEmployee | CompanyEmployeeExtended | CompanyEmployeeFull)[];
2740
2769
  }
2741
2770
  export interface CompanyEmployeesResponseBasic {
2742
2771
  employees: CompanyEmployee[];
2743
2772
  }
2744
2773
  export interface CompanyEmployeeExtended extends CompanyEmployee {
2745
- joined_at: number;
2746
- wage: number;
2747
2774
  stats: CompanyEmployeeStats;
2748
2775
  effectiveness: CompanyEmployeeEffectiveness;
2749
- value: number | null;
2750
2776
  }
2777
+ export type CompanyEmployeeFull = CompanyEmployeeExtended & {
2778
+ joined_at: number;
2779
+ wage: number;
2780
+ value: number | null;
2781
+ };
2751
2782
  export interface CompanyEmployeeStats {
2752
2783
  manual_labor: number;
2753
2784
  intelligence: number;
@@ -2998,7 +3029,7 @@ export interface MarketRentalsResponse {
2998
3029
  rentals_timestamp: number;
2999
3030
  /** The minimum amount of time needed before the cache timestamp can change. */
3000
3031
  rentals_delay?: number;
3001
- _metadata: RequestMetadataWithLinks;
3032
+ _metadata: RequestMetadataWithLinksAndTotal;
3002
3033
  }
3003
3034
  export interface MarketPropertyDetails {
3004
3035
  listings: {
@@ -3015,7 +3046,7 @@ export interface MarketPropertiesResponse {
3015
3046
  properties_timestamp: number;
3016
3047
  /** The minimum amount of time needed before the cache timestamp can change. */
3017
3048
  properties_delay?: number;
3018
- _metadata: RequestMetadataWithLinks;
3049
+ _metadata: RequestMetadataWithLinksAndTotal;
3019
3050
  }
3020
3051
  export interface BazaarWeekly {
3021
3052
  busiest: BazaarWeeklyCustomers[];
@@ -3108,7 +3139,7 @@ export interface ItemMarket {
3108
3139
  }
3109
3140
  export interface MarketItemMarketResponse {
3110
3141
  itemmarket: ItemMarket;
3111
- _metadata: RequestMetadataWithLinks;
3142
+ _metadata: RequestMetadataWithLinksAndTotal;
3112
3143
  }
3113
3144
  /** The following selections will fallback to API v1 and may change at any time: 'pointsmarket'. */
3114
3145
  export type MarketSelectionName = string;
@@ -3617,7 +3648,7 @@ export interface TornBountiesResponse {
3617
3648
  bounties: Bounty[];
3618
3649
  bounties_timestamp: number;
3619
3650
  /** The minimum amount of time needed before the cache timestamp can change. */
3620
- bounties_delay?: number;
3651
+ bounties_delay: number;
3621
3652
  _metadata: RequestMetadataWithLinksAndTotal;
3622
3653
  }
3623
3654
  export interface TornItemAmmo {
@@ -3633,6 +3664,7 @@ export interface TornItemAmmoResponse {
3633
3664
  export interface TornItemMods {
3634
3665
  id: ItemModId;
3635
3666
  name: string;
3667
+ image: string;
3636
3668
  description: string;
3637
3669
  /** Whether the upgrade fits on dual weapons. */
3638
3670
  dual_fit: boolean;
@@ -7104,6 +7136,10 @@ export interface UserV2 extends BaseSchema {
7104
7136
  response: UserItemMarketResponse;
7105
7137
  params: "offset" | "timestamp";
7106
7138
  };
7139
+ itemmods: {
7140
+ response: UserItemModsResponse;
7141
+ params: "timestamp";
7142
+ };
7107
7143
  job: {
7108
7144
  response: UserJobResponse;
7109
7145
  params: "timestamp";
@@ -7301,7 +7337,7 @@ export interface FactionV2 extends BaseSchema {
7301
7337
  params: "striptags" | "timestamp";
7302
7338
  };
7303
7339
  news: {
7304
- response: FactionNewsResponse;
7340
+ response: NewsResponse;
7305
7341
  params: "striptags" | "limit" | "sort" | "to" | "from" | "cat" | "timestamp";
7306
7342
  };
7307
7343
  positions: {
@@ -7396,6 +7432,14 @@ export interface CompanyV2 extends BaseSchema {
7396
7432
  response: CompanyEmployeesResponse;
7397
7433
  params: "striptags" | "timestamp";
7398
7434
  };
7435
+ news: {
7436
+ response: NewsResponse;
7437
+ params: "striptags" | "limit" | "sort" | "to" | "from" | "cat" | "timestamp";
7438
+ };
7439
+ companies: {
7440
+ response: CompaniesResponse;
7441
+ params: "typeId" | "limit" | "offset" | "striptags" | "timestamp";
7442
+ };
7399
7443
  profile: {
7400
7444
  response: CompanyProfileResponseMixed;
7401
7445
  params: "striptags" | "timestamp";
package/dist/index.ts CHANGED
@@ -4447,6 +4447,13 @@ export type FactionNewsCategory =
4447
4447
  | "depositFunds"
4448
4448
  | "giveFunds";
4449
4449
 
4450
+ export type CompanyNewsCategory =
4451
+ | "main"
4452
+ | "funds"
4453
+ | "training"
4454
+ | "employees"
4455
+ | "all";
4456
+
4450
4457
  export type FactionRankEnum =
4451
4458
  | "Unranked"
4452
4459
  | "Bronze"
@@ -5576,6 +5583,17 @@ export type ApiError =
5576
5583
  | ErrorIncorrectLogId
5577
5584
  | ErrorCategorySelectionUnavailableForInteractionLogs;
5578
5585
 
5586
+ export interface UserItemMod {
5587
+ id: ItemModId;
5588
+ title: string;
5589
+ equipped: boolean;
5590
+ equipped_item_uid: ItemUid | null;
5591
+ }
5592
+
5593
+ export interface UserItemModsResponse {
5594
+ itemmods: UserItemMod[];
5595
+ }
5596
+
5579
5597
  export interface UserTradesResponse {
5580
5598
  trades: UserTrade[];
5581
5599
  _metadata: RequestMetadataWithLinks;
@@ -5721,8 +5739,20 @@ export interface UserOrganizedCrimesResponse {
5721
5739
 
5722
5740
  export type UserEquipment = TornItemDetails & {
5723
5741
  slot: number;
5742
+ mods: UserEquipmentItemMod[];
5743
+ ammo: {
5744
+ id: AmmoId;
5745
+ name: string;
5746
+ quantity: number;
5747
+ type: TornItemAmmoTypeEnum;
5748
+ };
5724
5749
  };
5725
5750
 
5751
+ export interface UserEquipmentItemMod {
5752
+ id: ItemModId;
5753
+ name: string;
5754
+ }
5755
+
5726
5756
  export interface UserClothing {
5727
5757
  id: ItemId;
5728
5758
  name: string;
@@ -7773,6 +7803,7 @@ export interface FactionTerritoryWarReportResponse {
7773
7803
 
7774
7804
  export interface FactionTerritoryOwnership {
7775
7805
  id: string;
7806
+ irradiated: boolean;
7776
7807
  owned_by: FactionId | null;
7777
7808
  acquired_at: number | null;
7778
7809
  }
@@ -8033,14 +8064,14 @@ export interface FactionWarsResponse {
8033
8064
  wars: FactionWars;
8034
8065
  }
8035
8066
 
8036
- export interface FactionNews {
8067
+ export interface News {
8037
8068
  id: string;
8038
8069
  text: string;
8039
8070
  timestamp: number;
8040
8071
  }
8041
8072
 
8042
- export interface FactionNewsResponse {
8043
- news: FactionNews[];
8073
+ export interface NewsResponse {
8074
+ news: News[];
8044
8075
  _metadata: RequestMetadataWithLinks;
8045
8076
  }
8046
8077
 
@@ -8367,7 +8398,7 @@ export interface FactionRankedWarReportResponse {
8367
8398
  }
8368
8399
 
8369
8400
  /**
8370
- * The following selections will fallback to API v1 and may change at any time: 'companies', 'news', 'search'.
8401
+ * The following selections will fallback to API v1 and may change at any time: 'companies', 'search'.
8371
8402
  * * The following selections are not available in API v2: 'details'.
8372
8403
  */
8373
8404
  export type CompanySelectionName = string;
@@ -8376,6 +8407,14 @@ export interface CompanyLookupResponse {
8376
8407
  selections: CompanySelectionName[];
8377
8408
  }
8378
8409
 
8410
+ export interface CompaniesResponse {
8411
+ companies: CompanyProfile[];
8412
+ companies_timestamp: number;
8413
+ /** The minimum amount of time needed before the cache timestamp can change. */
8414
+ companies_delay: number;
8415
+ _metadata: RequestMetadataWithLinksAndTotal;
8416
+ }
8417
+
8379
8418
  export interface CompanyProfileResponse {
8380
8419
  profile: CompanyProfile;
8381
8420
  }
@@ -8448,7 +8487,11 @@ export interface CompanyCustomers {
8448
8487
  }
8449
8488
 
8450
8489
  export interface CompanyEmployeesResponse {
8451
- employees: (CompanyEmployee | CompanyEmployeeExtended)[];
8490
+ employees: (
8491
+ | CompanyEmployee
8492
+ | CompanyEmployeeExtended
8493
+ | CompanyEmployeeFull
8494
+ )[];
8452
8495
  }
8453
8496
 
8454
8497
  export interface CompanyEmployeesResponseBasic {
@@ -8456,13 +8499,16 @@ export interface CompanyEmployeesResponseBasic {
8456
8499
  }
8457
8500
 
8458
8501
  export interface CompanyEmployeeExtended extends CompanyEmployee {
8459
- joined_at: number;
8460
- wage: number;
8461
8502
  stats: CompanyEmployeeStats;
8462
8503
  effectiveness: CompanyEmployeeEffectiveness;
8463
- value: number | null;
8464
8504
  }
8465
8505
 
8506
+ export type CompanyEmployeeFull = CompanyEmployeeExtended & {
8507
+ joined_at: number;
8508
+ wage: number;
8509
+ value: number | null;
8510
+ };
8511
+
8466
8512
  export interface CompanyEmployeeStats {
8467
8513
  manual_labor: number;
8468
8514
  intelligence: number;
@@ -8748,7 +8794,7 @@ export interface MarketRentalsResponse {
8748
8794
  rentals_timestamp: number;
8749
8795
  /** The minimum amount of time needed before the cache timestamp can change. */
8750
8796
  rentals_delay?: number;
8751
- _metadata: RequestMetadataWithLinks;
8797
+ _metadata: RequestMetadataWithLinksAndTotal;
8752
8798
  }
8753
8799
 
8754
8800
  export interface MarketPropertyDetails {
@@ -8767,7 +8813,7 @@ export interface MarketPropertiesResponse {
8767
8813
  properties_timestamp: number;
8768
8814
  /** The minimum amount of time needed before the cache timestamp can change. */
8769
8815
  properties_delay?: number;
8770
- _metadata: RequestMetadataWithLinks;
8816
+ _metadata: RequestMetadataWithLinksAndTotal;
8771
8817
  }
8772
8818
 
8773
8819
  export interface BazaarWeekly {
@@ -8881,7 +8927,7 @@ export interface ItemMarket {
8881
8927
 
8882
8928
  export interface MarketItemMarketResponse {
8883
8929
  itemmarket: ItemMarket;
8884
- _metadata: RequestMetadataWithLinks;
8930
+ _metadata: RequestMetadataWithLinksAndTotal;
8885
8931
  }
8886
8932
 
8887
8933
  /** The following selections will fallback to API v1 and may change at any time: 'pointsmarket'. */
@@ -9472,7 +9518,7 @@ export interface TornBountiesResponse {
9472
9518
  bounties: Bounty[];
9473
9519
  bounties_timestamp: number;
9474
9520
  /** The minimum amount of time needed before the cache timestamp can change. */
9475
- bounties_delay?: number;
9521
+ bounties_delay: number;
9476
9522
  _metadata: RequestMetadataWithLinksAndTotal;
9477
9523
  }
9478
9524
 
@@ -9491,6 +9537,7 @@ export interface TornItemAmmoResponse {
9491
9537
  export interface TornItemMods {
9492
9538
  id: ItemModId;
9493
9539
  name: string;
9540
+ image: string;
9494
9541
  description: string;
9495
9542
  /** Whether the upgrade fits on dual weapons. */
9496
9543
  dual_fit: boolean;
@@ -13060,6 +13107,10 @@ export interface UserV2 extends BaseSchema {
13060
13107
  response: UserItemMarketResponse;
13061
13108
  params: "offset" | "timestamp";
13062
13109
  };
13110
+ itemmods: {
13111
+ response: UserItemModsResponse;
13112
+ params: "timestamp";
13113
+ };
13063
13114
  job: {
13064
13115
  response: UserJobResponse;
13065
13116
  params: "timestamp";
@@ -13298,7 +13349,7 @@ export interface FactionV2 extends BaseSchema {
13298
13349
  params: "striptags" | "timestamp";
13299
13350
  };
13300
13351
  news: {
13301
- response: FactionNewsResponse;
13352
+ response: NewsResponse;
13302
13353
  params:
13303
13354
  | "striptags"
13304
13355
  | "limit"
@@ -13420,6 +13471,21 @@ export interface CompanyV2 extends BaseSchema {
13420
13471
  response: CompanyEmployeesResponse;
13421
13472
  params: "striptags" | "timestamp";
13422
13473
  };
13474
+ news: {
13475
+ response: NewsResponse;
13476
+ params:
13477
+ | "striptags"
13478
+ | "limit"
13479
+ | "sort"
13480
+ | "to"
13481
+ | "from"
13482
+ | "cat"
13483
+ | "timestamp";
13484
+ };
13485
+ companies: {
13486
+ response: CompaniesResponse;
13487
+ params: "typeId" | "limit" | "offset" | "striptags" | "timestamp";
13488
+ };
13423
13489
  profile: {
13424
13490
  response: CompanyProfileResponseMixed;
13425
13491
  params: "striptags" | "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.9.0"
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
  },
@@ -4881,7 +4923,7 @@
4881
4923
  "content": {
4882
4924
  "application/json": {
4883
4925
  "schema": {
4884
- "$ref": "#/components/schemas/FactionNewsResponse"
4926
+ "$ref": "#/components/schemas/NewsResponse"
4885
4927
  }
4886
4928
  }
4887
4929
  }
@@ -6297,7 +6339,7 @@
6297
6339
  "$ref": "#/components/schemas/FactionWarsResponse"
6298
6340
  },
6299
6341
  {
6300
- "$ref": "#/components/schemas/FactionNewsResponse"
6342
+ "$ref": "#/components/schemas/NewsResponse"
6301
6343
  },
6302
6344
  {
6303
6345
  "$ref": "#/components/schemas/RevivesResponse"
@@ -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
  {
@@ -6526,6 +6568,126 @@
6526
6568
  "x-stability": "Unstable"
6527
6569
  }
6528
6570
  },
6571
+ "/company/news": {
6572
+ "get": {
6573
+ "tags": [
6574
+ "Company"
6575
+ ],
6576
+ "summary": "Get your company's news details",
6577
+ "description": "Requires minimal access key. <br>",
6578
+ "operationId": "getMyCompanyNews",
6579
+ "parameters": [
6580
+ {
6581
+ "$ref": "#/components/parameters/ApiStripTagsFalse"
6582
+ },
6583
+ {
6584
+ "$ref": "#/components/parameters/ApiLimit100"
6585
+ },
6586
+ {
6587
+ "$ref": "#/components/parameters/ApiSortDesc"
6588
+ },
6589
+ {
6590
+ "$ref": "#/components/parameters/ApiTo"
6591
+ },
6592
+ {
6593
+ "$ref": "#/components/parameters/ApiFrom"
6594
+ },
6595
+ {
6596
+ "name": "cat",
6597
+ "in": "query",
6598
+ "description": "News category type",
6599
+ "required": true,
6600
+ "schema": {
6601
+ "$ref": "#/components/schemas/CompanyNewsCategory"
6602
+ }
6603
+ },
6604
+ {
6605
+ "$ref": "#/components/parameters/ApiTimestamp"
6606
+ },
6607
+ {
6608
+ "$ref": "#/components/parameters/ApiComment"
6609
+ },
6610
+ {
6611
+ "$ref": "#/components/parameters/ApiKeyMinimal"
6612
+ }
6613
+ ],
6614
+ "responses": {
6615
+ "200": {
6616
+ "description": "Successful operation",
6617
+ "content": {
6618
+ "application/json": {
6619
+ "schema": {
6620
+ "$ref": "#/components/schemas/NewsResponse"
6621
+ }
6622
+ }
6623
+ }
6624
+ }
6625
+ },
6626
+ "security": [
6627
+ {
6628
+ "api_key": []
6629
+ }
6630
+ ],
6631
+ "x-stability": "Unstable"
6632
+ }
6633
+ },
6634
+ "/company/{typeId}/companies": {
6635
+ "get": {
6636
+ "tags": [
6637
+ "Company"
6638
+ ],
6639
+ "summary": "Get a list of companies for a specific company type",
6640
+ "description": "Requires public access key. <br>",
6641
+ "operationId": "getCompaniesList",
6642
+ "parameters": [
6643
+ {
6644
+ "name": "typeId",
6645
+ "in": "path",
6646
+ "description": "Company type id",
6647
+ "required": true,
6648
+ "schema": {
6649
+ "$ref": "#/components/schemas/CompanyTypeId"
6650
+ }
6651
+ },
6652
+ {
6653
+ "$ref": "#/components/parameters/ApiLimit100Default20"
6654
+ },
6655
+ {
6656
+ "$ref": "#/components/parameters/ApiOffsetNoDefault"
6657
+ },
6658
+ {
6659
+ "$ref": "#/components/parameters/ApiStripTagsTrue"
6660
+ },
6661
+ {
6662
+ "$ref": "#/components/parameters/ApiTimestamp"
6663
+ },
6664
+ {
6665
+ "$ref": "#/components/parameters/ApiComment"
6666
+ },
6667
+ {
6668
+ "$ref": "#/components/parameters/ApiKeyPublic"
6669
+ }
6670
+ ],
6671
+ "responses": {
6672
+ "200": {
6673
+ "description": "Successful operation",
6674
+ "content": {
6675
+ "application/json": {
6676
+ "schema": {
6677
+ "$ref": "#/components/schemas/CompaniesResponse"
6678
+ }
6679
+ }
6680
+ }
6681
+ }
6682
+ },
6683
+ "security": [
6684
+ {
6685
+ "api_key": []
6686
+ }
6687
+ ],
6688
+ "x-stability": "Unstable"
6689
+ }
6690
+ },
6529
6691
  "/company/profile": {
6530
6692
  "get": {
6531
6693
  "tags": [
@@ -6785,6 +6947,19 @@
6785
6947
  }
6786
6948
  }
6787
6949
  },
6950
+ {
6951
+ "name": "cat",
6952
+ "in": "query",
6953
+ "description": "Selection category",
6954
+ "required": false,
6955
+ "schema": {
6956
+ "oneOf": [
6957
+ {
6958
+ "$ref": "#/components/schemas/CompanyNewsCategory"
6959
+ }
6960
+ ]
6961
+ }
6962
+ },
6788
6963
  {
6789
6964
  "$ref": "#/components/parameters/ApiLimit"
6790
6965
  },
@@ -6826,6 +7001,9 @@
6826
7001
  {
6827
7002
  "$ref": "#/components/schemas/CompanyProfileResponse"
6828
7003
  },
7004
+ {
7005
+ "$ref": "#/components/schemas/NewsResponse"
7006
+ },
6829
7007
  {
6830
7008
  "$ref": "#/components/schemas/CompanyStockResponse"
6831
7009
  },
@@ -14989,6 +15167,16 @@
14989
15167
  "giveFunds"
14990
15168
  ]
14991
15169
  },
15170
+ "CompanyNewsCategory": {
15171
+ "type": "string",
15172
+ "enum": [
15173
+ "main",
15174
+ "funds",
15175
+ "training",
15176
+ "employees",
15177
+ "all"
15178
+ ]
15179
+ },
14992
15180
  "FactionRankEnum": {
14993
15181
  "type": "string",
14994
15182
  "enum": [
@@ -17770,6 +17958,50 @@
17770
17958
  }
17771
17959
  ]
17772
17960
  },
17961
+ "UserItemMod": {
17962
+ "required": [
17963
+ "id",
17964
+ "title",
17965
+ "equipped",
17966
+ "equipped_item_uid"
17967
+ ],
17968
+ "properties": {
17969
+ "id": {
17970
+ "$ref": "#/components/schemas/ItemModId"
17971
+ },
17972
+ "title": {
17973
+ "type": "string"
17974
+ },
17975
+ "equipped": {
17976
+ "type": "boolean"
17977
+ },
17978
+ "equipped_item_uid": {
17979
+ "oneOf": [
17980
+ {
17981
+ "$ref": "#/components/schemas/ItemUid"
17982
+ },
17983
+ {
17984
+ "type": "null"
17985
+ }
17986
+ ]
17987
+ }
17988
+ },
17989
+ "type": "object"
17990
+ },
17991
+ "UserItemModsResponse": {
17992
+ "required": [
17993
+ "itemmods"
17994
+ ],
17995
+ "properties": {
17996
+ "itemmods": {
17997
+ "type": "array",
17998
+ "items": {
17999
+ "$ref": "#/components/schemas/UserItemMod"
18000
+ }
18001
+ }
18002
+ },
18003
+ "type": "object"
18004
+ },
17773
18005
  "UserTradesResponse": {
17774
18006
  "required": [
17775
18007
  "trades",
@@ -18324,18 +18556,65 @@
18324
18556
  },
18325
18557
  {
18326
18558
  "required": [
18327
- "slot"
18559
+ "slot",
18560
+ "ammo",
18561
+ "mods"
18328
18562
  ],
18329
18563
  "properties": {
18330
18564
  "slot": {
18331
18565
  "type": "integer",
18332
18566
  "format": "int32"
18567
+ },
18568
+ "mods": {
18569
+ "type": "array",
18570
+ "items": {
18571
+ "$ref": "#/components/schemas/UserEquipmentItemMod"
18572
+ }
18573
+ },
18574
+ "ammo": {
18575
+ "required": [
18576
+ "id",
18577
+ "name",
18578
+ "type",
18579
+ "quantity"
18580
+ ],
18581
+ "properties": {
18582
+ "id": {
18583
+ "$ref": "#/components/schemas/AmmoId"
18584
+ },
18585
+ "name": {
18586
+ "type": "string"
18587
+ },
18588
+ "quantity": {
18589
+ "type": "integer",
18590
+ "format": "int32"
18591
+ },
18592
+ "type": {
18593
+ "$ref": "#/components/schemas/TornItemAmmoTypeEnum"
18594
+ }
18595
+ },
18596
+ "type": "object"
18333
18597
  }
18334
18598
  },
18335
18599
  "type": "object"
18336
18600
  }
18337
18601
  ]
18338
18602
  },
18603
+ "UserEquipmentItemMod": {
18604
+ "required": [
18605
+ "id",
18606
+ "name"
18607
+ ],
18608
+ "properties": {
18609
+ "id": {
18610
+ "$ref": "#/components/schemas/ItemModId"
18611
+ },
18612
+ "name": {
18613
+ "type": "string"
18614
+ }
18615
+ },
18616
+ "type": "object"
18617
+ },
18339
18618
  "UserClothing": {
18340
18619
  "required": [
18341
18620
  "id",
@@ -22007,6 +22286,7 @@
22007
22286
  "icons",
22008
22287
  "inventory",
22009
22288
  "itemmarket",
22289
+ "itemmod",
22010
22290
  "job",
22011
22291
  "jobpoints",
22012
22292
  "jobranks",
@@ -25990,12 +26270,16 @@
25990
26270
  "required": [
25991
26271
  "id",
25992
26272
  "owned_by",
25993
- "acquired_at"
26273
+ "acquired_at",
26274
+ "irradiated"
25994
26275
  ],
25995
26276
  "properties": {
25996
26277
  "id": {
25997
26278
  "type": "string"
25998
26279
  },
26280
+ "irradiated": {
26281
+ "type": "boolean"
26282
+ },
25999
26283
  "owned_by": {
26000
26284
  "oneOf": [
26001
26285
  {
@@ -27009,7 +27293,7 @@
27009
27293
  },
27010
27294
  "type": "object"
27011
27295
  },
27012
- "FactionNews": {
27296
+ "News": {
27013
27297
  "required": [
27014
27298
  "id",
27015
27299
  "text",
@@ -27029,7 +27313,7 @@
27029
27313
  },
27030
27314
  "type": "object"
27031
27315
  },
27032
- "FactionNewsResponse": {
27316
+ "NewsResponse": {
27033
27317
  "required": [
27034
27318
  "news",
27035
27319
  "_metadata"
@@ -27038,7 +27322,7 @@
27038
27322
  "news": {
27039
27323
  "type": "array",
27040
27324
  "items": {
27041
- "$ref": "#/components/schemas/FactionNews"
27325
+ "$ref": "#/components/schemas/News"
27042
27326
  }
27043
27327
  },
27044
27328
  "_metadata": {
@@ -28425,17 +28709,17 @@
28425
28709
  "CompanySelectionName": {
28426
28710
  "oneOf": [
28427
28711
  {
28428
- "description": "The following selections will fallback to API v1 and may change at any time: 'companies', 'news', 'search'.\n * The following selections are not available in API v2: 'details'.",
28712
+ "description": "The following selections will fallback to API v1 and may change at any time: 'companies', 'search'.\n * The following selections are not available in API v2: 'details'.",
28429
28713
  "type": "string",
28430
28714
  "enum": [
28431
28715
  "applications",
28432
28716
  "employees",
28433
28717
  "lookup",
28718
+ "news",
28434
28719
  "profile",
28435
28720
  "stock",
28436
28721
  "timestamp",
28437
28722
  "companies",
28438
- "news",
28439
28723
  "search"
28440
28724
  ]
28441
28725
  },
@@ -28458,6 +28742,35 @@
28458
28742
  },
28459
28743
  "type": "object"
28460
28744
  },
28745
+ "CompaniesResponse": {
28746
+ "required": [
28747
+ "companies",
28748
+ "companies_timestamp",
28749
+ "companies_delay",
28750
+ "_metadata"
28751
+ ],
28752
+ "properties": {
28753
+ "companies": {
28754
+ "type": "array",
28755
+ "items": {
28756
+ "$ref": "#/components/schemas/CompanyProfile"
28757
+ }
28758
+ },
28759
+ "companies_timestamp": {
28760
+ "type": "integer",
28761
+ "format": "int32"
28762
+ },
28763
+ "companies_delay": {
28764
+ "description": "The minimum amount of time needed before the cache timestamp can change.",
28765
+ "type": "integer",
28766
+ "format": "int32"
28767
+ },
28768
+ "_metadata": {
28769
+ "$ref": "#/components/schemas/RequestMetadataWithLinksAndTotal"
28770
+ }
28771
+ },
28772
+ "type": "object"
28773
+ },
28461
28774
  "CompanyProfileResponse": {
28462
28775
  "required": [
28463
28776
  "profile"
@@ -28731,6 +29044,9 @@
28731
29044
  },
28732
29045
  {
28733
29046
  "$ref": "#/components/schemas/CompanyEmployeeExtended"
29047
+ },
29048
+ {
29049
+ "$ref": "#/components/schemas/CompanyEmployeeFull"
28734
29050
  }
28735
29051
  ]
28736
29052
  }
@@ -28757,12 +29073,32 @@
28757
29073
  {
28758
29074
  "$ref": "#/components/schemas/CompanyEmployee"
28759
29075
  },
29076
+ {
29077
+ "required": [
29078
+ "stats",
29079
+ "effectiveness"
29080
+ ],
29081
+ "properties": {
29082
+ "stats": {
29083
+ "$ref": "#/components/schemas/CompanyEmployeeStats"
29084
+ },
29085
+ "effectiveness": {
29086
+ "$ref": "#/components/schemas/CompanyEmployeeEffectiveness"
29087
+ }
29088
+ },
29089
+ "type": "object"
29090
+ }
29091
+ ]
29092
+ },
29093
+ "CompanyEmployeeFull": {
29094
+ "allOf": [
29095
+ {
29096
+ "$ref": "#/components/schemas/CompanyEmployeeExtended"
29097
+ },
28760
29098
  {
28761
29099
  "required": [
28762
29100
  "joined_at",
28763
29101
  "wage",
28764
- "stats",
28765
- "effectiveness",
28766
29102
  "value"
28767
29103
  ],
28768
29104
  "properties": {
@@ -28774,12 +29110,6 @@
28774
29110
  "type": "integer",
28775
29111
  "format": "int64"
28776
29112
  },
28777
- "stats": {
28778
- "$ref": "#/components/schemas/CompanyEmployeeStats"
28779
- },
28780
- "effectiveness": {
28781
- "$ref": "#/components/schemas/CompanyEmployeeEffectiveness"
28782
- },
28783
29113
  "value": {
28784
29114
  "description": "This value is null if you don't have a secretary.",
28785
29115
  "oneOf": [
@@ -30001,7 +30331,7 @@
30001
30331
  "format": "int32"
30002
30332
  },
30003
30333
  "_metadata": {
30004
- "$ref": "#/components/schemas/RequestMetadataWithLinks"
30334
+ "$ref": "#/components/schemas/RequestMetadataWithLinksAndTotal"
30005
30335
  }
30006
30336
  },
30007
30337
  "type": "object"
@@ -30075,7 +30405,7 @@
30075
30405
  "format": "int32"
30076
30406
  },
30077
30407
  "_metadata": {
30078
- "$ref": "#/components/schemas/RequestMetadataWithLinks"
30408
+ "$ref": "#/components/schemas/RequestMetadataWithLinksAndTotal"
30079
30409
  }
30080
30410
  },
30081
30411
  "type": "object"
@@ -30577,7 +30907,7 @@
30577
30907
  "$ref": "#/components/schemas/ItemMarket"
30578
30908
  },
30579
30909
  "_metadata": {
30580
- "$ref": "#/components/schemas/RequestMetadataWithLinks"
30910
+ "$ref": "#/components/schemas/RequestMetadataWithLinksAndTotal"
30581
30911
  }
30582
30912
  },
30583
30913
  "type": "object"
@@ -33051,6 +33381,7 @@
33051
33381
  "required": [
33052
33382
  "bounties",
33053
33383
  "bounties_timestamp",
33384
+ "bounties_delay",
33054
33385
  "_metadata"
33055
33386
  ],
33056
33387
  "properties": {
@@ -33121,6 +33452,7 @@
33121
33452
  "required": [
33122
33453
  "id",
33123
33454
  "name",
33455
+ "image",
33124
33456
  "description",
33125
33457
  "dual_fit",
33126
33458
  "weapons"
@@ -33132,6 +33464,9 @@
33132
33464
  "name": {
33133
33465
  "type": "string"
33134
33466
  },
33467
+ "image": {
33468
+ "type": "string"
33469
+ },
33135
33470
  "description": {
33136
33471
  "type": "string"
33137
33472
  },
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "5.8.0",
4
+ "version": "5.9.0",
5
+ "repository": {
6
+ "url": "https://github.com/Torn-Playground/tornapi-typescript"
7
+ },
5
8
  "scripts": {
6
9
  "generate-types": "tsc && node build/index.js"
7
10
  },
8
11
  "devDependencies": {
9
- "@scalar/openapi-types": "^0.8.0",
10
- "@types/node": "^24.12.2",
12
+ "@scalar/openapi-types": "^0.9.0",
13
+ "@types/node": "^25.9.1",
11
14
  "prettier": "^3.8.3",
12
15
  "typeconv": "^2.3.1",
13
16
  "typescript": "^6.0.3"