feat: hey-api and projects fetch
This commit is contained in:
39
src/client/sdk.gen.ts
Normal file
39
src/client/sdk.gen.ts
Normal file
@ -0,0 +1,39 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import type { Client, Options as ClientOptions, TDataShape } from "./client";
|
||||
import { client as _heyApiClient } from "./client.gen";
|
||||
import type { GetProjectsData, GetProjectsResponses } from "./types.gen";
|
||||
|
||||
export type Options<
|
||||
TData extends TDataShape = TDataShape,
|
||||
ThrowOnError extends boolean = boolean,
|
||||
> = ClientOptions<TData, ThrowOnError> & {
|
||||
/**
|
||||
* You can provide a client instance returned by `createClient()` instead of
|
||||
* individual options. This might be also useful if you want to implement a
|
||||
* custom client.
|
||||
*/
|
||||
client?: Client;
|
||||
/**
|
||||
* You can pass arbitrary values through the `meta` object. This can be
|
||||
* used to access values that aren't defined as part of the SDK function.
|
||||
*/
|
||||
meta?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get Projects
|
||||
*/
|
||||
export const getProjects = <ThrowOnError extends boolean = false>(
|
||||
options?: Options<GetProjectsData, ThrowOnError>
|
||||
) => {
|
||||
return (options?.client ?? _heyApiClient).get<
|
||||
GetProjectsResponses,
|
||||
unknown,
|
||||
ThrowOnError
|
||||
>({
|
||||
responseType: "json",
|
||||
url: "/project/",
|
||||
...options,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user