@appconda/sdk 1.0.411 → 1.0.414

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.
Files changed (63) hide show
  1. package/dist/client.js +10 -4
  2. package/dist/inputFile.d.ts +0 -1
  3. package/dist/inputFile.js +1 -2
  4. package/dist/modules/agent/index.d.ts +0 -1
  5. package/dist/modules/agent/index.js +1 -2
  6. package/dist/modules/ai/node/index.d.ts +0 -1
  7. package/dist/modules/ai/node/index.js +1 -2
  8. package/dist/modules/builder/index.d.ts +0 -1
  9. package/dist/modules/builder/index.js +1 -2
  10. package/dist/modules/datasource/index.d.ts +0 -1
  11. package/dist/modules/datasource/index.js +1 -2
  12. package/dist/modules/emploid/index.d.ts +0 -1
  13. package/dist/modules/emploid/index.js +1 -2
  14. package/dist/modules/google/index.d.ts +0 -1
  15. package/dist/modules/google/index.js +1 -2
  16. package/dist/modules/hooks/index.d.ts +0 -1
  17. package/dist/modules/hooks/index.js +1 -2
  18. package/dist/modules/mail/index.d.ts +0 -1
  19. package/dist/modules/mail/index.js +1 -2
  20. package/dist/modules/notion/index.d.ts +0 -1
  21. package/dist/modules/notion/index.js +1 -2
  22. package/dist/modules/organization/index.d.ts +0 -1
  23. package/dist/modules/organization/index.js +1 -2
  24. package/dist/modules/scheduled-job/index.d.ts +0 -2
  25. package/dist/modules/scheduled-job/index.js +1 -3
  26. package/dist/modules/task/index.d.ts +0 -1
  27. package/dist/modules/task/index.js +1 -2
  28. package/dist/modules/tenant/index.d.ts +0 -1
  29. package/dist/modules/tenant/index.js +1 -2
  30. package/dist/modules/waitlist/index.d.ts +0 -1
  31. package/dist/modules/waitlist/index.js +1 -2
  32. package/package.json +1 -1
  33. package/src/client.ts +12 -3
  34. package/src/modules/agent/index.ts +1 -1
  35. package/src/modules/ai/node/index.ts +1 -1
  36. package/src/modules/builder/index.ts +1 -1
  37. package/src/modules/datasource/index.ts +1 -1
  38. package/src/modules/emploid/index.ts +1 -1
  39. package/src/modules/google/index.ts +1 -1
  40. package/src/modules/hooks/index.ts +1 -1
  41. package/src/modules/mail/index.ts +1 -1
  42. package/src/modules/notion/index.ts +1 -1
  43. package/src/modules/organization/index.ts +1 -1
  44. package/src/modules/scheduled-job/index.ts +1 -2
  45. package/src/modules/task/index.ts +1 -1
  46. package/src/modules/tenant/index.ts +1 -2
  47. package/src/modules/waitlist/index.ts +1 -1
  48. package/src/inputFile.ts +0 -23
  49. package/src/modules/agent/action.ts +0 -66
  50. package/src/modules/ai/node/actions.ts +0 -14
  51. package/src/modules/builder/action.ts +0 -234
  52. package/src/modules/datasource/action.ts +0 -189
  53. package/src/modules/emploid/action.ts +0 -1063
  54. package/src/modules/google/action.ts +0 -54
  55. package/src/modules/hooks/lib/handler.ts +0 -27
  56. package/src/modules/mail/action.ts +0 -22
  57. package/src/modules/notion/action.ts +0 -53
  58. package/src/modules/organization/action.ts +0 -71
  59. package/src/modules/scheduled-job/action.ts +0 -212
  60. package/src/modules/scheduled-job/lib/handler.ts +0 -27
  61. package/src/modules/task/action.ts +0 -819
  62. package/src/modules/tenant/actions.ts +0 -173
  63. package/src/modules/waitlist/action.ts +0 -93
@@ -1,54 +0,0 @@
1
- 'use server';
2
-
3
- import { z } from 'zod';
4
- import { AppcondaException } from '../../client';
5
- import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
6
- import { ListSpreadSheetsSchema, ListWorkbookColumnsSchema, ListWorkbooksSchema } from './schema';
7
-
8
-
9
-
10
- export const ListSpreadSheets = async (parsedInput: z.infer<typeof ListSpreadSheetsSchema>) => {
11
- try {
12
- const { google } = await getSDKForCurrentUser();
13
- //@ts-ignore
14
- const app = await google.ListSpreadSheets(parsedInput);
15
- return app;
16
- } catch (error) {
17
- if (error instanceof AppcondaException) {
18
- throw new Error(error.message);
19
- }
20
-
21
- throw error;
22
- }
23
- };
24
-
25
- export const ListWorkbooks = async (parsedInput: z.infer<typeof ListWorkbooksSchema>) => {
26
- try {
27
- const { google } = await getSDKForCurrentUser();
28
- //@ts-ignore
29
- const app = await google.ListWorkbooks(parsedInput);
30
- return app;
31
- } catch (error) {
32
- if (error instanceof AppcondaException) {
33
- throw new Error(error.message);
34
- }
35
-
36
- throw error;
37
- }
38
- };
39
-
40
- export const ListWorkbookColumns = async (parsedInput: z.infer<typeof ListWorkbookColumnsSchema>) => {
41
- try {
42
- const { google } = await getSDKForCurrentUser();
43
- //@ts-ignore
44
- const app = await google.ListWorkbookColumns(parsedInput);
45
- return app;
46
- } catch (error) {
47
- if (error instanceof AppcondaException) {
48
- throw new Error(error.message);
49
- }
50
-
51
- throw error;
52
- }
53
- };
54
-
@@ -1,27 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
-
3
- import './jobs';
4
- import { hooks } from './Hooks';
5
-
6
- /* export async function GET() {
7
- return NextResponse.json({ schedules: schedules.toJSON() },
8
- { status: 200 });
9
- }
10
-
11
- export async function POST(request: Request) {
12
-
13
- } */
14
-
15
- export async function hookHandler(request: NextRequest, res: NextResponse) {
16
- if (request.method === 'POST') {
17
- const body = await request.json();
18
- const hookId = body.hookId;
19
- hooks.run(hookId);
20
- return NextResponse.json({ message: 'Callback triggered' },
21
- { status: 200 });
22
- } else {
23
- return NextResponse.json({ hooks: hooks.toJSON() },
24
- { status: 200 });
25
- }
26
- }
27
-
@@ -1,22 +0,0 @@
1
- 'use server';
2
-
3
- import { z } from 'zod';
4
- import { AppcondaException } from '../../client';
5
- import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
6
- import { SendMailSchema } from './schema';
7
-
8
- export const SendMail = async (parsedInput: z.infer<typeof SendMailSchema>) => {
9
- try {
10
- const { mail } = await getSDKForCurrentUser();
11
- //@ts-ignore
12
- const app = await mail.SendMail(parsedInput);
13
- return app;
14
- } catch (error) {
15
- if (error instanceof AppcondaException) {
16
- throw new Error(error.message);
17
- }
18
-
19
- throw error;
20
- }
21
- };
22
-
@@ -1,53 +0,0 @@
1
- 'use server';
2
-
3
- import { z } from 'zod';
4
- import { AppcondaException } from '../../client';
5
- import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
6
- import { ListNotionDatabasesSchema, ListNotionColumnsSchema, CreateNotionRowSchema } from './schema';
7
-
8
- export const ListNotionDatabases = async (parsedInput: z.infer<typeof ListNotionDatabasesSchema>) => {
9
- try {
10
- const { notion } = await getSDKForCurrentUser();
11
- //@ts-ignore
12
- const app = await notion.ListDatabases(parsedInput);
13
- return app;
14
- } catch (error) {
15
- if (error instanceof AppcondaException) {
16
- throw new Error(error.message);
17
- }
18
-
19
- throw error;
20
- }
21
- };
22
-
23
- export const ListNotionColumns = async (parsedInput: z.infer<typeof ListNotionColumnsSchema>) => {
24
- try {
25
- const { notion } = await getSDKForCurrentUser();
26
- //@ts-ignore
27
- const app = await notion.ListColumns(parsedInput);
28
- return app;
29
- } catch (error) {
30
- if (error instanceof AppcondaException) {
31
- throw new Error(error.message);
32
- }
33
-
34
- throw error;
35
- }
36
- };
37
-
38
- export const CreateNotionRow = async (parsedInput: z.infer<typeof CreateNotionRowSchema>) => {
39
- try {
40
- const { notion } = await getSDKForCurrentUser();
41
- //@ts-ignore
42
- const app = await notion.CreateRow(parsedInput);
43
- return app;
44
- } catch (error) {
45
- if (error instanceof AppcondaException) {
46
- throw new Error(error.message);
47
- }
48
-
49
- throw error;
50
- }
51
- };
52
-
53
-
@@ -1,71 +0,0 @@
1
- 'use server';
2
-
3
- import z from "zod";
4
- import { CreateMembershipSchema, CreateOrganizationSchema, GetOrganizationsByUserIdSchema, RegisterOrganizationSchema } from "./schema";
5
- import { TMembership, TOrganization } from "./types";
6
- import { getSDKForService } from "../../getSDKForService";
7
- import { AppcondaException } from "../../client";
8
-
9
-
10
-
11
- export async function CreateOrganization(parsedInput: z.infer<typeof CreateOrganizationSchema>): Promise<TOrganization> {
12
- try {
13
- const { organization } = await getSDKForService();
14
- //@ts-ignore
15
- const app = await organization.CreateOrganization(parsedInput);
16
- return app;
17
- } catch (error) {
18
- if (error instanceof AppcondaException) {
19
- throw new Error(error.message);
20
- }
21
-
22
- throw error;
23
- }
24
- }
25
-
26
- export async function CreateMembership(parsedInput: z.infer<typeof CreateMembershipSchema>): Promise<TMembership> {
27
- try {
28
- const { organization } = await getSDKForService();
29
- //@ts-ignore
30
- const app = await organization.CreateMembership(parsedInput);
31
- return app;
32
- } catch (error) {
33
- if (error instanceof AppcondaException) {
34
- throw new Error(error.message);
35
- }
36
-
37
- throw error;
38
- }
39
- }
40
-
41
- export async function RegisterOrganization(parsedInput: z.infer<typeof RegisterOrganizationSchema>): Promise<TOrganization> {
42
- try {
43
- const { organization } = await getSDKForService();
44
- //@ts-ignore
45
- const app = await organization.RegisterOrganization(parsedInput);
46
- return app;
47
- } catch (error) {
48
- if (error instanceof AppcondaException) {
49
- throw new Error(error.message);
50
- }
51
-
52
- throw error;
53
- }
54
- }
55
-
56
- export async function GetOrganizationsByUserId(parsedInput: z.infer<typeof GetOrganizationsByUserIdSchema>): Promise<TOrganization[]> {
57
- try {
58
- const { organization } = await getSDKForService();
59
- //@ts-ignore
60
- const app = await organization.GetOrganizationsByUserId(parsedInput);
61
- return app;
62
- } catch (error) {
63
- if (error instanceof AppcondaException) {
64
- throw new Error(error.message);
65
- }
66
-
67
- throw error;
68
- }
69
- }
70
-
71
-
@@ -1,212 +0,0 @@
1
- 'use server';
2
-
3
-
4
- import { z, ZodError } from 'zod';
5
- import { actionClient } from '../../actions/actionClient';
6
- import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
7
- import { CreateScheduledJobSchema, DeleteExecutionsSchema, DeleteJobSchema, GetDailyExecutionTrendSchema, GetJobStatsSchema, GetScheduledJobSchema, GetTopFailedJobsSchema, ListAvgExecutionsSchema, ListExecutionsSchema, ListScheduledJobsSchema, QueueJobSchema, UpdateJobSchema } from './schema';
8
- import { AvgExecution, Execution, ExecutionTrend, FailedJob, JobStats, ScheduledJob } from './types';
9
- import { AppcondaException } from '../../client';
10
- import { ActionResult } from '../../lib/types';
11
-
12
- export const CreateScheduledJob = async ({ parsedInput }: { parsedInput: z.infer<typeof CreateScheduledJobSchema> }): Promise<{ data?: ScheduledJob, serverError?: string }> => {
13
- try {
14
-
15
- const { scheduledJob } = await getSDKForCurrentUser();
16
- return { data: await scheduledJob.CreateScheduledJob(parsedInput) };
17
-
18
- } catch (error) {
19
- console.error('Error in CreateScheduledJob:', error);
20
- return { serverError: error.toString() };
21
- }
22
- };
23
-
24
- export const ListScheduledJobs = async (parsedInput: z.infer<typeof ListScheduledJobsSchema>): Promise<{ data?: ScheduledJob[], serverError?: string }> => {
25
- try {
26
- const { scheduledJob } = await getSDKForCurrentUser();
27
- return { data: await scheduledJob.ListScheduledJobs(parsedInput) };
28
-
29
- } catch (error) {
30
- console.error('Error in ListScheduledJobs:', error);
31
- return { serverError: error.toString() };
32
- }
33
- };
34
-
35
- export const GetScheduledJob = async (parsedInput: z.infer<typeof GetScheduledJobSchema>): Promise<{ data?: ScheduledJob, serverError?: string }> => {
36
- try {
37
-
38
- const { scheduledJob } = await getSDKForCurrentUser();
39
- return { data: await scheduledJob.GetScheduledJob(parsedInput) };
40
-
41
- } catch (error) {
42
- console.error('Error in GetScheduledJob:', error);
43
- return { serverError: error.toString() };
44
- }
45
- };
46
-
47
- export const ListExecutions = async (parsedInput: z.infer<typeof ListExecutionsSchema>): Promise<{ data?: Execution[], serverError?: string }> => {
48
- try {
49
-
50
- const { scheduledJob } = await getSDKForCurrentUser();
51
- return { data: await scheduledJob.ListExecutions(parsedInput) };
52
-
53
- } catch (error) {
54
- console.error('Error in ListExecutions:', error);
55
- return { serverError: error.toString() };
56
- }
57
- };
58
-
59
- export const ListAvgExecutions = async (parsedInput: z.infer<typeof ListAvgExecutionsSchema>): Promise<{ data?: AvgExecution[], serverError?: string }> => {
60
- try {
61
-
62
- const { scheduledJob } = await getSDKForCurrentUser();
63
- return { data: await scheduledJob.ListAvgExecutions(parsedInput) };
64
-
65
- } catch (error) {
66
- console.error('Error in ListAvgExecutions:', error);
67
- return { serverError: error.toString() };
68
- }
69
- };
70
-
71
- export const UpdateJob = async (params: z.infer<typeof UpdateJobSchema>): Promise<ActionResult<ScheduledJob>> => {
72
- try {
73
- console.log('params', params);
74
- const parsedInput = UpdateJobSchema.parse(params);
75
- const { scheduledJob } = await getSDKForCurrentUser();
76
- return { data: await scheduledJob.UpdateJob(parsedInput) };
77
-
78
- } catch (error) {
79
- if (error instanceof AppcondaException) {
80
- return { serverError: error.message };
81
- }
82
- if (error instanceof ZodError) {
83
- return { validationError: error.toString() };
84
- }
85
- console.error('Error in UpdateJob:', error);
86
- return { serverError: error.toString() };
87
- }
88
- };
89
-
90
- export const GetDailyExecutionTrend = async (parsedInput: z.infer<typeof GetDailyExecutionTrendSchema>): Promise<{ data?: ExecutionTrend[], serverError?: string }> => {
91
- try {
92
-
93
- const { scheduledJob } = await getSDKForCurrentUser();
94
- return { data: await scheduledJob.GetDailyExecutionTrend(parsedInput) };
95
-
96
- } catch (error) {
97
- console.error('Error in GetDailyExecutionTrend:', error);
98
- return { serverError: error.toString() };
99
- }
100
- };
101
-
102
-
103
-
104
- export const GetTopFailedJobs = async (parsedInput: z.infer<typeof GetTopFailedJobsSchema>): Promise<{ data?: FailedJob[], serverError?: string }> => {
105
- try {
106
-
107
- const { scheduledJob } = await getSDKForCurrentUser();
108
- //@ts-ignore
109
- return { data: await scheduledJob.GetTopFailedJobs(parsedInput) };
110
-
111
- } catch (error) {
112
- console.error('Error in GetTopFailedJobs:', error);
113
- return { serverError: error.toString() };
114
- }
115
- };
116
-
117
- export const GetJobStats = async (parsedInput: z.infer<typeof GetJobStatsSchema>): Promise<{ data?: JobStats, serverError?: string }> => {
118
- try {
119
-
120
- const { scheduledJob } = await getSDKForCurrentUser();
121
- return { data: await scheduledJob.GetJobStats(parsedInput) };
122
-
123
- } catch (error) {
124
- console.error('Error in GetJobStats:', error);
125
- return { serverError: error.toString() };
126
- }
127
- };
128
-
129
- export const DeleteJob = async (parsedInput: z.infer<typeof DeleteJobSchema>): Promise<ActionResult<void>> => {
130
- try {
131
- const { scheduledJob } = await getSDKForCurrentUser();
132
- await scheduledJob.DeleteJob(parsedInput);
133
- return {};
134
- } catch (error) {
135
- console.error('Error in DeleteJob:', error);
136
- return { serverError: error.toString() };
137
- }
138
- };
139
-
140
- export const ListJobsWithStats = async () => {
141
- try {
142
-
143
- const jobs = await ListScheduledJobs({});
144
- const avg = await ListAvgExecutions({});
145
-
146
- // Merge jobs with average execution data
147
- const mergedJobs = jobs?.data?.map(job => {
148
- const jobAvg = avg?.data?.find(a => a.scheduledJobId === job.id);
149
- return {
150
- ...job,
151
- totalExecutions: jobAvg?.totalExecutions || 0,
152
- activeDays: jobAvg?.activeDays || 0,
153
- avgExecutionsPerDay: jobAvg?.avgExecutionsPerDay || 0,
154
- completed: jobAvg?.completed || 0,
155
- failed: jobAvg?.failed || 0,
156
- queued: jobAvg?.queued || 0,
157
- };
158
- }) || [];
159
-
160
- return { data: mergedJobs };
161
-
162
- } catch (error) {
163
- console.error('Error in ListJobsWithStats:', error);
164
- return { serverError: error.toString() };
165
- }
166
- };
167
-
168
- export const GetJobMetrics = async () => {
169
- try {
170
- const { scheduledJob } = await getSDKForCurrentUser();
171
- return await scheduledJob.GetJobMetrics();
172
- } catch (error) {
173
- console.error('Error in GetJobMetrics:', error);
174
- throw new Error(error.toString());
175
- }
176
- };
177
-
178
- export const QueueJob = async (parsedInput: z.infer<typeof QueueJobSchema>): Promise<boolean> => {
179
- try {
180
- const { scheduledJob } = await getSDKForCurrentUser();
181
- await scheduledJob.QueueJob(parsedInput);
182
- return true;
183
- } catch (error) {
184
- if (error instanceof AppcondaException) {
185
- console.error('Error in QueueJob:', error.message);
186
-
187
- }
188
- return false;
189
- }
190
- };
191
-
192
- export const DeleteExecutions = async ( parsedInput: z.infer<typeof DeleteExecutionsSchema> ): Promise<{data?: void, serverError?: string}> => {
193
- try {
194
-
195
- const { scheduledJob } = await getSDKForCurrentUser();
196
- return { data: await scheduledJob.DeleteExecutions(parsedInput) };
197
-
198
- } catch (error) {
199
- console.error('Error in DeleteExecutions:', error);
200
- return { serverError: error.toString() };
201
- }
202
- };
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
-
@@ -1,27 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
-
3
- import './jobs';
4
- import { schedules } from './Schedules';
5
-
6
- /* export async function GET() {
7
- return NextResponse.json({ schedules: schedules.toJSON() },
8
- { status: 200 });
9
- }
10
-
11
- export async function POST(request: Request) {
12
-
13
- } */
14
-
15
- export async function scheduledJobHandler(request: NextRequest, res: NextResponse) {
16
- if (request.method === 'POST') {
17
- const body = await request.json();
18
- const taskId = body.taskId;
19
- schedules.run(taskId);
20
- return NextResponse.json({ message: 'Callback triggered' },
21
- { status: 200 });
22
- } else {
23
- return NextResponse.json({ schedules: schedules.toJSON() },
24
- { status: 200 });
25
- }
26
- }
27
-