Skip to content

Commit e17b1b5

Browse files
committed
chore: scaffold swr plugin
1 parent e0b09d0 commit e17b1b5

File tree

522 files changed

+793
-5851
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

522 files changed

+793
-5851
lines changed

docs/openapi-ts/get-started.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import { embedProject } from '../embed'
1111

1212
[@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts) is an [open source](/openapi-ts/license) OpenAPI to TypeScript code generator trusted by companies like Google, Amazon, and PayPal to generate API clients, SDKs, validators, and more. We also build complementary tools and [services](https://app.heyapi.dev/) that help teams design, manage, and distribute APIs more effectively.
1313

14-
> “OpenAPI codegen that just works.”
15-
> — Guillermo Rauch
14+
> _“OpenAPI codegen that just works.”_
15+
>
16+
> <sub>— Guillermo Rauch, CEO of Vercel</sub>
1617
1718
### Demo
1819

docs/openapi-ts/plugins/custom.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export const defaultConfig: MyPlugin['Config'] = {
8080
dependencies: ['@hey-api/typescript'],
8181
handler,
8282
name: 'my-plugin',
83-
output: 'my-plugin',
8483
};
8584

8685
/**

packages/custom-client/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export type {
1313
Config,
1414
CreateClientConfig,
1515
Options,
16-
OptionsLegacyParser,
1716
RequestOptions,
1817
RequestResult,
1918
TDataShape,

packages/custom-client/src/plugin.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,17 @@ import {
77
definePluginConfig,
88
} from '@hey-api/openapi-ts';
99

10-
export type IApi = any;
11-
12-
export class Api implements IApi {}
13-
1410
export type Config = Client.Config & {
1511
/**
1612
* Plugin name. Must be unique.
1713
*/
1814
name: '@hey-api/custom-client';
1915
};
2016

21-
export type CustomClientPlugin = DefinePlugin<Config, Config, IApi>;
17+
export type CustomClientPlugin = DefinePlugin<Config, Config>;
2218

2319
export const defaultConfig: CustomClientPlugin['Config'] = {
2420
...clientDefaultMeta,
25-
api: new Api(),
2621
config: {
2722
...clientDefaultConfig,
2823
bundle: false,

packages/custom-client/src/types.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,3 @@ export type Options<
145145
ThrowOnError extends boolean = boolean,
146146
> = OmitKeys<RequestOptions<ThrowOnError>, 'body' | 'path' | 'query' | 'url'> &
147147
Omit<TData, 'url'>;
148-
149-
export type OptionsLegacyParser<
150-
TData = unknown,
151-
ThrowOnError extends boolean = boolean,
152-
> = TData extends { body?: any }
153-
? TData extends { headers?: any }
154-
? OmitKeys<RequestOptions<ThrowOnError>, 'body' | 'headers' | 'url'> & TData
155-
: OmitKeys<RequestOptions<ThrowOnError>, 'body' | 'url'> &
156-
TData &
157-
Pick<RequestOptions<ThrowOnError>, 'headers'>
158-
: TData extends { headers?: any }
159-
? OmitKeys<RequestOptions<ThrowOnError>, 'headers' | 'url'> &
160-
TData &
161-
Pick<RequestOptions<ThrowOnError>, 'body'>
162-
: OmitKeys<RequestOptions<ThrowOnError>, 'url'> & TData;

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/client/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export type {
1616
Config,
1717
CreateClientConfig,
1818
Options,
19-
OptionsLegacyParser,
2019
RequestOptions,
2120
RequestResult,
2221
ResolvedRequestOptions,

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/body-response-text-plain/client/types.gen.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -239,30 +239,3 @@ export type Options<
239239
'body' | 'path' | 'query' | 'url'
240240
> &
241241
([TData] extends [never] ? unknown : Omit<TData, 'url'>);
242-
243-
export type OptionsLegacyParser<
244-
TData = unknown,
245-
ThrowOnError extends boolean = boolean,
246-
TResponseStyle extends ResponseStyle = 'fields',
247-
> = TData extends { body?: any }
248-
? TData extends { headers?: any }
249-
? OmitKeys<
250-
RequestOptions<unknown, TResponseStyle, ThrowOnError>,
251-
'body' | 'headers' | 'url'
252-
> &
253-
TData
254-
: OmitKeys<
255-
RequestOptions<unknown, TResponseStyle, ThrowOnError>,
256-
'body' | 'url'
257-
> &
258-
TData &
259-
Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'headers'>
260-
: TData extends { headers?: any }
261-
? OmitKeys<
262-
RequestOptions<unknown, TResponseStyle, ThrowOnError>,
263-
'headers' | 'url'
264-
> &
265-
TData &
266-
Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'body'>
267-
: OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'url'> &
268-
TData;

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/client/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export type {
1616
Config,
1717
CreateClientConfig,
1818
Options,
19-
OptionsLegacyParser,
2019
RequestOptions,
2120
RequestResult,
2221
ResolvedRequestOptions,

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/form-data/client/types.gen.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -239,30 +239,3 @@ export type Options<
239239
'body' | 'path' | 'query' | 'url'
240240
> &
241241
([TData] extends [never] ? unknown : Omit<TData, 'url'>);
242-
243-
export type OptionsLegacyParser<
244-
TData = unknown,
245-
ThrowOnError extends boolean = boolean,
246-
TResponseStyle extends ResponseStyle = 'fields',
247-
> = TData extends { body?: any }
248-
? TData extends { headers?: any }
249-
? OmitKeys<
250-
RequestOptions<unknown, TResponseStyle, ThrowOnError>,
251-
'body' | 'headers' | 'url'
252-
> &
253-
TData
254-
: OmitKeys<
255-
RequestOptions<unknown, TResponseStyle, ThrowOnError>,
256-
'body' | 'url'
257-
> &
258-
TData &
259-
Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'headers'>
260-
: TData extends { headers?: any }
261-
? OmitKeys<
262-
RequestOptions<unknown, TResponseStyle, ThrowOnError>,
263-
'headers' | 'url'
264-
> &
265-
TData &
266-
Pick<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'body'>
267-
: OmitKeys<RequestOptions<unknown, TResponseStyle, ThrowOnError>, 'url'> &
268-
TData;

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/client/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export type {
1616
Config,
1717
CreateClientConfig,
1818
Options,
19-
OptionsLegacyParser,
2019
RequestOptions,
2120
RequestResult,
2221
ResolvedRequestOptions,

0 commit comments

Comments
 (0)