export type AgentConfigEnv = {id?: string | undefined, project_id?: string | undefined, env_name: string, blueprint_id: string, created_by?: string | undefined, created_at?: string | undefined, ended_at?: string | undefined}; export type AgentConfigEnvUpdate = {project_id: string, envs: Array}; export type CreateApiV1PrivateAgentConfigsBlueprintsEnvironmentsArgs = {body: AgentConfigEnvUpdate}; export type CreateApiV1PrivateAgentConfigsBlueprintsEnvironmentsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create or update environments * * POST /v1/private/agent-configs/blueprints/environments */ export const createApiV1PrivateAgentConfigsBlueprintsEnvironments = async (args: CreateApiV1PrivateAgentConfigsBlueprintsEnvironmentsArgs, options?: CreateApiV1PrivateAgentConfigsBlueprintsEnvironmentsOptions) => { const {baseUrl = "http://localhost:5173/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/private/agent-configs/blueprints/environments${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };