Replace the unmaintained openapi-typescript-codegen generator with
@hey-api/openapi-ts.
- openapi-ts.config.ts generates src/client from ../broker/jfjoch_api.yaml
(client-fetch + typescript + sdk plugins; enums as const objects via
mode: 'javascript', type names preserved)
- npm "openapi" script now runs openapi-ts; drop openapi-typescript-codegen
- migrate all imports from src/openapi to src/client
- DefaultService.foo() -> standalone foo({ body|query, throwOnError })
- OpenAPI.BASE='' -> client.setConfig({ baseUrl: '' }); ButtonWithSnackbar
uses the relative path directly
- adapt hey-api's inlined enums: broker_status.state/message_severity and
bit_depth_image/eiger_bit_depth become string/number literal unions;
file_writer_format NXMX_* -> N_XMX_*
- remove generated src/openapi
Build (tsc + vite) passes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
17 lines
852 B
TypeScript
17 lines
852 B
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import { type Client, type ClientOptions, type Config, createClient, createConfig } from './client';
|
|
import type { ClientOptions as ClientOptions2 } from './types.gen';
|
|
|
|
/**
|
|
* The `createClientConfig()` function will be called on client initialization
|
|
* and the returned object will become the client's initial configuration.
|
|
*
|
|
* You may want to initialize your client this way instead of calling
|
|
* `setConfig()`. This is useful for example if you're using Next.js
|
|
* to ensure your client always has the correct values.
|
|
*/
|
|
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
|
|
|
|
export const client: Client = createClient(createConfig<ClientOptions2>({ baseUrl: 'http://localhost:5232' }));
|