@appconda/nextjs 1.0.71 → 1.0.73
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/modules/agent/action.d.ts +13 -1
- package/dist/modules/agent/action.js +13 -1
- package/dist/modules/agent/schema.d.ts +7 -0
- package/dist/modules/agent/schema.js +3 -0
- package/dist/modules/agent/service.d.ts +3 -2
- package/dist/modules/agent/service.js +3 -0
- package/dist/modules/agent/types.d.ts +4 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/modules/agent/action.ts +21 -8
- package/src/modules/agent/schema.ts +4 -0
- package/src/modules/agent/service.ts +6 -2
- package/src/modules/agent/types.ts +6 -0
package/dist/index.d.ts
CHANGED
@@ -36,5 +36,6 @@ export { PasswordHash } from './enums/password-hash';
|
|
36
36
|
export { MessagingProviderType } from './enums/messaging-provider-type';
|
37
37
|
export { getSDKForCurrentUser } from './getSDKForCurrentUser';
|
38
38
|
export { getSDKForService } from './getSDKForService';
|
39
|
+
export { getAppcondaClient } from './getAppcondaClient';
|
39
40
|
export * from './modules';
|
40
41
|
export type { SafeActionFn } from 'next-safe-action';
|
package/dist/index.js
CHANGED
@@ -34,4 +34,5 @@ export { PasswordHash } from './enums/password-hash';
|
|
34
34
|
export { MessagingProviderType } from './enums/messaging-provider-type';
|
35
35
|
export { getSDKForCurrentUser } from './getSDKForCurrentUser';
|
36
36
|
export { getSDKForService } from './getSDKForService';
|
37
|
+
export { getAppcondaClient } from './getAppcondaClient';
|
37
38
|
export * from './modules';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Agent } from './types';
|
1
|
+
import { Agent, AIModel } from './types';
|
2
2
|
export declare const ListAgents: import("next-safe-action").SafeActionFn<string, undefined, readonly [], {
|
3
3
|
formErrors: string[];
|
4
4
|
fieldErrors: {};
|
@@ -39,3 +39,15 @@ export declare const ListModelProviders: import("next-safe-action").SafeActionFn
|
|
39
39
|
formErrors: string[];
|
40
40
|
fieldErrors: {};
|
41
41
|
}, readonly [], Agent[]>;
|
42
|
+
export declare const ListModels: import("next-safe-action").SafeActionFn<string, import("zod").ZodObject<{
|
43
|
+
modelProviderId: import("zod").ZodString;
|
44
|
+
}, "strip", import("zod").ZodTypeAny, {
|
45
|
+
modelProviderId?: string;
|
46
|
+
}, {
|
47
|
+
modelProviderId?: string;
|
48
|
+
}>, readonly [], {
|
49
|
+
formErrors: string[];
|
50
|
+
fieldErrors: {
|
51
|
+
modelProviderId?: string[];
|
52
|
+
};
|
53
|
+
}, readonly [], AIModel[]>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
'use server';
|
2
2
|
import { actionClient } from '../../actions/actionClient';
|
3
3
|
import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
|
4
|
-
import { CreateAgentSchema, GetAgentSchema } from './schema';
|
4
|
+
import { CreateAgentSchema, GetAgentSchema, ListModelsSchema } from './schema';
|
5
5
|
export const ListAgents = actionClient
|
6
6
|
//.schema(ListWaitlistSignupsSchema)
|
7
7
|
.action(async ({ parsedInput }) => {
|
@@ -49,3 +49,15 @@ export const ListModelProviders = actionClient
|
|
49
49
|
throw new Error('Failed to fetch ListModelProviders');
|
50
50
|
}
|
51
51
|
});
|
52
|
+
export const ListModels = actionClient
|
53
|
+
.schema(ListModelsSchema)
|
54
|
+
.action(async ({ parsedInput }) => {
|
55
|
+
try {
|
56
|
+
const { agent } = await getSDKForCurrentUser();
|
57
|
+
return await agent.ListModels(parsedInput);
|
58
|
+
}
|
59
|
+
catch (error) {
|
60
|
+
console.error('Error in ListModels:', error);
|
61
|
+
throw new Error('Failed to fetch ListModels');
|
62
|
+
}
|
63
|
+
});
|
@@ -39,3 +39,10 @@ export declare const DeleteAgentSchema: z.ZodObject<{
|
|
39
39
|
}, {
|
40
40
|
id?: string;
|
41
41
|
}>;
|
42
|
+
export declare const ListModelsSchema: z.ZodObject<{
|
43
|
+
modelProviderId: z.ZodString;
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
45
|
+
modelProviderId?: string;
|
46
|
+
}, {
|
47
|
+
modelProviderId?: string;
|
48
|
+
}>;
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import z from "zod";
|
2
2
|
import { ServiceClient } from "../../service-client";
|
3
|
-
import { CreateAgentSchema, GetAgentSchema } from "./schema";
|
4
|
-
import { Agent } from "./types";
|
3
|
+
import { CreateAgentSchema, GetAgentSchema, ListModelsSchema } from "./schema";
|
4
|
+
import { Agent, AIModel } 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
8
|
GetAgent(payload: z.infer<typeof GetAgentSchema>): Promise<Agent>;
|
9
9
|
ListAgents(): Promise<Agent[]>;
|
10
10
|
ListModelProviders(): Promise<Agent[]>;
|
11
|
+
ListModels(payload: z.infer<typeof ListModelsSchema>): Promise<AIModel[]>;
|
11
12
|
}
|
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.
|
5
|
+
"version": "1.0.73",
|
6
6
|
"license": "BSD-3-Clause",
|
7
7
|
"main": "dist/index.js",
|
8
8
|
"types": "dist/index.d.ts",
|
package/src/index.ts
CHANGED
@@ -36,5 +36,6 @@ export { PasswordHash } from './enums/password-hash';
|
|
36
36
|
export { MessagingProviderType } from './enums/messaging-provider-type';
|
37
37
|
export { getSDKForCurrentUser } from './getSDKForCurrentUser';
|
38
38
|
export { getSDKForService } from './getSDKForService';
|
39
|
+
export { getAppcondaClient } from './getAppcondaClient';
|
39
40
|
export * from './modules';
|
40
41
|
export type { SafeActionFn } from 'next-safe-action';
|
@@ -4,15 +4,15 @@
|
|
4
4
|
import { actionClient } from '../../actions/actionClient';
|
5
5
|
import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
|
6
6
|
import { getSDKForService } from '../../getSDKForService';
|
7
|
-
import { CreateAgentSchema, GetAgentSchema } from './schema';
|
8
|
-
import { Agent } from './types';
|
7
|
+
import { CreateAgentSchema, GetAgentSchema, ListModelsSchema } from './schema';
|
8
|
+
import { Agent, AIModel } from './types';
|
9
9
|
|
10
10
|
|
11
11
|
export const ListAgents = actionClient
|
12
12
|
//.schema(ListWaitlistSignupsSchema)
|
13
13
|
.action(async ({ parsedInput }): Promise<Agent[]> => {
|
14
14
|
try {
|
15
|
-
|
15
|
+
|
16
16
|
const { agent } = await getSDKForCurrentUser();
|
17
17
|
return await agent.ListAgents(); // typo: Wiatlist mi?
|
18
18
|
} catch (error) {
|
@@ -37,7 +37,7 @@ export const CreateAgent = actionClient
|
|
37
37
|
}
|
38
38
|
});
|
39
39
|
|
40
|
-
|
40
|
+
export const GetAgent = actionClient
|
41
41
|
.schema(GetAgentSchema)
|
42
42
|
.action(async ({ parsedInput }): Promise<Agent> => {
|
43
43
|
try {
|
@@ -51,14 +51,27 @@ export const CreateAgent = actionClient
|
|
51
51
|
}
|
52
52
|
});
|
53
53
|
|
54
|
-
|
54
|
+
export const ListModelProviders = actionClient
|
55
55
|
.action(async ({ parsedInput }): Promise<Agent[]> => {
|
56
56
|
try {
|
57
|
-
|
57
|
+
|
58
58
|
const { agent } = await getSDKForCurrentUser();
|
59
|
-
return await agent.ListModelProviders
|
59
|
+
return await agent.ListModelProviders();
|
60
60
|
} catch (error) {
|
61
61
|
console.error('Error in ListModelProviders:', error);
|
62
62
|
throw new Error('Failed to fetch ListModelProviders');
|
63
63
|
}
|
64
|
-
});
|
64
|
+
});
|
65
|
+
|
66
|
+
export const ListModels = actionClient
|
67
|
+
.schema(ListModelsSchema)
|
68
|
+
.action(async ({ parsedInput }): Promise<AIModel[]> => {
|
69
|
+
try {
|
70
|
+
|
71
|
+
const { agent } = await getSDKForCurrentUser();
|
72
|
+
return await agent.ListModels(parsedInput);
|
73
|
+
} catch (error) {
|
74
|
+
console.error('Error in ListModels:', error);
|
75
|
+
throw new Error('Failed to fetch ListModels');
|
76
|
+
}
|
77
|
+
});
|
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
import z from "zod";
|
3
3
|
import { ServiceClient } from "../../service-client";
|
4
|
-
import { CreateAgentSchema, GetAgentSchema } from "./schema";
|
5
|
-
import { Agent } from "./types";
|
4
|
+
import { CreateAgentSchema, GetAgentSchema, ListModelsSchema } from "./schema";
|
5
|
+
import { Agent, AIModel } from "./types";
|
6
6
|
|
7
7
|
|
8
8
|
export class AgentService extends ServiceClient {
|
@@ -26,5 +26,9 @@ export class AgentService extends ServiceClient {
|
|
26
26
|
return await this.actionCall('ListModelProviders', {});
|
27
27
|
}
|
28
28
|
|
29
|
+
public async ListModels(payload: z.infer<typeof ListModelsSchema>): Promise<AIModel[]> {
|
30
|
+
return await this.actionCall('ListModels', payload);
|
31
|
+
}
|
32
|
+
|
29
33
|
|
30
34
|
}
|