tornapi-typescript 4.4.0 → 4.6.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
@@ -78,6 +78,8 @@ export type TerritoryWarId = number;
78
78
  export type RaidWarId = number;
79
79
  export type ItemUid = number;
80
80
  export type UserId = number;
81
+ export type DiscordId = string;
82
+ export type UserDiscordPathId = UserId | DiscordId;
81
83
  export type UserMessageId = number;
82
84
  export type UserEventId = string;
83
85
  export type UserIconId = number;
@@ -358,6 +360,20 @@ export interface ReportsResponse {
358
360
  _metadata: RequestMetadataWithLinks;
359
361
  }
360
362
  export type SelectionCategoryEnum = ReportTypeEnum | UserListEnum | PersonalStatsCategoryEnum | RacingRaceTypeEnum;
363
+ export interface UserDiscordResponse {
364
+ discord: {
365
+ discord_id: DiscordId;
366
+ user_id: UserId;
367
+ };
368
+ }
369
+ export interface UserWeaponExpResponse {
370
+ weaponexp: UserWeaponExp[];
371
+ }
372
+ export interface UserWeaponExp {
373
+ id: ItemId;
374
+ name: string;
375
+ exp: number;
376
+ }
361
377
  export interface MissionRewardDetailsAmmo {
362
378
  id: AmmoId;
363
379
  name: string;
@@ -1077,7 +1093,7 @@ export interface UserListResponse {
1077
1093
  list: UserList[];
1078
1094
  _metadata: RequestMetadataWithLinks;
1079
1095
  }
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'. */
1096
+ /** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','equipment','gym','inventory','networth','perks','stocks'. */
1081
1097
  export type UserSelectionName = string;
1082
1098
  export interface UserLookupResponse {
1083
1099
  selections: UserSelectionName[];
@@ -6468,6 +6484,10 @@ export interface UserV2 extends BaseSchema {
6468
6484
  response: UserCrimesResponse;
6469
6485
  params: "crimeId" | "timestamp";
6470
6486
  };
6487
+ discord: {
6488
+ response: UserDiscordResponse;
6489
+ params: "timestamp";
6490
+ };
6471
6491
  education: {
6472
6492
  response: UserEducationResponse;
6473
6493
  params: "timestamp";
@@ -6632,6 +6652,10 @@ export interface UserV2 extends BaseSchema {
6632
6652
  response: UserVirusResponse;
6633
6653
  params: "timestamp";
6634
6654
  };
6655
+ weaponexp: {
6656
+ response: UserWeaponExpResponse;
6657
+ params: "timestamp";
6658
+ };
6635
6659
  workstats: {
6636
6660
  response: UserWorkStatsResponse;
6637
6661
  params: "timestamp";
package/dist/index.ts CHANGED
@@ -4771,6 +4771,10 @@ export type ItemUid = number;
4771
4771
 
4772
4772
  export type UserId = number;
4773
4773
 
4774
+ export type DiscordId = string;
4775
+
4776
+ export type UserDiscordPathId = UserId | DiscordId;
4777
+
4774
4778
  export type UserMessageId = number;
4775
4779
 
4776
4780
  export type UserEventId = string;
@@ -5319,6 +5323,23 @@ export type SelectionCategoryEnum =
5319
5323
  | PersonalStatsCategoryEnum
5320
5324
  | RacingRaceTypeEnum;
5321
5325
 
5326
+ export interface UserDiscordResponse {
5327
+ discord: {
5328
+ discord_id: DiscordId;
5329
+ user_id: UserId;
5330
+ };
5331
+ }
5332
+
5333
+ export interface UserWeaponExpResponse {
5334
+ weaponexp: UserWeaponExp[];
5335
+ }
5336
+
5337
+ export interface UserWeaponExp {
5338
+ id: ItemId;
5339
+ name: string;
5340
+ exp: number;
5341
+ }
5342
+
5322
5343
  export interface MissionRewardDetailsAmmo {
5323
5344
  id: AmmoId;
5324
5345
  name: string;
@@ -6176,7 +6197,7 @@ export interface UserListResponse {
6176
6197
  _metadata: RequestMetadataWithLinks;
6177
6198
  }
6178
6199
 
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'. */
6200
+ /** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','equipment','gym','inventory','networth','perks','stocks'. */
6180
6201
  export type UserSelectionName = string;
6181
6202
 
6182
6203
  export interface UserLookupResponse {
@@ -12206,6 +12227,10 @@ export interface UserV2 extends BaseSchema {
12206
12227
  response: UserCrimesResponse;
12207
12228
  params: "crimeId" | "timestamp";
12208
12229
  };
12230
+ discord: {
12231
+ response: UserDiscordResponse;
12232
+ params: "timestamp";
12233
+ };
12209
12234
  education: {
12210
12235
  response: UserEducationResponse;
12211
12236
  params: "timestamp";
@@ -12403,6 +12428,10 @@ export interface UserV2 extends BaseSchema {
12403
12428
  response: UserVirusResponse;
12404
12429
  params: "timestamp";
12405
12430
  };
12431
+ weaponexp: {
12432
+ response: UserWeaponExpResponse;
12433
+ params: "timestamp";
12434
+ };
12406
12435
  workstats: {
12407
12436
  response: UserWorkStatsResponse;
12408
12437
  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": "4.4.0"
6
+ "version": "4.6.0"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -18,7 +18,7 @@
18
18
  "User"
19
19
  ],
20
20
  "summary": "Get your ammo information",
21
- "description": "Requires public minimal key. <br>",
21
+ "description": "Requires minimal key. <br>",
22
22
  "operationId": "39826224a85f3a0dde89080ce7489685",
23
23
  "parameters": [
24
24
  {
@@ -252,10 +252,10 @@
252
252
  {
253
253
  "name": "id",
254
254
  "in": "path",
255
- "description": "User id",
255
+ "description": "User id or user discord id",
256
256
  "required": true,
257
257
  "schema": {
258
- "$ref": "#/components/schemas/UserId"
258
+ "$ref": "#/components/schemas/UserDiscordPathId"
259
259
  }
260
260
  },
261
261
  {
@@ -381,10 +381,10 @@
381
381
  {
382
382
  "name": "id",
383
383
  "in": "path",
384
- "description": "User id",
384
+ "description": "User id or user discord id",
385
385
  "required": true,
386
386
  "schema": {
387
- "$ref": "#/components/schemas/UserId"
387
+ "$ref": "#/components/schemas/UserDiscordPathId"
388
388
  }
389
389
  },
390
390
  {
@@ -507,10 +507,10 @@
507
507
  {
508
508
  "name": "id",
509
509
  "in": "path",
510
- "description": "User id",
510
+ "description": "User id or user discord id",
511
511
  "required": true,
512
512
  "schema": {
513
- "$ref": "#/components/schemas/UserId"
513
+ "$ref": "#/components/schemas/UserDiscordPathId"
514
514
  }
515
515
  },
516
516
  {
@@ -630,6 +630,93 @@
630
630
  "x-stability": "Stable"
631
631
  }
632
632
  },
633
+ "/user/discord": {
634
+ "get": {
635
+ "tags": [
636
+ "User"
637
+ ],
638
+ "summary": "Get your discord information",
639
+ "description": "Requires public key. <br>",
640
+ "operationId": "68f0493291a1ad38d42053d861b1bba5",
641
+ "parameters": [
642
+ {
643
+ "$ref": "#/components/parameters/ApiTimestamp"
644
+ },
645
+ {
646
+ "$ref": "#/components/parameters/ApiComment"
647
+ },
648
+ {
649
+ "$ref": "#/components/parameters/ApiKeyPublic"
650
+ }
651
+ ],
652
+ "responses": {
653
+ "200": {
654
+ "description": "Successful operation",
655
+ "content": {
656
+ "application/json": {
657
+ "schema": {
658
+ "$ref": "#/components/schemas/UserDiscordResponse"
659
+ }
660
+ }
661
+ }
662
+ }
663
+ },
664
+ "security": [
665
+ {
666
+ "api_key": []
667
+ }
668
+ ],
669
+ "x-stability": "Unstable"
670
+ }
671
+ },
672
+ "/user/{id}/discord": {
673
+ "get": {
674
+ "tags": [
675
+ "User"
676
+ ],
677
+ "summary": "Get discord information for a specific user",
678
+ "description": "Requires public access key. <br>",
679
+ "operationId": "6bb6623979be4fa4149f0eab3fda3c53",
680
+ "parameters": [
681
+ {
682
+ "name": "id",
683
+ "in": "path",
684
+ "description": "User id or user discord id",
685
+ "required": true,
686
+ "schema": {
687
+ "$ref": "#/components/schemas/UserDiscordPathId"
688
+ }
689
+ },
690
+ {
691
+ "$ref": "#/components/parameters/ApiTimestamp"
692
+ },
693
+ {
694
+ "$ref": "#/components/parameters/ApiComment"
695
+ },
696
+ {
697
+ "$ref": "#/components/parameters/ApiKeyPublic"
698
+ }
699
+ ],
700
+ "responses": {
701
+ "200": {
702
+ "description": "Successful operation",
703
+ "content": {
704
+ "application/json": {
705
+ "schema": {
706
+ "$ref": "#/components/schemas/UserDiscordResponse"
707
+ }
708
+ }
709
+ }
710
+ }
711
+ },
712
+ "security": [
713
+ {
714
+ "api_key": []
715
+ }
716
+ ],
717
+ "x-stability": "Unstable"
718
+ }
719
+ },
633
720
  "/user/education": {
634
721
  "get": {
635
722
  "tags": [
@@ -810,10 +897,10 @@
810
897
  {
811
898
  "name": "id",
812
899
  "in": "path",
813
- "description": "User id",
900
+ "description": "User id or user discord id",
814
901
  "required": true,
815
902
  "schema": {
816
- "$ref": "#/components/schemas/UserId"
903
+ "$ref": "#/components/schemas/UserDiscordPathId"
817
904
  }
818
905
  },
819
906
  {
@@ -1033,10 +1120,10 @@
1033
1120
  {
1034
1121
  "name": "id",
1035
1122
  "in": "path",
1036
- "description": "User id",
1123
+ "description": "User id or user discord id",
1037
1124
  "required": true,
1038
1125
  "schema": {
1039
- "$ref": "#/components/schemas/UserId"
1126
+ "$ref": "#/components/schemas/UserDiscordPathId"
1040
1127
  }
1041
1128
  },
1042
1129
  {
@@ -1183,10 +1270,10 @@
1183
1270
  {
1184
1271
  "name": "id",
1185
1272
  "in": "path",
1186
- "description": "User id",
1273
+ "description": "User id or user discord id",
1187
1274
  "required": true,
1188
1275
  "schema": {
1189
- "$ref": "#/components/schemas/UserId"
1276
+ "$ref": "#/components/schemas/UserDiscordPathId"
1190
1277
  }
1191
1278
  },
1192
1279
  {
@@ -1282,10 +1369,10 @@
1282
1369
  {
1283
1370
  "name": "id",
1284
1371
  "in": "path",
1285
- "description": "User id",
1372
+ "description": "User id or user discord id",
1286
1373
  "required": true,
1287
1374
  "schema": {
1288
- "$ref": "#/components/schemas/UserId"
1375
+ "$ref": "#/components/schemas/UserDiscordPathId"
1289
1376
  }
1290
1377
  },
1291
1378
  {
@@ -1408,10 +1495,10 @@
1408
1495
  {
1409
1496
  "name": "id",
1410
1497
  "in": "path",
1411
- "description": "User id",
1498
+ "description": "User id or user discord id",
1412
1499
  "required": true,
1413
1500
  "schema": {
1414
- "$ref": "#/components/schemas/UserId"
1501
+ "$ref": "#/components/schemas/UserDiscordPathId"
1415
1502
  }
1416
1503
  },
1417
1504
  {
@@ -1537,10 +1624,10 @@
1537
1624
  {
1538
1625
  "name": "id",
1539
1626
  "in": "path",
1540
- "description": "User id",
1627
+ "description": "User id or user discord id",
1541
1628
  "required": true,
1542
1629
  "schema": {
1543
- "$ref": "#/components/schemas/UserId"
1630
+ "$ref": "#/components/schemas/UserDiscordPathId"
1544
1631
  }
1545
1632
  },
1546
1633
  {
@@ -2238,10 +2325,10 @@
2238
2325
  {
2239
2326
  "name": "id",
2240
2327
  "in": "path",
2241
- "description": "User id",
2328
+ "description": "User id or user discord id",
2242
2329
  "required": true,
2243
2330
  "schema": {
2244
- "$ref": "#/components/schemas/UserId"
2331
+ "$ref": "#/components/schemas/UserDiscordPathId"
2245
2332
  }
2246
2333
  },
2247
2334
  {
@@ -2358,10 +2445,10 @@
2358
2445
  {
2359
2446
  "name": "id",
2360
2447
  "in": "path",
2361
- "description": "User id",
2448
+ "description": "User id or user discord id",
2362
2449
  "required": true,
2363
2450
  "schema": {
2364
- "$ref": "#/components/schemas/UserId"
2451
+ "$ref": "#/components/schemas/UserDiscordPathId"
2365
2452
  }
2366
2453
  },
2367
2454
  {
@@ -2457,10 +2544,10 @@
2457
2544
  {
2458
2545
  "name": "id",
2459
2546
  "in": "path",
2460
- "description": "User id",
2547
+ "description": "User id or user discord id",
2461
2548
  "required": true,
2462
2549
  "schema": {
2463
- "$ref": "#/components/schemas/UserId"
2550
+ "$ref": "#/components/schemas/UserDiscordPathId"
2464
2551
  }
2465
2552
  },
2466
2553
  {
@@ -2553,10 +2640,10 @@
2553
2640
  {
2554
2641
  "name": "id",
2555
2642
  "in": "path",
2556
- "description": "User id",
2643
+ "description": "User id or user discord id",
2557
2644
  "required": true,
2558
2645
  "schema": {
2559
- "$ref": "#/components/schemas/UserId"
2646
+ "$ref": "#/components/schemas/UserDiscordPathId"
2560
2647
  }
2561
2648
  },
2562
2649
  {
@@ -3021,6 +3108,45 @@
3021
3108
  "x-stability": "Stable"
3022
3109
  }
3023
3110
  },
3111
+ "/user/weaponexp": {
3112
+ "get": {
3113
+ "tags": [
3114
+ "User"
3115
+ ],
3116
+ "summary": "Get your weapon experience information",
3117
+ "description": "Requires minimal key. <br>",
3118
+ "operationId": "0b35f182b0a14eccc166ec542f1e7234",
3119
+ "parameters": [
3120
+ {
3121
+ "$ref": "#/components/parameters/ApiTimestamp"
3122
+ },
3123
+ {
3124
+ "$ref": "#/components/parameters/ApiComment"
3125
+ },
3126
+ {
3127
+ "$ref": "#/components/parameters/ApiKeyMinimal"
3128
+ }
3129
+ ],
3130
+ "responses": {
3131
+ "200": {
3132
+ "description": "Successful operation",
3133
+ "content": {
3134
+ "application/json": {
3135
+ "schema": {
3136
+ "$ref": "#/components/schemas/UserWeaponExpResponse"
3137
+ }
3138
+ }
3139
+ }
3140
+ }
3141
+ },
3142
+ "security": [
3143
+ {
3144
+ "api_key": []
3145
+ }
3146
+ ],
3147
+ "x-stability": "Stable"
3148
+ }
3149
+ },
3024
3150
  "/user/workstats": {
3025
3151
  "get": {
3026
3152
  "tags": [
@@ -3169,7 +3295,7 @@
3169
3295
  "schema": {
3170
3296
  "oneOf": [
3171
3297
  {
3172
- "$ref": "#/components/schemas/UserId"
3298
+ "$ref": "#/components/schemas/UserDiscordPathId"
3173
3299
  },
3174
3300
  {
3175
3301
  "$ref": "#/components/schemas/TornCrimeId"
@@ -3271,6 +3397,15 @@
3271
3397
  {
3272
3398
  "$ref": "#/components/schemas/UserCrimesResponse"
3273
3399
  },
3400
+ {
3401
+ "$ref": "#/components/schemas/UserWeaponExpResponse"
3402
+ },
3403
+ {
3404
+ "$ref": "#/components/schemas/UserAmmoResponse"
3405
+ },
3406
+ {
3407
+ "$ref": "#/components/schemas/UserDiscordResponse"
3408
+ },
3274
3409
  {
3275
3410
  "$ref": "#/components/schemas/UserRacesResponse"
3276
3411
  },
@@ -14118,6 +14253,19 @@
14118
14253
  "type": "integer",
14119
14254
  "format": "int32"
14120
14255
  },
14256
+ "DiscordId": {
14257
+ "type": "string"
14258
+ },
14259
+ "UserDiscordPathId": {
14260
+ "oneOf": [
14261
+ {
14262
+ "$ref": "#/components/schemas/UserId"
14263
+ },
14264
+ {
14265
+ "$ref": "#/components/schemas/DiscordId"
14266
+ }
14267
+ ]
14268
+ },
14121
14269
  "UserMessageId": {
14122
14270
  "type": "integer",
14123
14271
  "format": "int64"
@@ -15665,6 +15813,63 @@
15665
15813
  }
15666
15814
  ]
15667
15815
  },
15816
+ "UserDiscordResponse": {
15817
+ "required": [
15818
+ "discord"
15819
+ ],
15820
+ "properties": {
15821
+ "discord": {
15822
+ "required": [
15823
+ "discord_id",
15824
+ "user_id"
15825
+ ],
15826
+ "properties": {
15827
+ "discord_id": {
15828
+ "$ref": "#/components/schemas/DiscordId"
15829
+ },
15830
+ "user_id": {
15831
+ "$ref": "#/components/schemas/UserId"
15832
+ }
15833
+ },
15834
+ "type": "object"
15835
+ }
15836
+ },
15837
+ "type": "object"
15838
+ },
15839
+ "UserWeaponExpResponse": {
15840
+ "required": [
15841
+ "weaponexp"
15842
+ ],
15843
+ "properties": {
15844
+ "weaponexp": {
15845
+ "type": "array",
15846
+ "items": {
15847
+ "$ref": "#/components/schemas/UserWeaponExp"
15848
+ }
15849
+ }
15850
+ },
15851
+ "type": "object"
15852
+ },
15853
+ "UserWeaponExp": {
15854
+ "required": [
15855
+ "id",
15856
+ "name",
15857
+ "exp"
15858
+ ],
15859
+ "properties": {
15860
+ "id": {
15861
+ "$ref": "#/components/schemas/ItemId"
15862
+ },
15863
+ "name": {
15864
+ "type": "string"
15865
+ },
15866
+ "exp": {
15867
+ "type": "integer",
15868
+ "format": "int32"
15869
+ }
15870
+ },
15871
+ "type": "object"
15872
+ },
15668
15873
  "MissionRewardDetailsAmmo": {
15669
15874
  "required": [
15670
15875
  "id",
@@ -19169,7 +19374,7 @@
19169
19374
  "UserSelectionName": {
19170
19375
  "oneOf": [
19171
19376
  {
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'.",
19377
+ "description": "The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','equipment','gym','inventory','networth','perks','stocks'.",
19173
19378
  "type": "string",
19174
19379
  "enum": [
19175
19380
  "ammo",
@@ -19183,6 +19388,7 @@
19183
19388
  "competition",
19184
19389
  "cooldowns",
19185
19390
  "crimes",
19391
+ "discord",
19186
19392
  "enlistedcars",
19187
19393
  "events",
19188
19394
  "faction",
@@ -19224,10 +19430,10 @@
19224
19430
  "skills",
19225
19431
  "timestamp",
19226
19432
  "travel",
19433
+ "weaponexp",
19227
19434
  "workstats",
19228
19435
  "bazaar",
19229
19436
  "criminalrecord",
19230
- "discord",
19231
19437
  "display",
19232
19438
  "education",
19233
19439
  "equipment",
@@ -19235,8 +19441,7 @@
19235
19441
  "inventory",
19236
19442
  "networth",
19237
19443
  "perks",
19238
- "stocks",
19239
- "weaponexp"
19444
+ "stocks"
19240
19445
  ]
19241
19446
  },
19242
19447
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "4.4.0",
4
+ "version": "4.6.0",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },