tornapi-typescript 6.7.0 → 6.8.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
@@ -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.0"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -3281,6 +3281,54 @@
3281
3281
  "x-stability": "Stable"
3282
3282
  }
3283
3283
  },
3284
+ "/user/search": {
3285
+ "get": {
3286
+ "tags": [
3287
+ "User"
3288
+ ],
3289
+ "summary": "Search users by name or other criteria",
3290
+ "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.",
3291
+ "operationId": "getUsersSearch",
3292
+ "parameters": [
3293
+ {
3294
+ "$ref": "#/components/parameters/ApiName"
3295
+ },
3296
+ {
3297
+ "$ref": "#/components/parameters/ApiUserSearchFilter"
3298
+ },
3299
+ {
3300
+ "$ref": "#/components/parameters/ApiOffset"
3301
+ },
3302
+ {
3303
+ "$ref": "#/components/parameters/ApiTimestamp"
3304
+ },
3305
+ {
3306
+ "$ref": "#/components/parameters/ApiComment"
3307
+ },
3308
+ {
3309
+ "$ref": "#/components/parameters/ApiKeyPublic"
3310
+ }
3311
+ ],
3312
+ "responses": {
3313
+ "200": {
3314
+ "description": "Successful operation",
3315
+ "content": {
3316
+ "application/json": {
3317
+ "schema": {
3318
+ "$ref": "#/components/schemas/UserSearchResponse"
3319
+ }
3320
+ }
3321
+ }
3322
+ }
3323
+ },
3324
+ "security": [
3325
+ {
3326
+ "api_key": []
3327
+ }
3328
+ ],
3329
+ "x-stability": "Unstable"
3330
+ }
3331
+ },
3284
3332
  "/user/snapshot": {
3285
3333
  "get": {
3286
3334
  "tags": [
@@ -16355,6 +16403,47 @@
16355
16403
  }
16356
16404
  ]
16357
16405
  },
16406
+ "UserSearchParameter": {
16407
+ "oneOf": [
16408
+ {
16409
+ "type": "string",
16410
+ "enum": [
16411
+ "married",
16412
+ "notMarried",
16413
+ "traveling",
16414
+ "notTraveling",
16415
+ "inFaction",
16416
+ "notInFaction",
16417
+ "inCompany",
16418
+ "notInCompany",
16419
+ "inHospital",
16420
+ "notInHospital",
16421
+ "inJail",
16422
+ "notInJail",
16423
+ "inFederalJail",
16424
+ "notInFederalJail",
16425
+ "male",
16426
+ "female",
16427
+ "enby",
16428
+ "lastActionNow",
16429
+ "lastActionRecent",
16430
+ "lastActionHourAgo",
16431
+ "lastActionDayAgo",
16432
+ "lastActionWeekAgo",
16433
+ "lastActionMonthAgo",
16434
+ "lastActionYearAgo"
16435
+ ]
16436
+ },
16437
+ {
16438
+ "type": "string",
16439
+ "pattern": "^(level|daysOld|offences):(=|!=|<|<=|>=|>|Equal|NotEqual|Less|LessOrEqual|GreaterOrEqual|Greater):\\d+$"
16440
+ },
16441
+ {
16442
+ "type": "string",
16443
+ "pattern": "^factions:\\d+(;\\d+)*$"
16444
+ }
16445
+ ]
16446
+ },
16358
16447
  "Parameters": {
16359
16448
  "oneOf": [
16360
16449
  {
@@ -18445,6 +18534,59 @@
18445
18534
  }
18446
18535
  ]
18447
18536
  },
18537
+ "UserSearch": {
18538
+ "required": [
18539
+ "id",
18540
+ "name",
18541
+ "level",
18542
+ "online",
18543
+ "faction_id",
18544
+ "icons"
18545
+ ],
18546
+ "properties": {
18547
+ "id": {
18548
+ "$ref": "#/components/schemas/UserId"
18549
+ },
18550
+ "name": {
18551
+ "type": "string"
18552
+ },
18553
+ "level": {
18554
+ "type": "integer",
18555
+ "format": "int32"
18556
+ },
18557
+ "online": {
18558
+ "$ref": "#/components/schemas/UserLastActionStatusEnum"
18559
+ },
18560
+ "faction_id": {
18561
+ "$ref": "#/components/schemas/FactionId"
18562
+ },
18563
+ "icons": {
18564
+ "type": "array",
18565
+ "items": {
18566
+ "$ref": "#/components/schemas/UserIconPublic"
18567
+ }
18568
+ }
18569
+ },
18570
+ "type": "object"
18571
+ },
18572
+ "UserSearchResponse": {
18573
+ "required": [
18574
+ "search",
18575
+ "_metadata"
18576
+ ],
18577
+ "properties": {
18578
+ "search": {
18579
+ "type": "array",
18580
+ "items": {
18581
+ "$ref": "#/components/schemas/UserSearch"
18582
+ }
18583
+ },
18584
+ "_metadata": {
18585
+ "$ref": "#/components/schemas/RequestMetadataWithLinksAndTotal"
18586
+ }
18587
+ },
18588
+ "type": "object"
18589
+ },
18448
18590
  "UserPerksResponse": {
18449
18591
  "required": [
18450
18592
  "perks"
@@ -35107,7 +35249,7 @@
35107
35249
  "ApiCompanySearchFilter": {
35108
35250
  "name": "filters",
35109
35251
  "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`",
35252
+ "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
35253
  "required": false,
35112
35254
  "style": "form",
35113
35255
  "explode": false,
@@ -35131,6 +35273,59 @@
35131
35273
  }
35132
35274
  }
35133
35275
  },
35276
+ "ApiUserSearchFilter": {
35277
+ "name": "filters",
35278
+ "in": "query",
35279
+ "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`",
35280
+ "required": false,
35281
+ "style": "form",
35282
+ "explode": false,
35283
+ "schema": {
35284
+ "type": "array",
35285
+ "items": {
35286
+ "schema": "UserSearchParameter",
35287
+ "oneOf": [
35288
+ {
35289
+ "type": "string",
35290
+ "enum": [
35291
+ "married",
35292
+ "notMarried",
35293
+ "traveling",
35294
+ "notTraveling",
35295
+ "inFaction",
35296
+ "notInFaction",
35297
+ "inCompany",
35298
+ "notInCompany",
35299
+ "inHospital",
35300
+ "notInHospital",
35301
+ "inJail",
35302
+ "notInJail",
35303
+ "inFederalJail",
35304
+ "notInFederalJail",
35305
+ "male",
35306
+ "female",
35307
+ "enby",
35308
+ "lastActionNow",
35309
+ "lastActionRecent",
35310
+ "lastActionHourAgo",
35311
+ "lastActionDayAgo",
35312
+ "lastActionWeekAgo",
35313
+ "lastActionMonthAgo",
35314
+ "lastActionYearAgo"
35315
+ ]
35316
+ },
35317
+ {
35318
+ "type": "string",
35319
+ "pattern": "^(level|daysOld|offences):(=|!=|<|<=|>=|>|Equal|NotEqual|Less|LessOrEqual|GreaterOrEqual|Greater):\\d+$"
35320
+ },
35321
+ {
35322
+ "type": "string",
35323
+ "pattern": "^factions:\\d+(;\\d+)*$"
35324
+ }
35325
+ ]
35326
+ }
35327
+ }
35328
+ },
35134
35329
  "ApiKeyPublic": {
35135
35330
  "name": "key",
35136
35331
  "in": "query",
@@ -35246,7 +35441,7 @@
35246
35441
  "ApiFactionSearchFilter": {
35247
35442
  "name": "filters",
35248
35443
  "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`",
35444
+ "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
35445
  "required": false,
35251
35446
  "style": "form",
35252
35447
  "explode": false,
@@ -35284,7 +35479,7 @@
35284
35479
  "ApiName": {
35285
35480
  "name": "name",
35286
35481
  "in": "query",
35287
- "description": "Name to search for.",
35482
+ "description": "Name to search for.",
35288
35483
  "required": false,
35289
35484
  "schema": {
35290
35485
  "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.0",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/Torn-Playground/tornapi-typescript.git"
7
7
  },