@appconda/nextjs 1.0.113 → 1.0.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@appconda/nextjs",
3
3
  "homepage": "https://appconda.io/support",
4
4
  "description": "Appconda is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5
- "version": "1.0.113",
5
+ "version": "1.0.114",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "src/index.ts",
8
8
  "types": "src/index.ts",
@@ -1,7 +1,6 @@
1
1
  'use server';
2
2
 
3
3
 
4
- import { z, ZodError } from 'zod';
5
4
  import { actionClient } from '../../actions/actionClient';
6
5
  import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
7
6
  import { getSDKForService } from '../../getSDKForService';
@@ -22,7 +21,7 @@ export const CreateProject = actionClient
22
21
  }
23
22
  });
24
23
 
25
- /* export const ListProjects = actionClient
24
+ export const ListProjects = actionClient
26
25
  .schema(ListProjectsSchema)
27
26
  .action(async ({ parsedInput }): Promise<Project[]> => {
28
27
  try {
@@ -34,26 +33,7 @@ export const CreateProject = actionClient
34
33
  console.error('Error in CreateProject:', error);
35
34
  throw new Error('Failed to fetch CreateProject');
36
35
  }
37
- }); */
38
-
39
- export async function ListProjects(payload: z.infer<typeof ListProjectsSchema>): Promise<Project[]> {
40
- try {
41
-
42
- const validatedPayload = ListProjectsSchema.parse(payload);
43
-
44
- const { task } = await getSDKForCurrentUser();
45
- return await task.ListProjects(validatedPayload);
46
-
47
- } catch (error) {
48
- console.error('Error in ListProjects:', error);
49
-
50
- if (error instanceof ZodError) {
51
- throw new Error('Validation failed: ' + error.errors.map(e => e.message).join(', '));
52
- }
53
-
54
- throw new Error('Failed to fetch ListProjects');
55
- }
56
- }
36
+ });
57
37
 
58
38
  export const CreateTaskList = actionClient
59
39
  .schema(CreateTaskListSchema)
@@ -123,9 +103,9 @@ export const DeleteTaskList = actionClient
123
103
  throw new Error('Failed to fetch DeleteTaskList');
124
104
  }
125
105
  });
126
-
127
-
128
- export const CreateSprint = actionClient
106
+
107
+
108
+ export const CreateSprint = actionClient
129
109
  .schema(CreateSprintSchema)
130
110
  .action(async ({ parsedInput }): Promise<Sprint> => {
131
111
  try {
@@ -152,8 +132,8 @@ export const GetSprint = actionClient
152
132
  throw new Error('Failed to fetch GetSprint');
153
133
  }
154
134
  });
155
-
156
- export const ListSprints = actionClient
135
+
136
+ export const ListSprints = actionClient
157
137
  .action(async ({ parsedInput }): Promise<Sprint[]> => {
158
138
  try {
159
139
 
@@ -165,8 +145,8 @@ export const ListSprints = actionClient
165
145
  throw new Error('Failed to fetch ListSprints');
166
146
  }
167
147
  });
168
-
169
- export const UpdateSprint = actionClient
148
+
149
+ export const UpdateSprint = actionClient
170
150
  .schema(UpdateSprintSchema)
171
151
  .action(async ({ parsedInput }): Promise<Sprint> => {
172
152
  try {
@@ -179,8 +159,8 @@ export const UpdateSprint = actionClient
179
159
  throw new Error('Failed to fetch UpdateSprint');
180
160
  }
181
161
  });
182
-
183
- export const DeleteSprint = actionClient
162
+
163
+ export const DeleteSprint = actionClient
184
164
  .schema(DeleteSprintSchema)
185
165
  .action(async ({ parsedInput }): Promise<void> => {
186
166
  try {