@appconda/nextjs 1.0.68 → 1.0.70

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.
@@ -23,3 +23,15 @@ export declare const CreateAgent: import("next-safe-action").SafeActionFn<string
23
23
  modelId?: string[];
24
24
  };
25
25
  }, readonly [], Agent>;
26
+ export declare const GetAgent: import("next-safe-action").SafeActionFn<string, import("zod").ZodObject<{
27
+ id: import("zod").ZodString;
28
+ }, "strip", import("zod").ZodTypeAny, {
29
+ id?: string;
30
+ }, {
31
+ id?: string;
32
+ }>, readonly [], {
33
+ formErrors: string[];
34
+ fieldErrors: {
35
+ id?: string[];
36
+ };
37
+ }, readonly [], Agent>;
@@ -1,7 +1,7 @@
1
1
  'use server';
2
2
  import { actionClient } from '../../actions/actionClient';
3
3
  import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
4
- import { CreateAgentSchema } from './schema';
4
+ import { CreateAgentSchema, GetAgentSchema } from './schema';
5
5
  export const ListAgents = actionClient
6
6
  //.schema(ListWaitlistSignupsSchema)
7
7
  .action(async ({ parsedInput }) => {
@@ -26,3 +26,15 @@ export const CreateAgent = actionClient
26
26
  throw new Error('Failed to fetch ListWaitlists');
27
27
  }
28
28
  });
29
+ export const GetAgent = actionClient
30
+ .schema(GetAgentSchema)
31
+ .action(async ({ parsedInput }) => {
32
+ try {
33
+ const { agent } = await getSDKForCurrentUser();
34
+ return await agent.GetAgent(parsedInput);
35
+ }
36
+ catch (error) {
37
+ console.error('Error in ListWaitlists:', error);
38
+ throw new Error('Failed to fetch ListWaitlists');
39
+ }
40
+ });
@@ -12,3 +12,30 @@ export declare const CreateAgentSchema: z.ZodObject<{
12
12
  id?: string;
13
13
  modelId?: string;
14
14
  }>;
15
+ export declare const GetAgentSchema: z.ZodObject<{
16
+ id: z.ZodString;
17
+ }, "strip", z.ZodTypeAny, {
18
+ id?: string;
19
+ }, {
20
+ id?: string;
21
+ }>;
22
+ export declare const UpdateAgentSchema: z.ZodObject<{
23
+ id: z.ZodString;
24
+ name: z.ZodString;
25
+ modelId: z.ZodString;
26
+ }, "strip", z.ZodTypeAny, {
27
+ name?: string;
28
+ id?: string;
29
+ modelId?: string;
30
+ }, {
31
+ name?: string;
32
+ id?: string;
33
+ modelId?: string;
34
+ }>;
35
+ export declare const DeleteAgentSchema: z.ZodObject<{
36
+ id: z.ZodString;
37
+ }, "strip", z.ZodTypeAny, {
38
+ id?: string;
39
+ }, {
40
+ id?: string;
41
+ }>;
@@ -4,3 +4,14 @@ export const CreateAgentSchema = z.object({
4
4
  name: z.string(),
5
5
  modelId: z.string()
6
6
  });
7
+ export const GetAgentSchema = z.object({
8
+ id: z.string()
9
+ });
10
+ export const UpdateAgentSchema = z.object({
11
+ id: z.string(),
12
+ name: z.string(),
13
+ modelId: z.string()
14
+ });
15
+ export const DeleteAgentSchema = z.object({
16
+ id: z.string()
17
+ });
@@ -1,9 +1,10 @@
1
1
  import z from "zod";
2
2
  import { ServiceClient } from "../../service-client";
3
- import { CreateAgentSchema } from "./schema";
3
+ import { CreateAgentSchema, GetAgentSchema } from "./schema";
4
4
  import { Agent } from "./types";
5
5
  export declare class AgentService extends ServiceClient {
6
6
  protected getServiceName(): string;
7
7
  CreateAgent(payload: z.infer<typeof CreateAgentSchema>): Promise<Agent>;
8
+ GetAgent(payload: z.infer<typeof GetAgentSchema>): Promise<Agent>;
8
9
  ListAgents(): Promise<Agent[]>;
9
10
  }
@@ -6,6 +6,9 @@ export class AgentService extends ServiceClient {
6
6
  async CreateAgent(payload) {
7
7
  return await this.actionCall('CreateAgent', payload);
8
8
  }
9
+ async GetAgent(payload) {
10
+ return await this.actionCall('GetAgent', payload);
11
+ }
9
12
  async ListAgents() {
10
13
  return await this.actionCall('ListAgents', {});
11
14
  }
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.68",
5
+ "version": "1.0.70",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -4,7 +4,7 @@
4
4
  import { actionClient } from '../../actions/actionClient';
5
5
  import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
6
6
  import { getSDKForService } from '../../getSDKForService';
7
- import { CreateAgentSchema } from './schema';
7
+ import { CreateAgentSchema, GetAgentSchema } from './schema';
8
8
  import { Agent } from './types';
9
9
 
10
10
 
@@ -37,3 +37,16 @@ export const CreateAgent = actionClient
37
37
  }
38
38
  });
39
39
 
40
+ export const GetAgent = actionClient
41
+ .schema(GetAgentSchema)
42
+ .action(async ({ parsedInput }): Promise<Agent> => {
43
+ try {
44
+
45
+ const { agent } = await getSDKForCurrentUser();
46
+ return await agent.GetAgent(parsedInput);
47
+
48
+ } catch (error) {
49
+ console.error('Error in ListWaitlists:', error);
50
+ throw new Error('Failed to fetch ListWaitlists');
51
+ }
52
+ });
@@ -5,3 +5,17 @@ export const CreateAgentSchema = z.object({
5
5
  name: z.string(),
6
6
  modelId: z.string()
7
7
  });
8
+
9
+ export const GetAgentSchema = z.object({
10
+ id: z.string()
11
+ });
12
+
13
+ export const UpdateAgentSchema = z.object({
14
+ id: z.string(),
15
+ name: z.string(),
16
+ modelId: z.string()
17
+ });
18
+
19
+ export const DeleteAgentSchema = z.object({
20
+ id: z.string()
21
+ });
@@ -1,7 +1,7 @@
1
1
 
2
2
  import z from "zod";
3
3
  import { ServiceClient } from "../../service-client";
4
- import { CreateAgentSchema } from "./schema";
4
+ import { CreateAgentSchema, GetAgentSchema } from "./schema";
5
5
  import { Agent } from "./types";
6
6
 
7
7
 
@@ -14,6 +14,10 @@ export class AgentService extends ServiceClient {
14
14
  return await this.actionCall('CreateAgent', payload);
15
15
  }
16
16
 
17
+ public async GetAgent(payload: z.infer<typeof GetAgentSchema>): Promise<Agent> {
18
+ return await this.actionCall('GetAgent', payload);
19
+ }
20
+
17
21
  public async ListAgents(): Promise<Agent[]> {
18
22
  return await this.actionCall('ListAgents', {});
19
23
  }