tornapi-typescript 0.2.9 → 1.10.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
@@ -4201,6 +4201,32 @@ export type FactionBranchStateEnum = "war" | "peace";
4201
4201
 
4202
4202
  export type RacingRaceTypeEnum = "official" | "custom";
4203
4203
 
4204
+ export type MarketSpecializedBazaarCategoryEnum =
4205
+ | "Alcohol"
4206
+ | "Artifact"
4207
+ | "Booster"
4208
+ | "Candy"
4209
+ | "Car"
4210
+ | "Clothing"
4211
+ | "Collectible"
4212
+ | "Defensive"
4213
+ | "Drug"
4214
+ | "Energy Drink"
4215
+ | "Enhancer"
4216
+ | "Flower"
4217
+ | "Jewelry"
4218
+ | "Material"
4219
+ | "Medical"
4220
+ | "Melee"
4221
+ | "Other"
4222
+ | "Plushie"
4223
+ | "Primary"
4224
+ | "Secondary"
4225
+ | "Special"
4226
+ | "Supply Pack"
4227
+ | "Temporary"
4228
+ | "Tool";
4229
+
4204
4230
  export type FactionPositionAbilityEnum =
4205
4231
  | "Medical Item Usage"
4206
4232
  | "Booster Item Usage"
@@ -7201,6 +7227,67 @@ export interface KeyInfoResponse {
7201
7227
 
7202
7228
  export type KeySelectionName = string;
7203
7229
 
7230
+ export interface BazaarWeekly {
7231
+ busiest: BazaarWeeklyCustomers[];
7232
+ most_popular: BazaarTotalFavorites[];
7233
+ trending: BazaarRecentFavorites[];
7234
+ top_grossing: BazaarWeeklyIncome[];
7235
+ bulk: BazaarBulkSales[];
7236
+ advanced_item: BazaarAdvancedItemSales[];
7237
+ bargain: BazaarBargainSales[];
7238
+ dollar_sale: BazaarDollarSales[];
7239
+ }
7240
+
7241
+ export interface BazaarSpecialized {
7242
+ specialized: BazaarWeeklyCustomers[];
7243
+ }
7244
+
7245
+ export interface BazaarResponse {
7246
+ bazaar: BazaarWeekly | BazaarSpecialized;
7247
+ }
7248
+
7249
+ export interface BazaarResponseSpecialized {
7250
+ bazaar: BazaarSpecialized;
7251
+ }
7252
+
7253
+ export interface Bazaar {
7254
+ id: UserId;
7255
+ name: string;
7256
+ is_open: boolean;
7257
+ }
7258
+
7259
+ export interface BazaarWeeklyCustomers extends Bazaar {
7260
+ weekly_customers: number;
7261
+ }
7262
+
7263
+ export interface BazaarTotalFavorites extends Bazaar {
7264
+ total_favorites: number;
7265
+ }
7266
+
7267
+ export interface BazaarRecentFavorites extends Bazaar {
7268
+ recent_favorites: number;
7269
+ }
7270
+
7271
+ export interface BazaarWeeklyIncome extends Bazaar {
7272
+ weekly_income: number;
7273
+ }
7274
+
7275
+ export interface BazaarBulkSales extends Bazaar {
7276
+ bulk_sales: number;
7277
+ }
7278
+
7279
+ export interface BazaarAdvancedItemSales extends Bazaar {
7280
+ advanced_item_sales: number;
7281
+ }
7282
+
7283
+ export interface BazaarBargainSales extends Bazaar {
7284
+ bargain_sales: number;
7285
+ }
7286
+
7287
+ export interface BazaarDollarSales extends Bazaar {
7288
+ dollar_sales: number;
7289
+ }
7290
+
7204
7291
  export interface ItemMarketListingItemBonus {
7205
7292
  id: number;
7206
7293
  title: string;
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": "1.9.0"
6
+ "version": "1.10.0"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -4677,6 +4677,102 @@
4677
4677
  "x-stability": "Stable"
4678
4678
  }
4679
4679
  },
4680
+ "/market/bazaar": {
4681
+ "get": {
4682
+ "tags": [
4683
+ "Market"
4684
+ ],
4685
+ "summary": "Get bazaar directory",
4686
+ "description": "Requires public access key. <br> The default response is of type 'BazaarWeekly', but if a category is chosen, the response will be of type 'BazaarSpecialized'.",
4687
+ "operationId": "422876deda064e2f3a2cc3c4bf6d73a9",
4688
+ "parameters": [
4689
+ {
4690
+ "name": "cat",
4691
+ "in": "query",
4692
+ "description": "Category of specialized bazaars returned",
4693
+ "required": false,
4694
+ "schema": {
4695
+ "$ref": "#/components/schemas/MarketSpecializedBazaarCategoryEnum"
4696
+ }
4697
+ },
4698
+ {
4699
+ "$ref": "#/components/parameters/ApiTimestamp"
4700
+ },
4701
+ {
4702
+ "$ref": "#/components/parameters/ApiComment"
4703
+ },
4704
+ {
4705
+ "$ref": "#/components/parameters/ApiKeyPublic"
4706
+ }
4707
+ ],
4708
+ "responses": {
4709
+ "200": {
4710
+ "description": "Successful operation",
4711
+ "content": {
4712
+ "application/json": {
4713
+ "schema": {
4714
+ "$ref": "#/components/schemas/BazaarResponse"
4715
+ }
4716
+ }
4717
+ }
4718
+ }
4719
+ },
4720
+ "security": [
4721
+ {
4722
+ "api_key": []
4723
+ }
4724
+ ],
4725
+ "x-stability": "Unstable"
4726
+ }
4727
+ },
4728
+ "/market/{id}/bazaar": {
4729
+ "get": {
4730
+ "tags": [
4731
+ "Market"
4732
+ ],
4733
+ "summary": "Get item specialized bazaar directory",
4734
+ "description": "Requires public access key. <br>",
4735
+ "operationId": "8254489388603bf1b21740e6f71bef06",
4736
+ "parameters": [
4737
+ {
4738
+ "name": "id",
4739
+ "in": "path",
4740
+ "description": "Item id",
4741
+ "required": true,
4742
+ "schema": {
4743
+ "$ref": "#/components/schemas/ItemId"
4744
+ }
4745
+ },
4746
+ {
4747
+ "$ref": "#/components/parameters/ApiTimestamp"
4748
+ },
4749
+ {
4750
+ "$ref": "#/components/parameters/ApiComment"
4751
+ },
4752
+ {
4753
+ "$ref": "#/components/parameters/ApiKeyPublic"
4754
+ }
4755
+ ],
4756
+ "responses": {
4757
+ "200": {
4758
+ "description": "Successful operation",
4759
+ "content": {
4760
+ "application/json": {
4761
+ "schema": {
4762
+ "$ref": "#/components/schemas/BazaarResponseSpecialized"
4763
+ }
4764
+ }
4765
+ }
4766
+ }
4767
+ },
4768
+ "security": [
4769
+ {
4770
+ "api_key": []
4771
+ }
4772
+ ],
4773
+ "x-stability": "Unstable"
4774
+ }
4775
+ },
4680
4776
  "/market/{id}/itemmarket": {
4681
4777
  "get": {
4682
4778
  "tags": [
@@ -4847,6 +4943,15 @@
4847
4943
  "$ref": "#/components/schemas/ItemId"
4848
4944
  }
4849
4945
  },
4946
+ {
4947
+ "name": "cat",
4948
+ "in": "query",
4949
+ "description": "Category of specialized bazaars returned",
4950
+ "required": false,
4951
+ "schema": {
4952
+ "$ref": "#/components/schemas/MarketSpecializedBazaarCategoryEnum"
4953
+ }
4954
+ },
4850
4955
  {
4851
4956
  "name": "bonus",
4852
4957
  "in": "query",
@@ -4889,6 +4994,12 @@
4889
4994
  "application/json": {
4890
4995
  "schema": {
4891
4996
  "anyOf": [
4997
+ {
4998
+ "$ref": "#/components/schemas/BazaarResponse"
4999
+ },
5000
+ {
5001
+ "$ref": "#/components/schemas/BazaarResponseSpecialized"
5002
+ },
4892
5003
  {
4893
5004
  "$ref": "#/components/schemas/MarketItemMarketResponse"
4894
5005
  },
@@ -10662,6 +10773,35 @@
10662
10773
  "custom"
10663
10774
  ]
10664
10775
  },
10776
+ "MarketSpecializedBazaarCategoryEnum": {
10777
+ "type": "string",
10778
+ "enum": [
10779
+ "Alcohol",
10780
+ "Artifact",
10781
+ "Booster",
10782
+ "Candy",
10783
+ "Car",
10784
+ "Clothing",
10785
+ "Collectible",
10786
+ "Defensive",
10787
+ "Drug",
10788
+ "Energy Drink",
10789
+ "Enhancer",
10790
+ "Flower",
10791
+ "Jewelry",
10792
+ "Material",
10793
+ "Medical",
10794
+ "Melee",
10795
+ "Other",
10796
+ "Plushie",
10797
+ "Primary",
10798
+ "Secondary",
10799
+ "Special",
10800
+ "Supply Pack",
10801
+ "Temporary",
10802
+ "Tool"
10803
+ ]
10804
+ },
10665
10805
  "FactionPositionAbilityEnum": {
10666
10806
  "type": "string",
10667
10807
  "enum": [
@@ -20824,6 +20964,284 @@
20824
20964
  }
20825
20965
  ]
20826
20966
  },
20967
+ "BazaarWeekly": {
20968
+ "required": [
20969
+ "busiest",
20970
+ "most_popular",
20971
+ "trending",
20972
+ "top_grossing",
20973
+ "bulk",
20974
+ "advanced_item",
20975
+ "bargain",
20976
+ "dollar_sale"
20977
+ ],
20978
+ "properties": {
20979
+ "busiest": {
20980
+ "type": "array",
20981
+ "items": {
20982
+ "$ref": "#/components/schemas/BazaarWeeklyCustomers"
20983
+ }
20984
+ },
20985
+ "most_popular": {
20986
+ "type": "array",
20987
+ "items": {
20988
+ "$ref": "#/components/schemas/BazaarTotalFavorites"
20989
+ }
20990
+ },
20991
+ "trending": {
20992
+ "type": "array",
20993
+ "items": {
20994
+ "$ref": "#/components/schemas/BazaarRecentFavorites"
20995
+ }
20996
+ },
20997
+ "top_grossing": {
20998
+ "type": "array",
20999
+ "items": {
21000
+ "$ref": "#/components/schemas/BazaarWeeklyIncome"
21001
+ }
21002
+ },
21003
+ "bulk": {
21004
+ "type": "array",
21005
+ "items": {
21006
+ "$ref": "#/components/schemas/BazaarBulkSales"
21007
+ }
21008
+ },
21009
+ "advanced_item": {
21010
+ "type": "array",
21011
+ "items": {
21012
+ "$ref": "#/components/schemas/BazaarAdvancedItemSales"
21013
+ }
21014
+ },
21015
+ "bargain": {
21016
+ "type": "array",
21017
+ "items": {
21018
+ "$ref": "#/components/schemas/BazaarBargainSales"
21019
+ }
21020
+ },
21021
+ "dollar_sale": {
21022
+ "type": "array",
21023
+ "items": {
21024
+ "$ref": "#/components/schemas/BazaarDollarSales"
21025
+ }
21026
+ }
21027
+ },
21028
+ "type": "object"
21029
+ },
21030
+ "BazaarSpecialized": {
21031
+ "required": [
21032
+ "specialized"
21033
+ ],
21034
+ "properties": {
21035
+ "specialized": {
21036
+ "type": "array",
21037
+ "items": {
21038
+ "$ref": "#/components/schemas/BazaarWeeklyCustomers"
21039
+ }
21040
+ }
21041
+ },
21042
+ "type": "object"
21043
+ },
21044
+ "BazaarResponse": {
21045
+ "required": [
21046
+ "bazaar"
21047
+ ],
21048
+ "properties": {
21049
+ "bazaar": {
21050
+ "description": "If there's a specific item ID passed or a category chosen, the response will be of type 'BazaarSpecialized', otherwise it will be 'BazaarWeekly'.",
21051
+ "oneOf": [
21052
+ {
21053
+ "$ref": "#/components/schemas/BazaarWeekly"
21054
+ },
21055
+ {
21056
+ "$ref": "#/components/schemas/BazaarSpecialized"
21057
+ }
21058
+ ]
21059
+ }
21060
+ },
21061
+ "type": "object"
21062
+ },
21063
+ "BazaarResponseSpecialized": {
21064
+ "required": [
21065
+ "bazaar"
21066
+ ],
21067
+ "properties": {
21068
+ "bazaar": {
21069
+ "$ref": "#/components/schemas/BazaarSpecialized"
21070
+ }
21071
+ },
21072
+ "type": "object"
21073
+ },
21074
+ "Bazaar": {
21075
+ "required": [
21076
+ "id",
21077
+ "name",
21078
+ "is_open"
21079
+ ],
21080
+ "properties": {
21081
+ "id": {
21082
+ "$ref": "#/components/schemas/UserId"
21083
+ },
21084
+ "name": {
21085
+ "type": "string"
21086
+ },
21087
+ "is_open": {
21088
+ "type": "boolean"
21089
+ }
21090
+ },
21091
+ "type": "object"
21092
+ },
21093
+ "BazaarWeeklyCustomers": {
21094
+ "allOf": [
21095
+ {
21096
+ "$ref": "#/components/schemas/Bazaar"
21097
+ },
21098
+ {
21099
+ "required": [
21100
+ "weekly_customers"
21101
+ ],
21102
+ "properties": {
21103
+ "weekly_customers": {
21104
+ "type": "integer",
21105
+ "format": "int32"
21106
+ }
21107
+ },
21108
+ "type": "object"
21109
+ }
21110
+ ]
21111
+ },
21112
+ "BazaarTotalFavorites": {
21113
+ "allOf": [
21114
+ {
21115
+ "$ref": "#/components/schemas/Bazaar"
21116
+ },
21117
+ {
21118
+ "required": [
21119
+ "total_favorites"
21120
+ ],
21121
+ "properties": {
21122
+ "total_favorites": {
21123
+ "type": "integer",
21124
+ "format": "int32"
21125
+ }
21126
+ },
21127
+ "type": "object"
21128
+ }
21129
+ ]
21130
+ },
21131
+ "BazaarRecentFavorites": {
21132
+ "allOf": [
21133
+ {
21134
+ "$ref": "#/components/schemas/Bazaar"
21135
+ },
21136
+ {
21137
+ "required": [
21138
+ "recent_favorites"
21139
+ ],
21140
+ "properties": {
21141
+ "recent_favorites": {
21142
+ "type": "integer",
21143
+ "format": "int32"
21144
+ }
21145
+ },
21146
+ "type": "object"
21147
+ }
21148
+ ]
21149
+ },
21150
+ "BazaarWeeklyIncome": {
21151
+ "allOf": [
21152
+ {
21153
+ "$ref": "#/components/schemas/Bazaar"
21154
+ },
21155
+ {
21156
+ "required": [
21157
+ "weekly_income"
21158
+ ],
21159
+ "properties": {
21160
+ "weekly_income": {
21161
+ "type": "integer",
21162
+ "format": "int64"
21163
+ }
21164
+ },
21165
+ "type": "object"
21166
+ }
21167
+ ]
21168
+ },
21169
+ "BazaarBulkSales": {
21170
+ "allOf": [
21171
+ {
21172
+ "$ref": "#/components/schemas/Bazaar"
21173
+ },
21174
+ {
21175
+ "required": [
21176
+ "bulk_sales"
21177
+ ],
21178
+ "properties": {
21179
+ "bulk_sales": {
21180
+ "type": "integer",
21181
+ "format": "int32"
21182
+ }
21183
+ },
21184
+ "type": "object"
21185
+ }
21186
+ ]
21187
+ },
21188
+ "BazaarAdvancedItemSales": {
21189
+ "allOf": [
21190
+ {
21191
+ "$ref": "#/components/schemas/Bazaar"
21192
+ },
21193
+ {
21194
+ "required": [
21195
+ "advanced_item_sales"
21196
+ ],
21197
+ "properties": {
21198
+ "advanced_item_sales": {
21199
+ "type": "integer",
21200
+ "format": "int32"
21201
+ }
21202
+ },
21203
+ "type": "object"
21204
+ }
21205
+ ]
21206
+ },
21207
+ "BazaarBargainSales": {
21208
+ "allOf": [
21209
+ {
21210
+ "$ref": "#/components/schemas/Bazaar"
21211
+ },
21212
+ {
21213
+ "required": [
21214
+ "bargain_sales"
21215
+ ],
21216
+ "properties": {
21217
+ "bargain_sales": {
21218
+ "type": "integer",
21219
+ "format": "int32"
21220
+ }
21221
+ },
21222
+ "type": "object"
21223
+ }
21224
+ ]
21225
+ },
21226
+ "BazaarDollarSales": {
21227
+ "allOf": [
21228
+ {
21229
+ "$ref": "#/components/schemas/Bazaar"
21230
+ },
21231
+ {
21232
+ "required": [
21233
+ "dollar_sales"
21234
+ ],
21235
+ "properties": {
21236
+ "dollar_sales": {
21237
+ "type": "integer",
21238
+ "format": "int32"
21239
+ }
21240
+ },
21241
+ "type": "object"
21242
+ }
21243
+ ]
21244
+ },
20827
21245
  "ItemMarketListingItemBonus": {
20828
21246
  "required": [
20829
21247
  "id",
@@ -21049,11 +21467,11 @@
21049
21467
  "description": "The following selections will fallback to API v1 and may change at any time: 'pointsmarket'.",
21050
21468
  "type": "string",
21051
21469
  "enum": [
21470
+ "bazaar",
21052
21471
  "itemmarket",
21053
21472
  "lookup",
21054
21473
  "timestamp",
21055
- "pointsmarket",
21056
- "bazaar"
21474
+ "pointsmarket"
21057
21475
  ]
21058
21476
  },
21059
21477
  {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "0.2.9",
4
+ "version": "1.10.0",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },
8
8
  "devDependencies": {
9
- "@scalar/openapi-types": "^0.3.1",
10
- "@types/node": "^22.15.29",
9
+ "@scalar/openapi-types": "^0.3.2",
10
+ "@types/node": "^22.15.31",
11
11
  "prettier": "^3.5.3",
12
12
  "typeconv": "^2.3.1",
13
13
  "typescript": "^5.8.3"
@@ -17,4 +17,4 @@
17
17
  "./dist/index.d.ts",
18
18
  "./dist/openapi.json"
19
19
  ]
20
- }
20
+ }