'use server'; import { z } from 'zod'; import { AppcondaException } from '../../client'; import { CreateAgentFlowSchema, CreateAssistantSchema, CreateCompetencySchema, CreateEmploidSchema, CreateExtensionSchema, CreateInputSchema, CreateInstructionSchema, CreateJobDefinitionSchema, CreateOccupationSchema, CreateScopeSchema, CreateSkillSchema, CreateStreamIdSchema, CreateTeamSchema, CreateWorkerSchema, DeleteAssistantSchema, DeleteChatByIdSchema, DeleteCompetencySchema, DeleteDocumentsByIdAfterTimestampSchema, DeleteEmploidSchema, DeleteInputSchema, DeleteInstructionSchema, DeleteJobDefinitionSchema, DeleteMessagesByChatIdAfterTimestampSchema, DeleteOccupationSchema, DeleteScopeSchema, DeleteSkillSchema, DeleteTeamSchema, DeleteWorkerSchema, GetChatByIdSchema, GetChatsByUserIdSchema, GetDocumentByIdSchema, GetDocumentsByIdSchema, GetMessageByIdSchema, GetMessageCountByUserIdSchema, GetMessagesByChatIdSchema, GetStreamIdsByChatIdSchema, GetSuggestionsByDocumentIdSchema, GetVotesByChatIdSchema, ListAgentFlowsSchema, ListAssistantsSchema, ListCompetenciesSchema, ListEmploidsPaginatedSchema, ListEmploidsSchema, ListExtensionsSchema, ListInputSchema, ListInstructionsSchema, ListJobDefinitionSchema, ListOccupationsSchema, ListScopesSchema, ListSkillsSchema, ListTeamsSchema, ListWorkersSchema, SaveChatSchema, SaveDocumentSchema, SaveMessagesSchema, SaveSuggestionsSchema, UpdateAssistantSchema, UpdateChatLastContextByIdSchema, UpdateChatVisiblityByIdSchema, UpdateCompetencySchema, UpdateEmploidSchema, UpdateInputSchema, UpdateInstructionSchema, UpdateJobDefinitionSchema, UpdateOccupationSchema, UpdateScopeSchema, UpdateSkillSchema, UpdateTeamSchema, UpdateWorkerSchema, VoteMessageSchema } from './schema'; import { TEmploid, TInstruction } from './types'; import { getSDKForService } from '../../getSDKForService'; export async function CreateEmploid(parsedInput: z.infer): Promise { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateEmploid(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } } export const UpdateEmploid = async (parsedInput: z.infer): Promise => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateEmploid(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } } export const DeleteEmploid = async (parsedInput: z.infer): Promise => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteEmploid(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } } export const CreateInstruction = async (parsedInput: z.infer): Promise => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateInstruction(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } } export const UpdateInstruction = async (parsedInput: z.infer): Promise => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateInstruction(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } } export const ListInstructions = async (parsedInput: z.infer): Promise => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListInstructions(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } } export const DeleteInstruction = async (parsedInput: z.infer): Promise => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteInstruction(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } } export const ListEmploids = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListEmploids(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListEmploidsPaginated = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListEmploidsPaginated(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListScopes = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListScopes(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateOccupation = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateOccupation(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateOccupation = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateOccupation(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } } export const DeleteOccupation = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteOccupation(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } } export const CreateScope = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateScope(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } } export const UpdateScope = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateScope(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteScope = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteScope(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListOccupations = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListOccupations(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateJobDefinition = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateJobDefinition(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateJobDefinition = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateJobDefinition(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteJobDefinition = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteJobDefinition(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListJobDefinitions = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListJobDefinitions(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateCompetency = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateCompetency(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateCompetency = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateCompetency(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteCompetency = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteCompetency(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListCompetencies = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListCompetencies(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateAgentFlow = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateAgentFlow(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListAgentFlows = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListAgentFlows(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateExtension = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateExtension(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListExtensions = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListExtensions(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateAssistant = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateAssistant(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateAssistant = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateAssistant(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteAssistant = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteAssistant(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListAssistants = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListAssistants(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateWorker = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateWorker(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateWorker = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateWorker(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteWorker = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteWorker(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListWorkers = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListWorkers(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateInput = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateInput(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateInput = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateInput(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteInput = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteInput(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListInputs = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListInputs(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateTeam = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateTeam(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateTeam = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateTeam(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteTeam = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteTeam(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListTeams = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListTeams(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const SaveChat = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.SaveChat(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteChatById = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteChatById(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetChatById = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.GetChatById(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetChatsByUserId = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.GetChatsByUserId(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const SaveMessages = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.SaveMessages(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetMessagesByChatId = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.GetMessagesByChatId(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetMessageById = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.GetMessageById(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const VoteMessage = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.VoteMessage(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetVotesByChatId = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.GetVotesByChatId(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteDocumentsByIdAfterTimestamp = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteDocumentsByIdAfterTimestamp(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const SaveSuggestions = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.SaveSuggestions(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetSuggestionsByDocumentId = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.GetSuggestionsByDocumentId(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteMessagesByChatIdAfterTimestamp = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteMessagesByChatIdAfterTimestamp(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateChatVisiblityById = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateChatVisiblityById(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateChatLastContextById = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateChatLastContextById(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetMessageCountByUserId = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.GetMessageCountByUserId(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateStreamId = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateStreamId(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetStreamIdsByChatId = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.GetStreamIdsByChatId(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const SaveDocument = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.SaveDocument(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetDocumentById = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.GetDocumentById(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetDocumentsById = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.GetDocumentsById(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateSkill = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.CreateSkill(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateSkill = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.UpdateSkill(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteSkill = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.DeleteSkill(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListSkills = async (parsedInput: z.infer) => { try { const { emploid } = await getSDKForService(); //@ts-ignore const app = await emploid.ListSkills(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } };