@appconda/nextjs 1.0.158 → 1.0.160
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/actions/index.d.ts +0 -1
- package/dist/actions/index.js +0 -1
- package/dist/getSDKForCurrentUser.d.ts +7 -3
- package/dist/getSDKForCurrentUser.js +9 -3
- package/dist/getSDKForService.d.ts +6 -0
- package/dist/getSDKForService.js +49 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -5
- package/dist/modules/account/actions.d.ts +25 -0
- package/dist/modules/account/actions.js +17 -0
- package/dist/modules/account/enums/authentication-factor.d.ts +6 -0
- package/dist/modules/account/enums/authentication-factor.js +7 -0
- package/dist/modules/account/enums/authenticator-type.d.ts +3 -0
- package/dist/modules/account/enums/authenticator-type.js +4 -0
- package/dist/modules/account/enums/o-auth-provider.d.ts +41 -0
- package/dist/modules/account/enums/o-auth-provider.js +42 -0
- package/dist/modules/account/index.d.ts +3 -0
- package/dist/modules/account/index.js +3 -0
- package/dist/modules/account/schema.d.ts +17 -0
- package/dist/modules/account/schema.js +7 -0
- package/dist/modules/account/service.d.ts +530 -0
- package/dist/modules/account/service.js +1259 -0
- package/dist/modules/account/types.d.ts +411 -0
- package/dist/modules/account/types.js +1 -0
- package/dist/modules/agent/action.d.ts +53 -0
- package/dist/modules/agent/action.js +63 -0
- package/dist/modules/agent/index.d.ts +4 -0
- package/dist/modules/agent/index.js +4 -0
- package/dist/modules/agent/schema.d.ts +48 -0
- package/dist/modules/agent/schema.js +20 -0
- package/dist/modules/agent/service.d.ts +12 -0
- package/dist/modules/agent/service.js +21 -0
- package/dist/modules/agent/types.d.ts +11 -0
- package/dist/modules/agent/types.js +1 -0
- package/dist/modules/ai/index.d.ts +1 -0
- package/dist/modules/ai/index.js +1 -0
- package/dist/modules/ai/node/actions.d.ts +4 -0
- package/dist/modules/ai/node/actions.js +15 -0
- package/dist/modules/ai/node/index.d.ts +2 -0
- package/dist/modules/ai/node/index.js +2 -0
- package/dist/modules/ai/node/service.d.ts +5 -0
- package/dist/modules/ai/node/service.js +11 -0
- package/dist/modules/index.d.ts +3 -0
- package/dist/modules/index.js +3 -0
- package/dist/modules/waitlist/action.d.ts +24 -0
- package/dist/modules/waitlist/action.js +29 -4
- package/dist/modules/waitlist/index.d.ts +1 -0
- package/dist/modules/waitlist/index.js +1 -0
- package/dist/modules/waitlist/schema.d.ts +14 -0
- package/dist/modules/waitlist/schema.js +6 -0
- package/dist/modules/waitlist/service.d.ts +4 -2
- package/dist/modules/waitlist/service.js +6 -0
- package/dist/modules/waitlist/types.d.ts +4 -0
- package/dist/services/chat-flow.d.ts +7 -0
- package/dist/services/chat-flow.js +25 -0
- package/dist/services/projects.d.ts +1 -1
- package/dist/services/users.d.ts +1 -1
- package/package.json +1 -1
- package/src/actions/index.ts +0 -1
- package/src/getSDKForCurrentUser.ts +9 -3
- package/src/getSDKForService.ts +52 -0
- package/src/index.ts +6 -6
- package/src/modules/account/actions.ts +21 -0
- package/src/modules/account/index.ts +3 -0
- package/src/modules/account/schema.ts +8 -0
- package/src/{services/account.ts → modules/account/service.ts} +61 -59
- package/src/modules/account/types.ts +426 -0
- package/src/modules/agent/action.ts +77 -0
- package/src/modules/agent/index.ts +4 -0
- package/src/modules/agent/schema.ts +25 -0
- package/src/modules/agent/service.ts +34 -0
- package/src/modules/agent/types.ts +15 -0
- package/src/modules/ai/index.ts +1 -0
- package/src/{actions/nodes.ts → modules/ai/node/actions.ts} +2 -2
- package/src/modules/ai/node/index.ts +2 -0
- package/src/{services/node.ts → modules/ai/node/service.ts} +4 -4
- package/src/modules/index.ts +4 -1
- package/src/modules/waitlist/action.ts +33 -4
- package/src/modules/waitlist/index.ts +2 -1
- package/src/modules/waitlist/schema.ts +9 -0
- package/src/modules/waitlist/service.ts +11 -2
- package/src/modules/waitlist/types.ts +5 -0
- package/src/services/chat-flow.ts +32 -0
- package/src/services/projects.ts +1 -1
- package/src/services/users.ts +1 -1
- /package/src/{enums → modules/account/enums}/authentication-factor.ts +0 -0
- /package/src/{enums → modules/account/enums}/authenticator-type.ts +0 -0
- /package/src/{enums → modules/account/enums}/o-auth-provider.ts +0 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
import { ServiceClient } from "../../../service-client";
|
2
|
+
export class Node extends ServiceClient {
|
3
|
+
getServiceName() {
|
4
|
+
return 'com.appconda.service.node';
|
5
|
+
}
|
6
|
+
// @Cache()
|
7
|
+
async GetAllNodes(isPublic) {
|
8
|
+
const payload = {};
|
9
|
+
return await this.actionCall('GetAllNodes', payload);
|
10
|
+
}
|
11
|
+
}
|
package/dist/modules/index.d.ts
CHANGED
package/dist/modules/index.js
CHANGED
@@ -43,3 +43,27 @@ export declare const CreateWaitlistSignup: import("next-safe-action").SafeAction
|
|
43
43
|
waitlistId?: string[];
|
44
44
|
};
|
45
45
|
}, readonly [], WaitlistSignup>;
|
46
|
+
export declare const CreateWaitlistOffboardedSignup: import("next-safe-action").SafeActionFn<string, import("zod").ZodObject<{
|
47
|
+
waitlistSignupId: import("zod").ZodString;
|
48
|
+
}, "strip", import("zod").ZodTypeAny, {
|
49
|
+
waitlistSignupId?: string;
|
50
|
+
}, {
|
51
|
+
waitlistSignupId?: string;
|
52
|
+
}>, readonly [], {
|
53
|
+
formErrors: string[];
|
54
|
+
fieldErrors: {
|
55
|
+
waitlistSignupId?: string[];
|
56
|
+
};
|
57
|
+
}, readonly [], WaitlistSignup>;
|
58
|
+
export declare const ListWaitlistOffboardedSignups: import("next-safe-action").SafeActionFn<string, import("zod").ZodObject<{
|
59
|
+
waitlistId: import("zod").ZodString;
|
60
|
+
}, "strip", import("zod").ZodTypeAny, {
|
61
|
+
waitlistId?: string;
|
62
|
+
}, {
|
63
|
+
waitlistId?: string;
|
64
|
+
}>, readonly [], {
|
65
|
+
formErrors: string[];
|
66
|
+
fieldErrors: {
|
67
|
+
waitlistId?: string[];
|
68
|
+
};
|
69
|
+
}, readonly [], WaitlistSignup>;
|
@@ -1,13 +1,14 @@
|
|
1
1
|
'use server';
|
2
2
|
import { actionClient } from '../../actions/actionClient';
|
3
3
|
import { getSDKForCurrentUser } from '../../getSDKForCurrentUser';
|
4
|
-
import {
|
4
|
+
import { getSDKForService } from '../../getSDKForService';
|
5
|
+
import { CreateWaitlistOffboardedSignupSchema, CreateWaitlistSchema, CreateWaitlistSignupSchema, ListWaitlistOffboardedSignupsSchema, ListWaitlistSignupsSchema } from "./schema";
|
5
6
|
export const ListWaitlistSignups = actionClient
|
6
7
|
.schema(ListWaitlistSignupsSchema)
|
7
8
|
.action(async ({ parsedInput }) => {
|
8
9
|
try {
|
9
10
|
const { waitlistId } = parsedInput;
|
10
|
-
const { waitlist } = await
|
11
|
+
const { waitlist } = await getSDKForService();
|
11
12
|
return await waitlist.ListWiatlistSignups(waitlistId); // typo: Wiatlist mi?
|
12
13
|
}
|
13
14
|
catch (error) {
|
@@ -18,7 +19,7 @@ export const ListWaitlistSignups = actionClient
|
|
18
19
|
export const ListWaitlists = actionClient
|
19
20
|
.action(async () => {
|
20
21
|
try {
|
21
|
-
const { waitlist } = await
|
22
|
+
const { waitlist } = await getSDKForService();
|
22
23
|
return await waitlist.ListWaitlists();
|
23
24
|
}
|
24
25
|
catch (error) {
|
@@ -42,7 +43,7 @@ export const CreateWaitlistSignup = actionClient
|
|
42
43
|
.schema(CreateWaitlistSignupSchema)
|
43
44
|
.action(async ({ parsedInput }) => {
|
44
45
|
try {
|
45
|
-
const { waitlist } = await
|
46
|
+
const { waitlist } = await getSDKForService();
|
46
47
|
return await waitlist.CreateWaitlistSignup(parsedInput);
|
47
48
|
}
|
48
49
|
catch (error) {
|
@@ -50,3 +51,27 @@ export const CreateWaitlistSignup = actionClient
|
|
50
51
|
throw new Error('Failed to fetch ListWaitlists');
|
51
52
|
}
|
52
53
|
});
|
54
|
+
export const CreateWaitlistOffboardedSignup = actionClient
|
55
|
+
.schema(CreateWaitlistOffboardedSignupSchema)
|
56
|
+
.action(async ({ parsedInput }) => {
|
57
|
+
try {
|
58
|
+
const { waitlist } = await getSDKForService();
|
59
|
+
return await waitlist.CreateWaitlistOffboardedSignup(parsedInput);
|
60
|
+
}
|
61
|
+
catch (error) {
|
62
|
+
console.error('Error in ListWaitlists:', error);
|
63
|
+
throw new Error('Failed to fetch ListWaitlists');
|
64
|
+
}
|
65
|
+
});
|
66
|
+
export const ListWaitlistOffboardedSignups = actionClient
|
67
|
+
.schema(ListWaitlistOffboardedSignupsSchema)
|
68
|
+
.action(async ({ parsedInput }) => {
|
69
|
+
try {
|
70
|
+
const { waitlist } = await getSDKForService();
|
71
|
+
return await waitlist.ListWaitlistOffboardedSignups(parsedInput);
|
72
|
+
}
|
73
|
+
catch (error) {
|
74
|
+
console.error('Error in ListWaitlists:', error);
|
75
|
+
throw new Error('Failed to fetch ListWaitlists');
|
76
|
+
}
|
77
|
+
});
|
@@ -6,6 +6,13 @@ export declare const ListWaitlistSignupsSchema: z.ZodObject<{
|
|
6
6
|
}, {
|
7
7
|
waitlistId?: string;
|
8
8
|
}>;
|
9
|
+
export declare const ListWaitlistOffboardedSignupsSchema: z.ZodObject<{
|
10
|
+
waitlistId: z.ZodString;
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
12
|
+
waitlistId?: string;
|
13
|
+
}, {
|
14
|
+
waitlistId?: string;
|
15
|
+
}>;
|
9
16
|
export declare const CreateWaitlistSchema: z.ZodObject<{
|
10
17
|
name: z.ZodString;
|
11
18
|
}, "strip", z.ZodTypeAny, {
|
@@ -23,3 +30,10 @@ export declare const CreateWaitlistSignupSchema: z.ZodObject<{
|
|
23
30
|
email?: string;
|
24
31
|
waitlistId?: string;
|
25
32
|
}>;
|
33
|
+
export declare const CreateWaitlistOffboardedSignupSchema: z.ZodObject<{
|
34
|
+
waitlistSignupId: z.ZodString;
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
36
|
+
waitlistSignupId?: string;
|
37
|
+
}, {
|
38
|
+
waitlistSignupId?: string;
|
39
|
+
}>;
|
@@ -2,6 +2,9 @@ import { z } from "zod";
|
|
2
2
|
export const ListWaitlistSignupsSchema = z.object({
|
3
3
|
waitlistId: z.string()
|
4
4
|
});
|
5
|
+
export const ListWaitlistOffboardedSignupsSchema = z.object({
|
6
|
+
waitlistId: z.string()
|
7
|
+
});
|
5
8
|
export const CreateWaitlistSchema = z.object({
|
6
9
|
name: z.string()
|
7
10
|
});
|
@@ -9,3 +12,6 @@ export const CreateWaitlistSignupSchema = z.object({
|
|
9
12
|
waitlistId: z.string(),
|
10
13
|
email: z.string()
|
11
14
|
});
|
15
|
+
export const CreateWaitlistOffboardedSignupSchema = z.object({
|
16
|
+
waitlistSignupId: z.string(),
|
17
|
+
});
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import z from "zod";
|
2
2
|
import { ServiceClient } from "../../service-client";
|
3
|
-
import { Waitlist, WaitlistSignup } from "./types";
|
4
|
-
import { CreateWaitlistSchema, CreateWaitlistSignupSchema } from "./schema";
|
3
|
+
import { Waitlist, WaitlistOffboardedSignup, WaitlistSignup } from "./types";
|
4
|
+
import { CreateWaitlistOffboardedSignupSchema, CreateWaitlistSchema, CreateWaitlistSignupSchema, ListWaitlistOffboardedSignupsSchema } from "./schema";
|
5
5
|
export declare class WaitlistService extends ServiceClient {
|
6
6
|
protected getServiceName(): string;
|
7
7
|
ListWiatlistSignups(waitlistId: string): Promise<any[]>;
|
8
8
|
ListWaitlists(): Promise<any[]>;
|
9
9
|
CreateWaitlist(payload: z.infer<typeof CreateWaitlistSchema>): Promise<Waitlist>;
|
10
10
|
CreateWaitlistSignup(payload: z.infer<typeof CreateWaitlistSignupSchema>): Promise<WaitlistSignup>;
|
11
|
+
CreateWaitlistOffboardedSignup(payload: z.infer<typeof CreateWaitlistOffboardedSignupSchema>): Promise<WaitlistSignup>;
|
12
|
+
ListWaitlistOffboardedSignups(payload: z.infer<typeof ListWaitlistOffboardedSignupsSchema>): Promise<WaitlistOffboardedSignup>;
|
11
13
|
}
|
@@ -18,4 +18,10 @@ export class WaitlistService extends ServiceClient {
|
|
18
18
|
async CreateWaitlistSignup(payload) {
|
19
19
|
return await this.actionCall('CreateWaitlistSignup', payload);
|
20
20
|
}
|
21
|
+
async CreateWaitlistOffboardedSignup(payload) {
|
22
|
+
return await this.actionCall('CreateWaitlistOffboardedSignup', payload);
|
23
|
+
}
|
24
|
+
async ListWaitlistOffboardedSignups(payload) {
|
25
|
+
return await this.actionCall('ListOffboardedSignups', payload);
|
26
|
+
}
|
21
27
|
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { ServiceClient } from "../service-client";
|
2
|
+
export declare class ChatFlow extends ServiceClient {
|
3
|
+
protected getServiceName(): string;
|
4
|
+
createChatFlow(id: string, name: string, flowData: object): Promise<any[]>;
|
5
|
+
updateChatFlow(id: string, name: string, flowData: object): Promise<any[]>;
|
6
|
+
get(id: string): Promise<any[]>;
|
7
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { ServiceClient } from "../service-client";
|
2
|
+
export class ChatFlow extends ServiceClient {
|
3
|
+
getServiceName() {
|
4
|
+
return 'com.appconda.service.chat-flow';
|
5
|
+
}
|
6
|
+
async createChatFlow(id, name, flowData) {
|
7
|
+
const payload = {};
|
8
|
+
payload['id'] = id;
|
9
|
+
payload['name'] = name;
|
10
|
+
payload['flowData'] = JSON.stringify(flowData);
|
11
|
+
return await this.actionCall('CreateChatFlow', payload);
|
12
|
+
}
|
13
|
+
async updateChatFlow(id, name, flowData) {
|
14
|
+
const payload = {};
|
15
|
+
payload['id'] = id;
|
16
|
+
payload['name'] = name;
|
17
|
+
payload['flowData'] = JSON.stringify(flowData);
|
18
|
+
return await this.actionCall('UpdateChatFlow', payload);
|
19
|
+
}
|
20
|
+
async get(id) {
|
21
|
+
const payload = {};
|
22
|
+
payload['id'] = id;
|
23
|
+
return await this.actionCall('GetChatFlow', payload);
|
24
|
+
}
|
25
|
+
}
|
@@ -4,7 +4,7 @@ import { ApiService } from "../enums/api-service";
|
|
4
4
|
import { AuthMethod } from "../enums/auth-method";
|
5
5
|
import { EmailTemplateLocale } from "../enums/email-template-locale";
|
6
6
|
import { EmailTemplateType } from "../enums/email-template-type";
|
7
|
-
import { OAuthProvider } from "../enums/o-auth-provider";
|
7
|
+
import { OAuthProvider } from "../modules/account/enums/o-auth-provider";
|
8
8
|
import { PlatformType } from "../enums/platform-type";
|
9
9
|
import { Region } from "../enums/region";
|
10
10
|
import { SMTPSecure } from "../enums/s-m-t-p-secure";
|
package/dist/services/users.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Client } from '../client';
|
2
2
|
import type { Models } from '../models';
|
3
3
|
import { PasswordHash } from '../enums/password-hash';
|
4
|
-
import { AuthenticatorType } from '../enums/authenticator-type';
|
4
|
+
import { AuthenticatorType } from '../modules/account/enums/authenticator-type';
|
5
5
|
import { MessagingProviderType } from '../enums/messaging-provider-type';
|
6
6
|
export declare class Users {
|
7
7
|
client: Client;
|
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.160",
|
6
6
|
"license": "BSD-3-Clause",
|
7
7
|
"main": "dist/index.js",
|
8
8
|
"types": "dist/index.d.ts",
|
package/src/actions/index.ts
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './nodes';
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { cookies } from "next/headers";
|
2
2
|
import { getAppcondaClient } from "./getAppcondaClient";
|
3
|
-
import { Account } from "./services/account";
|
4
3
|
import { Community } from "./services/community";
|
5
4
|
import { Configuration } from "./services/configuration";
|
6
5
|
import { Databases } from "./services/databases";
|
@@ -13,9 +12,12 @@ import { Teams } from "./services/teams";
|
|
13
12
|
import { Tenant } from "./services/tenant";
|
14
13
|
import { TenantSubscription } from "./services/tenant-subscription";
|
15
14
|
import { Users } from "./services/users";
|
16
|
-
import { Node } from "./services/node";
|
17
15
|
import { Permissions } from "./services/permissions";
|
18
16
|
import { WaitlistService } from "./modules/waitlist/service";
|
17
|
+
import { Account } from "./modules/account/service";
|
18
|
+
import { Node } from "./modules/ai/node/service";
|
19
|
+
import { AgentService } from "./modules/agent/service";
|
20
|
+
import { ChatFlow } from "./services/chat-flow";
|
19
21
|
|
20
22
|
export async function getSDKForCurrentUser() {
|
21
23
|
const adminClient = await getAppcondaClient();
|
@@ -54,6 +56,8 @@ export async function getSDKForCurrentUser() {
|
|
54
56
|
|
55
57
|
const node = new Node(adminClient);
|
56
58
|
const waitlist = new WaitlistService(adminClient);
|
59
|
+
const agent = new AgentService(adminClient);
|
60
|
+
const chatFlow = new ChatFlow(adminClient);
|
57
61
|
|
58
62
|
return {
|
59
63
|
currentUser,
|
@@ -73,6 +77,8 @@ export async function getSDKForCurrentUser() {
|
|
73
77
|
configuration,
|
74
78
|
// acl,
|
75
79
|
node,
|
76
|
-
waitlist
|
80
|
+
waitlist,
|
81
|
+
agent,
|
82
|
+
chatFlow
|
77
83
|
}
|
78
84
|
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { getAppcondaClient } from "./getAppcondaClient";
|
2
|
+
import { WaitlistService } from "./modules";
|
3
|
+
import { Configuration } from "./services/configuration";
|
4
|
+
|
5
|
+
export async function getSDKForService() {
|
6
|
+
const adminClient = await getAppcondaClient();
|
7
|
+
|
8
|
+
adminClient.addHeader('x-service-token', process.env._SERVICE_TOKEN ?? '');
|
9
|
+
/*
|
10
|
+
const accounts = new Account(adminClient);
|
11
|
+
const databases = new Databases(adminClient);
|
12
|
+
|
13
|
+
const projects = new Projects(adminClient);
|
14
|
+
|
15
|
+
const currentUser = await accounts.get();
|
16
|
+
|
17
|
+
const users = new Users(adminClient);
|
18
|
+
const teams = new Teams(adminClient);
|
19
|
+
|
20
|
+
const tenants = new Tenant(adminClient);
|
21
|
+
const roles = new Roles(adminClient);
|
22
|
+
const permissions = new Permissions(adminClient);
|
23
|
+
const schemas = new Schemas(adminClient);
|
24
|
+
|
25
|
+
const community = new Community(adminClient);
|
26
|
+
|
27
|
+
const tenantSubscriptions = new TenantSubscription(adminClient);
|
28
|
+
|
29
|
+
const subscription = new Subscription(adminClient);
|
30
|
+
const pricing = new Pricing(adminClient); */
|
31
|
+
const waitlist = new WaitlistService(adminClient);
|
32
|
+
const configuration = new Configuration(adminClient);
|
33
|
+
|
34
|
+
return {
|
35
|
+
/* currentUser,
|
36
|
+
accounts,
|
37
|
+
databases,
|
38
|
+
projects,
|
39
|
+
users,
|
40
|
+
teams,
|
41
|
+
tenants,
|
42
|
+
roles,
|
43
|
+
permissions,
|
44
|
+
schemas,
|
45
|
+
community,
|
46
|
+
tenantSubscriptions,
|
47
|
+
subscription,
|
48
|
+
pricing, */
|
49
|
+
waitlist,
|
50
|
+
configuration
|
51
|
+
}
|
52
|
+
}
|
package/src/index.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
export { Client, Query, AppcondaException } from './client';
|
2
|
-
export { Account } from './
|
2
|
+
export { Account } from './modules/account/service';
|
3
3
|
export { Avatars } from './services/avatars';
|
4
4
|
export { Databases } from './services/databases';
|
5
5
|
export { Applets } from './services/applets';
|
@@ -16,9 +16,9 @@ export type { QueryTypes, QueryTypesList } from './query';
|
|
16
16
|
export { Permission } from './permission';
|
17
17
|
export { Role } from './role';
|
18
18
|
export { ID } from './id';
|
19
|
-
export { AuthenticatorType } from './enums/authenticator-type';
|
20
|
-
export { AuthenticationFactor } from './enums/authentication-factor';
|
21
|
-
export { OAuthProvider } from './enums/o-auth-provider';
|
19
|
+
export { AuthenticatorType } from './modules/account/enums/authenticator-type';
|
20
|
+
export { AuthenticationFactor } from './modules/account/enums/authentication-factor';
|
21
|
+
export { OAuthProvider } from './modules/account/enums/o-auth-provider';
|
22
22
|
export { Browser } from './enums/browser';
|
23
23
|
export { CreditCard } from './enums/credit-card';
|
24
24
|
export { Flag } from './enums/flag';
|
@@ -35,8 +35,8 @@ export { ImageFormat } from './enums/image-format';
|
|
35
35
|
export { PasswordHash } from './enums/password-hash';
|
36
36
|
export { MessagingProviderType } from './enums/messaging-provider-type';
|
37
37
|
export { getSDKForCurrentUser } from './getSDKForCurrentUser';
|
38
|
-
export
|
38
|
+
export { getSDKForService } from './getSDKForService';
|
39
39
|
export * from './modules';
|
40
40
|
export type { SafeActionFn } from 'next-safe-action';
|
41
41
|
|
42
|
-
export
|
42
|
+
export { getAppcondaClient } from './getAppcondaClient';
|
@@ -0,0 +1,21 @@
|
|
1
|
+
'use server';
|
2
|
+
|
3
|
+
import { actionClient } from "../../actions/actionClient";
|
4
|
+
import { getSDKForCurrentUser } from "../../getSDKForCurrentUser";
|
5
|
+
import { CreateUserSchema } from "./schema";
|
6
|
+
import { User } from "./types";
|
7
|
+
|
8
|
+
|
9
|
+
export const CreateUser = actionClient
|
10
|
+
.schema(CreateUserSchema)
|
11
|
+
.action(async ({ parsedInput }): Promise<User> => {
|
12
|
+
try {
|
13
|
+
const { userId, email, password, name } = parsedInput;
|
14
|
+
const { accounts } = await getSDKForCurrentUser();
|
15
|
+
return await accounts.create(userId, email, password, name);
|
16
|
+
|
17
|
+
} catch (error) {
|
18
|
+
console.error('Error in ListWaitlists:', error);
|
19
|
+
throw new Error('Failed to fetch ListWaitlists');
|
20
|
+
}
|
21
|
+
});
|