tornapi-typescript 4.5.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,12 @@ 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
+ }
361
369
  export interface UserWeaponExpResponse {
362
370
  weaponexp: UserWeaponExp[];
363
371
  }
@@ -1085,7 +1093,7 @@ export interface UserListResponse {
1085
1093
  list: UserList[];
1086
1094
  _metadata: RequestMetadataWithLinks;
1087
1095
  }
1088
- /** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','discord','display','equipment','gym','inventory','networth','perks','stocks'. */
1096
+ /** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','equipment','gym','inventory','networth','perks','stocks'. */
1089
1097
  export type UserSelectionName = string;
1090
1098
  export interface UserLookupResponse {
1091
1099
  selections: UserSelectionName[];
@@ -6476,6 +6484,10 @@ export interface UserV2 extends BaseSchema {
6476
6484
  response: UserCrimesResponse;
6477
6485
  params: "crimeId" | "timestamp";
6478
6486
  };
6487
+ discord: {
6488
+ response: UserDiscordResponse;
6489
+ params: "timestamp";
6490
+ };
6479
6491
  education: {
6480
6492
  response: UserEducationResponse;
6481
6493
  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,13 @@ 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
+
5322
5333
  export interface UserWeaponExpResponse {
5323
5334
  weaponexp: UserWeaponExp[];
5324
5335
  }
@@ -6186,7 +6197,7 @@ export interface UserListResponse {
6186
6197
  _metadata: RequestMetadataWithLinks;
6187
6198
  }
6188
6199
 
6189
- /** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','discord','display','equipment','gym','inventory','networth','perks','stocks'. */
6200
+ /** The following selections will fallback to API v1 and may change at any time: 'bazaar','criminalrecord','display','equipment','gym','inventory','networth','perks','stocks'. */
6190
6201
  export type UserSelectionName = string;
6191
6202
 
6192
6203
  export interface UserLookupResponse {
@@ -12216,6 +12227,10 @@ export interface UserV2 extends BaseSchema {
12216
12227
  response: UserCrimesResponse;
12217
12228
  params: "crimeId" | "timestamp";
12218
12229
  };
12230
+ discord: {
12231
+ response: UserDiscordResponse;
12232
+ params: "timestamp";
12233
+ };
12219
12234
  education: {
12220
12235
  response: UserEducationResponse;
12221
12236
  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.5.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
  {
@@ -3027,7 +3114,7 @@
3027
3114
  "User"
3028
3115
  ],
3029
3116
  "summary": "Get your weapon experience information",
3030
- "description": "Requires public minimal key. <br>",
3117
+ "description": "Requires minimal key. <br>",
3031
3118
  "operationId": "0b35f182b0a14eccc166ec542f1e7234",
3032
3119
  "parameters": [
3033
3120
  {
@@ -3208,7 +3295,7 @@
3208
3295
  "schema": {
3209
3296
  "oneOf": [
3210
3297
  {
3211
- "$ref": "#/components/schemas/UserId"
3298
+ "$ref": "#/components/schemas/UserDiscordPathId"
3212
3299
  },
3213
3300
  {
3214
3301
  "$ref": "#/components/schemas/TornCrimeId"
@@ -3316,6 +3403,9 @@
3316
3403
  {
3317
3404
  "$ref": "#/components/schemas/UserAmmoResponse"
3318
3405
  },
3406
+ {
3407
+ "$ref": "#/components/schemas/UserDiscordResponse"
3408
+ },
3319
3409
  {
3320
3410
  "$ref": "#/components/schemas/UserRacesResponse"
3321
3411
  },
@@ -14163,6 +14253,19 @@
14163
14253
  "type": "integer",
14164
14254
  "format": "int32"
14165
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
+ },
14166
14269
  "UserMessageId": {
14167
14270
  "type": "integer",
14168
14271
  "format": "int64"
@@ -15710,6 +15813,29 @@
15710
15813
  }
15711
15814
  ]
15712
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
+ },
15713
15839
  "UserWeaponExpResponse": {
15714
15840
  "required": [
15715
15841
  "weaponexp"
@@ -19248,7 +19374,7 @@
19248
19374
  "UserSelectionName": {
19249
19375
  "oneOf": [
19250
19376
  {
19251
- "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'.",
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'.",
19252
19378
  "type": "string",
19253
19379
  "enum": [
19254
19380
  "ammo",
@@ -19262,6 +19388,7 @@
19262
19388
  "competition",
19263
19389
  "cooldowns",
19264
19390
  "crimes",
19391
+ "discord",
19265
19392
  "enlistedcars",
19266
19393
  "events",
19267
19394
  "faction",
@@ -19307,7 +19434,6 @@
19307
19434
  "workstats",
19308
19435
  "bazaar",
19309
19436
  "criminalrecord",
19310
- "discord",
19311
19437
  "display",
19312
19438
  "education",
19313
19439
  "equipment",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "4.5.0",
4
+ "version": "4.6.0",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },