'use server'; import { z } from 'zod'; import { AppcondaException } from '../../client'; import { getSDKForCurrentUser } from '../../getSDKForCurrentUser'; import { ChangePostCategorySchema, ChangePostStatusSchema, ChangeTaskStatusSchema, CreateBoardSchema, CreateChangelogSchema, CreateCommentSchema, CreateLabelSchema, CreateListSchema, CreatePostCategorySchema, CreatePostSchema, CreateProjectSchema, CreateRoadmapSchema, CreateSprintSchema, CreateStatusChangeSchema, CreateTagSchema, CreateTaskListSchema, CreateTaskSchema, CreateViewSchema, CreateVoteSchema, DeleteBoardSchema, DeleteCommentSchema, DeleteLabelSchema, DeletePostCategorySchema, DeleteSprintSchema, DeleteTaskListSchema, DeleteVoteSchema, GetBoardSchema, GetChangeLogSchema, GetCommentSchema, GetPostCategorySchema, GetPostSchema, GetProjectSchema, GetRoadmapSchema, GetSprintSchema, GetTagSchema, GetTaskListSchema, GetTaskSchema, GetVoteSchema, ListBoardsSchema, ListChangeLogsSchema, ListCommentsSchema, ListLabelsSchema, ListPostCategoriesSchema, ListPostsSchema, ListProjectsSchema, ListTagsSchema, ListTaskListsSchema, ListTasksInListSchema, ListTasksSchema, ListViewsSchema, ListVotesSchema, MoveTaskSchema, MoveViewSchema, UpdateLabelSchema, UpdateListSchema, UpdateProjectSchema, UpdateSprintSchema, UpdateTaskListSchema, UpdateViewSchema } from './schema'; export const CreateProject = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); //@ts-ignore const project = await task.CreateProject(parsedInput); const view = await CreateView({ id: `${project.id}-default`, title: 'Backlog', projectId: project.id }); return project; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateProject = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.UpdateProject(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetProject = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetProject(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListProjects = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); //@ts-ignore return await task.ListProjects(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetTask = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetTask(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ChangeTaskStatus = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ChangeTaskStatus(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateTaskList = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateTaskList(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetTaskList = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetTaskList(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListTaskLists = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListTaskLists(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateTaskList = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.UpdateTaskList(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteTaskList = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.DeleteTaskList(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateSprint = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateSprint(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetSprint = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetSprint(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; //@ts-ignore export const ListSprints = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListSprints(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateSprint = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.UpdateSprint(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteSprint = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.DeleteSprint(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateList = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateList(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateList = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.UpdateList(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListTasksInList = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListTasksInList(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateTask = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateTask(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const MoveTask = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.MoveTask(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(`Error in MoveTask : ${error.toString()}`); } throw error; } }; export const CreateView = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateView(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateView = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.UpdateView(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListViews = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListViews(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListTasks = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListTasks(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; // Feedback modülü action fonksiyonları export const ChangePostCategory = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ChangePostCategory(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ChangePostStatus = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ChangePostStatus(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateBoard = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateBoard(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetBoard = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetBoard(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListBoards = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListBoards(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteBoard = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.DeleteBoard(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateChangelog = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateChangelog(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateComment = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateComment(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreatePost = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreatePost(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreatePostCategory = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreatePostCategory(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateRoadmap = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateRoadmap(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateStatusChange = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateStatusChange(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateTag = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateTag(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateVote = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateVote(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteComment = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.DeleteComment(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeletePostCategory = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.DeletePostCategory(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteVote = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.DeleteVote(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetChangeLog = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetChangeLog(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetComment = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetComment(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetPost = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetPost(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetPostCategory = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetPostCategory(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetRoadmap = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetRoadmap(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetTag = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetTag(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const GetVote = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.GetVote(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListChangeLogs = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListChangeLogs(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListComments = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListComments(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListPostCategories = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListPostCategories(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListPosts = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListPosts(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListRoadmaps = async () => { try { const { task } = await getSDKForCurrentUser(); return await task.ListRoadmaps(); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListStatusChanges = async () => { try { const { task } = await getSDKForCurrentUser(); return await task.ListStatusChanges(); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListTags = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListTags(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListVotes = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListVotes(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const MoveView = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.MoveView(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const CreateLabel = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.CreateLabel(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListLabels = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.ListLabels(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const DeleteLabel = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.DeleteLabel(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const UpdateLabel = async (parsedInput: z.infer) => { try { const { task } = await getSDKForCurrentUser(); return await task.UpdateLabel(parsedInput); } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } };