tornapi-typescript 6.7.0 → 6.8.2

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
@@ -146,6 +146,7 @@ export type CompanyStorageSizeEnum = "Small room" | "Standard room" | "Large roo
146
146
  export type HonorRarityEnum = "Extremely Rare" | "Very Rare" | "Rare" | "Limited" | "Uncommon" | "Common" | "Very Common" | "Unknown" | "Unknown Rarity";
147
147
  export type AwardCrimesVersionEnum = "v1" | "v2";
148
148
  export type CompanySearchParameter = string;
149
+ export type UserSearchParameter = string;
149
150
  export type Parameters = string;
150
151
  export type ReviveSetting = "Everyone" | "Friends & faction" | "No one" | "Unknown";
151
152
  export type FactionWarfareTypeEnum = "ranked" | "territory" | "raid" | "chain" | "chainOngoing" | "db";
@@ -506,6 +507,18 @@ export interface ErrorFileDoesNotExist {
506
507
  error: string;
507
508
  }
508
509
  export type ApiError = ErrorUnknown | ErrorKeyEmpty | ErrorIncorrectKey | ErrorWrongType | ErrorWrongFields | ErrorTooManyRequests | ErrorIncorrectId | ErrorIncorrectIdEntityRelation | ErrorIpBlocked | ErrorApiDisabled | ErrorKeyOwnerInFederalJail | ErrorKeyChangeCooldown | ErrorKeyReadError | ErrorKeyTemporaryDisabled | ErrorDailyReadLimitReached | ErrorLogUnavailable | ErrorAccessLevelTooLow | ErrorBackendError | ErrorApiKeyPaused | ErrorMustMigrateToCrimesV2 | ErrorRaceNotFinished | ErrorIncorrectCategory | ErrorOnlyAvailableInApiV1 | ErrorOnlyAvailableInApiV2 | ErrorClosedTemporarily | ErrorInvalidStatRequested | ErrorOnlyCategoryOrStatsAllowed | ErrorMustMigrateToOrganizedCrimesV2 | ErrorIncorrectLogId | ErrorCategorySelectionUnavailableForInteractionLogs | ErrorFileDoesNotExist;
510
+ export interface UserSearch {
511
+ id: UserId;
512
+ name: string;
513
+ level: number;
514
+ online: UserLastActionStatusEnum;
515
+ faction_id: FactionId;
516
+ icons: UserIconPublic[];
517
+ }
518
+ export interface UserSearchResponse {
519
+ search: UserSearch[];
520
+ _metadata: RequestMetadataWithLinksAndTotal;
521
+ }
509
522
  export interface UserPerksResponse {
510
523
  perks: {
511
524
  faction: string[];
@@ -7386,6 +7399,10 @@ export interface UserV2 extends BaseSchema {
7386
7399
  response: UserSkillsResponse;
7387
7400
  params: "timestamp";
7388
7401
  };
7402
+ search: {
7403
+ response: UserSearchResponse;
7404
+ params: "name" | "filters" | "offset" | "timestamp";
7405
+ };
7389
7406
  snapshot: {
7390
7407
  response: null;
7391
7408
  params: "timestamp";
package/dist/index.ts CHANGED
@@ -4864,6 +4864,8 @@ export type AwardCrimesVersionEnum = "v1" | "v2";
4864
4864
 
4865
4865
  export type CompanySearchParameter = string;
4866
4866
 
4867
+ export type UserSearchParameter = string;
4868
+
4867
4869
  export type Parameters = string;
4868
4870
 
4869
4871
  export type ReviveSetting =
@@ -5521,6 +5523,20 @@ export type ApiError =
5521
5523
  | ErrorCategorySelectionUnavailableForInteractionLogs
5522
5524
  | ErrorFileDoesNotExist;
5523
5525
 
5526
+ export interface UserSearch {
5527
+ id: UserId;
5528
+ name: string;
5529
+ level: number;
5530
+ online: UserLastActionStatusEnum;
5531
+ faction_id: FactionId;
5532
+ icons: UserIconPublic[];
5533
+ }
5534
+
5535
+ export interface UserSearchResponse {
5536
+ search: UserSearch[];
5537
+ _metadata: RequestMetadataWithLinksAndTotal;
5538
+ }
5539
+
5524
5540
  export interface UserPerksResponse {
5525
5541
  perks: {
5526
5542
  faction: string[];
@@ -13305,6 +13321,10 @@ export interface UserV2 extends BaseSchema {
13305
13321
  response: UserSkillsResponse;
13306
13322
  params: "timestamp";
13307
13323
  };
13324
+ search: {
13325
+ response: UserSearchResponse;
13326
+ params: "name" | "filters" | "offset" | "timestamp";
13327
+ };
13308
13328
  snapshot: {
13309
13329
  response: null;
13310
13330
  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": "6.7.0"
6
+ "version": "6.8.2"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -1488,7 +1488,7 @@
1488
1488
  "User"
1489
1489
  ],
1490
1490
  "summary": "Get your icons information",
1491
- "description": "Requires public access key. <br> When requesting data for yourself with 'Custom', 'Limited' or 'Full' access keys, the response will be of type UserIconPrivate, otherwise UserIconPublic.",
1491
+ "description": "Requires public access key. <br> When requesting data for yourself with 'Limited' or 'Full' access keys, the response will be of type UserIconPrivate, otherwise UserIconPublic.",
1492
1492
  "operationId": "getMyIcons",
1493
1493
  "parameters": [
1494
1494
  {
@@ -1575,7 +1575,7 @@
1575
1575
  "User"
1576
1576
  ],
1577
1577
  "summary": "Get your inventory",
1578
- "description": "<b>Cached selection (1 hour per category).</b><br><br>Requires limited access key. <br>",
1578
+ "description": "<b>Cached selection (1 hour per category).</b><br><br>Requires minimal access key. <br>",
1579
1579
  "operationId": "getMyInventory",
1580
1580
  "parameters": [
1581
1581
  {
@@ -1600,7 +1600,7 @@
1600
1600
  "$ref": "#/components/parameters/ApiComment"
1601
1601
  },
1602
1602
  {
1603
- "$ref": "#/components/parameters/ApiKeyLimited"
1603
+ "$ref": "#/components/parameters/ApiKeyMinimal"
1604
1604
  }
1605
1605
  ],
1606
1606
  "responses": {
@@ -2014,8 +2014,8 @@
2014
2014
  "tags": [
2015
2015
  "User"
2016
2016
  ],
2017
- "summary": "Get your achieved medals",
2018
- "description": "Requires minimal access key. <br>",
2017
+ "summary": "Get all your achieved medals",
2018
+ "description": "Requires public access key. <br>",
2019
2019
  "operationId": "getMyMedals",
2020
2020
  "parameters": [
2021
2021
  {
@@ -2025,7 +2025,55 @@
2025
2025
  "$ref": "#/components/parameters/ApiComment"
2026
2026
  },
2027
2027
  {
2028
- "$ref": "#/components/parameters/ApiKeyMinimal"
2028
+ "$ref": "#/components/parameters/ApiKeyPublic"
2029
+ }
2030
+ ],
2031
+ "responses": {
2032
+ "200": {
2033
+ "description": "Successful operation",
2034
+ "content": {
2035
+ "application/json": {
2036
+ "schema": {
2037
+ "$ref": "#/components/schemas/UserMedalsResponse"
2038
+ }
2039
+ }
2040
+ }
2041
+ }
2042
+ },
2043
+ "security": [
2044
+ {
2045
+ "api_key": []
2046
+ }
2047
+ ],
2048
+ "x-stability": "Stable"
2049
+ }
2050
+ },
2051
+ "/user/{id}/medals": {
2052
+ "get": {
2053
+ "tags": [
2054
+ "User"
2055
+ ],
2056
+ "summary": "Get medals achieved by a specific player",
2057
+ "description": "Requires public access key.<br>Returns only highest medal in each category (just like profiles on site).",
2058
+ "operationId": "getUserMedals",
2059
+ "parameters": [
2060
+ {
2061
+ "name": "id",
2062
+ "in": "path",
2063
+ "description": "User id or user discord id",
2064
+ "required": true,
2065
+ "schema": {
2066
+ "$ref": "#/components/schemas/UserDiscordPathId"
2067
+ }
2068
+ },
2069
+ {
2070
+ "$ref": "#/components/parameters/ApiTimestamp"
2071
+ },
2072
+ {
2073
+ "$ref": "#/components/parameters/ApiComment"
2074
+ },
2075
+ {
2076
+ "$ref": "#/components/parameters/ApiKeyPublic"
2029
2077
  }
2030
2078
  ],
2031
2079
  "responses": {
@@ -3281,6 +3329,54 @@
3281
3329
  "x-stability": "Stable"
3282
3330
  }
3283
3331
  },
3332
+ "/user/search": {
3333
+ "get": {
3334
+ "tags": [
3335
+ "User"
3336
+ ],
3337
+ "summary": "Search users by name or other criteria",
3338
+ "description": "Requires public access key. <br>This selection is standalone and cannot be used together with other selections.<br>It's always limited to return just 25 records.",
3339
+ "operationId": "getUsersSearch",
3340
+ "parameters": [
3341
+ {
3342
+ "$ref": "#/components/parameters/ApiName"
3343
+ },
3344
+ {
3345
+ "$ref": "#/components/parameters/ApiUserSearchFilter"
3346
+ },
3347
+ {
3348
+ "$ref": "#/components/parameters/ApiOffset"
3349
+ },
3350
+ {
3351
+ "$ref": "#/components/parameters/ApiTimestamp"
3352
+ },
3353
+ {
3354
+ "$ref": "#/components/parameters/ApiComment"
3355
+ },
3356
+ {
3357
+ "$ref": "#/components/parameters/ApiKeyPublic"
3358
+ }
3359
+ ],
3360
+ "responses": {
3361
+ "200": {
3362
+ "description": "Successful operation",
3363
+ "content": {
3364
+ "application/json": {
3365
+ "schema": {
3366
+ "$ref": "#/components/schemas/UserSearchResponse"
3367
+ }
3368
+ }
3369
+ }
3370
+ }
3371
+ },
3372
+ "security": [
3373
+ {
3374
+ "api_key": []
3375
+ }
3376
+ ],
3377
+ "x-stability": "Unstable"
3378
+ }
3379
+ },
3284
3380
  "/user/snapshot": {
3285
3381
  "get": {
3286
3382
  "tags": [
@@ -6738,7 +6834,7 @@
6738
6834
  "Company"
6739
6835
  ],
6740
6836
  "summary": "Get your company's news details",
6741
- "description": "Requires minimal access key. <br>",
6837
+ "description": "Requires limited access key. <br>",
6742
6838
  "operationId": "getMyCompanyNews",
6743
6839
  "parameters": [
6744
6840
  {
@@ -6772,7 +6868,7 @@
6772
6868
  "$ref": "#/components/parameters/ApiComment"
6773
6869
  },
6774
6870
  {
6775
- "$ref": "#/components/parameters/ApiKeyMinimal"
6871
+ "$ref": "#/components/parameters/ApiKeyLimited"
6776
6872
  }
6777
6873
  ],
6778
6874
  "responses": {
@@ -16355,6 +16451,47 @@
16355
16451
  }
16356
16452
  ]
16357
16453
  },
16454
+ "UserSearchParameter": {
16455
+ "oneOf": [
16456
+ {
16457
+ "type": "string",
16458
+ "enum": [
16459
+ "married",
16460
+ "notMarried",
16461
+ "traveling",
16462
+ "notTraveling",
16463
+ "inFaction",
16464
+ "notInFaction",
16465
+ "inCompany",
16466
+ "notInCompany",
16467
+ "inHospital",
16468
+ "notInHospital",
16469
+ "inJail",
16470
+ "notInJail",
16471
+ "inFederalJail",
16472
+ "notInFederalJail",
16473
+ "male",
16474
+ "female",
16475
+ "enby",
16476
+ "lastActionNow",
16477
+ "lastActionRecent",
16478
+ "lastActionHourAgo",
16479
+ "lastActionDayAgo",
16480
+ "lastActionWeekAgo",
16481
+ "lastActionMonthAgo",
16482
+ "lastActionYearAgo"
16483
+ ]
16484
+ },
16485
+ {
16486
+ "type": "string",
16487
+ "pattern": "^(level|daysOld|offences):(=|!=|<|<=|>=|>|Equal|NotEqual|Less|LessOrEqual|GreaterOrEqual|Greater):\\d+$"
16488
+ },
16489
+ {
16490
+ "type": "string",
16491
+ "pattern": "^factions:\\d+(;\\d+)*$"
16492
+ }
16493
+ ]
16494
+ },
16358
16495
  "Parameters": {
16359
16496
  "oneOf": [
16360
16497
  {
@@ -18445,6 +18582,59 @@
18445
18582
  }
18446
18583
  ]
18447
18584
  },
18585
+ "UserSearch": {
18586
+ "required": [
18587
+ "id",
18588
+ "name",
18589
+ "level",
18590
+ "online",
18591
+ "faction_id",
18592
+ "icons"
18593
+ ],
18594
+ "properties": {
18595
+ "id": {
18596
+ "$ref": "#/components/schemas/UserId"
18597
+ },
18598
+ "name": {
18599
+ "type": "string"
18600
+ },
18601
+ "level": {
18602
+ "type": "integer",
18603
+ "format": "int32"
18604
+ },
18605
+ "online": {
18606
+ "$ref": "#/components/schemas/UserLastActionStatusEnum"
18607
+ },
18608
+ "faction_id": {
18609
+ "$ref": "#/components/schemas/FactionId"
18610
+ },
18611
+ "icons": {
18612
+ "type": "array",
18613
+ "items": {
18614
+ "$ref": "#/components/schemas/UserIconPublic"
18615
+ }
18616
+ }
18617
+ },
18618
+ "type": "object"
18619
+ },
18620
+ "UserSearchResponse": {
18621
+ "required": [
18622
+ "search",
18623
+ "_metadata"
18624
+ ],
18625
+ "properties": {
18626
+ "search": {
18627
+ "type": "array",
18628
+ "items": {
18629
+ "$ref": "#/components/schemas/UserSearch"
18630
+ }
18631
+ },
18632
+ "_metadata": {
18633
+ "$ref": "#/components/schemas/RequestMetadataWithLinksAndTotal"
18634
+ }
18635
+ },
18636
+ "type": "object"
18637
+ },
18448
18638
  "UserPerksResponse": {
18449
18639
  "required": [
18450
18640
  "perks"
@@ -35107,7 +35297,7 @@
35107
35297
  "ApiCompanySearchFilter": {
35108
35298
  "name": "filters",
35109
35299
  "in": "query",
35110
- "description": "A filtering query parameter allowing a comma-separated list of filters. <br>\n * Each filter can be one of the following:\n * Fixed options: `recruiting`, `notRecruiting`\n * Dynamic options: `fieldName`+`condition`+`number`. Each dynamic filter is made out of 3 parts separated by colon `:`:\n * * `fieldName` is one of: `id`, `type`, `daysOld`, `rating`, `dailyIncome`, `weeklyIncome`, `dailyCustomers`, `weeklyCustomers`\n * * `condition` is one of: `=`, `!=`, `<`, `<=`, `>=`, `>`, `Equal`, `NotEqual`, `Less`, `LessOrEqual`, `GreaterOrEqual`, `Greater`\n * * `number`: any integer value\n * Examples: `filters=recruiting`, `filters=weeklyIncome:>=:20000,id:<:1000,notRecruiting`, `filters=type:Equal:10,rating:=:10,dailyIncome:<=:6666666`",
35300
+ "description": "A filtering query parameter allowing a comma-separated list of filters. <br>\n * Each filter can be one of the following:\n * Fixed options: `recruiting`, `notRecruiting`\n * Dynamic options: `fieldName`+`condition`+`number`. Each dynamic filter is made out of 3 parts separated by colon `:`:\n * * `fieldName` is one of: `id`, `type`, `daysOld`, `rating`, `dailyIncome`, `weeklyIncome`, `dailyCustomers`, `weeklyCustomers`\n * * `condition` is one of: `=`, `!=`, `<`, `<=`, `>=`, `>`, `Equal`, `NotEqual`, `Less`, `LessOrEqual`, `GreaterOrEqual`, `Greater`\n * * `number`: any integer value\n * Examples:\n * `filters=recruiting`,\n * `filters=weeklyIncome:>=:20000,id:<:1000,notRecruiting`,\n * `filters=type:Equal:10,rating:=:10,dailyIncome:<=:6666666`",
35111
35301
  "required": false,
35112
35302
  "style": "form",
35113
35303
  "explode": false,
@@ -35131,6 +35321,59 @@
35131
35321
  }
35132
35322
  }
35133
35323
  },
35324
+ "ApiUserSearchFilter": {
35325
+ "name": "filters",
35326
+ "in": "query",
35327
+ "description": "A filtering query parameter allowing a comma-separated list of filters. <br>\n * Filters in this selection reflect on-site filters, and they can be:\n * One of: `married`, `notMarried`, `traveling`, `notTraveling`, `inFaction`, `notInFaction`, `inCompany`, `notInCompany`, `inHospital`, `notInHospital`, `inJail`, `notInJail`, `inFederalJail`, `notInFederalJail`\n * Additionally, one of last action: `lastActionNow`, `lastActionRecent`, `lastActionHourAgo`, `lastActionDayAgo`, `lastActionWeekAgo`, `lastActionMonthAgo`, `lastActionYearAgo`\n * Additionally, one of gender: `male`, `female`, `enby`\n * Any dynamic option: `fieldName`+`condition`+`number`. Each dynamic filter is made out of 3 parts separated by colon `:`:\n * * `fieldName` is one of: `level`, `daysOld`, `offences`\n * * `condition` is one of: `=`, `!=`, `<`, `<=`, `>=`, `>`, `Equal`, `NotEqual`, `Less`, `LessOrEqual`, `GreaterOrEqual`, `Greater`\n * * `number`: any integer value\n * Additionally, a dynamic list of faction ids (negates `inFaction` and `notInFaction` filters): `factions`+`:`+`list of ids separated by semicolon ;`\n * Examples:\n * `filters=married`,\n * `filters=daysOld:>=:5000,offences:>:100000,notInFaction`,\n * `filters=factions:1;2;3`,\n * `filters=level:=:100,lastActionYearAgo,male,inFaction,offences:>=:1000,offences:<=:1000000,daysOld:>:500,daysOld:<:7000`",
35328
+ "required": false,
35329
+ "style": "form",
35330
+ "explode": false,
35331
+ "schema": {
35332
+ "type": "array",
35333
+ "items": {
35334
+ "schema": "UserSearchParameter",
35335
+ "oneOf": [
35336
+ {
35337
+ "type": "string",
35338
+ "enum": [
35339
+ "married",
35340
+ "notMarried",
35341
+ "traveling",
35342
+ "notTraveling",
35343
+ "inFaction",
35344
+ "notInFaction",
35345
+ "inCompany",
35346
+ "notInCompany",
35347
+ "inHospital",
35348
+ "notInHospital",
35349
+ "inJail",
35350
+ "notInJail",
35351
+ "inFederalJail",
35352
+ "notInFederalJail",
35353
+ "male",
35354
+ "female",
35355
+ "enby",
35356
+ "lastActionNow",
35357
+ "lastActionRecent",
35358
+ "lastActionHourAgo",
35359
+ "lastActionDayAgo",
35360
+ "lastActionWeekAgo",
35361
+ "lastActionMonthAgo",
35362
+ "lastActionYearAgo"
35363
+ ]
35364
+ },
35365
+ {
35366
+ "type": "string",
35367
+ "pattern": "^(level|daysOld|offences):(=|!=|<|<=|>=|>|Equal|NotEqual|Less|LessOrEqual|GreaterOrEqual|Greater):\\d+$"
35368
+ },
35369
+ {
35370
+ "type": "string",
35371
+ "pattern": "^factions:\\d+(;\\d+)*$"
35372
+ }
35373
+ ]
35374
+ }
35375
+ }
35376
+ },
35134
35377
  "ApiKeyPublic": {
35135
35378
  "name": "key",
35136
35379
  "in": "query",
@@ -35246,7 +35489,7 @@
35246
35489
  "ApiFactionSearchFilter": {
35247
35490
  "name": "filters",
35248
35491
  "in": "query",
35249
- "description": "A filtering query parameter allowing a comma-separated list of filters. <br>\n * Each filter can be one of the following:\n * Fixed options: `destroyed`, `notDestroyed`, `recruiting`, `notRecruiting`\n * Dynamic options: `fieldName`+`condition`+`number`. Each dynamic filter is made out of 3 parts separated by colon `:`:\n * * `fieldName` is one of: `id`, `respect`, `members`, `membersMax`\n * * `condition` is one of: `=`, `!=`, `<`, `<=`, `>=`, `>`, `Equal`, `NotEqual`, `Less`, `LessOrEqual`, `GreaterOrEqual`, `Greater`\n * * `number`: any integer value\n * Examples: `filters=destroyed`, `filters=notDestroyed,recruiting`, `filters=respect:>=:20000,id:<:100,notRecruiting`",
35492
+ "description": "A filtering query parameter allowing a comma-separated list of filters. <br>\n * Each filter can be one of the following:\n * Fixed options: `destroyed`, `notDestroyed`, `recruiting`, `notRecruiting`\n * Dynamic options: `fieldName`+`condition`+`number`. Each dynamic filter is made out of 3 parts separated by colon `:`:\n * * `fieldName` is one of: `id`, `respect`, `members`, `membersMax`\n * * `condition` is one of: `=`, `!=`, `<`, `<=`, `>=`, `>`, `Equal`, `NotEqual`, `Less`, `LessOrEqual`, `GreaterOrEqual`, `Greater`\n * * `number`: any integer value\n * Examples:\n * `filters=destroyed`,\n * `filters=notDestroyed,recruiting`,\n * `filters=respect:>=:20000,id:<:100,notRecruiting`",
35250
35493
  "required": false,
35251
35494
  "style": "form",
35252
35495
  "explode": false,
@@ -35284,7 +35527,7 @@
35284
35527
  "ApiName": {
35285
35528
  "name": "name",
35286
35529
  "in": "query",
35287
- "description": "Name to search for.",
35530
+ "description": "Name to search for.",
35288
35531
  "required": false,
35289
35532
  "schema": {
35290
35533
  "type": "string"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "6.7.0",
4
+ "version": "6.8.2",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/Torn-Playground/tornapi-typescript.git"
7
7
  },