tornapi-typescript 0.0.2

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 ADDED
@@ -0,0 +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>
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # TornAPI Typescript
2
+
3
+ Automatically generated type definition in Typescript for [torn.com](https://torn.com) API V2.
4
+
5
+ ## Installation
6
+
7
+ `npm i -D tornapi-typescript`
8
+
9
+ ## Generation
10
+
11
+ These types are generated in the following way:
12
+
13
+ * load [openapi specification](https://www.torn.com/swagger/openapi.json)
14
+ * clean the specification for better types
15
+ * remove `type` when `allOf` is present, otherwise the specification is not valid
16
+ * remove `type` when `oneOf` is present, for improved types
17
+ * mark all fields as required, for improved types
18
+ * convert the specification to Typescript definitions using [typeconv](https://github.com/grantila/typeconv)
19
+ * clean the type definitions
20
+ * remove all "[key: string]: any;", because typeconv adds it everywhere for some reason
21
+ * remove all empty objects (caused by the above cleaning)
22
+ * run through prettier to have it look decent
23
+
24
+ ## Contact
25
+
26
+ You can join the community in [our Discord server](https://discord.gg/2wb7GKN). There you can discuss anything related
27
+ to the Torn API, or other tools related to Torn. Issues can also be reported there, or as GitHub issue.