export type Variable = {key?: string | undefined, value?: string | undefined, sensitivity?: ('string' | 'secret') | undefined, destination?: ('env' | 'iac') | undefined}; export type UpdateVariableSetRequest = {name?: string | undefined, description?: string | undefined, labels?: Array | undefined, parents?: Array | undefined, variables?: Array | undefined}; export type UpdateApiRunnersVariablesVariableSetsVariableSetIdArgs = {variableSetId: string, body: UpdateVariableSetRequest}; export type UpdateApiRunnersVariablesVariableSetsVariableSetIdOptions = {baseUrl?: string | undefined, JWTAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a variable set * * PUT /runners/variables/variable-sets/{variableSetId} */ export const updateApiRunnersVariablesVariableSetsVariableSetId = async (args: UpdateApiRunnersVariablesVariableSetsVariableSetIdArgs, options?: UpdateApiRunnersVariablesVariableSetsVariableSetIdOptions) => { const {baseUrl = "https://api.firefly.ai/v2", fetch: fetchFn = fetch, JWTAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (JWTAuth !== undefined) headers.set('authorization', `Bearer ${JWTAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/runners/variables/variable-sets/${encodeURIComponent(String(args.variableSetId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };