|
| 1 | +# @openapitools/typescript-fetch-petstore@1.0.0 |
| 2 | + |
| 3 | +A TypeScript SDK client for the localhost API. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +First, install the SDK from npm. |
| 8 | + |
| 9 | +```bash |
| 10 | +npm install @openapitools/typescript-fetch-petstore --save |
| 11 | +``` |
| 12 | + |
| 13 | +Next, try it out. |
| 14 | + |
| 15 | + |
| 16 | +```ts |
| 17 | +import { |
| 18 | + Configuration, |
| 19 | + DefaultApi, |
| 20 | +} from '@openapitools/typescript-fetch-petstore'; |
| 21 | +import type { TestRequest } from '@openapitools/typescript-fetch-petstore'; |
| 22 | + |
| 23 | +async function example() { |
| 24 | + console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK..."); |
| 25 | + const api = new DefaultApi(); |
| 26 | + |
| 27 | + try { |
| 28 | + const data = await api.test(); |
| 29 | + console.log(data); |
| 30 | + } catch (error) { |
| 31 | + console.error(error); |
| 32 | + } |
| 33 | +} |
| 34 | + |
| 35 | +// Run the test |
| 36 | +example().catch(console.error); |
| 37 | +``` |
| 38 | + |
| 39 | + |
| 40 | +## Documentation |
| 41 | + |
| 42 | +### API Endpoints |
| 43 | + |
| 44 | +All URIs are relative to *http://localhost:3000* |
| 45 | + |
| 46 | +| Class | Method | HTTP request | Description |
| 47 | +| ----- | ------ | ------------ | ------------- |
| 48 | +*DefaultApi* | [**test**](docs/DefaultApi.md#test) | **GET** /test | |
| 49 | +*DefaultApi* | [**testArray**](docs/DefaultApi.md#testarray) | **GET** /test-array | |
| 50 | +*DefaultApi* | [**testDiscriminator**](docs/DefaultApi.md#testdiscriminator) | **GET** /test-discriminator | |
| 51 | + |
| 52 | + |
| 53 | +### Models |
| 54 | + |
| 55 | +- [OneOfPrimitiveTypes](docs/OneOfPrimitiveTypes.md) |
| 56 | +- [OneOfPrimitiveTypesValue](docs/OneOfPrimitiveTypesValue.md) |
| 57 | +- [OptionOne](docs/OptionOne.md) |
| 58 | +- [OptionTwo](docs/OptionTwo.md) |
| 59 | +- [TestA](docs/TestA.md) |
| 60 | +- [TestArrayResponse](docs/TestArrayResponse.md) |
| 61 | +- [TestB](docs/TestB.md) |
| 62 | +- [TestDiscriminatorResponse](docs/TestDiscriminatorResponse.md) |
| 63 | +- [TestResponse](docs/TestResponse.md) |
| 64 | + |
| 65 | +### Authorization |
| 66 | + |
| 67 | +Endpoints do not require authorization. |
| 68 | + |
| 69 | + |
| 70 | +## About |
| 71 | + |
| 72 | +This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/) |
| 73 | +and is automatically generated by the |
| 74 | +[OpenAPI Generator](https://openapi-generator.tech) project: |
| 75 | + |
| 76 | +- API version: `1.0.0` |
| 77 | +- Package version: `1.0.0` |
| 78 | +- Generator version: `7.20.0-SNAPSHOT` |
| 79 | +- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen` |
| 80 | + |
| 81 | +The generated npm module supports the following: |
| 82 | + |
| 83 | +- Environments |
| 84 | + * Node.js |
| 85 | + * Webpack |
| 86 | + * Browserify |
| 87 | +- Language levels |
| 88 | + * ES5 - you must have a Promises/A+ library installed |
| 89 | + * ES6 |
| 90 | +- Module systems |
| 91 | + * CommonJS |
| 92 | + * ES6 module system |
| 93 | + |
| 94 | + |
| 95 | +## Development |
| 96 | + |
| 97 | +### Building |
| 98 | + |
| 99 | +To build the TypeScript source code, you need to have Node.js and npm installed. |
| 100 | +After cloning the repository, navigate to the project directory and run: |
| 101 | + |
| 102 | +```bash |
| 103 | +npm install |
| 104 | +npm run build |
| 105 | +``` |
| 106 | + |
| 107 | +### Publishing |
| 108 | + |
| 109 | +Once you've built the package, you can publish it to npm: |
| 110 | + |
| 111 | +```bash |
| 112 | +npm publish |
| 113 | +``` |
| 114 | + |
| 115 | +## License |
| 116 | + |
| 117 | +[]() |
0 commit comments