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 AppSigningSecretSys = Except < BasicMetaSysProps , 'version' | 'id' > & { appDefinition : SysLink ; organization : SysLink ; } ; export type AppSigningSecretProps = { /**
     * System metadata
     */ sys : AppSigningSecretSys ; /** The last four characters of the signing secret */ redactedValue : string ; } ; export type CreateAppSigningSecretProps = { /** A 64 character matching the regular expression /^[0-9a-zA-Z+/=_-]+$/  */ value : string ; } ; export interface AppSigningSecret extends AppSigningSecretProps , DefaultElements < AppSigningSecretProps > { return example delete ( ) : Promise < void > ; } function createSigningSecretApi ( makeRequest ) { const getParams = ( data ) => ( { organizationId : data . sys . organization . sys . id , appDefinitionId : data . sys . appDefinition . sys . id , } ) ; return { delete : function del ( ) { const self = this as AppSigningSecretProps ; return makeRequest ( { entityType : 'AppSigningSecret' , action : 'delete' , params : getParams ( self ) , } ) ; } , } ; } private param http param data return export function wrapAppSigningSecret ( makeRequest , data ) { const signingSecret = toPlainObject ( copy ( data ) ) ; return enhanceWithMethods ( signingSecret , createSigningSecretApi ( makeRequest ) ) ; }