export type GetApiActivityTypesArgs = {cursor?: string | undefined, show?: number | undefined, name?: string | undefined, description?: string | undefined, active?: boolean | undefined, pipeline_id?: string | undefined, created_at_start?: string | undefined, created_at_end?: string | undefined, updated_at_start?: string | undefined, updated_at_end?: string | undefined}; export type GetApiActivityTypesOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Listar tipos de atividade * * GET /activityTypes */ export const getApiActivityTypes = async (args: GetApiActivityTypesArgs, options?: GetApiActivityTypesOptions) => { const {baseUrl = "https://api.pipe.run/v1", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.cursor != null) query.append("cursor", String(args.cursor)) if (args.show != null) query.append("show", String(args.show)) if (args.name != null) query.append("name", String(args.name)) if (args.description != null) query.append("description", String(args.description)) if (args.active != null) query.append("active", String(args.active)) if (args.pipeline_id != null) query.append("pipeline_id", String(args.pipeline_id)) if (args.created_at_start != null) query.append("created_at_start", String(args.created_at_start)) if (args.created_at_end != null) query.append("created_at_end", String(args.created_at_end)) if (args.updated_at_start != null) query.append("updated_at_start", String(args.updated_at_start)) if (args.updated_at_end != null) query.append("updated_at_end", String(args.updated_at_end)) if (sec0 !== undefined) headers.set("token", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/activityTypes${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };