tornapi-typescript 3.0.1 → 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;
@@ -350,6 +368,11 @@ export interface UserPropertyDetailsExtended extends UserPropertyBasicDetails {
350
368
  used_by: BasicUser[];
351
369
  status: "none" | "in_use";
352
370
  }
371
+ export interface UserPropertyDetailsExtendedWithRent extends UserPropertyBasicDetails {
372
+ used_by: BasicUser[];
373
+ status: "none" | "in_use";
374
+ rented_by?: BasicUser;
375
+ }
353
376
  export interface UserPropertyDetails extends UserPropertyBasicDetails {
354
377
  used_by: BasicUser[];
355
378
  }
@@ -382,6 +405,9 @@ export interface UserPropertiesResponse {
382
405
  export interface UserPropertyResponse {
383
406
  property: UserPropertyDetails;
384
407
  }
408
+ export interface PropertyPropertyResponse {
409
+ property: UserPropertyDetailsExtendedWithRent;
410
+ }
385
411
  export interface UserCurrentEducation {
386
412
  id: EducationId;
387
413
  until: number;
@@ -2039,6 +2065,10 @@ export interface KeyLogResponse {
2039
2065
  ip: string;
2040
2066
  }[];
2041
2067
  }
2068
+ export interface KeyInfoAvailableLog {
2069
+ category_id: LogCategoryId;
2070
+ log_ids: LogId[];
2071
+ }
2042
2072
  export interface KeyInfoResponse {
2043
2073
  info: {
2044
2074
  selections: {
@@ -2064,6 +2094,11 @@ export interface KeyInfoResponse {
2064
2094
  faction_id?: FactionId | null;
2065
2095
  company: boolean;
2066
2096
  company_id?: CompanyId | null;
2097
+ log: {
2098
+ /** Shows if key has custom log permissions enabled. */
2099
+ custom_permissions: boolean;
2100
+ available: KeyInfoAvailableLog[];
2101
+ };
2067
2102
  };
2068
2103
  };
2069
2104
  }
@@ -5988,6 +6023,10 @@ export interface UserV2 extends BaseSchema {
5988
6023
  response: UserListResponse;
5989
6024
  params: "cat" | "limit" | "offset" | "sort" | "timestamp";
5990
6025
  };
6026
+ log: {
6027
+ response: UserLogsResponse;
6028
+ params: "log" | "cat" | "limit" | "to" | "from" | "timestamp";
6029
+ };
5991
6030
  organizedcrime: {
5992
6031
  response: UserOrganizedCrimeResponse;
5993
6032
  params: "timestamp";
@@ -6281,7 +6320,7 @@ export interface RacingV2 extends BaseSchema {
6281
6320
  export interface PropertyV2 extends BaseSchema {
6282
6321
  selections: {
6283
6322
  property: {
6284
- response: UserPropertyResponse;
6323
+ response: PropertyPropertyResponse;
6285
6324
  params: "id" | "timestamp";
6286
6325
  };
6287
6326
  lookup: {
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;
@@ -5105,6 +5126,13 @@ export interface UserPropertyDetailsExtended extends UserPropertyBasicDetails {
5105
5126
  status: "none" | "in_use";
5106
5127
  }
5107
5128
 
5129
+ export interface UserPropertyDetailsExtendedWithRent
5130
+ extends UserPropertyBasicDetails {
5131
+ used_by: BasicUser[];
5132
+ status: "none" | "in_use";
5133
+ rented_by?: BasicUser;
5134
+ }
5135
+
5108
5136
  export interface UserPropertyDetails extends UserPropertyBasicDetails {
5109
5137
  used_by: BasicUser[];
5110
5138
  }
@@ -5152,6 +5180,10 @@ export interface UserPropertyResponse {
5152
5180
  property: UserPropertyDetails;
5153
5181
  }
5154
5182
 
5183
+ export interface PropertyPropertyResponse {
5184
+ property: UserPropertyDetailsExtendedWithRent;
5185
+ }
5186
+
5155
5187
  export interface UserCurrentEducation {
5156
5188
  id: EducationId;
5157
5189
  until: number;
@@ -7323,6 +7355,11 @@ export interface KeyLogResponse {
7323
7355
  }[];
7324
7356
  }
7325
7357
 
7358
+ export interface KeyInfoAvailableLog {
7359
+ category_id: LogCategoryId;
7360
+ log_ids: LogId[];
7361
+ }
7362
+
7326
7363
  export interface KeyInfoResponse {
7327
7364
  info: {
7328
7365
  selections: {
@@ -7348,6 +7385,11 @@ export interface KeyInfoResponse {
7348
7385
  faction_id?: FactionId | null;
7349
7386
  company: boolean;
7350
7387
  company_id?: CompanyId | null;
7388
+ log: {
7389
+ /** Shows if key has custom log permissions enabled. */
7390
+ custom_permissions: boolean;
7391
+ available: KeyInfoAvailableLog[];
7392
+ };
7351
7393
  };
7352
7394
  };
7353
7395
  }
@@ -11447,6 +11489,10 @@ export interface UserV2 extends BaseSchema {
11447
11489
  response: UserListResponse;
11448
11490
  params: "cat" | "limit" | "offset" | "sort" | "timestamp";
11449
11491
  };
11492
+ log: {
11493
+ response: UserLogsResponse;
11494
+ params: "log" | "cat" | "limit" | "to" | "from" | "timestamp";
11495
+ };
11450
11496
  organizedcrime: {
11451
11497
  response: UserOrganizedCrimeResponse;
11452
11498
  params: "timestamp";
@@ -11788,7 +11834,7 @@ export interface RacingV2 extends BaseSchema {
11788
11834
  export interface PropertyV2 extends BaseSchema {
11789
11835
  selections: {
11790
11836
  property: {
11791
- response: UserPropertyResponse;
11837
+ response: PropertyPropertyResponse;
11792
11838
  params: "id" | "timestamp";
11793
11839
  };
11794
11840
  lookup: {
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.1"
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": [
@@ -5932,7 +6003,7 @@
5932
6003
  "content": {
5933
6004
  "application/json": {
5934
6005
  "schema": {
5935
- "$ref": "#/components/schemas/UserPropertyResponse"
6006
+ "$ref": "#/components/schemas/PropertyPropertyResponse"
5936
6007
  }
5937
6008
  }
5938
6009
  }
@@ -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",
@@ -13541,6 +13679,38 @@
13541
13679
  }
13542
13680
  ]
13543
13681
  },
13682
+ "UserPropertyDetailsExtendedWithRent": {
13683
+ "allOf": [
13684
+ {
13685
+ "$ref": "#/components/schemas/UserPropertyBasicDetails"
13686
+ },
13687
+ {
13688
+ "required": [
13689
+ "status",
13690
+ "used_by"
13691
+ ],
13692
+ "properties": {
13693
+ "used_by": {
13694
+ "type": "array",
13695
+ "items": {
13696
+ "$ref": "#/components/schemas/BasicUser"
13697
+ }
13698
+ },
13699
+ "status": {
13700
+ "type": "string",
13701
+ "enum": [
13702
+ "none",
13703
+ "in_use"
13704
+ ]
13705
+ },
13706
+ "rented_by": {
13707
+ "$ref": "#/components/schemas/BasicUser"
13708
+ }
13709
+ },
13710
+ "type": "object"
13711
+ }
13712
+ ]
13713
+ },
13544
13714
  "UserPropertyDetails": {
13545
13715
  "allOf": [
13546
13716
  {
@@ -13738,6 +13908,17 @@
13738
13908
  },
13739
13909
  "type": "object"
13740
13910
  },
13911
+ "PropertyPropertyResponse": {
13912
+ "required": [
13913
+ "property"
13914
+ ],
13915
+ "properties": {
13916
+ "property": {
13917
+ "$ref": "#/components/schemas/UserPropertyDetailsExtendedWithRent"
13918
+ }
13919
+ },
13920
+ "type": "object"
13921
+ },
13741
13922
  "UserCurrentEducation": {
13742
13923
  "required": [
13743
13924
  "id",
@@ -21912,6 +22093,24 @@
21912
22093
  },
21913
22094
  "type": "object"
21914
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
+ },
21915
22114
  "KeyInfoResponse": {
21916
22115
  "required": [
21917
22116
  "info"
@@ -22034,7 +22233,8 @@
22034
22233
  "level",
22035
22234
  "type",
22036
22235
  "faction",
22037
- "company"
22236
+ "company",
22237
+ "log"
22038
22238
  ],
22039
22239
  "properties": {
22040
22240
  "level": {
@@ -22073,6 +22273,25 @@
22073
22273
  "type": "null"
22074
22274
  }
22075
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"
22076
22295
  }
22077
22296
  },
22078
22297
  "type": "object"
@@ -25182,6 +25401,15 @@
25182
25401
  "type": "string"
25183
25402
  }
25184
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
+ },
25185
25413
  "ApiTimestamp": {
25186
25414
  "name": "timestamp",
25187
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.1",
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",