tornapi-typescript 2.0.0 → 2.0.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/README.md +23 -5
- package/dist/index.d.ts +3885 -5448
- package/dist/index.js +138 -0
- package/dist/index.ts +12174 -0
- package/dist/openapi.json +53 -45
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/tornapi-typescript)
|
|
4
4
|
[](https://www.npmjs.com/package/tornapi-typescript)
|
|
5
5
|
|
|
6
|
-
Automatically generated type definition in TypeScript for [torn.com](https://torn.com) API V2.
|
|
6
|
+
Automatically generated type definition in TypeScript for [torn.com](https://torn.com) API V2. Includes a client for
|
|
7
|
+
both API V1 and V2.
|
|
7
8
|
|
|
8
9
|
## Installation
|
|
9
10
|
|
|
@@ -11,14 +12,31 @@ Automatically generated type definition in TypeScript for [torn.com](https://tor
|
|
|
11
12
|
|
|
12
13
|
## Generation
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
### V1 types
|
|
16
|
+
|
|
17
|
+
Based on data provided by [tornapi-documentation](https://github.com/Torn-Playground/tornapi-documentation). Code mostly
|
|
18
|
+
provided from [Kwack's V1 wrapper](https://www.npmjs.com/package/@kwack-dev/tornapi). These types are not available
|
|
19
|
+
without using the client.
|
|
20
|
+
|
|
21
|
+
### V1 client
|
|
22
|
+
|
|
23
|
+
Code mostly provided from [Kwack's V1 wrapper](https://www.npmjs.com/package/@kwack-dev/tornapi). Uses the types as
|
|
24
|
+
generated above.
|
|
25
|
+
|
|
26
|
+
### V2 types
|
|
27
|
+
|
|
28
|
+
The V2 types are generated in the following way:
|
|
15
29
|
|
|
16
30
|
* load [openapi specification](https://www.torn.com/swagger/openapi.json)
|
|
17
31
|
* convert the specification to TypeScript definitions using [typeconv](https://github.com/grantila/typeconv)
|
|
18
32
|
* clean the type definitions
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
* remove all "[key: string]: any;", because typeconv adds it everywhere for some reason
|
|
34
|
+
* remove all empty objects (caused by the above cleaning)
|
|
35
|
+
* run through prettier to have it look decent
|
|
36
|
+
|
|
37
|
+
### V2 client
|
|
38
|
+
|
|
39
|
+
Code mostly provided from [Kwack's V1 wrapper](https://www.npmjs.com/package/@kwack-dev/tornapi).
|
|
22
40
|
|
|
23
41
|
## Contact
|
|
24
42
|
|