tornapi-typescript 5.4.1 → 5.5.1

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,11 @@ export type RaceCarUpgradeSubCategory = "Engine Cooling" | "Front Diffuser" | "R
58
58
  export type FactionApplicationStatusEnum = "accepted" | "declined" | "withdrawn" | "active";
59
59
  export type FactionRankedWarsCategoryEnum = "all" | "ongoing";
60
60
  export type FactionTerritoryWarsCategoryEnum = "finsihed" | "ongoing";
61
+ /**
62
+ * @default
63
+ * ongoing
64
+ */
65
+ export type TradeCategoryEnum = "finished" | "ongoing";
61
66
  export type FactionCrimeUserOutcome = "Successful" | "Failed" | "Jailed" | "Injured" | "Hospitalized";
62
67
  export type FactionCrimeUserItemOutcomeEnum = "user" | "faction";
63
68
  export type FactionCrimeItemOutcomeEnum = "lost" | "used";
@@ -81,6 +86,7 @@ export type TerritoryWarId = number;
81
86
  export type RaidWarId = number;
82
87
  export type ItemUid = number;
83
88
  export type UserId = number;
89
+ export type TradeId = number;
84
90
  export type StockId = number;
85
91
  export type DiscordId = string;
86
92
  export type UserDiscordPathId = UserId | DiscordId;
@@ -148,7 +154,7 @@ export type HonorTypeEnum = "attacking" | "camo" | "weapons" | "education" | "cr
148
154
  export type TornItemTypeEnum = "Alcohol" | "Armor" | "Artifact" | "Book" | "Booster" | "Candy" | "Car" | "Clothing" | "Collectible" | "Drug" | "Energy Drink" | "Enhancer" | "Flower" | "Jewelry" | "Material" | "Medical" | "Other" | "Plushie" | "Special" | "Supply Pack" | "Tool" | "Unused" | "Weapon";
149
155
  export type TornItemCategory = "All" | "Alcohol" | "Armor" | "Artifact" | "Book" | "Booster" | "Candy" | "Car" | "Clothing" | "Collectible" | "Defensive" | "Drug" | "Energy Drink" | "Enhancer" | "Flower" | "Jewelry" | "Material" | "Medical" | "Melee" | "Other" | "Plushie" | "Primary" | "Secondary" | "Special" | "Supply Pack" | "Temporary" | "Tool" | "Unused" | "Weapon";
150
156
  export type TornItemArmorCoveragePartEnum = "Full Body" | "Heart" | "Stomach" | "Chest" | "Arm" | "Groin" | "Leg" | "Throat" | "Hand" | "Foot" | "Head";
151
- export interface AttackPlayerFaction {
157
+ export interface UserFactionBasic {
152
158
  id: FactionId;
153
159
  name: string;
154
160
  }
@@ -156,7 +162,7 @@ export interface AttackPlayer {
156
162
  id: UserId;
157
163
  name: string;
158
164
  level: number;
159
- faction: AttackPlayerFaction | null;
165
+ faction: UserFactionBasic | null;
160
166
  }
161
167
  export interface AttackPlayerSimplified {
162
168
  id: UserId;
@@ -486,6 +492,77 @@ export interface ErrorCategorySelectionUnavailableForInteractionLogs {
486
492
  error: string;
487
493
  }
488
494
  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;
495
+ export interface UserTradesResponse {
496
+ trades: UserTrade[];
497
+ _metadata: RequestMetadataWithLinks;
498
+ }
499
+ export interface UserTradeResponse {
500
+ trade: UserTradeDetailed;
501
+ }
502
+ export interface UserTrade {
503
+ id: TradeId;
504
+ timestamp: number;
505
+ user: UserTradeParticipant;
506
+ trader: UserTradeParticipant;
507
+ }
508
+ export interface UserTradeParticipant {
509
+ id: UserId;
510
+ name: string;
511
+ }
512
+ export interface UserTradeDetailed extends UserTrade {
513
+ items: TradeItem[];
514
+ }
515
+ export interface TradeItemNap {
516
+ user_id: UserId;
517
+ type: "NAP";
518
+ details: {
519
+ days: number;
520
+ factions: UserFactionBasic[];
521
+ };
522
+ }
523
+ export interface TradeItemMoney {
524
+ user_id: UserId;
525
+ type: "Money";
526
+ details: {
527
+ amount: number;
528
+ };
529
+ }
530
+ export interface TradeItemFaction {
531
+ user_id: UserId;
532
+ type: "Faction";
533
+ details: {
534
+ id: FactionId;
535
+ name: string;
536
+ respect: number;
537
+ };
538
+ }
539
+ export interface TradeItemProperty {
540
+ user_id: UserId;
541
+ type: "Property";
542
+ details: {
543
+ id: PropertyId;
544
+ happiness: number;
545
+ };
546
+ }
547
+ export interface TradeItemCompany {
548
+ user_id: UserId;
549
+ type: "Company";
550
+ details: {
551
+ id: CompanyId;
552
+ name: string;
553
+ value: number;
554
+ };
555
+ }
556
+ export interface TradeItemItem {
557
+ user_id: UserId;
558
+ type: "Item";
559
+ details: {
560
+ id: ItemId;
561
+ uid: ItemUid | null;
562
+ amount: number;
563
+ };
564
+ }
565
+ export type TradeItem = TradeItemMoney | TradeItemItem | TradeItemFaction | TradeItemCompany | TradeItemProperty | TradeItemNap;
489
566
  export interface UserStockTransaction {
490
567
  id: number;
491
568
  shares: number;
@@ -6945,6 +7022,14 @@ export interface UserV2 extends BaseSchema {
6945
7022
  response: UserStocksResponse;
6946
7023
  params: "timestamp";
6947
7024
  };
7025
+ trades: {
7026
+ response: UserTradesResponse;
7027
+ params: "cat" | "limit" | "sort" | "to" | "from" | "timestamp";
7028
+ };
7029
+ trade: {
7030
+ response: UserTradeResponse;
7031
+ params: "id" | "timestamp";
7032
+ };
6948
7033
  travel: {
6949
7034
  response: UserTravelResponse;
6950
7035
  params: "timestamp";
package/dist/index.ts CHANGED
@@ -4728,6 +4728,12 @@ export type FactionRankedWarsCategoryEnum = "all" | "ongoing";
4728
4728
 
4729
4729
  export type FactionTerritoryWarsCategoryEnum = "finsihed" | "ongoing";
4730
4730
 
4731
+ /**
4732
+ * @default
4733
+ * ongoing
4734
+ */
4735
+ export type TradeCategoryEnum = "finished" | "ongoing";
4736
+
4731
4737
  export type FactionCrimeUserOutcome =
4732
4738
  | "Successful"
4733
4739
  | "Failed"
@@ -4779,6 +4785,8 @@ export type ItemUid = number;
4779
4785
 
4780
4786
  export type UserId = number;
4781
4787
 
4788
+ export type TradeId = number;
4789
+
4782
4790
  export type StockId = number;
4783
4791
 
4784
4792
  export type DiscordId = string;
@@ -5075,7 +5083,7 @@ export type TornItemArmorCoveragePartEnum =
5075
5083
  | "Foot"
5076
5084
  | "Head";
5077
5085
 
5078
- export interface AttackPlayerFaction {
5086
+ export interface UserFactionBasic {
5079
5087
  id: FactionId;
5080
5088
  name: string;
5081
5089
  }
@@ -5084,7 +5092,7 @@ export interface AttackPlayer {
5084
5092
  id: UserId;
5085
5093
  name: string;
5086
5094
  level: number;
5087
- faction: AttackPlayerFaction | null;
5095
+ faction: UserFactionBasic | null;
5088
5096
  }
5089
5097
 
5090
5098
  export interface AttackPlayerSimplified {
@@ -5517,6 +5525,95 @@ export type ApiError =
5517
5525
  | ErrorIncorrectLogId
5518
5526
  | ErrorCategorySelectionUnavailableForInteractionLogs;
5519
5527
 
5528
+ export interface UserTradesResponse {
5529
+ trades: UserTrade[];
5530
+ _metadata: RequestMetadataWithLinks;
5531
+ }
5532
+
5533
+ export interface UserTradeResponse {
5534
+ trade: UserTradeDetailed;
5535
+ }
5536
+
5537
+ export interface UserTrade {
5538
+ id: TradeId;
5539
+ timestamp: number;
5540
+ user: UserTradeParticipant;
5541
+ trader: UserTradeParticipant;
5542
+ }
5543
+
5544
+ export interface UserTradeParticipant {
5545
+ id: UserId;
5546
+ name: string;
5547
+ }
5548
+
5549
+ export interface UserTradeDetailed extends UserTrade {
5550
+ items: TradeItem[];
5551
+ }
5552
+
5553
+ export interface TradeItemNap {
5554
+ user_id: UserId;
5555
+ type: "NAP";
5556
+ details: {
5557
+ days: number;
5558
+ factions: UserFactionBasic[];
5559
+ };
5560
+ }
5561
+
5562
+ export interface TradeItemMoney {
5563
+ user_id: UserId;
5564
+ type: "Money";
5565
+ details: {
5566
+ amount: number;
5567
+ };
5568
+ }
5569
+
5570
+ export interface TradeItemFaction {
5571
+ user_id: UserId;
5572
+ type: "Faction";
5573
+ details: {
5574
+ id: FactionId;
5575
+ name: string;
5576
+ respect: number;
5577
+ };
5578
+ }
5579
+
5580
+ export interface TradeItemProperty {
5581
+ user_id: UserId;
5582
+ type: "Property";
5583
+ details: {
5584
+ id: PropertyId;
5585
+ happiness: number;
5586
+ };
5587
+ }
5588
+
5589
+ export interface TradeItemCompany {
5590
+ user_id: UserId;
5591
+ type: "Company";
5592
+ details: {
5593
+ id: CompanyId;
5594
+ name: string;
5595
+ value: number;
5596
+ };
5597
+ }
5598
+
5599
+ export interface TradeItemItem {
5600
+ user_id: UserId;
5601
+ type: "Item";
5602
+ details: {
5603
+ id: ItemId;
5604
+ uid: ItemUid | null;
5605
+ amount: number;
5606
+ };
5607
+ }
5608
+
5609
+ export type TradeItem =
5610
+ | TradeItemMoney
5611
+ | TradeItemItem
5612
+ | TradeItemFaction
5613
+ | TradeItemCompany
5614
+ | TradeItemProperty
5615
+ | TradeItemNap;
5616
+
5520
5617
  export interface UserStockTransaction {
5521
5618
  id: number;
5522
5619
  shares: number;
@@ -12818,6 +12915,14 @@ export interface UserV2 extends BaseSchema {
12818
12915
  response: UserStocksResponse;
12819
12916
  params: "timestamp";
12820
12917
  };
12918
+ trades: {
12919
+ response: UserTradesResponse;
12920
+ params: "cat" | "limit" | "sort" | "to" | "from" | "timestamp";
12921
+ };
12922
+ trade: {
12923
+ response: UserTradeResponse;
12924
+ params: "id" | "timestamp";
12925
+ };
12821
12926
  travel: {
12822
12927
  response: UserTravelResponse;
12823
12928
  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": "5.4.1"
6
+ "version": "5.5.1"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -48,7 +48,7 @@
48
48
  "api_key": []
49
49
  }
50
50
  ],
51
- "x-stability": "Unstable"
51
+ "x-stability": "Stable"
52
52
  }
53
53
  },
54
54
  "/user/attacks": {
@@ -666,7 +666,7 @@
666
666
  "api_key": []
667
667
  }
668
668
  ],
669
- "x-stability": "Unstable"
669
+ "x-stability": "Stable"
670
670
  }
671
671
  },
672
672
  "/user/{id}/discord": {
@@ -714,7 +714,7 @@
714
714
  "api_key": []
715
715
  }
716
716
  ],
717
- "x-stability": "Unstable"
717
+ "x-stability": "Stable"
718
718
  }
719
719
  },
720
720
  "/user/education": {
@@ -831,7 +831,7 @@
831
831
  "api_key": []
832
832
  }
833
833
  ],
834
- "x-stability": "Unstable"
834
+ "x-stability": "Stable"
835
835
  }
836
836
  },
837
837
  "/user/events": {
@@ -2042,7 +2042,7 @@
2042
2042
  "api_key": []
2043
2043
  }
2044
2044
  ],
2045
- "x-stability": "Unstable"
2045
+ "x-stability": "Stable"
2046
2046
  }
2047
2047
  },
2048
2048
  "/user/money": {
@@ -3107,6 +3107,114 @@
3107
3107
  "api_key": []
3108
3108
  }
3109
3109
  ],
3110
+ "x-stability": "Stable"
3111
+ }
3112
+ },
3113
+ "/user/trades": {
3114
+ "get": {
3115
+ "tags": [
3116
+ "User"
3117
+ ],
3118
+ "summary": "Get your trades",
3119
+ "description": "Requires limited access key. <br> When requesting 'ongoing' trades (default), limit/offset/sort are not being used.",
3120
+ "operationId": "getMyTrades",
3121
+ "parameters": [
3122
+ {
3123
+ "name": "cat",
3124
+ "in": "query",
3125
+ "description": "Category of trades returned",
3126
+ "required": false,
3127
+ "schema": {
3128
+ "$ref": "#/components/schemas/TradeCategoryEnum"
3129
+ }
3130
+ },
3131
+ {
3132
+ "$ref": "#/components/parameters/ApiLimit100"
3133
+ },
3134
+ {
3135
+ "$ref": "#/components/parameters/ApiSortDesc"
3136
+ },
3137
+ {
3138
+ "$ref": "#/components/parameters/ApiTo"
3139
+ },
3140
+ {
3141
+ "$ref": "#/components/parameters/ApiFrom"
3142
+ },
3143
+ {
3144
+ "$ref": "#/components/parameters/ApiTimestamp"
3145
+ },
3146
+ {
3147
+ "$ref": "#/components/parameters/ApiComment"
3148
+ },
3149
+ {
3150
+ "$ref": "#/components/parameters/ApiKeyLimited"
3151
+ }
3152
+ ],
3153
+ "responses": {
3154
+ "200": {
3155
+ "description": "Successful operation",
3156
+ "content": {
3157
+ "application/json": {
3158
+ "schema": {
3159
+ "$ref": "#/components/schemas/UserTradesResponse"
3160
+ }
3161
+ }
3162
+ }
3163
+ }
3164
+ },
3165
+ "security": [
3166
+ {
3167
+ "api_key": []
3168
+ }
3169
+ ],
3170
+ "x-stability": "Unstable"
3171
+ }
3172
+ },
3173
+ "/user/{tradeId}/trade": {
3174
+ "get": {
3175
+ "tags": [
3176
+ "User"
3177
+ ],
3178
+ "summary": "Get your detailed trade",
3179
+ "description": "Requires limited access key. <br>Only possible to get trades you participated in.",
3180
+ "operationId": "getMyDetailedTrade",
3181
+ "parameters": [
3182
+ {
3183
+ "name": "id",
3184
+ "in": "path",
3185
+ "description": "Trade id",
3186
+ "required": true,
3187
+ "schema": {
3188
+ "$ref": "#/components/schemas/TradeId"
3189
+ }
3190
+ },
3191
+ {
3192
+ "$ref": "#/components/parameters/ApiTimestamp"
3193
+ },
3194
+ {
3195
+ "$ref": "#/components/parameters/ApiComment"
3196
+ },
3197
+ {
3198
+ "$ref": "#/components/parameters/ApiKeyLimited"
3199
+ }
3200
+ ],
3201
+ "responses": {
3202
+ "200": {
3203
+ "description": "Successful operation",
3204
+ "content": {
3205
+ "application/json": {
3206
+ "schema": {
3207
+ "$ref": "#/components/schemas/UserTradeResponse"
3208
+ }
3209
+ }
3210
+ }
3211
+ }
3212
+ },
3213
+ "security": [
3214
+ {
3215
+ "api_key": []
3216
+ }
3217
+ ],
3110
3218
  "x-stability": "Unstable"
3111
3219
  }
3112
3220
  },
@@ -3380,6 +3488,9 @@
3380
3488
  {
3381
3489
  "$ref": "#/components/schemas/TornCrimeId"
3382
3490
  },
3491
+ {
3492
+ "$ref": "#/components/schemas/TradeId"
3493
+ },
3383
3494
  {
3384
3495
  "type": "string"
3385
3496
  }
@@ -3430,6 +3541,9 @@
3430
3541
  },
3431
3542
  {
3432
3543
  "$ref": "#/components/schemas/RacingRaceTypeEnum"
3544
+ },
3545
+ {
3546
+ "$ref": "#/components/schemas/TradeCategoryEnum"
3433
3547
  }
3434
3548
  ]
3435
3549
  }
@@ -3630,6 +3744,12 @@
3630
3744
  {
3631
3745
  "$ref": "#/components/schemas/UserBattleStatsResponse"
3632
3746
  },
3747
+ {
3748
+ "$ref": "#/components/schemas/UserTradeResponse"
3749
+ },
3750
+ {
3751
+ "$ref": "#/components/schemas/UserTradesResponse"
3752
+ },
3633
3753
  {
3634
3754
  "$ref": "#/components/schemas/UserNewEventsResponse"
3635
3755
  },
@@ -6816,7 +6936,7 @@
6816
6936
  "api_key": []
6817
6937
  }
6818
6938
  ],
6819
- "x-stability": "Unstable"
6939
+ "x-stability": "Stable"
6820
6940
  }
6821
6941
  },
6822
6942
  "/market/{id}/auctionhouse": {
@@ -6876,7 +6996,7 @@
6876
6996
  "api_key": []
6877
6997
  }
6878
6998
  ],
6879
- "x-stability": "Unstable"
6999
+ "x-stability": "Stable"
6880
7000
  }
6881
7001
  },
6882
7002
  "/market/auctionhouse": {
@@ -6927,7 +7047,7 @@
6927
7047
  "api_key": []
6928
7048
  }
6929
7049
  ],
6930
- "x-stability": "Unstable"
7050
+ "x-stability": "Stable"
6931
7051
  }
6932
7052
  },
6933
7053
  "/market/bazaar": {
@@ -8759,7 +8879,7 @@
8759
8879
  "api_key": []
8760
8880
  }
8761
8881
  ],
8762
- "x-stability": "Unstable"
8882
+ "x-stability": "Stable"
8763
8883
  }
8764
8884
  },
8765
8885
  "/torn/itemmods": {
@@ -9279,7 +9399,7 @@
9279
9399
  "api_key": []
9280
9400
  }
9281
9401
  ],
9282
- "x-stability": "Unstable"
9402
+ "x-stability": "Stable"
9283
9403
  }
9284
9404
  },
9285
9405
  "/torn/{stockId}/stocks": {
@@ -9327,7 +9447,7 @@
9327
9447
  "api_key": []
9328
9448
  }
9329
9449
  ],
9330
- "x-stability": "Unstable"
9450
+ "x-stability": "Stable"
9331
9451
  }
9332
9452
  },
9333
9453
  "/torn/{crimeId}/subcrimes": {
@@ -14681,6 +14801,14 @@
14681
14801
  "ongoing"
14682
14802
  ]
14683
14803
  },
14804
+ "TradeCategoryEnum": {
14805
+ "type": "string",
14806
+ "default": "ongoing",
14807
+ "enum": [
14808
+ "finished",
14809
+ "ongoing"
14810
+ ]
14811
+ },
14684
14812
  "FactionCrimeUserOutcome": {
14685
14813
  "type": "string",
14686
14814
  "enum": [
@@ -14784,6 +14912,10 @@
14784
14912
  "type": "integer",
14785
14913
  "format": "int32"
14786
14914
  },
14915
+ "TradeId": {
14916
+ "type": "integer",
14917
+ "format": "int64"
14918
+ },
14787
14919
  "StockId": {
14788
14920
  "type": "integer",
14789
14921
  "format": "int32"
@@ -15253,7 +15385,7 @@
15253
15385
  "Head"
15254
15386
  ]
15255
15387
  },
15256
- "AttackPlayerFaction": {
15388
+ "UserFactionBasic": {
15257
15389
  "required": [
15258
15390
  "id",
15259
15391
  "name"
@@ -15289,7 +15421,7 @@
15289
15421
  "faction": {
15290
15422
  "oneOf": [
15291
15423
  {
15292
- "$ref": "#/components/schemas/AttackPlayerFaction"
15424
+ "$ref": "#/components/schemas/UserFactionBasic"
15293
15425
  },
15294
15426
  {
15295
15427
  "type": "null"
@@ -17016,6 +17148,346 @@
17016
17148
  }
17017
17149
  ]
17018
17150
  },
17151
+ "UserTradesResponse": {
17152
+ "required": [
17153
+ "trades",
17154
+ "_metadata"
17155
+ ],
17156
+ "properties": {
17157
+ "trades": {
17158
+ "type": "array",
17159
+ "items": {
17160
+ "$ref": "#/components/schemas/UserTrade"
17161
+ }
17162
+ },
17163
+ "_metadata": {
17164
+ "$ref": "#/components/schemas/RequestMetadataWithLinks"
17165
+ }
17166
+ },
17167
+ "type": "object"
17168
+ },
17169
+ "UserTradeResponse": {
17170
+ "required": [
17171
+ "trade"
17172
+ ],
17173
+ "properties": {
17174
+ "trade": {
17175
+ "$ref": "#/components/schemas/UserTradeDetailed"
17176
+ }
17177
+ },
17178
+ "type": "object"
17179
+ },
17180
+ "UserTrade": {
17181
+ "required": [
17182
+ "id",
17183
+ "timestamp",
17184
+ "user",
17185
+ "trader",
17186
+ "items"
17187
+ ],
17188
+ "properties": {
17189
+ "id": {
17190
+ "$ref": "#/components/schemas/TradeId"
17191
+ },
17192
+ "timestamp": {
17193
+ "type": "integer",
17194
+ "format": "int32"
17195
+ },
17196
+ "user": {
17197
+ "$ref": "#/components/schemas/UserTradeParticipant"
17198
+ },
17199
+ "trader": {
17200
+ "$ref": "#/components/schemas/UserTradeParticipant"
17201
+ }
17202
+ },
17203
+ "type": "object"
17204
+ },
17205
+ "UserTradeParticipant": {
17206
+ "required": [
17207
+ "id",
17208
+ "name"
17209
+ ],
17210
+ "properties": {
17211
+ "id": {
17212
+ "$ref": "#/components/schemas/UserId"
17213
+ },
17214
+ "name": {
17215
+ "type": "string"
17216
+ }
17217
+ },
17218
+ "type": "object"
17219
+ },
17220
+ "UserTradeDetailed": {
17221
+ "allOf": [
17222
+ {
17223
+ "$ref": "#/components/schemas/UserTrade"
17224
+ },
17225
+ {
17226
+ "required": [
17227
+ "items"
17228
+ ],
17229
+ "properties": {
17230
+ "items": {
17231
+ "type": "array",
17232
+ "items": {
17233
+ "$ref": "#/components/schemas/TradeItem"
17234
+ }
17235
+ }
17236
+ },
17237
+ "type": "object"
17238
+ }
17239
+ ]
17240
+ },
17241
+ "TradeItemNap": {
17242
+ "required": [
17243
+ "user_id",
17244
+ "type",
17245
+ "details"
17246
+ ],
17247
+ "properties": {
17248
+ "user_id": {
17249
+ "$ref": "#/components/schemas/UserId"
17250
+ },
17251
+ "type": {
17252
+ "type": "string",
17253
+ "enum": [
17254
+ "NAP"
17255
+ ]
17256
+ },
17257
+ "details": {
17258
+ "required": [
17259
+ "days",
17260
+ "factions"
17261
+ ],
17262
+ "properties": {
17263
+ "days": {
17264
+ "type": "integer",
17265
+ "format": "int32"
17266
+ },
17267
+ "factions": {
17268
+ "type": "array",
17269
+ "items": {
17270
+ "$ref": "#/components/schemas/UserFactionBasic"
17271
+ }
17272
+ }
17273
+ },
17274
+ "type": "object"
17275
+ }
17276
+ },
17277
+ "type": "object"
17278
+ },
17279
+ "TradeItemMoney": {
17280
+ "required": [
17281
+ "user_id",
17282
+ "type",
17283
+ "details"
17284
+ ],
17285
+ "properties": {
17286
+ "user_id": {
17287
+ "$ref": "#/components/schemas/UserId"
17288
+ },
17289
+ "type": {
17290
+ "type": "string",
17291
+ "enum": [
17292
+ "Money"
17293
+ ]
17294
+ },
17295
+ "details": {
17296
+ "required": [
17297
+ "amount"
17298
+ ],
17299
+ "properties": {
17300
+ "amount": {
17301
+ "type": "integer",
17302
+ "format": "int64"
17303
+ }
17304
+ },
17305
+ "type": "object"
17306
+ }
17307
+ },
17308
+ "type": "object"
17309
+ },
17310
+ "TradeItemFaction": {
17311
+ "required": [
17312
+ "user_id",
17313
+ "type",
17314
+ "details"
17315
+ ],
17316
+ "properties": {
17317
+ "user_id": {
17318
+ "$ref": "#/components/schemas/UserId"
17319
+ },
17320
+ "type": {
17321
+ "type": "string",
17322
+ "enum": [
17323
+ "Faction"
17324
+ ]
17325
+ },
17326
+ "details": {
17327
+ "required": [
17328
+ "id",
17329
+ "name",
17330
+ "respect"
17331
+ ],
17332
+ "properties": {
17333
+ "id": {
17334
+ "$ref": "#/components/schemas/FactionId"
17335
+ },
17336
+ "name": {
17337
+ "type": "string"
17338
+ },
17339
+ "respect": {
17340
+ "type": "integer",
17341
+ "format": "int32"
17342
+ }
17343
+ },
17344
+ "type": "object"
17345
+ }
17346
+ },
17347
+ "type": "object"
17348
+ },
17349
+ "TradeItemProperty": {
17350
+ "required": [
17351
+ "user_id",
17352
+ "type",
17353
+ "details"
17354
+ ],
17355
+ "properties": {
17356
+ "user_id": {
17357
+ "$ref": "#/components/schemas/UserId"
17358
+ },
17359
+ "type": {
17360
+ "type": "string",
17361
+ "enum": [
17362
+ "Property"
17363
+ ]
17364
+ },
17365
+ "details": {
17366
+ "required": [
17367
+ "id",
17368
+ "happiness"
17369
+ ],
17370
+ "properties": {
17371
+ "id": {
17372
+ "$ref": "#/components/schemas/PropertyId"
17373
+ },
17374
+ "happiness": {
17375
+ "type": "integer",
17376
+ "format": "int32"
17377
+ }
17378
+ },
17379
+ "type": "object"
17380
+ }
17381
+ },
17382
+ "type": "object"
17383
+ },
17384
+ "TradeItemCompany": {
17385
+ "required": [
17386
+ "user_id",
17387
+ "type",
17388
+ "details"
17389
+ ],
17390
+ "properties": {
17391
+ "user_id": {
17392
+ "$ref": "#/components/schemas/UserId"
17393
+ },
17394
+ "type": {
17395
+ "type": "string",
17396
+ "enum": [
17397
+ "Company"
17398
+ ]
17399
+ },
17400
+ "details": {
17401
+ "required": [
17402
+ "id",
17403
+ "name",
17404
+ "value"
17405
+ ],
17406
+ "properties": {
17407
+ "id": {
17408
+ "$ref": "#/components/schemas/CompanyId"
17409
+ },
17410
+ "name": {
17411
+ "type": "string"
17412
+ },
17413
+ "value": {
17414
+ "type": "integer",
17415
+ "format": "int64"
17416
+ }
17417
+ },
17418
+ "type": "object"
17419
+ }
17420
+ },
17421
+ "type": "object"
17422
+ },
17423
+ "TradeItemItem": {
17424
+ "required": [
17425
+ "user_id",
17426
+ "type",
17427
+ "details"
17428
+ ],
17429
+ "properties": {
17430
+ "user_id": {
17431
+ "$ref": "#/components/schemas/UserId"
17432
+ },
17433
+ "type": {
17434
+ "type": "string",
17435
+ "enum": [
17436
+ "Item"
17437
+ ]
17438
+ },
17439
+ "details": {
17440
+ "required": [
17441
+ "id",
17442
+ "uid",
17443
+ "amount"
17444
+ ],
17445
+ "properties": {
17446
+ "id": {
17447
+ "$ref": "#/components/schemas/ItemId"
17448
+ },
17449
+ "uid": {
17450
+ "oneOf": [
17451
+ {
17452
+ "$ref": "#/components/schemas/ItemUid"
17453
+ },
17454
+ {
17455
+ "type": "null"
17456
+ }
17457
+ ]
17458
+ },
17459
+ "amount": {
17460
+ "type": "integer",
17461
+ "format": "int64"
17462
+ }
17463
+ },
17464
+ "type": "object"
17465
+ }
17466
+ },
17467
+ "type": "object"
17468
+ },
17469
+ "TradeItem": {
17470
+ "oneOf": [
17471
+ {
17472
+ "$ref": "#/components/schemas/TradeItemMoney"
17473
+ },
17474
+ {
17475
+ "$ref": "#/components/schemas/TradeItemItem"
17476
+ },
17477
+ {
17478
+ "$ref": "#/components/schemas/TradeItemFaction"
17479
+ },
17480
+ {
17481
+ "$ref": "#/components/schemas/TradeItemCompany"
17482
+ },
17483
+ {
17484
+ "$ref": "#/components/schemas/TradeItemProperty"
17485
+ },
17486
+ {
17487
+ "$ref": "#/components/schemas/TradeItemNap"
17488
+ }
17489
+ ]
17490
+ },
17019
17491
  "UserStockTransaction": {
17020
17492
  "required": [
17021
17493
  "id",
@@ -20835,8 +21307,10 @@
20835
21307
  "revivesfull",
20836
21308
  "skills",
20837
21309
  "stocks",
20838
- "timestamp",
21310
+ "trades",
21311
+ "trade",
20839
21312
  "travel",
21313
+ "timestamp",
20840
21314
  "weaponexp",
20841
21315
  "workstats",
20842
21316
  "bazaar",
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "5.4.1",
4
+ "version": "5.5.1",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },
8
8
  "devDependencies": {
9
- "@scalar/openapi-types": "^0.5.3",
10
- "@types/node": "^24.10.13",
9
+ "@scalar/openapi-types": "^0.6.0",
10
+ "@types/node": "^24.12.0",
11
11
  "prettier": "^3.8.1",
12
12
  "typeconv": "^2.3.1",
13
13
  "typescript": "^5.9.3"