Skip to content

Commit c6f4bb7

Browse files
authored
[typescript-fetch] test dateLibrary (string, date) option in CI (#24947)
* test dateLibrary option (ts-fetch) in CI * test dateLibrary option (ts-fetch) in CI
1 parent bc2368e commit c6f4bb7

40 files changed

Lines changed: 390 additions & 34 deletions

‎bin/configs/typescript-fetch-date-library-date.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/dat
44
templateDir: modules/openapi-generator/src/main/resources/typescript-fetch
55
additionalProperties:
66
dateLibrary: date
7+
npmVersion: 1.0.0
8+
npmName: '@openapitools/typescript-fetch-petstore'
9+
npmRepository: https://skimdb.npmjs.com/registry

‎bin/configs/typescript-fetch-date-library-string.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/dat
44
templateDir: modules/openapi-generator/src/main/resources/typescript-fetch
55
additionalProperties:
66
dateLibrary: string
7+
npmVersion: 1.0.0
8+
npmName: '@openapitools/typescript-fetch-petstore'
9+
npmRepository: https://skimdb.npmjs.com/registry
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
wwwroot/*.js
2+
node_modules
3+
typings
4+
dist
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README.md
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
apis/DefaultApi.ts
2-
apis/index.ts
1+
.gitignore
2+
.npmignore
3+
README.md
34
docs/DefaultApi.md
45
docs/Event.md
56
docs/Holidays.md
67
docs/Venue.md
7-
index.ts
8-
models/Event.ts
9-
models/Holidays.ts
10-
models/Venue.ts
11-
models/index.ts
12-
runtime.ts
8+
package.json
9+
src/apis/DefaultApi.ts
10+
src/apis/index.ts
11+
src/index.ts
12+
src/models/Event.ts
13+
src/models/Holidays.ts
14+
src/models/Venue.ts
15+
src/models/index.ts
16+
src/runtime.ts
17+
tsconfig.esm.json
18+
tsconfig.json
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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 { CreateEventRequest } 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+
const body = {
28+
// Date
29+
startsOn: 2013-10-20,
30+
// Date (optional)
31+
createdAt: 2013-10-20T19:20:30+01:00,
32+
} satisfies CreateEventRequest;
33+
34+
try {
35+
const data = await api.createEvent(body);
36+
console.log(data);
37+
} catch (error) {
38+
console.error(error);
39+
}
40+
}
41+
42+
// Run the test
43+
example().catch(console.error);
44+
```
45+
46+
47+
## Documentation
48+
49+
### API Endpoints
50+
51+
All URIs are relative to *http://localhost*
52+
53+
| Class | Method | HTTP request | Description
54+
| ----- | ------ | ------------ | -------------
55+
*DefaultApi* | [**createEvent**](docs/DefaultApi.md#createevent) | **POST** /events |
56+
*DefaultApi* | [**listEvents**](docs/DefaultApi.md#listevents) | **GET** /events/{onDate} |
57+
58+
59+
### Models
60+
61+
- [Event](docs/Event.md)
62+
- [Holidays](docs/Holidays.md)
63+
- [Venue](docs/Venue.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.26.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+
[]()

‎samples/client/petstore/typescript-fetch/builds/date-library-date/docs/DefaultApi.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ All URIs are relative to *http://localhost*
2121
import {
2222
Configuration,
2323
DefaultApi,
24-
} from '';
25-
import type { CreateEventRequest } from '';
24+
} from '@openapitools/typescript-fetch-petstore';
25+
import type { CreateEventRequest } from '@openapitools/typescript-fetch-petstore';
2626

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

3131
const body = {
@@ -89,11 +89,11 @@ No authorization required
8989
import {
9090
Configuration,
9191
DefaultApi,
92-
} from '';
93-
import type { ListEventsRequest } from '';
92+
} from '@openapitools/typescript-fetch-petstore';
93+
import type { ListEventsRequest } from '@openapitools/typescript-fetch-petstore';
9494

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

9999
const body = {

‎samples/client/petstore/typescript-fetch/builds/date-library-date/docs/Event.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Name | Type
1313
## Example
1414

1515
```typescript
16-
import type { Event } from ''
16+
import type { Event } from '@openapitools/typescript-fetch-petstore'
1717

1818
// TODO: Update the object below with actual values
1919
const example = {

‎samples/client/petstore/typescript-fetch/builds/date-library-date/docs/Holidays.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Name | Type
1111
## Example
1212

1313
```typescript
14-
import type { Holidays } from ''
14+
import type { Holidays } from '@openapitools/typescript-fetch-petstore'
1515

1616
// TODO: Update the object below with actual values
1717
const example = {

‎samples/client/petstore/typescript-fetch/builds/date-library-date/docs/Venue.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Name | Type
1212
## Example
1313

1414
```typescript
15-
import type { Venue } from ''
15+
import type { Venue } from '@openapitools/typescript-fetch-petstore'
1616

1717
// TODO: Update the object below with actual values
1818
const example = {

0 commit comments

Comments
 (0)