export type Configurations = {auth_mode?: string | undefined, primary_auth_mode?: (boolean | null) | undefined, ldap_base_dn?: string | undefined, ldap_filter?: string | undefined, ldap_group_base_dn?: string | undefined, ldap_group_admin_dn?: string | undefined, ldap_group_attribute_name?: string | undefined, ldap_group_search_filter?: string | undefined, ldap_group_search_scope?: number | undefined, ldap_group_attach_parallel?: boolean | undefined, ldap_scope?: number | undefined, ldap_search_dn?: string | undefined, ldap_search_password?: string | undefined, ldap_timeout?: number | undefined, ldap_uid?: string | undefined, ldap_url?: string | undefined, ldap_verify_cert?: boolean | undefined, ldap_group_membership_attribute?: string | undefined, project_creation_restriction?: string | undefined, read_only?: boolean | undefined, self_registration?: boolean | undefined, token_expiration?: number | undefined, uaa_client_id?: string | undefined, uaa_client_secret?: string | undefined, uaa_endpoint?: string | undefined, uaa_verify_cert?: boolean | undefined, http_authproxy_endpoint?: string | undefined, http_authproxy_tokenreview_endpoint?: string | undefined, http_authproxy_admin_groups?: string | undefined, http_authproxy_admin_usernames?: string | undefined, http_authproxy_verify_cert?: boolean | undefined, http_authproxy_skip_search?: boolean | undefined, http_authproxy_server_certificate?: string | undefined, oidc_name?: string | undefined, oidc_endpoint?: string | undefined, oidc_client_id?: string | undefined, oidc_client_secret?: string | undefined, oidc_groups_claim?: string | undefined, oidc_admin_group?: string | undefined, oidc_group_filter?: string | undefined, oidc_scope?: string | undefined, oidc_user_claim?: string | undefined, oidc_verify_cert?: boolean | undefined, oidc_auto_onboard?: boolean | undefined, oidc_extra_redirect_parms?: string | undefined, oidc_logout?: boolean | undefined, robot_token_duration?: number | undefined, robot_name_prefix?: string | undefined, notification_enable?: boolean | undefined, quota_per_project_enable?: boolean | undefined, storage_per_project?: number | undefined, audit_log_forward_endpoint?: string | undefined, skip_audit_log_database?: boolean | undefined, session_timeout?: number | undefined, scanner_skip_update_pulltime?: boolean | undefined, banner_message?: string | undefined, disabled_audit_log_event_types?: string | undefined}; export type UpdateApiConfigurationsArgs = {'X-Request-Id'?: string | undefined, body: Configurations}; export type UpdateApiConfigurationsOptions = {baseUrl?: string | undefined, basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Modify system configurations. * * PUT /configurations */ export const updateApiConfigurations = async (args: UpdateApiConfigurationsArgs, options?: UpdateApiConfigurationsOptions) => { const {baseUrl = "http://localhost/api/v2.0", fetch: fetchFn = fetch, basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-Request-Id'] != null) headers.set("X-Request-Id", String(args['X-Request-Id'])) if (basic !== undefined) headers.set('authorization', `Basic ${btoa(`${basic.username}:${basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/configurations${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 };