tornapi-typescript 5.8.1 → 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";
@@ -2170,6 +2171,7 @@ export interface FactionTerritoryWarReportResponse {
2170
2171
  }
2171
2172
  export interface FactionTerritoryOwnership {
2172
2173
  id: string;
2174
+ irradiated: boolean;
2173
2175
  owned_by: FactionId | null;
2174
2176
  acquired_at: number | null;
2175
2177
  }
@@ -2395,13 +2397,13 @@ export interface FactionWarsResponse {
2395
2397
  pacts: FactionPact[];
2396
2398
  wars: FactionWars;
2397
2399
  }
2398
- export interface FactionNews {
2400
+ export interface News {
2399
2401
  id: string;
2400
2402
  text: string;
2401
2403
  timestamp: number;
2402
2404
  }
2403
- export interface FactionNewsResponse {
2404
- news: FactionNews[];
2405
+ export interface NewsResponse {
2406
+ news: News[];
2405
2407
  _metadata: RequestMetadataWithLinks;
2406
2408
  }
2407
2409
  export interface FactionRaidsResponse {
@@ -2688,13 +2690,20 @@ export interface FactionRankedWarReportResponse {
2688
2690
  };
2689
2691
  }
2690
2692
  /**
2691
- * 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'.
2692
2694
  * * The following selections are not available in API v2: 'details'.
2693
2695
  */
2694
2696
  export type CompanySelectionName = string;
2695
2697
  export interface CompanyLookupResponse {
2696
2698
  selections: CompanySelectionName[];
2697
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
+ }
2698
2707
  export interface CompanyProfileResponse {
2699
2708
  profile: CompanyProfile;
2700
2709
  }
@@ -3639,7 +3648,7 @@ export interface TornBountiesResponse {
3639
3648
  bounties: Bounty[];
3640
3649
  bounties_timestamp: number;
3641
3650
  /** The minimum amount of time needed before the cache timestamp can change. */
3642
- bounties_delay?: number;
3651
+ bounties_delay: number;
3643
3652
  _metadata: RequestMetadataWithLinksAndTotal;
3644
3653
  }
3645
3654
  export interface TornItemAmmo {
@@ -7328,7 +7337,7 @@ export interface FactionV2 extends BaseSchema {
7328
7337
  params: "striptags" | "timestamp";
7329
7338
  };
7330
7339
  news: {
7331
- response: FactionNewsResponse;
7340
+ response: NewsResponse;
7332
7341
  params: "striptags" | "limit" | "sort" | "to" | "from" | "cat" | "timestamp";
7333
7342
  };
7334
7343
  positions: {
@@ -7423,6 +7432,14 @@ export interface CompanyV2 extends BaseSchema {
7423
7432
  response: CompanyEmployeesResponse;
7424
7433
  params: "striptags" | "timestamp";
7425
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
+ };
7426
7443
  profile: {
7427
7444
  response: CompanyProfileResponseMixed;
7428
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"
@@ -7796,6 +7803,7 @@ export interface FactionTerritoryWarReportResponse {
7796
7803
 
7797
7804
  export interface FactionTerritoryOwnership {
7798
7805
  id: string;
7806
+ irradiated: boolean;
7799
7807
  owned_by: FactionId | null;
7800
7808
  acquired_at: number | null;
7801
7809
  }
@@ -8056,14 +8064,14 @@ export interface FactionWarsResponse {
8056
8064
  wars: FactionWars;
8057
8065
  }
8058
8066
 
8059
- export interface FactionNews {
8067
+ export interface News {
8060
8068
  id: string;
8061
8069
  text: string;
8062
8070
  timestamp: number;
8063
8071
  }
8064
8072
 
8065
- export interface FactionNewsResponse {
8066
- news: FactionNews[];
8073
+ export interface NewsResponse {
8074
+ news: News[];
8067
8075
  _metadata: RequestMetadataWithLinks;
8068
8076
  }
8069
8077
 
@@ -8390,7 +8398,7 @@ export interface FactionRankedWarReportResponse {
8390
8398
  }
8391
8399
 
8392
8400
  /**
8393
- * 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'.
8394
8402
  * * The following selections are not available in API v2: 'details'.
8395
8403
  */
8396
8404
  export type CompanySelectionName = string;
@@ -8399,6 +8407,14 @@ export interface CompanyLookupResponse {
8399
8407
  selections: CompanySelectionName[];
8400
8408
  }
8401
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
+
8402
8418
  export interface CompanyProfileResponse {
8403
8419
  profile: CompanyProfile;
8404
8420
  }
@@ -9502,7 +9518,7 @@ export interface TornBountiesResponse {
9502
9518
  bounties: Bounty[];
9503
9519
  bounties_timestamp: number;
9504
9520
  /** The minimum amount of time needed before the cache timestamp can change. */
9505
- bounties_delay?: number;
9521
+ bounties_delay: number;
9506
9522
  _metadata: RequestMetadataWithLinksAndTotal;
9507
9523
  }
9508
9524
 
@@ -13333,7 +13349,7 @@ export interface FactionV2 extends BaseSchema {
13333
13349
  params: "striptags" | "timestamp";
13334
13350
  };
13335
13351
  news: {
13336
- response: FactionNewsResponse;
13352
+ response: NewsResponse;
13337
13353
  params:
13338
13354
  | "striptags"
13339
13355
  | "limit"
@@ -13455,6 +13471,21 @@ export interface CompanyV2 extends BaseSchema {
13455
13471
  response: CompanyEmployeesResponse;
13456
13472
  params: "striptags" | "timestamp";
13457
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
+ };
13458
13489
  profile: {
13459
13490
  response: CompanyProfileResponseMixed;
13460
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.1"
6
+ "version": "5.9.0"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -4923,7 +4923,7 @@
4923
4923
  "content": {
4924
4924
  "application/json": {
4925
4925
  "schema": {
4926
- "$ref": "#/components/schemas/FactionNewsResponse"
4926
+ "$ref": "#/components/schemas/NewsResponse"
4927
4927
  }
4928
4928
  }
4929
4929
  }
@@ -6339,7 +6339,7 @@
6339
6339
  "$ref": "#/components/schemas/FactionWarsResponse"
6340
6340
  },
6341
6341
  {
6342
- "$ref": "#/components/schemas/FactionNewsResponse"
6342
+ "$ref": "#/components/schemas/NewsResponse"
6343
6343
  },
6344
6344
  {
6345
6345
  "$ref": "#/components/schemas/RevivesResponse"
@@ -6568,6 +6568,126 @@
6568
6568
  "x-stability": "Unstable"
6569
6569
  }
6570
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
+ },
6571
6691
  "/company/profile": {
6572
6692
  "get": {
6573
6693
  "tags": [
@@ -6827,6 +6947,19 @@
6827
6947
  }
6828
6948
  }
6829
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
+ },
6830
6963
  {
6831
6964
  "$ref": "#/components/parameters/ApiLimit"
6832
6965
  },
@@ -6868,6 +7001,9 @@
6868
7001
  {
6869
7002
  "$ref": "#/components/schemas/CompanyProfileResponse"
6870
7003
  },
7004
+ {
7005
+ "$ref": "#/components/schemas/NewsResponse"
7006
+ },
6871
7007
  {
6872
7008
  "$ref": "#/components/schemas/CompanyStockResponse"
6873
7009
  },
@@ -15031,6 +15167,16 @@
15031
15167
  "giveFunds"
15032
15168
  ]
15033
15169
  },
15170
+ "CompanyNewsCategory": {
15171
+ "type": "string",
15172
+ "enum": [
15173
+ "main",
15174
+ "funds",
15175
+ "training",
15176
+ "employees",
15177
+ "all"
15178
+ ]
15179
+ },
15034
15180
  "FactionRankEnum": {
15035
15181
  "type": "string",
15036
15182
  "enum": [
@@ -26124,12 +26270,16 @@
26124
26270
  "required": [
26125
26271
  "id",
26126
26272
  "owned_by",
26127
- "acquired_at"
26273
+ "acquired_at",
26274
+ "irradiated"
26128
26275
  ],
26129
26276
  "properties": {
26130
26277
  "id": {
26131
26278
  "type": "string"
26132
26279
  },
26280
+ "irradiated": {
26281
+ "type": "boolean"
26282
+ },
26133
26283
  "owned_by": {
26134
26284
  "oneOf": [
26135
26285
  {
@@ -27143,7 +27293,7 @@
27143
27293
  },
27144
27294
  "type": "object"
27145
27295
  },
27146
- "FactionNews": {
27296
+ "News": {
27147
27297
  "required": [
27148
27298
  "id",
27149
27299
  "text",
@@ -27163,7 +27313,7 @@
27163
27313
  },
27164
27314
  "type": "object"
27165
27315
  },
27166
- "FactionNewsResponse": {
27316
+ "NewsResponse": {
27167
27317
  "required": [
27168
27318
  "news",
27169
27319
  "_metadata"
@@ -27172,7 +27322,7 @@
27172
27322
  "news": {
27173
27323
  "type": "array",
27174
27324
  "items": {
27175
- "$ref": "#/components/schemas/FactionNews"
27325
+ "$ref": "#/components/schemas/News"
27176
27326
  }
27177
27327
  },
27178
27328
  "_metadata": {
@@ -28559,17 +28709,17 @@
28559
28709
  "CompanySelectionName": {
28560
28710
  "oneOf": [
28561
28711
  {
28562
- "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'.",
28563
28713
  "type": "string",
28564
28714
  "enum": [
28565
28715
  "applications",
28566
28716
  "employees",
28567
28717
  "lookup",
28718
+ "news",
28568
28719
  "profile",
28569
28720
  "stock",
28570
28721
  "timestamp",
28571
28722
  "companies",
28572
- "news",
28573
28723
  "search"
28574
28724
  ]
28575
28725
  },
@@ -28592,6 +28742,35 @@
28592
28742
  },
28593
28743
  "type": "object"
28594
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
+ },
28595
28774
  "CompanyProfileResponse": {
28596
28775
  "required": [
28597
28776
  "profile"
@@ -33202,6 +33381,7 @@
33202
33381
  "required": [
33203
33382
  "bounties",
33204
33383
  "bounties_timestamp",
33384
+ "bounties_delay",
33205
33385
  "_metadata"
33206
33386
  ],
33207
33387
  "properties": {
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "5.8.1",
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.3",
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"