tornapi-typescript 0.1.3 → 0.1.4

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
@@ -4511,6 +4511,8 @@ export type LogCategoryId = number;
4511
4511
 
4512
4512
  export type FactionId = number;
4513
4513
 
4514
+ export type EducationId = number;
4515
+
4514
4516
  export type FactionBranchId = number;
4515
4517
 
4516
4518
  export type FactionCrimeId = number;
@@ -5410,11 +5412,16 @@ export type FactionSelectionName =
5410
5412
  | "lookup"
5411
5413
  | "members"
5412
5414
  | "news"
5415
+ | "rackets"
5413
5416
  | "rankedwars"
5414
5417
  | "rankedwarreport"
5415
5418
  | "revives"
5416
5419
  | "revivesfull"
5417
5420
  | "stats"
5421
+ | "territory"
5422
+ | "territoryownership"
5423
+ | "territorywarreport"
5424
+ | "territorywars"
5418
5425
  | "timestamp"
5419
5426
  | "upgrades"
5420
5427
  | "wars"
@@ -5428,7 +5435,6 @@ export type FactionSelectionName =
5428
5435
  | "positions"
5429
5436
  | "reports"
5430
5437
  | "temporary"
5431
- | "territory"
5432
5438
  | "weapons";
5433
5439
 
5434
5440
  export interface FactionLookupResponse {
@@ -5806,6 +5812,41 @@ export interface RacingLookupResponse {
5806
5812
  selections: RacingSelectionName[];
5807
5813
  }
5808
5814
 
5815
+ export interface TornEducationRewards {
5816
+ working_stats: {
5817
+ manual_labor: number | null;
5818
+ intelligence: number | null;
5819
+ endurance: number | null;
5820
+ };
5821
+ effect: string | null;
5822
+ honor: string | null;
5823
+ }
5824
+
5825
+ export interface TornEducationPrerequisites {
5826
+ cost: number;
5827
+ courses: number[];
5828
+ }
5829
+
5830
+ export interface TornEducationCourses {
5831
+ id: EducationId;
5832
+ code: string;
5833
+ name: string;
5834
+ description: string;
5835
+ duration: number;
5836
+ rewards: TornEducationRewards;
5837
+ prerequisites: TornEducationPrerequisites;
5838
+ }
5839
+
5840
+ export interface TornEducation {
5841
+ id: number;
5842
+ name: string;
5843
+ courses: TornEducationCourses[];
5844
+ }
5845
+
5846
+ export interface TornEducationResponse {
5847
+ education: TornEducation[];
5848
+ }
5849
+
5809
5850
  export interface TornTerritoryCoordinates {
5810
5851
  x: number;
5811
5852
  y: number;
@@ -6099,12 +6140,13 @@ export interface TornFactionTreeResponse {
6099
6140
  factionTree: TornFactionTree;
6100
6141
  }
6101
6142
 
6102
- /** The following selections will fallback to API v1 and may change at any time: 'bank','cards','cityshops','companies','competition','dirtybombs','education','gyms','honors','itemdetails','itemstats','medals','organisedcrimes','pawnshop','pokertables','properties','rackets','raidreport','raids','rockpaperscissors','searchforcash','shoplifting','stats','stocks'. */
6143
+ /** The following selections will fallback to API v1 and may change at any time: 'bank','cards','cityshops','companies','competition','dirtybombs','gyms','honors','itemdetails','itemstats','medals','organisedcrimes','pawnshop','pokertables','properties','raidreport','raids','rockpaperscissors','searchforcash','shoplifting','stats','stocks'. */
6103
6144
  export type TornSelectionName =
6104
6145
  | "attacklog"
6105
6146
  | "bounties"
6106
6147
  | "calendar"
6107
6148
  | "crimes"
6149
+ | "education"
6108
6150
  | "factionHof"
6109
6151
  | "factiontree"
6110
6152
  | "hof"
@@ -6123,7 +6165,6 @@ export type TornSelectionName =
6123
6165
  | "companies"
6124
6166
  | "competition"
6125
6167
  | "dirtybombs"
6126
- | "education"
6127
6168
  | "gyms"
6128
6169
  | "honors"
6129
6170
  | "itemdetails"
@@ -6133,11 +6174,8 @@ export type TornSelectionName =
6133
6174
  | "pawnshop"
6134
6175
  | "pokertables"
6135
6176
  | "properties"
6136
- | "rackets"
6137
6177
  | "raidreport"
6138
6178
  | "raids"
6139
- | "rankedwarreport"
6140
- | "rankedwars"
6141
6179
  | "rockpaperscissors"
6142
6180
  | "searchforcash"
6143
6181
  | "shoplifting"
@@ -7059,6 +7097,20 @@ export type PersonalStatsStatName =
7059
7097
  | "forgeryskill"
7060
7098
  | "scammingskill";
7061
7099
 
7100
+ export interface UserCurrentEducation {
7101
+ id: EducationId;
7102
+ until: number;
7103
+ }
7104
+
7105
+ export interface UserEducation {
7106
+ complete: EducationId[];
7107
+ current: UserCurrentEducation | null;
7108
+ }
7109
+
7110
+ export interface UserEducationResponse {
7111
+ education: UserEducation;
7112
+ }
7113
+
7062
7114
  export interface UserCrimeDetailsBootlegging {
7063
7115
  /** Online store statistics. */
7064
7116
  online_store: {
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.2.0"
6
+ "version": "1.3.0"
7
7
  },
8
8
  "servers": [
9
9
  {
@@ -224,6 +224,33 @@
224
224
  "x-stability": "Stable"
225
225
  }
226
226
  },
227
+ "/user/education": {
228
+ "get": {
229
+ "tags": [
230
+ "User"
231
+ ],
232
+ "summary": "Get your education information",
233
+ "description": "The response contains a list of complete eduactions and of a current education (if any).",
234
+ "responses": {
235
+ "200": {
236
+ "description": "Successful operation",
237
+ "content": {
238
+ "application/json": {
239
+ "schema": {
240
+ "$ref": "#/components/schemas/UserEducationResponse"
241
+ }
242
+ }
243
+ }
244
+ }
245
+ },
246
+ "security": [
247
+ {
248
+ "api_key": []
249
+ }
250
+ ],
251
+ "x-stability": "Unstable"
252
+ }
253
+ },
227
254
  "/user/enlistedcars": {
228
255
  "get": {
229
256
  "tags": [
@@ -1180,6 +1207,9 @@
1180
1207
  {
1181
1208
  "$ref": "#/components/schemas/UserCalendarResponse"
1182
1209
  },
1210
+ {
1211
+ "$ref": "#/components/schemas/UserEducationResponse"
1212
+ },
1183
1213
  {
1184
1214
  "$ref": "#/components/schemas/UserBountiesResponse"
1185
1215
  },
@@ -3865,6 +3895,33 @@
3865
3895
  "x-stability": "Stable"
3866
3896
  }
3867
3897
  },
3898
+ "/torn/education": {
3899
+ "get": {
3900
+ "tags": [
3901
+ "Torn"
3902
+ ],
3903
+ "summary": "Get education information",
3904
+ "description": "Requires public access key.<br>",
3905
+ "responses": {
3906
+ "200": {
3907
+ "description": "Successful operation",
3908
+ "content": {
3909
+ "application/json": {
3910
+ "schema": {
3911
+ "$ref": "#/components/schemas/TornEducationResponse"
3912
+ }
3913
+ }
3914
+ }
3915
+ }
3916
+ },
3917
+ "security": [
3918
+ {
3919
+ "api_key": []
3920
+ }
3921
+ ],
3922
+ "x-stability": "Unstable"
3923
+ }
3924
+ },
3868
3925
  "/torn/factionhof": {
3869
3926
  "get": {
3870
3927
  "tags": [
@@ -4283,7 +4340,7 @@
4283
4340
  "x-stability": "Unstable"
4284
4341
  }
4285
4342
  },
4286
- "/torn/{territoryIds}/territories": {
4343
+ "/torn/{territoryIds}/territory": {
4287
4344
  "get": {
4288
4345
  "tags": [
4289
4346
  "Torn"
@@ -4486,6 +4543,9 @@
4486
4543
  {
4487
4544
  "$ref": "#/components/schemas/TornLogCategoriesResponse"
4488
4545
  },
4546
+ {
4547
+ "$ref": "#/components/schemas/TornEducationResponse"
4548
+ },
4489
4549
  {
4490
4550
  "$ref": "#/components/schemas/TornBountiesResponse"
4491
4551
  },
@@ -9176,6 +9236,10 @@
9176
9236
  "type": "integer",
9177
9237
  "format": "int32"
9178
9238
  },
9239
+ "EducationId": {
9240
+ "type": "integer",
9241
+ "format": "int32"
9242
+ },
9179
9243
  "FactionBranchId": {
9180
9244
  "type": "integer",
9181
9245
  "format": "int32"
@@ -12263,11 +12327,16 @@
12263
12327
  "lookup",
12264
12328
  "members",
12265
12329
  "news",
12330
+ "rackets",
12266
12331
  "rankedwars",
12267
12332
  "rankedwarreport",
12268
12333
  "revives",
12269
12334
  "revivesfull",
12270
12335
  "stats",
12336
+ "territory",
12337
+ "territoryownership",
12338
+ "territorywarreport",
12339
+ "territorywars",
12271
12340
  "timestamp",
12272
12341
  "upgrades",
12273
12342
  "wars",
@@ -12281,7 +12350,6 @@
12281
12350
  "positions",
12282
12351
  "reports",
12283
12352
  "temporary",
12284
- "territory",
12285
12353
  "weapons"
12286
12354
  ]
12287
12355
  },
@@ -13811,6 +13879,172 @@
13811
13879
  },
13812
13880
  "type": "object"
13813
13881
  },
13882
+ "TornEducationRewards": {
13883
+ "required": [
13884
+ "working_stats",
13885
+ "effect",
13886
+ "honor"
13887
+ ],
13888
+ "properties": {
13889
+ "working_stats": {
13890
+ "required": [
13891
+ "manual_labor",
13892
+ "intelligence",
13893
+ "endurance"
13894
+ ],
13895
+ "properties": {
13896
+ "manual_labor": {
13897
+ "oneOf": [
13898
+ {
13899
+ "type": "integer",
13900
+ "format": "int32"
13901
+ },
13902
+ {
13903
+ "type": "null"
13904
+ }
13905
+ ]
13906
+ },
13907
+ "intelligence": {
13908
+ "oneOf": [
13909
+ {
13910
+ "type": "integer",
13911
+ "format": "int32"
13912
+ },
13913
+ {
13914
+ "type": "null"
13915
+ }
13916
+ ]
13917
+ },
13918
+ "endurance": {
13919
+ "oneOf": [
13920
+ {
13921
+ "type": "integer",
13922
+ "format": "int32"
13923
+ },
13924
+ {
13925
+ "type": "null"
13926
+ }
13927
+ ]
13928
+ }
13929
+ },
13930
+ "type": "object"
13931
+ },
13932
+ "effect": {
13933
+ "oneOf": [
13934
+ {
13935
+ "type": "string"
13936
+ },
13937
+ {
13938
+ "type": "null"
13939
+ }
13940
+ ]
13941
+ },
13942
+ "honor": {
13943
+ "oneOf": [
13944
+ {
13945
+ "type": "string"
13946
+ },
13947
+ {
13948
+ "type": "null"
13949
+ }
13950
+ ]
13951
+ }
13952
+ },
13953
+ "type": "object"
13954
+ },
13955
+ "TornEducationPrerequisites": {
13956
+ "required": [
13957
+ "cost",
13958
+ "courses"
13959
+ ],
13960
+ "properties": {
13961
+ "cost": {
13962
+ "type": "integer",
13963
+ "format": "int32"
13964
+ },
13965
+ "courses": {
13966
+ "type": "array",
13967
+ "items": {
13968
+ "type": "integer",
13969
+ "format": "int32"
13970
+ }
13971
+ }
13972
+ },
13973
+ "type": "object"
13974
+ },
13975
+ "TornEducationCourses": {
13976
+ "required": [
13977
+ "id",
13978
+ "code",
13979
+ "name",
13980
+ "description",
13981
+ "duration",
13982
+ "rewards",
13983
+ "prerequisites"
13984
+ ],
13985
+ "properties": {
13986
+ "id": {
13987
+ "$ref": "#/components/schemas/EducationId"
13988
+ },
13989
+ "code": {
13990
+ "type": "string"
13991
+ },
13992
+ "name": {
13993
+ "type": "string"
13994
+ },
13995
+ "description": {
13996
+ "type": "string"
13997
+ },
13998
+ "duration": {
13999
+ "type": "integer",
14000
+ "format": "int32"
14001
+ },
14002
+ "rewards": {
14003
+ "$ref": "#/components/schemas/TornEducationRewards"
14004
+ },
14005
+ "prerequisites": {
14006
+ "$ref": "#/components/schemas/TornEducationPrerequisites"
14007
+ }
14008
+ },
14009
+ "type": "object"
14010
+ },
14011
+ "TornEducation": {
14012
+ "required": [
14013
+ "id",
14014
+ "name",
14015
+ "courses"
14016
+ ],
14017
+ "properties": {
14018
+ "id": {
14019
+ "type": "integer",
14020
+ "format": "int32"
14021
+ },
14022
+ "name": {
14023
+ "type": "string"
14024
+ },
14025
+ "courses": {
14026
+ "type": "array",
14027
+ "items": {
14028
+ "$ref": "#/components/schemas/TornEducationCourses"
14029
+ }
14030
+ }
14031
+ },
14032
+ "type": "object"
14033
+ },
14034
+ "TornEducationResponse": {
14035
+ "required": [
14036
+ "education"
14037
+ ],
14038
+ "properties": {
14039
+ "education": {
14040
+ "type": "array",
14041
+ "items": {
14042
+ "$ref": "#/components/schemas/TornEducation"
14043
+ }
14044
+ }
14045
+ },
14046
+ "type": "object"
14047
+ },
13814
14048
  "TornTerritoryCoordinates": {
13815
14049
  "required": [
13816
14050
  "x",
@@ -15044,13 +15278,14 @@
15044
15278
  "type": "object"
15045
15279
  },
15046
15280
  "TornSelectionName": {
15047
- "description": "The following selections will fallback to API v1 and may change at any time: 'bank','cards','cityshops','companies','competition','dirtybombs','education','gyms','honors','itemdetails','itemstats','medals','organisedcrimes','pawnshop','pokertables','properties','rackets','raidreport','raids','rockpaperscissors','searchforcash','shoplifting','stats','stocks'.",
15281
+ "description": "The following selections will fallback to API v1 and may change at any time: 'bank','cards','cityshops','companies','competition','dirtybombs','gyms','honors','itemdetails','itemstats','medals','organisedcrimes','pawnshop','pokertables','properties','raidreport','raids','rockpaperscissors','searchforcash','shoplifting','stats','stocks'.",
15048
15282
  "type": "string",
15049
15283
  "enum": [
15050
15284
  "attacklog",
15051
15285
  "bounties",
15052
15286
  "calendar",
15053
15287
  "crimes",
15288
+ "education",
15054
15289
  "factionHof",
15055
15290
  "factiontree",
15056
15291
  "hof",
@@ -15069,7 +15304,6 @@
15069
15304
  "companies",
15070
15305
  "competition",
15071
15306
  "dirtybombs",
15072
- "education",
15073
15307
  "gyms",
15074
15308
  "honors",
15075
15309
  "itemdetails",
@@ -15079,11 +15313,8 @@
15079
15313
  "pawnshop",
15080
15314
  "pokertables",
15081
15315
  "properties",
15082
- "rackets",
15083
15316
  "raidreport",
15084
15317
  "raids",
15085
- "rankedwarreport",
15086
- "rankedwars",
15087
15318
  "rockpaperscissors",
15088
15319
  "searchforcash",
15089
15320
  "shoplifting",
@@ -18113,6 +18344,58 @@
18113
18344
  "scammingskill"
18114
18345
  ]
18115
18346
  },
18347
+ "UserCurrentEducation": {
18348
+ "required": [
18349
+ "id",
18350
+ "until"
18351
+ ],
18352
+ "properties": {
18353
+ "id": {
18354
+ "$ref": "#/components/schemas/EducationId"
18355
+ },
18356
+ "until": {
18357
+ "type": "integer",
18358
+ "format": "int32"
18359
+ }
18360
+ },
18361
+ "type": "object"
18362
+ },
18363
+ "UserEducation": {
18364
+ "required": [
18365
+ "complete",
18366
+ "current"
18367
+ ],
18368
+ "properties": {
18369
+ "complete": {
18370
+ "type": "array",
18371
+ "items": {
18372
+ "$ref": "#/components/schemas/EducationId"
18373
+ }
18374
+ },
18375
+ "current": {
18376
+ "oneOf": [
18377
+ {
18378
+ "$ref": "#/components/schemas/UserCurrentEducation"
18379
+ },
18380
+ {
18381
+ "type": "null"
18382
+ }
18383
+ ]
18384
+ }
18385
+ },
18386
+ "type": "object"
18387
+ },
18388
+ "UserEducationResponse": {
18389
+ "required": [
18390
+ "education"
18391
+ ],
18392
+ "properties": {
18393
+ "education": {
18394
+ "$ref": "#/components/schemas/UserEducation"
18395
+ }
18396
+ },
18397
+ "type": "object"
18398
+ },
18116
18399
  "UserCrimeDetailsBootlegging": {
18117
18400
  "required": [
18118
18401
  "online_store",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },