tornapi-typescript 3.0.4 → 3.0.6

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
@@ -40,6 +40,8 @@ export type FactionApplicationStatusEnum = "accepted" | "declined" | "withdrawn"
40
40
  export type FactionRankedWarsCategoryEnum = "all" | "ongoing";
41
41
  export type FactionTerritoryWarsCategoryEnum = "finsihed" | "ongoing";
42
42
  export type FactionCrimeUserOutcome = "Successful" | "Failed" | "Jailed" | "Injured" | "Hospitalized";
43
+ export type FactionCrimeUserItemOutcomeEnum = "user" | "faction";
44
+ export type FactionCrimeItemOutcomeEnum = "lost" | "used";
43
45
  export type RaceId = number;
44
46
  export type OrganizedCrimeName = string;
45
47
  export type PropertyTypeId = number;
@@ -1807,9 +1809,17 @@ export interface FactionChainReportAttackerAttacks {
1807
1809
  war: number;
1808
1810
  bonuses: number;
1809
1811
  }
1812
+ export interface FactionCrimeUserItemOutcome {
1813
+ owned_by: FactionCrimeUserItemOutcomeEnum;
1814
+ item_id: ItemId;
1815
+ item_uid: ItemUid;
1816
+ outcome: FactionCrimeItemOutcomeEnum;
1817
+ }
1810
1818
  export interface FactionCrimeUser {
1811
1819
  id: UserId;
1812
1820
  outcome: FactionCrimeUserOutcome | null;
1821
+ outcome_duration?: number | null;
1822
+ item_outcome: FactionCrimeUserItemOutcome | null;
1813
1823
  /** The timestamp at which the user joined the slot. */
1814
1824
  joined_at: number;
1815
1825
  /** Current planning progress on the slot. */
package/dist/index.ts CHANGED
@@ -4554,6 +4554,10 @@ export type FactionCrimeUserOutcome =
4554
4554
  | "Injured"
4555
4555
  | "Hospitalized";
4556
4556
 
4557
+ export type FactionCrimeUserItemOutcomeEnum = "user" | "faction";
4558
+
4559
+ export type FactionCrimeItemOutcomeEnum = "lost" | "used";
4560
+
4557
4561
  export type RaceId = number;
4558
4562
 
4559
4563
  export type OrganizedCrimeName = string;
@@ -7059,9 +7063,18 @@ export interface FactionChainReportAttackerAttacks {
7059
7063
  bonuses: number;
7060
7064
  }
7061
7065
 
7066
+ export interface FactionCrimeUserItemOutcome {
7067
+ owned_by: FactionCrimeUserItemOutcomeEnum;
7068
+ item_id: ItemId;
7069
+ item_uid: ItemUid;
7070
+ outcome: FactionCrimeItemOutcomeEnum;
7071
+ }
7072
+
7062
7073
  export interface FactionCrimeUser {
7063
7074
  id: UserId;
7064
7075
  outcome: FactionCrimeUserOutcome | null;
7076
+ outcome_duration?: number | null;
7077
+ item_outcome: FactionCrimeUserItemOutcome | null;
7065
7078
  /** The timestamp at which the user joined the slot. */
7066
7079
  joined_at: number;
7067
7080
  /** Current planning progress on the slot. */
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.4"
6
+ "version": "3.0.6"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -22,17 +22,7 @@
22
22
  "operationId": "3acc98a3016974b786cb01e04e1ced04",
23
23
  "parameters": [
24
24
  {
25
- "name": "filters",
26
- "in": "query",
27
- "description": "It's possible to use this query parameter to only get incoming or outgoing attacks. If not specified, this selection will return both incoming and outgoing attacks.",
28
- "required": false,
29
- "schema": {
30
- "type": "string",
31
- "enum": [
32
- "incoming",
33
- "outgoing"
34
- ]
35
- }
25
+ "$ref": "#/components/parameters/ApiFiltersIncomingOutgoing"
36
26
  },
37
27
  {
38
28
  "$ref": "#/components/parameters/ApiLimit100"
@@ -86,17 +76,7 @@
86
76
  "operationId": "e995691fd9845c8b4a91f065ac9c8420",
87
77
  "parameters": [
88
78
  {
89
- "name": "filters",
90
- "in": "query",
91
- "description": "It's possible to use this query parameter to only get incoming or outgoing attacks. If not specified, this selection will return both incoming and outgoing attacks.",
92
- "required": false,
93
- "schema": {
94
- "type": "string",
95
- "enum": [
96
- "incoming",
97
- "outgoing"
98
- ]
99
- }
79
+ "$ref": "#/components/parameters/ApiFiltersIncomingOutgoing"
100
80
  },
101
81
  {
102
82
  "$ref": "#/components/parameters/ApiLimit1000"
@@ -1616,17 +1596,7 @@
1616
1596
  "operationId": "3c847eb1325040798f37a7492108e094",
1617
1597
  "parameters": [
1618
1598
  {
1619
- "name": "filters",
1620
- "in": "query",
1621
- "description": "It's possible to use this query parameter to only get incoming or outgoing revives. If not specified, this selection will return both incoming and outgoing revives.",
1622
- "required": false,
1623
- "schema": {
1624
- "type": "string",
1625
- "enum": [
1626
- "incoming",
1627
- "outgoing"
1628
- ]
1629
- }
1599
+ "$ref": "#/components/parameters/ApiFiltersIncomingOutgoing"
1630
1600
  },
1631
1601
  {
1632
1602
  "$ref": "#/components/parameters/ApiLimit100Default20"
@@ -1683,17 +1653,7 @@
1683
1653
  "operationId": "8820cd889afde899353037ca5a0f9a07",
1684
1654
  "parameters": [
1685
1655
  {
1686
- "name": "filters",
1687
- "in": "query",
1688
- "description": "It's possible to use this query parameter to only get incoming or outgoing revives. If not specified, this selection will return both incoming and outgoing revives.",
1689
- "required": false,
1690
- "schema": {
1691
- "type": "string",
1692
- "enum": [
1693
- "incoming",
1694
- "outgoing"
1695
- ]
1696
- }
1656
+ "$ref": "#/components/parameters/ApiFiltersIncomingOutgoing"
1697
1657
  },
1698
1658
  {
1699
1659
  "$ref": "#/components/parameters/ApiLimit1000Default20"
@@ -1908,6 +1868,9 @@
1908
1868
  }
1909
1869
  }
1910
1870
  },
1871
+ {
1872
+ "$ref": "#/components/parameters/ApiFiltersIncomingOutgoing"
1873
+ },
1911
1874
  {
1912
1875
  "$ref": "#/components/parameters/ApiStripTags"
1913
1876
  },
@@ -2072,17 +2035,7 @@
2072
2035
  "operationId": "cb5b38ba64c389e706526df8bc8af9b6",
2073
2036
  "parameters": [
2074
2037
  {
2075
- "name": "filters",
2076
- "in": "query",
2077
- "description": "It's possible to use this query parameter to only get incoming or outgoing attacks. If not specified, this selection will return both incoming and outgoing attacks.",
2078
- "required": false,
2079
- "schema": {
2080
- "type": "string",
2081
- "enum": [
2082
- "incoming",
2083
- "outgoing"
2084
- ]
2085
- }
2038
+ "$ref": "#/components/parameters/ApiFiltersIncomingOutgoing"
2086
2039
  },
2087
2040
  {
2088
2041
  "$ref": "#/components/parameters/ApiLimit100"
@@ -2136,17 +2089,7 @@
2136
2089
  "operationId": "8551280aaaf9819aa94be5c469a523de",
2137
2090
  "parameters": [
2138
2091
  {
2139
- "name": "filters",
2140
- "in": "query",
2141
- "description": "It's possible to use this query parameter to only get incoming or outgoing attacks. If not specified, this selection will return both incoming and outgoing attacks.",
2142
- "required": false,
2143
- "schema": {
2144
- "type": "string",
2145
- "enum": [
2146
- "incoming",
2147
- "outgoing"
2148
- ]
2149
- }
2092
+ "$ref": "#/components/parameters/ApiFiltersIncomingOutgoing"
2150
2093
  },
2151
2094
  {
2152
2095
  "$ref": "#/components/parameters/ApiLimit1000"
@@ -3487,17 +3430,7 @@
3487
3430
  "operationId": "486fcda26ed1aa6aba8ec7091080723b",
3488
3431
  "parameters": [
3489
3432
  {
3490
- "name": "filters",
3491
- "in": "query",
3492
- "description": "It's possible to use this query parameter to only get incoming or outgoing revives. If not specified, this selection will return both incoming and outgoing revives.",
3493
- "required": false,
3494
- "schema": {
3495
- "type": "string",
3496
- "enum": [
3497
- "incoming",
3498
- "outgoing"
3499
- ]
3500
- }
3433
+ "$ref": "#/components/parameters/ApiFiltersIncomingOutgoing"
3501
3434
  },
3502
3435
  {
3503
3436
  "$ref": "#/components/parameters/ApiLimit100"
@@ -3554,17 +3487,7 @@
3554
3487
  "operationId": "f17a4064779e8de5200238816c233c02",
3555
3488
  "parameters": [
3556
3489
  {
3557
- "name": "filters",
3558
- "in": "query",
3559
- "description": "It's possible to use this query parameter to only get incoming or outgoing revives. If not specified, this selection will return both incoming and outgoing revives.",
3560
- "required": false,
3561
- "schema": {
3562
- "type": "string",
3563
- "enum": [
3564
- "incoming",
3565
- "outgoing"
3566
- ]
3567
- }
3490
+ "$ref": "#/components/parameters/ApiFiltersIncomingOutgoing"
3568
3491
  },
3569
3492
  {
3570
3493
  "$ref": "#/components/parameters/ApiLimit1000"
@@ -4376,7 +4299,9 @@
4376
4299
  "created_at",
4377
4300
  "executed_at",
4378
4301
  "ready_at",
4379
- "expired_at"
4302
+ "expired_at",
4303
+ "incoming",
4304
+ "outgoing"
4380
4305
  ]
4381
4306
  }
4382
4307
  },
@@ -12072,6 +11997,20 @@
12072
11997
  "Hospitalized"
12073
11998
  ]
12074
11999
  },
12000
+ "FactionCrimeUserItemOutcomeEnum": {
12001
+ "type": "string",
12002
+ "enum": [
12003
+ "user",
12004
+ "faction"
12005
+ ]
12006
+ },
12007
+ "FactionCrimeItemOutcomeEnum": {
12008
+ "type": "string",
12009
+ "enum": [
12010
+ "lost",
12011
+ "used"
12012
+ ]
12013
+ },
12075
12014
  "RaceId": {
12076
12015
  "type": "integer",
12077
12016
  "format": "int32"
@@ -20903,12 +20842,36 @@
20903
20842
  },
20904
20843
  "type": "object"
20905
20844
  },
20845
+ "FactionCrimeUserItemOutcome": {
20846
+ "required": [
20847
+ "owned_by",
20848
+ "item_id",
20849
+ "item_uid",
20850
+ "outcome"
20851
+ ],
20852
+ "properties": {
20853
+ "owned_by": {
20854
+ "$ref": "#/components/schemas/FactionCrimeUserItemOutcomeEnum"
20855
+ },
20856
+ "item_id": {
20857
+ "$ref": "#/components/schemas/ItemId"
20858
+ },
20859
+ "item_uid": {
20860
+ "$ref": "#/components/schemas/ItemUid"
20861
+ },
20862
+ "outcome": {
20863
+ "$ref": "#/components/schemas/FactionCrimeItemOutcomeEnum"
20864
+ }
20865
+ },
20866
+ "type": "object"
20867
+ },
20906
20868
  "FactionCrimeUser": {
20907
20869
  "required": [
20908
20870
  "id",
20909
20871
  "outcome",
20910
20872
  "joined_at",
20911
- "progress"
20873
+ "progress",
20874
+ "item_outcome"
20912
20875
  ],
20913
20876
  "properties": {
20914
20877
  "id": {
@@ -20925,6 +20888,29 @@
20925
20888
  }
20926
20889
  ]
20927
20890
  },
20891
+ "outcome_duration": {
20892
+ "description": "This field is only populated for crimes completed after 25/07/2025 and only if the outcome is 'Jailed' or 'Hospitalized'.",
20893
+ "oneOf": [
20894
+ {
20895
+ "type": "integer",
20896
+ "format": "int32"
20897
+ },
20898
+ {
20899
+ "type": "null"
20900
+ }
20901
+ ]
20902
+ },
20903
+ "item_outcome": {
20904
+ "description": "This field is only populated for crimes completed after 25/07/2025 and only if the item was used or lost.",
20905
+ "oneOf": [
20906
+ {
20907
+ "$ref": "#/components/schemas/FactionCrimeUserItemOutcome"
20908
+ },
20909
+ {
20910
+ "type": "null"
20911
+ }
20912
+ ]
20913
+ },
20928
20914
  "joined_at": {
20929
20915
  "description": "The timestamp at which the user joined the slot.",
20930
20916
  "type": "integer",
@@ -25523,6 +25509,19 @@
25523
25509
  "type": "string"
25524
25510
  }
25525
25511
  },
25512
+ "ApiFiltersIncomingOutgoing": {
25513
+ "name": "filters",
25514
+ "in": "query",
25515
+ "description": "It's possible to use this query parameter to only get incoming or outgoing attacks / revives. If not specified, this selection will return both incoming and outgoing attacks / revives.",
25516
+ "required": false,
25517
+ "schema": {
25518
+ "type": "string",
25519
+ "enum": [
25520
+ "incoming",
25521
+ "outgoing"
25522
+ ]
25523
+ }
25524
+ },
25526
25525
  "ApiFactionSearchFilter": {
25527
25526
  "name": "filters",
25528
25527
  "in": "query",
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "3.0.4",
4
+ "version": "3.0.6",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },
8
8
  "devDependencies": {
9
9
  "@scalar/openapi-types": "^0.3.7",
10
- "@types/node": "^22.17.0",
10
+ "@types/node": "^22.17.1",
11
11
  "prettier": "^3.6.2",
12
12
  "typeconv": "^2.3.1",
13
13
  "typescript": "^5.9.2"