Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bin/configs/typescript-fetch-date-library-temporal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
generatorName: typescript-fetch
outputDir: samples/client/petstore/typescript-fetch/builds/date-library-temporal
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/date-handling.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-fetch
additionalProperties:
dateLibrary: temporal
npmVersion: 1.0.0
npmName: '@openapitools/typescript-fetch-petstore'
npmRepository: https://skimdb.npmjs.com/registry

2 changes: 1 addition & 1 deletion bin/ts-typecheck-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ main() {
pushd "${root_dir}/${dir}" > /dev/null
npm_install \
|| npm_install --force # --force because we have some incompatible peer-dependencies that can't be fixed
npm exec --package=typescript@5.6.3 --yes -- tsc --noEmit
npm exec --package=typescript@6.0.3 --yes -- tsc --noEmit
log "✓ ${dir}"
log
popd > /dev/null
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.gitignore
.npmignore
README.md
docs/DefaultApi.md
docs/Event.md
docs/Holidays.md
docs/Venue.md
package.json
src/apis/DefaultApi.ts
src/apis/index.ts
src/index.ts
src/models/Event.ts
src/models/Holidays.ts
src/models/Venue.ts
src/models/index.ts
src/runtime.ts
tsconfig.esm.json
tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.26.0-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# @openapitools/typescript-fetch-petstore@1.0.0

A TypeScript SDK client for the localhost API.

## Usage

First, install the SDK from npm.

```bash
npm install @openapitools/typescript-fetch-petstore --save
```

Next, try it out.


```ts
import {
Configuration,
DefaultApi,
} from '@openapitools/typescript-fetch-petstore';
import type { CreateEventRequest } from '@openapitools/typescript-fetch-petstore';

async function example() {
console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK...");
const api = new DefaultApi();

const body = {
// Temporal.PlainDate
startsOn: 2013-10-20,
// Temporal.Instant (optional)
createdAt: 2013-10-20T19:20:30+01:00,
} satisfies CreateEventRequest;

try {
const data = await api.createEvent(body);
console.log(data);
} catch (error) {
console.error(error);
}
}

// Run the test
example().catch(console.error);
```


## Documentation

### API Endpoints

All URIs are relative to *http://localhost*

| Class | Method | HTTP request | Description
| ----- | ------ | ------------ | -------------
*DefaultApi* | [**createEvent**](docs/DefaultApi.md#createevent) | **POST** /events |
*DefaultApi* | [**listEvents**](docs/DefaultApi.md#listevents) | **GET** /events/{onDate} |


### Models

- [Event](docs/Event.md)
- [Holidays](docs/Holidays.md)
- [Venue](docs/Venue.md)

### Authorization

Endpoints do not require authorization.


## About

This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/)
and is automatically generated by the
[OpenAPI Generator](https://openapi-generator.tech) project:

- API version: `1.0.0`
- Package version: `1.0.0`
- Generator version: `7.26.0-SNAPSHOT`
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`

The generated npm module supports the following:

- Environments
* Node.js
* Webpack
* Browserify
- Language levels
* ES5 - you must have a Promises/A+ library installed
* ES6
- Module systems
* CommonJS
* ES6 module system


## Development

### Building

To build the TypeScript source code, you need to have Node.js and npm installed.
After cloning the repository, navigate to the project directory and run:

```bash
npm install
npm run build
```

### Publishing

Once you've built the package, you can publish it to npm:

```bash
npm publish
```

## License

[]()
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# DefaultApi

All URIs are relative to *http://localhost*

| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**createEvent**](DefaultApi.md#createevent) | **POST** /events | |
| [**listEvents**](DefaultApi.md#listevents) | **GET** /events/{onDate} | |



## createEvent

> Event createEvent(startsOn, createdAt)



### Example

```ts
import {
Configuration,
DefaultApi,
} from '@openapitools/typescript-fetch-petstore';
import type { CreateEventRequest } from '@openapitools/typescript-fetch-petstore';

async function example() {
console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK...");
const api = new DefaultApi();

const body = {
// Temporal.PlainDate
startsOn: 2013-10-20,
// Temporal.Instant (optional)
createdAt: 2013-10-20T19:20:30+01:00,
} satisfies CreateEventRequest;

try {
const data = await api.createEvent(body);
console.log(data);
} catch (error) {
console.error(error);
}
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **startsOn** | `Temporal.PlainDate` | | [Defaults to `undefined`] |
| **createdAt** | `Temporal.Instant` | | [Optional] [Defaults to `undefined`] |

### Return type

[**Event**](Event.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: `application/x-www-form-urlencoded`
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | the created event | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)


## listEvents

> Array<Event> listEvents(onDate, from, updatedSince)



### Example

```ts
import {
Configuration,
DefaultApi,
} from '@openapitools/typescript-fetch-petstore';
import type { ListEventsRequest } from '@openapitools/typescript-fetch-petstore';

async function example() {
console.log("🚀 Testing @openapitools/typescript-fetch-petstore SDK...");
const api = new DefaultApi();

const body = {
// Temporal.PlainDate
onDate: 2013-10-20,
// Temporal.PlainDate (optional)
from: 2013-10-20,
// Temporal.Instant (optional)
updatedSince: 2013-10-20T19:20:30+01:00,
} satisfies ListEventsRequest;

try {
const data = await api.listEvents(body);
console.log(data);
} catch (error) {
console.error(error);
}
}

// Run the test
example().catch(console.error);
```

### Parameters


| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **onDate** | `Temporal.PlainDate` | | [Defaults to `undefined`] |
| **from** | `Temporal.PlainDate` | | [Optional] [Defaults to `undefined`] |
| **updatedSince** | `Temporal.Instant` | | [Optional] [Defaults to `undefined`] |

### Return type

[**Array<Event>**](Event.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | matching events | - |

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

# Event


## Properties

Name | Type
------------ | -------------
`startsOn` | Temporal.PlainDate
`endsOn` | Temporal.PlainDate
`createdAt` | Temporal.Instant

## Example

```typescript
import type { Event } from '@openapitools/typescript-fetch-petstore'

// TODO: Update the object below with actual values
const example = {
"startsOn": null,
"endsOn": null,
"createdAt": null,
} satisfies Event

console.log(example)

// Convert the instance to a JSON string
const exampleJSON: string = JSON.stringify(example)
console.log(exampleJSON)

// Parse the JSON string back to an object
const exampleParsed = JSON.parse(exampleJSON) as Event
console.log(exampleParsed)
```

[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)


Loading
Loading