tornapi-typescript 0.0.3 → 0.0.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/LICENSE CHANGED
@@ -1,24 +1,24 @@
1
- This is free and unencumbered software released into the public domain.
2
-
3
- Anyone is free to copy, modify, publish, use, compile, sell, or
4
- distribute this software, either in source code form or as a compiled
5
- binary, for any purpose, commercial or non-commercial, and by any
6
- means.
7
-
8
- In jurisdictions that recognize copyright laws, the author or authors
9
- of this software dedicate any and all copyright interest in the
10
- software to the public domain. We make this dedication for the benefit
11
- of the public at large and to the detriment of our heirs and
12
- successors. We intend this dedication to be an overt act of
13
- relinquishment in perpetuity of all present and future rights to this
14
- software under copyright law.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- For more information, please refer to <https://unlicense.org>
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <https://unlicense.org>
package/README.md CHANGED
@@ -1,30 +1,30 @@
1
- # TornAPI Typescript
2
-
3
- [![NPM Version](https://img.shields.io/npm/v/tornapi-typescript)](https://www.npmjs.com/package/tornapi-typescript)
4
- [![NPM Downloads](https://img.shields.io/npm/d18m/tornapi-typescript)](https://www.npmjs.com/package/tornapi-typescript)
5
-
6
- Automatically generated type definition in Typescript for [torn.com](https://torn.com) API V2.
7
-
8
- ## Installation
9
-
10
- `npm i -D tornapi-typescript`
11
-
12
- ## Generation
13
-
14
- These types are generated in the following way:
15
-
16
- * load [openapi specification](https://www.torn.com/swagger/openapi.json)
17
- * clean the specification for better types
18
- * remove `type` when `allOf` is present, otherwise the specification is not valid
19
- * remove `type` when `oneOf` is present, for improved types
20
- * mark all fields as required, for improved types
21
- * convert the specification to Typescript definitions using [typeconv](https://github.com/grantila/typeconv)
22
- * clean the type definitions
23
- * remove all "[key: string]: any;", because typeconv adds it everywhere for some reason
24
- * remove all empty objects (caused by the above cleaning)
25
- * run through prettier to have it look decent
26
-
27
- ## Contact
28
-
29
- You can join the community in [our Discord server](https://discord.gg/2wb7GKN). There you can discuss anything related
30
- to the Torn API, or other tools related to Torn. Issues can also be reported there, or as GitHub issue.
1
+ # TornAPI Typescript
2
+
3
+ [![NPM Version](https://img.shields.io/npm/v/tornapi-typescript)](https://www.npmjs.com/package/tornapi-typescript)
4
+ [![NPM Downloads](https://img.shields.io/npm/d18m/tornapi-typescript)](https://www.npmjs.com/package/tornapi-typescript)
5
+
6
+ Automatically generated type definition in Typescript for [torn.com](https://torn.com) API V2.
7
+
8
+ ## Installation
9
+
10
+ `npm i -D tornapi-typescript`
11
+
12
+ ## Generation
13
+
14
+ These types are generated in the following way:
15
+
16
+ * load [openapi specification](https://www.torn.com/swagger/openapi.json)
17
+ * clean the specification for better types
18
+ * remove `type` when `allOf` is present, otherwise the specification is not valid
19
+ * remove `type` when `oneOf` is present, for improved types
20
+ * mark all fields as required, for improved types
21
+ * convert the specification to Typescript definitions using [typeconv](https://github.com/grantila/typeconv)
22
+ * clean the type definitions
23
+ * remove all "[key: string]: any;", because typeconv adds it everywhere for some reason
24
+ * remove all empty objects (caused by the above cleaning)
25
+ * run through prettier to have it look decent
26
+
27
+ ## Contact
28
+
29
+ You can join the community in [our Discord server](https://discord.gg/2wb7GKN). There you can discuss anything related
30
+ to the Torn API, or other tools related to Torn. Issues can also be reported there, or as GitHub issue.
package/dist/index.d.ts CHANGED
@@ -956,7 +956,9 @@ export interface FactionCrimeSlot {
956
956
  } | null;
957
957
  user_id: UserId;
958
958
  user: FactionCrimeUser | null;
959
+ /** This field is replaced with 'crime_pass_rate' field and will be removed on 1st of May 2025. */
959
960
  success_chance: number;
961
+ crime_pass_rate: number;
960
962
  }
961
963
 
962
964
  export interface FactionCrime {
@@ -966,9 +968,6 @@ export interface FactionCrime {
966
968
  status: FactionCrimeStatusEnum;
967
969
  /** The timestamp at which the crime was created. */
968
970
  created_at: number;
969
- initiated_at: /** Replaced by the 'planning_at' field (same value). This field will be removed in the future (1st Februrary 2025 or later). */
970
- | number /** Replaced by the 'planning_at' field (same value). This field will be removed in the future (1st Februrary 2025 or later). */
971
- | null;
972
971
  planning_at: /** The timestamp at which the planning phase for the crime has begun. */
973
972
  | number /** The timestamp at which the planning phase for the crime has begun. */
974
973
  | null;
@@ -988,6 +987,10 @@ export interface FactionCrimesResponse {
988
987
  _metadata: RequestMetadataWithLinks;
989
988
  }
990
989
 
990
+ export interface FactionCrimeResponse {
991
+ crime: FactionCrime;
992
+ }
993
+
991
994
  /** The following selections will fallback to API v1 and may change at any time: 'armor', 'boosters', 'caches', 'cesium', 'contributors', 'crimeexp', 'currency', 'donations', 'drugs', 'medical', 'positions', 'reports', 'stats', 'temporary', 'upgrades', 'weapons'. */
992
995
  export type FactionSelectionName =
993
996
  | "applications"
@@ -997,6 +1000,7 @@ export type FactionSelectionName =
997
1000
  | "chain"
998
1001
  | "chainreport"
999
1002
  | "chains"
1003
+ | "crime"
1000
1004
  | "crimes"
1001
1005
  | "hof"
1002
1006
  | "lookup"
@@ -1218,12 +1222,14 @@ export interface ItemMarketListingItemBonus {
1218
1222
  id: number;
1219
1223
  title: string;
1220
1224
  description: string;
1225
+ value: number;
1221
1226
  }
1222
1227
 
1223
1228
  export interface ItemMarketListingItemStats {
1224
1229
  damage: number | null;
1225
1230
  accuracy: number | null;
1226
1231
  armor: number | null;
1232
+ quality: number;
1227
1233
  }
1228
1234
 
1229
1235
  export interface ItemMarketItem {
@@ -1234,7 +1240,6 @@ export interface ItemMarketItem {
1234
1240
  }
1235
1241
 
1236
1242
  export interface ItemMarketListingStackable {
1237
- id: number;
1238
1243
  price: number;
1239
1244
  amount: number;
1240
1245
  }
@@ -1247,7 +1252,6 @@ export interface ItemMarketListingItemDetails {
1247
1252
  }
1248
1253
 
1249
1254
  export interface ItemMarketListingNonstackable {
1250
- id: number;
1251
1255
  price: number;
1252
1256
  amount: number;
1253
1257
  itemDetails: ItemMarketListingItemDetails;
package/dist/openapi.json CHANGED
@@ -799,7 +799,7 @@
799
799
  "get": {
800
800
  "tags": [
801
801
  "User",
802
- "Unstable"
802
+ "Stable"
803
803
  ],
804
804
  "summary": "Get your current ongoing organized crime",
805
805
  "description": "Requires minimal access key. <br>",
@@ -1740,7 +1740,7 @@
1740
1740
  "get": {
1741
1741
  "tags": [
1742
1742
  "Faction",
1743
- "Unstable"
1743
+ "Stable"
1744
1744
  ],
1745
1745
  "summary": "Get your faction's organized crimes",
1746
1746
  "description": "Requires public minimal access key with faction API access permissions. <br> It's possible to get older entries either by timestamp range (from, to) or with offset.",
@@ -1818,6 +1818,44 @@
1818
1818
  ]
1819
1819
  }
1820
1820
  },
1821
+ "/faction/{id}/crime": {
1822
+ "get": {
1823
+ "tags": [
1824
+ "Faction",
1825
+ "Stable"
1826
+ ],
1827
+ "summary": "Get a specific organized crime",
1828
+ "description": "Requires public minimal access key with faction API access permissions. <br>",
1829
+ "parameters": [
1830
+ {
1831
+ "name": "id",
1832
+ "in": "path",
1833
+ "description": "Crime id",
1834
+ "required": true,
1835
+ "schema": {
1836
+ "$ref": "#/components/schemas/ItemId"
1837
+ }
1838
+ }
1839
+ ],
1840
+ "responses": {
1841
+ "200": {
1842
+ "description": "Successful operation",
1843
+ "content": {
1844
+ "application/json": {
1845
+ "schema": {
1846
+ "$ref": "#/components/schemas/FactionCrimeResponse"
1847
+ }
1848
+ }
1849
+ }
1850
+ }
1851
+ },
1852
+ "security": [
1853
+ {
1854
+ "api_key": []
1855
+ }
1856
+ ]
1857
+ }
1858
+ },
1821
1859
  "/faction/hof": {
1822
1860
  "get": {
1823
1861
  "tags": [
@@ -2463,6 +2501,9 @@
2463
2501
  {
2464
2502
  "$ref": "#/components/schemas/FactionCrimesResponse"
2465
2503
  },
2504
+ {
2505
+ "$ref": "#/components/schemas/FactionCrimeResponse"
2506
+ },
2466
2507
  {
2467
2508
  "$ref": "#/components/schemas/FactionRankedWarReportResponse"
2468
2509
  },
@@ -6554,6 +6595,11 @@
6554
6595
  ]
6555
6596
  },
6556
6597
  "success_chance": {
6598
+ "description": "This field is replaced with 'crime_pass_rate' field and will be removed on 1st of May 2025.",
6599
+ "type": "integer",
6600
+ "deprecated": true
6601
+ },
6602
+ "crime_pass_rate": {
6557
6603
  "type": "integer"
6558
6604
  }
6559
6605
  },
@@ -6563,7 +6609,8 @@
6563
6609
  "item_requirement",
6564
6610
  "user_id",
6565
6611
  "user",
6566
- "success_chance"
6612
+ "success_chance",
6613
+ "crime_pass_rate"
6567
6614
  ]
6568
6615
  },
6569
6616
  "FactionCrime": {
@@ -6584,12 +6631,6 @@
6584
6631
  "description": "The timestamp at which the crime was created.",
6585
6632
  "type": "integer"
6586
6633
  },
6587
- "initiated_at": {
6588
- "description": "Replaced by the 'planning_at' field (same value). This field will be removed in the future (1st Februrary 2025 or later).",
6589
- "type": "integer",
6590
- "nullable": true,
6591
- "deprecated": true
6592
- },
6593
6634
  "planning_at": {
6594
6635
  "description": "The timestamp at which the planning phase for the crime has begun.",
6595
6636
  "type": "integer",
@@ -6635,7 +6676,6 @@
6635
6676
  "difficulty",
6636
6677
  "status",
6637
6678
  "created_at",
6638
- "initiated_at",
6639
6679
  "planning_at",
6640
6680
  "ready_at",
6641
6681
  "expired_at",
@@ -6662,6 +6702,17 @@
6662
6702
  "_metadata"
6663
6703
  ]
6664
6704
  },
6705
+ "FactionCrimeResponse": {
6706
+ "properties": {
6707
+ "crime": {
6708
+ "$ref": "#/components/schemas/FactionCrime"
6709
+ }
6710
+ },
6711
+ "type": "object",
6712
+ "required": [
6713
+ "crime"
6714
+ ]
6715
+ },
6665
6716
  "FactionSelectionName": {
6666
6717
  "description": "The following selections will fallback to API v1 and may change at any time: 'armor', 'boosters', 'caches', 'cesium', 'contributors', 'crimeexp', 'currency', 'donations', 'drugs', 'medical', 'positions', 'reports', 'stats', 'temporary', 'upgrades', 'weapons'.",
6667
6718
  "type": "string",
@@ -6673,6 +6724,7 @@
6673
6724
  "chain",
6674
6725
  "chainreport",
6675
6726
  "chains",
6727
+ "crime",
6676
6728
  "crimes",
6677
6729
  "hof",
6678
6730
  "lookup",
@@ -7327,13 +7379,17 @@
7327
7379
  },
7328
7380
  "description": {
7329
7381
  "type": "string"
7382
+ },
7383
+ "value": {
7384
+ "type": "integer"
7330
7385
  }
7331
7386
  },
7332
7387
  "type": "object",
7333
7388
  "required": [
7334
7389
  "id",
7335
7390
  "title",
7336
- "description"
7391
+ "description",
7392
+ "value"
7337
7393
  ]
7338
7394
  },
7339
7395
  "ItemMarketListingItemStats": {
@@ -7352,13 +7408,18 @@
7352
7408
  "type": "number",
7353
7409
  "format": "float",
7354
7410
  "nullable": true
7411
+ },
7412
+ "quality": {
7413
+ "type": "number",
7414
+ "format": "float"
7355
7415
  }
7356
7416
  },
7357
7417
  "type": "object",
7358
7418
  "required": [
7359
7419
  "damage",
7360
7420
  "accuracy",
7361
- "armor"
7421
+ "armor",
7422
+ "quality"
7362
7423
  ]
7363
7424
  },
7364
7425
  "ItemMarketItem": {
@@ -7386,9 +7447,6 @@
7386
7447
  },
7387
7448
  "ItemMarketListingStackable": {
7388
7449
  "properties": {
7389
- "id": {
7390
- "type": "integer"
7391
- },
7392
7450
  "price": {
7393
7451
  "type": "integer"
7394
7452
  },
@@ -7398,7 +7456,6 @@
7398
7456
  },
7399
7457
  "type": "object",
7400
7458
  "required": [
7401
- "id",
7402
7459
  "price",
7403
7460
  "amount"
7404
7461
  ]
@@ -7437,9 +7494,6 @@
7437
7494
  },
7438
7495
  "ItemMarketListingNonstackable": {
7439
7496
  "properties": {
7440
- "id": {
7441
- "type": "integer"
7442
- },
7443
7497
  "price": {
7444
7498
  "type": "integer"
7445
7499
  },
@@ -7452,7 +7506,6 @@
7452
7506
  },
7453
7507
  "type": "object",
7454
7508
  "required": [
7455
- "id",
7456
7509
  "price",
7457
7510
  "amount",
7458
7511
  "itemDetails"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tornapi-typescript",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "scripts": {
6
6
  "generate-types": "tsc && node build/index.js"
7
7
  },