@appconda/nextjs 1.0.69 → 1.0.71

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,19 @@ 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>;
38
+ export declare const ListModelProviders: import("next-safe-action").SafeActionFn<string, undefined, readonly [], {
39
+ formErrors: string[];
40
+ fieldErrors: {};
41
+ }, 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,26 @@ 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
+ });
41
+ export const ListModelProviders = actionClient
42
+ .action(async ({ parsedInput }) => {
43
+ try {
44
+ const { agent } = await getSDKForCurrentUser();
45
+ return await agent.ListModelProviders();
46
+ }
47
+ catch (error) {
48
+ console.error('Error in ListModelProviders:', error);
49
+ throw new Error('Failed to fetch ListModelProviders');
50
+ }
51
+ });
@@ -7,4 +7,5 @@ export declare class AgentService extends ServiceClient {
7
7
  CreateAgent(payload: z.infer<typeof CreateAgentSchema>): Promise<Agent>;
8
8
  GetAgent(payload: z.infer<typeof GetAgentSchema>): Promise<Agent>;
9
9
  ListAgents(): Promise<Agent[]>;
10
+ ListModelProviders(): Promise<Agent[]>;
10
11
  }
@@ -12,4 +12,7 @@ export class AgentService extends ServiceClient {
12
12
  async ListAgents() {
13
13
  return await this.actionCall('ListAgents', {});
14
14
  }
15
+ async ListModelProviders() {
16
+ return await this.actionCall('ListModelProviders', {});
17
+ }
15
18
  }
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.69",
5
+ "version": "1.0.71",
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,28 @@ 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
+ });
53
+
54
+ export const ListModelProviders = actionClient
55
+ .action(async ({ parsedInput }): Promise<Agent[]> => {
56
+ try {
57
+
58
+ const { agent } = await getSDKForCurrentUser();
59
+ return await agent.ListModelProviders ();
60
+ } catch (error) {
61
+ console.error('Error in ListModelProviders:', error);
62
+ throw new Error('Failed to fetch ListModelProviders');
63
+ }
64
+ });
@@ -22,4 +22,9 @@ export class AgentService extends ServiceClient {
22
22
  return await this.actionCall('ListAgents', {});
23
23
  }
24
24
 
25
+ public async ListModelProviders(): Promise<Agent[]> {
26
+ return await this.actionCall('ListModelProviders', {});
27
+ }
28
+
29
+
25
30
  }