import { IDataObject } from 'n8n-workflow' ; import { IRestApiContext , IN8nPrompts , IN8nValueSurveyData , IN8nUISettings , IPersonalizationSurveyAnswers } from '../Interface' ; import { makeRestApiRequest , get , post } from './helpers' ; import { TEMPLATES_BASE_URL } from '@/constants' ; export async function getSettings ( context ) { return await makeRestApiRequest ( context , 'GET' , '/settings' ) ; } export async function submitPersonalizationSurvey ( context , params ) { await makeRestApiRequest ( context , 'POST' , '/user-survey' , params as unknown as IDataObject ) ; } export async function getPromptsData ( instanceId ) { return await get ( TEMPLATES_BASE_URL , '/prompts' , { } , { 'n8n-instance-id' : instanceId } ) ; } export async function submitContactInfo ( instanceId , email ) { return await post ( TEMPLATES_BASE_URL , '/prompt' , { email } , { 'n8n-instance-id' : instanceId } ) ; } export async function submitValueSurvey ( instanceId , params ) { return await post ( TEMPLATES_BASE_URL , '/value-survey' , params , { 'n8n-instance-id' : instanceId } ) ; }