tornapi-typescript 4.3.7 → 4.4.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
@@ -48,6 +48,7 @@ export type WeaponBonusEnum = "Any" | "Double" | "Yellow" | "Orange" | "Red" | "
48
48
  export type UserListEnum = "Friends" | "Enemies" | "Targets";
49
49
  export type JobPositionCasinoEnum = "Gaming Consultant" | "Marketing Manager" | "Revenue Manager" | "Casino Manager" | "Casino President";
50
50
  export type AttackFinishingHitEffect = "proficience" | "stricken" | "revitalize" | "warlord" | "plunder" | "irradiate";
51
+ export type ApiFiltersAttacksRevivesEnum = "incoming" | "outgoing" | "idFilter";
51
52
  export type JobPositionMedicalEnum = "Medical Student" | "Houseman" | "Senior Houseman" | "GP" | "Consultant" | "Surgeon" | "Brain Surgeon";
52
53
  export type JobPositionLawEnum = "Law Student" | "Paralegal" | "Probate Lawyer" | "Trial Lawyer" | "Circuit Court Judge" | "Federal Judge";
53
54
  export type JobPositionEducationEnum = "Recess Supervisor" | "Substitute Teacher" | "Elementary Teacher" | "Secondary Teacher" | "Professor" | "Vice-Principal" | "Principal";
@@ -124,6 +125,7 @@ export interface RequestMetadataWithLinksAndTotal {
124
125
  export type ForumFeedTypeEnum = 1 | 2 | 3 | 4 | 5 | 6 | 7;
125
126
  export type UserGenderEnum = "Male" | "Female" | "Enby";
126
127
  export type HonorRarityEnum = "Extremely Rare" | "Very Rare" | "Rare" | "Limited" | "Uncommon" | "Common" | "Very Common" | "Unknown" | "Unknown Rarity";
128
+ export type AwardCrimesVersionEnum = "v1" | "v2";
127
129
  export type Parameters = string;
128
130
  export type ReviveSetting = "Everyone" | "Friends & faction" | "No one" | "Unknown";
129
131
  export type FactionWarfareTypeEnum = "ranked" | "territory" | "raid" | "chain" | "chainOngoing" | "db";
@@ -672,6 +674,19 @@ export interface UserBattleStatModifierDetail {
672
674
  value: number;
673
675
  type: string;
674
676
  }
677
+ export interface UserAmmoResponse {
678
+ ammo?: UserAmmo[];
679
+ }
680
+ export interface UserAmmo {
681
+ id: AmmoId;
682
+ name: string;
683
+ types: UserAmmoType[];
684
+ }
685
+ export interface UserAmmoType {
686
+ name: TornItemAmmoTypeEnum;
687
+ quantity: number;
688
+ equipped: boolean;
689
+ }
675
690
  export interface UserBasic {
676
691
  id: UserId;
677
692
  name: string;
@@ -1062,7 +1077,7 @@ export interface UserListResponse {
1062
1077
  list: UserList[];
1063
1078
  _metadata: RequestMetadataWithLinks;
1064
1079
  }
1065
- /** The following selections will fallback to API v1 and may change at any time: 'ammo','bazaar','criminalrecord','discord','display','equipment','gym','inventory','networth','perks','stocks','weaponexp'. */
1080
+ /** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','discord','display','equipment','gym','inventory','networth','perks','stocks','weaponexp'. */
1066
1081
  export type UserSelectionName = string;
1067
1082
  export interface UserLookupResponse {
1068
1083
  selections: UserSelectionName[];
@@ -2782,6 +2797,7 @@ export interface TornHonor {
2782
2797
  circulation?: number;
2783
2798
  equipped?: number;
2784
2799
  rarity?: HonorRarityEnum;
2800
+ crimes_version?: AwardCrimesVersionEnum;
2785
2801
  }
2786
2802
  export interface TornHonorsResponse {
2787
2803
  honors: TornHonor[];
@@ -2796,6 +2812,7 @@ export interface TornMedal {
2796
2812
  };
2797
2813
  circulation: number;
2798
2814
  rarity: HonorRarityEnum;
2815
+ crimes_version?: AwardCrimesVersionEnum;
2799
2816
  }
2800
2817
  export interface TornMedalsResponse {
2801
2818
  medals: TornMedal[];
@@ -6407,6 +6424,10 @@ export interface SectionsV1Map {
6407
6424
  }
6408
6425
  export interface UserV2 extends BaseSchema {
6409
6426
  selections: {
6427
+ ammo: {
6428
+ response: UserAmmoResponse;
6429
+ params: "timestamp";
6430
+ };
6410
6431
  attacks: {
6411
6432
  response: FactionAttacksResponse;
6412
6433
  params: "filters" | "limit" | "sort" | "to" | "from" | "timestamp";
package/dist/index.ts CHANGED
@@ -4629,6 +4629,8 @@ export type AttackFinishingHitEffect =
4629
4629
  | "plunder"
4630
4630
  | "irradiate";
4631
4631
 
4632
+ export type ApiFiltersAttacksRevivesEnum = "incoming" | "outgoing" | "idFilter";
4633
+
4632
4634
  export type JobPositionMedicalEnum =
4633
4635
  | "Medical Student"
4634
4636
  | "Houseman"
@@ -4852,6 +4854,8 @@ export type HonorRarityEnum =
4852
4854
  | "Unknown"
4853
4855
  | "Unknown Rarity";
4854
4856
 
4857
+ export type AwardCrimesVersionEnum = "v1" | "v2";
4858
+
4855
4859
  export type Parameters = string;
4856
4860
 
4857
4861
  export type ReviveSetting =
@@ -5685,6 +5689,22 @@ export interface UserBattleStatModifierDetail {
5685
5689
  type: string;
5686
5690
  }
5687
5691
 
5692
+ export interface UserAmmoResponse {
5693
+ ammo?: UserAmmo[];
5694
+ }
5695
+
5696
+ export interface UserAmmo {
5697
+ id: AmmoId;
5698
+ name: string;
5699
+ types: UserAmmoType[];
5700
+ }
5701
+
5702
+ export interface UserAmmoType {
5703
+ name: TornItemAmmoTypeEnum;
5704
+ quantity: number;
5705
+ equipped: boolean;
5706
+ }
5707
+
5688
5708
  export interface UserBasic {
5689
5709
  id: UserId;
5690
5710
  name: string;
@@ -6156,7 +6176,7 @@ export interface UserListResponse {
6156
6176
  _metadata: RequestMetadataWithLinks;
6157
6177
  }
6158
6178
 
6159
- /** The following selections will fallback to API v1 and may change at any time: 'ammo','bazaar','criminalrecord','discord','display','equipment','gym','inventory','networth','perks','stocks','weaponexp'. */
6179
+ /** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','discord','display','equipment','gym','inventory','networth','perks','stocks','weaponexp'. */
6160
6180
  export type UserSelectionName = string;
6161
6181
 
6162
6182
  export interface UserLookupResponse {
@@ -8394,6 +8414,7 @@ export interface TornHonor {
8394
8414
  circulation?: number;
8395
8415
  equipped?: number;
8396
8416
  rarity?: HonorRarityEnum;
8417
+ crimes_version?: AwardCrimesVersionEnum;
8397
8418
  }
8398
8419
 
8399
8420
  export interface TornHonorsResponse {
@@ -8410,6 +8431,7 @@ export interface TornMedal {
8410
8431
  };
8411
8432
  circulation: number;
8412
8433
  rarity: HonorRarityEnum;
8434
+ crimes_version?: AwardCrimesVersionEnum;
8413
8435
  }
8414
8436
 
8415
8437
  export interface TornMedalsResponse {
@@ -12140,6 +12162,10 @@ export interface SectionsV1Map {
12140
12162
  }
12141
12163
  export interface UserV2 extends BaseSchema {
12142
12164
  selections: {
12165
+ ammo: {
12166
+ response: UserAmmoResponse;
12167
+ params: "timestamp";
12168
+ };
12143
12169
  attacks: {
12144
12170
  response: FactionAttacksResponse;
12145
12171
  params: "filters" | "limit" | "sort" | "to" | "from" | "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": "4.3.7"
6
+ "version": "4.4.0"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -12,6 +12,45 @@
12
12
  }
13
13
  ],
14
14
  "paths": {
15
+ "/user/ammo": {
16
+ "get": {
17
+ "tags": [
18
+ "User"
19
+ ],
20
+ "summary": "Get your ammo information",
21
+ "description": "Requires public minimal key. <br>",
22
+ "operationId": "39826224a85f3a0dde89080ce7489685",
23
+ "parameters": [
24
+ {
25
+ "$ref": "#/components/parameters/ApiTimestamp"
26
+ },
27
+ {
28
+ "$ref": "#/components/parameters/ApiComment"
29
+ },
30
+ {
31
+ "$ref": "#/components/parameters/ApiKeyMinimal"
32
+ }
33
+ ],
34
+ "responses": {
35
+ "200": {
36
+ "description": "Successful operation",
37
+ "content": {
38
+ "application/json": {
39
+ "schema": {
40
+ "$ref": "#/components/schemas/UserAmmoResponse"
41
+ }
42
+ }
43
+ }
44
+ }
45
+ },
46
+ "security": [
47
+ {
48
+ "api_key": []
49
+ }
50
+ ],
51
+ "x-stability": "Unstable"
52
+ }
53
+ },
15
54
  "/user/attacks": {
16
55
  "get": {
17
56
  "tags": [
@@ -13856,6 +13895,14 @@
13856
13895
  "irradiate"
13857
13896
  ]
13858
13897
  },
13898
+ "ApiFiltersAttacksRevivesEnum": {
13899
+ "type": "string",
13900
+ "enum": [
13901
+ "incoming",
13902
+ "outgoing",
13903
+ "idFilter"
13904
+ ]
13905
+ },
13859
13906
  "JobPositionMedicalEnum": {
13860
13907
  "type": "string",
13861
13908
  "enum": [
@@ -14252,6 +14299,13 @@
14252
14299
  "Unknown Rarity"
14253
14300
  ]
14254
14301
  },
14302
+ "AwardCrimesVersionEnum": {
14303
+ "type": "string",
14304
+ "enum": [
14305
+ "v1",
14306
+ "v2"
14307
+ ]
14308
+ },
14255
14309
  "Parameters": {
14256
14310
  "oneOf": [
14257
14311
  {
@@ -17158,6 +17212,59 @@
17158
17212
  },
17159
17213
  "type": "object"
17160
17214
  },
17215
+ "UserAmmoResponse": {
17216
+ "properties": {
17217
+ "ammo": {
17218
+ "type": "array",
17219
+ "items": {
17220
+ "$ref": "#/components/schemas/UserAmmo"
17221
+ }
17222
+ }
17223
+ },
17224
+ "type": "object"
17225
+ },
17226
+ "UserAmmo": {
17227
+ "required": [
17228
+ "id",
17229
+ "name",
17230
+ "types"
17231
+ ],
17232
+ "properties": {
17233
+ "id": {
17234
+ "$ref": "#/components/schemas/AmmoId"
17235
+ },
17236
+ "name": {
17237
+ "type": "string"
17238
+ },
17239
+ "types": {
17240
+ "type": "array",
17241
+ "items": {
17242
+ "$ref": "#/components/schemas/UserAmmoType"
17243
+ }
17244
+ }
17245
+ },
17246
+ "type": "object"
17247
+ },
17248
+ "UserAmmoType": {
17249
+ "required": [
17250
+ "name",
17251
+ "quantity",
17252
+ "equipped"
17253
+ ],
17254
+ "properties": {
17255
+ "name": {
17256
+ "$ref": "#/components/schemas/TornItemAmmoTypeEnum"
17257
+ },
17258
+ "quantity": {
17259
+ "type": "integer",
17260
+ "format": "int32"
17261
+ },
17262
+ "equipped": {
17263
+ "type": "boolean"
17264
+ }
17265
+ },
17266
+ "type": "object"
17267
+ },
17161
17268
  "UserBasic": {
17162
17269
  "required": [
17163
17270
  "id",
@@ -19062,9 +19169,10 @@
19062
19169
  "UserSelectionName": {
19063
19170
  "oneOf": [
19064
19171
  {
19065
- "description": "The following selections will fallback to API v1 and may change at any time: 'ammo','bazaar','criminalrecord','discord','display','equipment','gym','inventory','networth','perks','stocks','weaponexp'.",
19172
+ "description": "The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','discord','display','equipment','gym','inventory','networth','perks','stocks','weaponexp'.",
19066
19173
  "type": "string",
19067
19174
  "enum": [
19175
+ "ammo",
19068
19176
  "attacks",
19069
19177
  "attacksfull",
19070
19178
  "bars",
@@ -19117,7 +19225,6 @@
19117
19225
  "timestamp",
19118
19226
  "travel",
19119
19227
  "workstats",
19120
- "ammo",
19121
19228
  "bazaar",
19122
19229
  "criminalrecord",
19123
19230
  "discord",
@@ -27636,6 +27743,10 @@
27636
27743
  },
27637
27744
  "rarity": {
27638
27745
  "$ref": "#/components/schemas/HonorRarityEnum"
27746
+ },
27747
+ "crimes_version": {
27748
+ "$ref": "#/components/schemas/AwardCrimesVersionEnum",
27749
+ "description": "Populated only when the type.id is 5."
27639
27750
  }
27640
27751
  },
27641
27752
  "type": "object"
@@ -27695,6 +27806,10 @@
27695
27806
  },
27696
27807
  "rarity": {
27697
27808
  "$ref": "#/components/schemas/HonorRarityEnum"
27809
+ },
27810
+ "crimes_version": {
27811
+ "$ref": "#/components/schemas/AwardCrimesVersionEnum",
27812
+ "description": "Populated only when the type.id is 'CRM'."
27698
27813
  }
27699
27814
  },
27700
27815
  "type": "object"
@@ -29482,14 +29597,15 @@
29482
29597
  "ApiFiltersIncomingOutgoing": {
29483
29598
  "name": "filters",
29484
29599
  "in": "query",
29485
- "description": "It's possible to use this query parameter to only get incoming or outgoing attacks / revives. If not specified, this selection will return both incoming and outgoing attacks / revives.",
29600
+ "description": "It's possible to use this query parameter to only get incoming or outgoing attacks / revives. If not specified, this selection will return both incoming and outgoing attacks / revives.\nIt's also possible to combine this with 'idFilter'. This filter allows using from/to to filter by ids instead of timestamps.",
29486
29601
  "required": false,
29602
+ "style": "form",
29603
+ "explode": false,
29487
29604
  "schema": {
29488
- "type": "string",
29489
- "enum": [
29490
- "incoming",
29491
- "outgoing"
29492
- ]
29605
+ "type": "array",
29606
+ "items": {
29607
+ "$ref": "#/components/schemas/ApiFiltersAttacksRevivesEnum"
29608
+ }
29493
29609
  }
29494
29610
  },
29495
29611
  "ApiFiltersUser": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "4.3.7",
4
+ "version": "4.4.0",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },