import { BaseResource } from '@gitbeaker/requester-utils'; import { RequestHelper } from '../infrastructure'; import type { BaseRequestOptions, GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure'; export interface ApplicationAppearanceSchema extends Record { title: string; description: string; pwa_name: string; pwa_short_name: string; pwa_description: string; pwa_icon: string; logo: string; header_logo: string; favicon: string; new_project_guidelines: string; profile_image_guidelines: string; header_message: string; footer_message: string; message_background_color: string; message_font_color: string; email_header_and_footer_enabled: boolean; } export class ApplicationAppearance extends BaseResource { show( options?: Sudo & ShowExpanded, ): Promise> { return RequestHelper.get()( this, 'application/appearence', options, ); } edit( { logo, pwaIcon, ...options }: { logo?: { content: Blob; filename: string }; pwaIcon?: { content: Blob; filename: string }; } & BaseRequestOptions = {} as any, ): Promise> { if (logo || pwaIcon) { const opts: BaseRequestOptions = { ...options, isForm: true, }; if (logo) opts.logo = [logo.content, logo.filename]; if (pwaIcon) opts.pwaIcon = [pwaIcon.content, pwaIcon.filename]; return RequestHelper.put()(this, 'application/appearence', opts); } return RequestHelper.put()( this, 'application/appearence', options, ); } }