// 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 { GetBoardsData, GetBoardsErrors, GetBoardsResponses, GetDealsData, GetDealsErrors, GetDealsResponses, GetProjectsData, GetProjectsResponses, GetStatusesData, GetStatusesErrors, GetStatusesResponses, UpdateBoardData, UpdateBoardErrors, UpdateBoardResponses, UpdateDealData, UpdateDealErrors, UpdateDealResponses, UpdateStatusData, UpdateStatusErrors, UpdateStatusResponses, } from "./types.gen"; export type Options< TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, > = ClientOptions & { /** * 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; }; /** * Get Projects */ export const getProjects = ( options?: Options ) => { return (options?.client ?? _heyApiClient).get< GetProjectsResponses, unknown, ThrowOnError >({ responseType: "json", url: "/project/", ...options, }); }; /** * Get Boards */ export const getBoards = ( options: Options ) => { return (options.client ?? _heyApiClient).get< GetBoardsResponses, GetBoardsErrors, ThrowOnError >({ responseType: "json", url: "/board/{projectId}", ...options, }); }; /** * Update Board */ export const updateBoard = ( options: Options ) => { return (options.client ?? _heyApiClient).patch< UpdateBoardResponses, UpdateBoardErrors, ThrowOnError >({ responseType: "json", url: "/board/{boardId}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); }; /** * Get Statuses */ export const getStatuses = ( options: Options ) => { return (options.client ?? _heyApiClient).get< GetStatusesResponses, GetStatusesErrors, ThrowOnError >({ responseType: "json", url: "/status/{boardId}", ...options, }); }; /** * Update Status */ export const updateStatus = ( options: Options ) => { return (options.client ?? _heyApiClient).patch< UpdateStatusResponses, UpdateStatusErrors, ThrowOnError >({ responseType: "json", url: "/status/{statusId}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); }; /** * Get Deals */ export const getDeals = ( options: Options ) => { return (options.client ?? _heyApiClient).get< GetDealsResponses, GetDealsErrors, ThrowOnError >({ responseType: "json", url: "/deal/{boardId}", ...options, }); }; /** * Update Deal */ export const updateDeal = ( options: Options ) => { return (options.client ?? _heyApiClient).patch< UpdateDealResponses, UpdateDealErrors, ThrowOnError >({ responseType: "json", url: "/deal/{dealId}", ...options, headers: { "Content-Type": "application/json", ...options.headers, }, }); };