tornapi-typescript 3.0.2 → 3.0.3

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
@@ -58,6 +58,7 @@ export type ItemUid = number;
58
58
  export type UserId = number;
59
59
  export type ReviveId = number;
60
60
  export type LogId = number;
61
+ export type UserLogId = string;
61
62
  export type LogCategoryId = number;
62
63
  export type FactionId = number;
63
64
  export type CompanyId = number;
@@ -326,6 +327,23 @@ export interface ReportsResponse {
326
327
  _metadata: RequestMetadataWithLinks;
327
328
  }
328
329
  export type SelectionCategoryEnum = ReportTypeEnum | UserListEnum | PersonalStatsCategoryEnum | RacingRaceTypeEnum;
330
+ export interface UserLog {
331
+ id: UserLogId;
332
+ timestamp: number;
333
+ details: {
334
+ id: LogId;
335
+ title: string;
336
+ category: string;
337
+ };
338
+ /** Dynamic key-value pairs related to the log. */
339
+ data: {};
340
+ /** Dynamic key-value pairs related to the log. */
341
+ params: {};
342
+ }
343
+ export interface UserLogsResponse {
344
+ log: UserLog[];
345
+ _metadata: RequestMetadataWithLinks;
346
+ }
329
347
  export interface BasicUser {
330
348
  id: UserId;
331
349
  name: string;
@@ -2047,6 +2065,10 @@ export interface KeyLogResponse {
2047
2065
  ip: string;
2048
2066
  }[];
2049
2067
  }
2068
+ export interface KeyInfoAvailableLog {
2069
+ category_id: LogCategoryId;
2070
+ log_ids: LogId[];
2071
+ }
2050
2072
  export interface KeyInfoResponse {
2051
2073
  info: {
2052
2074
  selections: {
@@ -2072,6 +2094,11 @@ export interface KeyInfoResponse {
2072
2094
  faction_id?: FactionId | null;
2073
2095
  company: boolean;
2074
2096
  company_id?: CompanyId | null;
2097
+ log: {
2098
+ /** Shows if key has custom log permissions enabled. */
2099
+ custom_permissions: boolean;
2100
+ available: KeyInfoAvailableLog[];
2101
+ };
2075
2102
  };
2076
2103
  };
2077
2104
  }
@@ -5996,6 +6023,10 @@ export interface UserV2 extends BaseSchema {
5996
6023
  response: UserListResponse;
5997
6024
  params: "cat" | "limit" | "offset" | "sort" | "timestamp";
5998
6025
  };
6026
+ log: {
6027
+ response: UserLogsResponse;
6028
+ params: "log" | "cat" | "limit" | "to" | "from" | "timestamp";
6029
+ };
5999
6030
  organizedcrime: {
6000
6031
  response: UserOrganizedCrimeResponse;
6001
6032
  params: "timestamp";
package/dist/index.ts CHANGED
@@ -4590,6 +4590,8 @@ export type ReviveId = number;
4590
4590
 
4591
4591
  export type LogId = number;
4592
4592
 
4593
+ export type UserLogId = string;
4594
+
4593
4595
  export type LogCategoryId = number;
4594
4596
 
4595
4597
  export type FactionId = number;
@@ -5078,6 +5080,25 @@ export type SelectionCategoryEnum =
5078
5080
  | PersonalStatsCategoryEnum
5079
5081
  | RacingRaceTypeEnum;
5080
5082
 
5083
+ export interface UserLog {
5084
+ id: UserLogId;
5085
+ timestamp: number;
5086
+ details: {
5087
+ id: LogId;
5088
+ title: string;
5089
+ category: string;
5090
+ };
5091
+ /** Dynamic key-value pairs related to the log. */
5092
+ data: {};
5093
+ /** Dynamic key-value pairs related to the log. */
5094
+ params: {};
5095
+ }
5096
+
5097
+ export interface UserLogsResponse {
5098
+ log: UserLog[];
5099
+ _metadata: RequestMetadataWithLinks;
5100
+ }
5101
+
5081
5102
  export interface BasicUser {
5082
5103
  id: UserId;
5083
5104
  name: string;
@@ -7334,6 +7355,11 @@ export interface KeyLogResponse {
7334
7355
  }[];
7335
7356
  }
7336
7357
 
7358
+ export interface KeyInfoAvailableLog {
7359
+ category_id: LogCategoryId;
7360
+ log_ids: LogId[];
7361
+ }
7362
+
7337
7363
  export interface KeyInfoResponse {
7338
7364
  info: {
7339
7365
  selections: {
@@ -7359,6 +7385,11 @@ export interface KeyInfoResponse {
7359
7385
  faction_id?: FactionId | null;
7360
7386
  company: boolean;
7361
7387
  company_id?: CompanyId | null;
7388
+ log: {
7389
+ /** Shows if key has custom log permissions enabled. */
7390
+ custom_permissions: boolean;
7391
+ available: KeyInfoAvailableLog[];
7392
+ };
7362
7393
  };
7363
7394
  };
7364
7395
  }
@@ -11458,6 +11489,10 @@ export interface UserV2 extends BaseSchema {
11458
11489
  response: UserListResponse;
11459
11490
  params: "cat" | "limit" | "offset" | "sort" | "timestamp";
11460
11491
  };
11492
+ log: {
11493
+ response: UserLogsResponse;
11494
+ params: "log" | "cat" | "limit" | "to" | "from" | "timestamp";
11495
+ };
11461
11496
  organizedcrime: {
11462
11497
  response: UserOrganizedCrimeResponse;
11463
11498
  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": "3.0.2"
6
+ "version": "3.0.3"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -975,6 +975,77 @@
975
975
  "x-stability": "Stable"
976
976
  }
977
977
  },
978
+ "/user/log": {
979
+ "get": {
980
+ "tags": [
981
+ "User"
982
+ ],
983
+ "summary": "Get your logs",
984
+ "description": "Requires limited access key. <br> It's possible to pass a list of log ids or a log category id.<br>",
985
+ "operationId": "f354f40bc5d6cbadf57fdecb453c976f",
986
+ "parameters": [
987
+ {
988
+ "name": "log",
989
+ "in": "query",
990
+ "description": "Log ids, comma separated, e.g. 105,4900,4905",
991
+ "required": false,
992
+ "style": "form",
993
+ "explode": false,
994
+ "schema": {
995
+ "type": "array",
996
+ "items": {
997
+ "$ref": "#/components/schemas/LogId"
998
+ }
999
+ }
1000
+ },
1001
+ {
1002
+ "name": "cat",
1003
+ "in": "query",
1004
+ "description": "Log category id",
1005
+ "required": false,
1006
+ "schema": {
1007
+ "$ref": "#/components/schemas/LogCategoryId"
1008
+ }
1009
+ },
1010
+ {
1011
+ "$ref": "#/components/parameters/ApiLimit100Default20"
1012
+ },
1013
+ {
1014
+ "$ref": "#/components/parameters/ApiTo"
1015
+ },
1016
+ {
1017
+ "$ref": "#/components/parameters/ApiFrom"
1018
+ },
1019
+ {
1020
+ "$ref": "#/components/parameters/ApiTimestamp"
1021
+ },
1022
+ {
1023
+ "$ref": "#/components/parameters/ApiComment"
1024
+ },
1025
+ {
1026
+ "$ref": "#/components/parameters/ApiKeyFull"
1027
+ }
1028
+ ],
1029
+ "responses": {
1030
+ "200": {
1031
+ "description": "Successful operation",
1032
+ "content": {
1033
+ "application/json": {
1034
+ "schema": {
1035
+ "$ref": "#/components/schemas/UserLogsResponse"
1036
+ }
1037
+ }
1038
+ }
1039
+ }
1040
+ },
1041
+ "security": [
1042
+ {
1043
+ "api_key": []
1044
+ }
1045
+ ],
1046
+ "x-stability": "Unstable"
1047
+ }
1048
+ },
978
1049
  "/user/organizedcrime": {
979
1050
  "get": {
980
1051
  "tags": [
@@ -11968,6 +12039,9 @@
11968
12039
  "type": "integer",
11969
12040
  "format": "int32"
11970
12041
  },
12042
+ "UserLogId": {
12043
+ "type": "string"
12044
+ },
11971
12045
  "LogCategoryId": {
11972
12046
  "type": "integer",
11973
12047
  "format": "int32"
@@ -13423,6 +13497,70 @@
13423
13497
  }
13424
13498
  ]
13425
13499
  },
13500
+ "UserLog": {
13501
+ "required": [
13502
+ "id",
13503
+ "timestamp",
13504
+ "details",
13505
+ "data",
13506
+ "params"
13507
+ ],
13508
+ "properties": {
13509
+ "id": {
13510
+ "$ref": "#/components/schemas/UserLogId"
13511
+ },
13512
+ "timestamp": {
13513
+ "type": "integer",
13514
+ "format": "int32"
13515
+ },
13516
+ "details": {
13517
+ "required": [
13518
+ "id",
13519
+ "title",
13520
+ "category"
13521
+ ],
13522
+ "properties": {
13523
+ "id": {
13524
+ "$ref": "#/components/schemas/LogId"
13525
+ },
13526
+ "title": {
13527
+ "type": "string"
13528
+ },
13529
+ "category": {
13530
+ "type": "string"
13531
+ }
13532
+ },
13533
+ "type": "object"
13534
+ },
13535
+ "data": {
13536
+ "description": "Dynamic key-value pairs related to the log.",
13537
+ "type": "object"
13538
+ },
13539
+ "params": {
13540
+ "description": "Dynamic key-value pairs related to the log.",
13541
+ "type": "object"
13542
+ }
13543
+ },
13544
+ "type": "object"
13545
+ },
13546
+ "UserLogsResponse": {
13547
+ "required": [
13548
+ "log",
13549
+ "_metadata"
13550
+ ],
13551
+ "properties": {
13552
+ "log": {
13553
+ "type": "array",
13554
+ "items": {
13555
+ "$ref": "#/components/schemas/UserLog"
13556
+ }
13557
+ },
13558
+ "_metadata": {
13559
+ "$ref": "#/components/schemas/RequestMetadataWithLinks"
13560
+ }
13561
+ },
13562
+ "type": "object"
13563
+ },
13426
13564
  "BasicUser": {
13427
13565
  "required": [
13428
13566
  "id",
@@ -21955,6 +22093,24 @@
21955
22093
  },
21956
22094
  "type": "object"
21957
22095
  },
22096
+ "KeyInfoAvailableLog": {
22097
+ "required": [
22098
+ "category_id",
22099
+ "log_ids"
22100
+ ],
22101
+ "properties": {
22102
+ "category_id": {
22103
+ "$ref": "#/components/schemas/LogCategoryId"
22104
+ },
22105
+ "log_ids": {
22106
+ "type": "array",
22107
+ "items": {
22108
+ "$ref": "#/components/schemas/LogId"
22109
+ }
22110
+ }
22111
+ },
22112
+ "type": "object"
22113
+ },
21958
22114
  "KeyInfoResponse": {
21959
22115
  "required": [
21960
22116
  "info"
@@ -22077,7 +22233,8 @@
22077
22233
  "level",
22078
22234
  "type",
22079
22235
  "faction",
22080
- "company"
22236
+ "company",
22237
+ "log"
22081
22238
  ],
22082
22239
  "properties": {
22083
22240
  "level": {
@@ -22116,6 +22273,25 @@
22116
22273
  "type": "null"
22117
22274
  }
22118
22275
  ]
22276
+ },
22277
+ "log": {
22278
+ "required": [
22279
+ "custom_permissions",
22280
+ "available"
22281
+ ],
22282
+ "properties": {
22283
+ "custom_permissions": {
22284
+ "description": "Shows if key has custom log permissions enabled.",
22285
+ "type": "boolean"
22286
+ },
22287
+ "available": {
22288
+ "type": "array",
22289
+ "items": {
22290
+ "$ref": "#/components/schemas/KeyInfoAvailableLog"
22291
+ }
22292
+ }
22293
+ },
22294
+ "type": "object"
22119
22295
  }
22120
22296
  },
22121
22297
  "type": "object"
@@ -25225,6 +25401,15 @@
25225
25401
  "type": "string"
25226
25402
  }
25227
25403
  },
25404
+ "ApiKeyFull": {
25405
+ "name": "key",
25406
+ "in": "query",
25407
+ "description": "API key (Full).<br>It's not required to use this parameter when passing the API key via the Authorization header.",
25408
+ "required": false,
25409
+ "schema": {
25410
+ "type": "string"
25411
+ }
25412
+ },
25228
25413
  "ApiTimestamp": {
25229
25414
  "name": "timestamp",
25230
25415
  "in": "query",
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "3.0.2",
4
+ "version": "3.0.3",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },
8
8
  "devDependencies": {
9
- "@scalar/openapi-types": "^0.3.6",
10
- "@types/node": "^22.16.5",
9
+ "@scalar/openapi-types": "^0.3.7",
10
+ "@types/node": "^22.17.0",
11
11
  "prettier": "^3.6.2",
12
12
  "typeconv": "^2.3.1",
13
- "typescript": "^5.8.3"
13
+ "typescript": "^5.9.2"
14
14
  },
15
15
  "main": "./dist/index.js",
16
16
  "types": "./dist/index.d.ts",