tornapi-typescript 0.1.5 → 0.2.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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![NPM Version](https://img.shields.io/npm/v/tornapi-typescript)](https://www.npmjs.com/package/tornapi-typescript)
4
4
  [![NPM Downloads](https://img.shields.io/npm/d18m/tornapi-typescript)](https://www.npmjs.com/package/tornapi-typescript)
5
5
 
6
- Automatically generated type definition in Typescript for [torn.com](https://torn.com) API V2.
6
+ Automatically generated type definition in TypeScript for [torn.com](https://torn.com) API V2.
7
7
 
8
8
  ## Installation
9
9
 
@@ -14,9 +14,7 @@ Automatically generated type definition in Typescript for [torn.com](https://tor
14
14
  These types are generated in the following way:
15
15
 
16
16
  * load [openapi specification](https://www.torn.com/swagger/openapi.json)
17
- * clean the specification for better types
18
- * remove `type` when `oneOf` is present, for improved types
19
- * convert the specification to Typescript definitions using [typeconv](https://github.com/grantila/typeconv)
17
+ * convert the specification to TypeScript definitions using [typeconv](https://github.com/grantila/typeconv)
20
18
  * clean the type definitions
21
19
  * remove all "[key: string]: any;", because typeconv adds it everywhere for some reason
22
20
  * remove all empty objects (caused by the above cleaning)
@@ -25,4 +23,4 @@ These types are generated in the following way:
25
23
  ## Contact
26
24
 
27
25
  You can join the community in [our Discord server](https://discord.gg/2wb7GKN). There you can discuss anything related
28
- to the Torn API, or other tools related to Torn. Issues can also be reported there, or as GitHub issue.
26
+ to the Torn API or other tools related to Torn. Issues can also be reported there, or as GitHub issue.
package/dist/index.d.ts CHANGED
@@ -9,6 +9,13 @@
9
9
 
10
10
  export type RaceClassEnum = "A" | "B" | "C" | "D" | "E";
11
11
 
12
+ export type ApiKeyAccessTypeEnum =
13
+ | "Custom"
14
+ | "Public Only"
15
+ | "Minimal Access"
16
+ | "Limited Access"
17
+ | "Full Access";
18
+
12
19
  export type FactionTerritoryEnum =
13
20
  | "AAB"
14
21
  | "AAC"
@@ -4161,7 +4168,9 @@ export type FactionStatEnum =
4161
4168
  | "attacksrunaway"
4162
4169
  | "highestterritories"
4163
4170
  | "territoryrespect"
4164
- | "membersamount";
4171
+ | "membersamount"
4172
+ | "factionage"
4173
+ | "upgradesamount";
4165
4174
 
4166
4175
  export type FactionBranchStateEnum = "war" | "peace";
4167
4176
 
@@ -5357,6 +5366,7 @@ export interface FactionCrimeSlot {
5357
5366
 
5358
5367
  export interface FactionCrime {
5359
5368
  id: FactionCrimeId;
5369
+ previous_crime_id: FactionCrimeId | null;
5360
5370
  name: string;
5361
5371
  difficulty: number;
5362
5372
  status: FactionCrimeStatusEnum;
@@ -5637,6 +5647,40 @@ export interface ForumLookupResponse {
5637
5647
  selections: ForumSelectionName[];
5638
5648
  }
5639
5649
 
5650
+ export interface KeyLogResponse {
5651
+ log: {
5652
+ timestamp: number;
5653
+ type: string;
5654
+ selections: string;
5655
+ id: number | null;
5656
+ ip: string;
5657
+ }[];
5658
+ }
5659
+
5660
+ export interface KeyInfoResponse {
5661
+ info: {
5662
+ selections: {
5663
+ company: string[];
5664
+ faction: FactionSelectionName[];
5665
+ market: MarketSelectionName[];
5666
+ property: string[];
5667
+ torn: TornSelectionName[];
5668
+ user: UserSelectionName[];
5669
+ racing: RacingSelectionName[];
5670
+ forum: ForumSelectionName[];
5671
+ key: KeySelectionName[];
5672
+ };
5673
+ access: {
5674
+ level: number;
5675
+ type: ApiKeyAccessTypeEnum;
5676
+ faction: boolean;
5677
+ company: boolean;
5678
+ };
5679
+ };
5680
+ }
5681
+
5682
+ export type KeySelectionName = "info" | "log";
5683
+
5640
5684
  export interface ItemMarketListingItemBonus {
5641
5685
  id: number;
5642
5686
  title: string;
@@ -6168,7 +6212,7 @@ export type TornSelectionName =
6168
6212
  | "calendar"
6169
6213
  | "crimes"
6170
6214
  | "education"
6171
- | "factionHof"
6215
+ | "factionhof"
6172
6216
  | "factiontree"
6173
6217
  | "hof"
6174
6218
  | "itemammo"
@@ -7363,7 +7407,7 @@ export interface HofValue {
7363
7407
 
7364
7408
  export interface HofValueString {
7365
7409
  value: string;
7366
- rank: number;
7410
+ rank: number | null;
7367
7411
  }
7368
7412
 
7369
7413
  export interface UserHofStats {