@appconda/nextjs 1.0.138 → 1.0.140
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/dist/modules/scheduled-job/action.d.ts +55 -75
- package/dist/modules/scheduled-job/action.js +44 -65
- package/dist/modules/scheduled-job/index.d.ts +0 -1
- package/dist/modules/scheduled-job/index.js +1 -2
- package/dist/modules/task/action.d.ts +72 -200
- package/dist/modules/task/action.js +47 -71
- package/package.json +1 -1
- package/src/modules/scheduled-job/action.ts +40 -56
- package/src/modules/scheduled-job/index.ts +0 -1
- package/src/modules/task/action.ts +103 -125
- package/src/modules/scheduled-job/action2.ts +0 -21
@@ -1,29 +1,23 @@
|
|
1
1
|
'use server';
|
2
2
|
|
3
3
|
|
4
|
-
import {
|
4
|
+
import { z } from 'zod';
|
5
5
|
import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
|
6
|
-
import { getSDKForService } from '../../getSDKForService';
|
7
6
|
import { CreateProjectSchema, CreateSprintSchema, CreateTaskListSchema, DeleteSprintSchema, DeleteTaskListSchema, GetSprintSchema, GetTaskListSchema, ListProjectsSchema, UpdateSprintSchema, UpdateTaskListSchema } from './schema';
|
8
7
|
import { Project, Sprint, TaskList } from './types';
|
9
8
|
|
10
|
-
export const CreateProject =
|
11
|
-
|
12
|
-
|
13
|
-
try {
|
14
|
-
|
15
|
-
const { task } = await getSDKForCurrentUser();
|
9
|
+
export const CreateProject = async ({ parsedInput }: { parsedInput: z.infer<typeof CreateProjectSchema> }): Promise<{data?: Project, serverError?: string}> => {
|
10
|
+
try {
|
11
|
+
const { task } = await getSDKForCurrentUser();
|
16
12
|
return await task.CreateProject(parsedInput);
|
17
13
|
|
18
14
|
} catch (error) {
|
19
15
|
console.error('Error in CreateProject:', error);
|
20
|
-
|
16
|
+
return { serverError: error.toString() };
|
21
17
|
}
|
22
|
-
}
|
18
|
+
};
|
23
19
|
|
24
|
-
export const ListProjects =
|
25
|
-
.schema(ListProjectsSchema)
|
26
|
-
.action(async ({ parsedInput }): Promise<Project[]> => {
|
20
|
+
export const ListProjects = async ({ parsedInput }: { parsedInput: z.infer<typeof ListProjectsSchema> }): Promise<{data?: Project[], serverError?: string}> => {
|
27
21
|
try {
|
28
22
|
|
29
23
|
const { task } = await getSDKForCurrentUser();
|
@@ -31,145 +25,129 @@ export const CreateProject = actionClient
|
|
31
25
|
|
32
26
|
} catch (error) {
|
33
27
|
console.error('Error in ListProjects:', error);
|
34
|
-
|
28
|
+
return { serverError: error.toString() };
|
35
29
|
}
|
36
|
-
}
|
30
|
+
};
|
37
31
|
|
38
|
-
export const CreateTaskList =
|
39
|
-
|
40
|
-
.action(async ({ parsedInput }): Promise<TaskList> => {
|
41
|
-
try {
|
32
|
+
export const CreateTaskList = async ({ parsedInput }: { parsedInput: z.infer<typeof CreateTaskListSchema> }): Promise<{data?: TaskList, serverError?: string}> => {
|
33
|
+
try {
|
42
34
|
|
43
|
-
|
44
|
-
|
35
|
+
const { task } = await getSDKForCurrentUser();
|
36
|
+
return { data: await task.CreateTaskList(parsedInput) };
|
45
37
|
|
46
38
|
} catch (error) {
|
47
39
|
console.error('Error in CreateTaskList:', error);
|
48
|
-
|
40
|
+
return { serverError: error.toString() };
|
49
41
|
}
|
50
|
-
}
|
42
|
+
};
|
51
43
|
|
52
|
-
export const GetTaskList =
|
53
|
-
|
54
|
-
.action(async ({ parsedInput }): Promise<TaskList> => {
|
55
|
-
try {
|
44
|
+
export const GetTaskList = async ({ parsedInput }: { parsedInput: z.infer<typeof GetTaskListSchema> }): Promise<{data?: TaskList, serverError?: string}> => {
|
45
|
+
try {
|
56
46
|
|
57
|
-
|
58
|
-
|
47
|
+
const { task } = await getSDKForCurrentUser();
|
48
|
+
return { data: await task.GetTaskList(parsedInput) };
|
59
49
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
50
|
+
} catch (error) {
|
51
|
+
console.error('Error in GetTaskList:', error);
|
52
|
+
return { serverError: error.toString() };
|
53
|
+
}
|
54
|
+
};
|
65
55
|
|
66
|
-
export const ListTaskLists = actionClient
|
67
|
-
.action(async ({ parsedInput }): Promise<TaskList[]> => {
|
68
|
-
try {
|
69
56
|
|
70
|
-
const { task } = await getSDKForCurrentUser();
|
71
|
-
return await task.ListTaskLists();
|
72
57
|
|
73
|
-
|
74
|
-
|
75
|
-
throw new Error('Failed to fetch ListTaskLists');
|
76
|
-
}
|
77
|
-
});
|
58
|
+
export const ListTaskLists = async (): Promise<{data?: TaskList[], serverError?: string}> => {
|
59
|
+
try {
|
78
60
|
|
79
|
-
|
80
|
-
|
81
|
-
.action(async ({ parsedInput }): Promise<TaskList> => {
|
82
|
-
try {
|
61
|
+
const { task } = await getSDKForCurrentUser();
|
62
|
+
return { data: await task.ListTaskLists() };
|
83
63
|
|
84
|
-
|
85
|
-
|
64
|
+
} catch (error) {
|
65
|
+
console.error('Error in ListTaskLists:', error);
|
66
|
+
return { serverError: error.toString() };
|
67
|
+
}
|
68
|
+
};
|
86
69
|
|
87
|
-
|
88
|
-
|
89
|
-
throw new Error('Failed to fetch UpdateTaskList');
|
90
|
-
}
|
91
|
-
});
|
70
|
+
export const UpdateTaskList = async ({ parsedInput }: { parsedInput: z.infer<typeof UpdateTaskListSchema> }): Promise<{data?: TaskList, serverError?: string}> => {
|
71
|
+
try {
|
92
72
|
|
93
|
-
|
94
|
-
|
95
|
-
.action(async ({ parsedInput }): Promise<void> => {
|
96
|
-
try {
|
73
|
+
const { task } = await getSDKForCurrentUser();
|
74
|
+
return { data: await task.UpdateTaskList(parsedInput) };
|
97
75
|
|
98
|
-
|
99
|
-
|
76
|
+
} catch (error) {
|
77
|
+
console.error('Error in UpdateTaskList:', error);
|
78
|
+
return { serverError: error.toString() };
|
79
|
+
}
|
80
|
+
};
|
100
81
|
|
101
|
-
|
102
|
-
|
103
|
-
throw new Error('Failed to fetch DeleteTaskList');
|
104
|
-
}
|
105
|
-
});
|
106
|
-
|
107
|
-
|
108
|
-
export const CreateSprint = actionClient
|
109
|
-
.schema(CreateSprintSchema)
|
110
|
-
.action(async ({ parsedInput }): Promise<Sprint> => {
|
111
|
-
try {
|
82
|
+
export const DeleteTaskList = async ({ parsedInput }: { parsedInput: z.infer<typeof DeleteTaskListSchema> }): Promise<{data?: void, serverError?: string}> => {
|
83
|
+
try {
|
112
84
|
|
113
|
-
|
114
|
-
|
85
|
+
const { task } = await getSDKForCurrentUser();
|
86
|
+
return { data: await task.DeleteTaskList(parsedInput) };
|
115
87
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
88
|
+
} catch (error) {
|
89
|
+
console.error('Error in DeleteTaskList:', error);
|
90
|
+
return { serverError: error.toString() };
|
91
|
+
}
|
92
|
+
};
|
121
93
|
|
122
|
-
export const
|
123
|
-
|
124
|
-
.action(async ({ parsedInput }): Promise<Sprint> => {
|
125
|
-
try {
|
94
|
+
export const CreateSprint = async ({ parsedInput }: { parsedInput: z.infer<typeof CreateSprintSchema> }): Promise<{data?: Sprint, serverError?: string}> => {
|
95
|
+
try {
|
126
96
|
|
127
|
-
|
128
|
-
|
97
|
+
const { task } = await getSDKForCurrentUser();
|
98
|
+
return { data: await task.CreateSprint(parsedInput) };
|
129
99
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
export const ListSprints = actionClient
|
137
|
-
.action(async ({ parsedInput }): Promise<Sprint[]> => {
|
138
|
-
try {
|
100
|
+
} catch (error) {
|
101
|
+
console.error('Error in CreateSprint:', error);
|
102
|
+
return { serverError: error.toString() };
|
103
|
+
}
|
104
|
+
};
|
139
105
|
|
140
|
-
|
141
|
-
|
106
|
+
export const GetSprint = async ({ parsedInput }: { parsedInput: z.infer<typeof GetSprintSchema> }): Promise<{data?: Sprint, serverError?: string}> => {
|
107
|
+
try {
|
142
108
|
|
143
|
-
}
|
144
|
-
|
145
|
-
throw new Error('Failed to fetch ListSprints');
|
146
|
-
}
|
147
|
-
});
|
148
|
-
|
149
|
-
export const UpdateSprint = actionClient
|
150
|
-
.schema(UpdateSprintSchema)
|
151
|
-
.action(async ({ parsedInput }): Promise<Sprint> => {
|
152
|
-
try {
|
109
|
+
const { task } = await getSDKForCurrentUser();
|
110
|
+
return { data: await task.GetSprint(parsedInput) };
|
153
111
|
|
154
|
-
|
155
|
-
|
112
|
+
} catch (error) {
|
113
|
+
console.error('Error in GetSprint:', error);
|
114
|
+
return { serverError: error.toString() };
|
115
|
+
}
|
116
|
+
};
|
156
117
|
|
157
|
-
|
158
|
-
|
159
|
-
throw new Error('Failed to fetch UpdateSprint');
|
160
|
-
}
|
161
|
-
});
|
162
|
-
|
163
|
-
export const DeleteSprint = actionClient
|
164
|
-
.schema(DeleteSprintSchema)
|
165
|
-
.action(async ({ parsedInput }): Promise<void> => {
|
166
|
-
try {
|
118
|
+
export const ListSprints = async ({ parsedInput }: { parsedInput: z.infer<typeof ListSprintsSchema> }): Promise<{data?: Sprint[], serverError?: string}> => {
|
119
|
+
try {
|
167
120
|
|
168
|
-
|
169
|
-
|
121
|
+
const { task } = await getSDKForCurrentUser();
|
122
|
+
return { data: await task.ListSprints() };
|
170
123
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
124
|
+
} catch (error) {
|
125
|
+
console.error('Error in ListSprints:', error);
|
126
|
+
return { serverError: error.toString() };
|
127
|
+
}
|
128
|
+
};
|
129
|
+
|
130
|
+
export const UpdateSprint = async ({ parsedInput }: { parsedInput: z.infer<typeof UpdateSprintSchema> }): Promise<{data?: Sprint, serverError?: string}> => {
|
131
|
+
try {
|
132
|
+
|
133
|
+
const { task } = await getSDKForCurrentUser();
|
134
|
+
return { data: await task.UpdateSprint(parsedInput) };
|
135
|
+
|
136
|
+
} catch (error) {
|
137
|
+
console.error('Error in UpdateSprint:', error);
|
138
|
+
return { serverError: error.toString() };
|
139
|
+
}
|
140
|
+
};
|
141
|
+
|
142
|
+
export const DeleteSprint = async ({ parsedInput }: { parsedInput: z.infer<typeof DeleteSprintSchema> }): Promise<{data?: void, serverError?: string}> => {
|
143
|
+
try {
|
144
|
+
|
145
|
+
const { task } = await getSDKForCurrentUser();
|
146
|
+
return { data: await task.DeleteSprint(parsedInput) };
|
147
|
+
|
148
|
+
} catch (error) {
|
149
|
+
console.error('Error in DeleteSprint:', error);
|
150
|
+
return { serverError: error.toString() };
|
151
|
+
}
|
152
|
+
};
|
153
|
+
|
@@ -1,21 +0,0 @@
|
|
1
|
-
'use server';
|
2
|
-
|
3
|
-
import { z } from "zod";
|
4
|
-
|
5
|
-
import { UpdateJobSchema } from "./schema";
|
6
|
-
import { getSDKForCurrentUser } from "../../getSDKForCurrentUser";
|
7
|
-
|
8
|
-
|
9
|
-
export const UpdateJob = async (params: z.infer<typeof UpdateJobSchema>) => {
|
10
|
-
try {
|
11
|
-
const parsedInput = UpdateJobSchema.parse(params);
|
12
|
-
const { scheduledJob } = await getSDKForCurrentUser();
|
13
|
-
return await scheduledJob.UpdateJob(parsedInput);
|
14
|
-
|
15
|
-
} catch (error) {
|
16
|
-
console.error('Error in UpdateJob:', error);
|
17
|
-
return {
|
18
|
-
serverError: error.toString()
|
19
|
-
}
|
20
|
-
}
|
21
|
-
}
|