export type SystemMountsRequest = {config?: Record | undefined, description?: string | undefined, external_entropy_access?: boolean | undefined, local?: boolean | undefined, options?: Record | undefined, plugin_name?: string | undefined, plugin_version?: string | undefined, seal_wrap?: boolean | undefined, type?: string | undefined}; export type CreateApiSysMountsPathArgs = {body: SystemMountsRequest}; export type CreateApiSysMountsPathOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Enable a new secrets engine at the given path. * * POST /sys/mounts/{path} */ export const createApiSysMountsPath = async (args: CreateApiSysMountsPathArgs, options: CreateApiSysMountsPathOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/sys/mounts/${encodeURIComponent(String(args.path))}${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 };