@moccona/apicodegen 0.0.1 → 0.0.3

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 ADDED
@@ -0,0 +1,48 @@
1
+ # @moccona/apicodegen
2
+
3
+ `@moccona/apicodegen` is a command-line tool for generating TypeScript code from OpenAPI documentation. It provides a simple and efficient way to automate the process of creating API clients.
4
+
5
+ ## Installation
6
+
7
+ To install `@moccona/apicodegen`, you can use npm or yarn:
8
+
9
+ ```sh
10
+ npm install -g @moccona/apicodegen
11
+
12
+ # or
13
+
14
+ yarn global add @moccona/apicodegen
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ### Basic Command
20
+
21
+ The basic command to generate TypeScript code from an OpenAPI documentation URL is as follows:
22
+
23
+ ```sh
24
+ apicodegen <docURL> --output ./output.ts
25
+ ```
26
+
27
+ - `<docURL>`: The URL of the OpenAPI documentation file.
28
+ - `--output`: The path where the generated TypeScript code will be saved. Default is `./output.ts`.
29
+ - `--adaptor`: The adaptor for API calls. Default is `fetch`.
30
+ - `--baseURL`: The base path of the API endpoint.
31
+ - `--verbose`: Enable verbose logging.
32
+ - `--importClientSource`: The source from which the request tool will be imported.
33
+
34
+ ## Example
35
+
36
+ To generate TypeScript code from an OpenAPI documentation file located at `https://api.example.com/openapi.json` and save it to `./src/api.ts`, you can run:
37
+
38
+ ```sh
39
+ apicodegen https://api.example.com/openapi.json --output ./src/api.ts
40
+ ```
41
+
42
+ ## Contributing
43
+
44
+ Contributions are welcome! Please read the [contributing guidelines](./CONTRIBUTING.md) before submitting a pull request.
45
+
46
+ ## License
47
+
48
+ This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.