import copy from 'fast-copy' ; import { toPlainObject } from 'contentful-sdk-core' ; import { Except } from 'type-fest' ; import { BasicMetaSysProps , DefaultElements , MakeRequest , SysLink } from '../common-types' ; import enhanceWithMethods from '../enhance-with-methods' ; type AppDetailsSys = Except < BasicMetaSysProps , 'version' | 'id' > & { appDefinition : SysLink ; organization : SysLink ; } ; export enum IconType { Base64 = 'base64' } export interface AppIcon { value : string ; type : IconType ; } export type AppDetailsProps = { /**
     * System metadata
     */ sys : AppDetailsSys ; /**
     * An Icon that represents the App
     */ icon ? : AppIcon ; } ; export type CreateAppDetailsProps = { /**
     * An Icon that represents the App
     */ icon ? : AppIcon ; } ; export interface AppDetails extends AppDetailsProps , DefaultElements < AppDetailsProps > { return example delete ( ) : Promise < void > ; } private param makeRequest return function createAppDetailsApi ( makeRequest ) { const getParams = ( data ) => ( { organizationId : data . sys . organization . sys . id , appDefinitionId : data . sys . appDefinition . sys . id , } ) ; return { delete : function del ( ) { const self = this as AppDetailsProps ; return makeRequest ( { entityType : 'AppDetails' , action : 'delete' , params : getParams ( self ) , } ) ; } , } ; } private param http param data return export function wrapAppDetails ( makeRequest , data ) { const appDetails = toPlainObject ( copy ( data ) ) ; return enhanceWithMethods ( appDetails , createAppDetailsApi ( makeRequest ) ) ; }