@appconda/nextjs 1.0.73 → 1.0.75

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.
@@ -1,4 +1,5 @@
1
1
  import { Client } from "./client";
2
+ import { env } from "./lib/env";
2
3
  function getPortAndHostname(urlString) {
3
4
  try {
4
5
  const url = new URL(urlString);
@@ -15,8 +16,8 @@ function getPortAndHostname(urlString) {
15
16
  }
16
17
  export async function getAppcondaClient() {
17
18
  let url;
18
- if (process.env.NEXT_PUBLIC_APPCONDA_CLIENT_ENDPOINT) {
19
- url = process.env.NEXT_PUBLIC_APPCONDA_CLIENT_ENDPOINT;
19
+ if (env.APPCONDA_ENDPOINT) {
20
+ url = env.APPCONDA_ENDPOINT;
20
21
  }
21
22
  else if (typeof window !== 'undefined') {
22
23
  const hostInfo = getPortAndHostname(window.location.href);
@@ -28,7 +29,7 @@ export async function getAppcondaClient() {
28
29
  }
29
30
  }
30
31
  else {
31
- url = 'http://appconda/v1';
32
+ url = env.APPCONDA_ENDPOINT || 'http://appconda/v1';
32
33
  }
33
34
  /* if (ApplicationConfig.Port == null) {
34
35
  url = `${ApplicationConfig.Protocol}://${ApplicationConfig.Domain}:${ApplicationConfig.Port}/v1`
@@ -15,6 +15,7 @@ import { WaitlistService } from "./modules/waitlist/service";
15
15
  import { Account } from "./modules/account/service";
16
16
  import { Node } from "./modules/ai/node/service";
17
17
  import { AgentService } from "./modules/agent/service";
18
+ import { ChatFlow } from "./services/chat-flow";
18
19
  export declare function getSDKForCurrentUser(): Promise<{
19
20
  currentUser: import("./modules/account/types").User<import("./modules/account/types").Preferences>;
20
21
  accounts: Account;
@@ -34,4 +35,5 @@ export declare function getSDKForCurrentUser(): Promise<{
34
35
  node: Node;
35
36
  waitlist: WaitlistService;
36
37
  agent: AgentService;
38
+ chatFlow: ChatFlow;
37
39
  }>;
@@ -17,6 +17,7 @@ import { WaitlistService } from "./modules/waitlist/service";
17
17
  import { Account } from "./modules/account/service";
18
18
  import { Node } from "./modules/ai/node/service";
19
19
  import { AgentService } from "./modules/agent/service";
20
+ import { ChatFlow } from "./services/chat-flow";
20
21
  export async function getSDKForCurrentUser() {
21
22
  const adminClient = await getAppcondaClient();
22
23
  const c = await cookies();
@@ -44,6 +45,7 @@ export async function getSDKForCurrentUser() {
44
45
  const node = new Node(adminClient);
45
46
  const waitlist = new WaitlistService(adminClient);
46
47
  const agent = new AgentService(adminClient);
48
+ const chatFlow = new ChatFlow(adminClient);
47
49
  return {
48
50
  currentUser,
49
51
  accounts,
@@ -63,6 +65,7 @@ export async function getSDKForCurrentUser() {
63
65
  // acl,
64
66
  node,
65
67
  waitlist,
66
- agent
68
+ agent,
69
+ chatFlow
67
70
  };
68
71
  }
@@ -1,9 +1,10 @@
1
1
  import { getAppcondaClient } from "./getAppcondaClient";
2
+ import { env } from "./lib/env";
2
3
  import { WaitlistService } from "./modules";
3
4
  import { Configuration } from "./services/configuration";
4
5
  export async function getSDKForService() {
5
6
  const adminClient = await getAppcondaClient();
6
- adminClient.addHeader('x-service-token', process.env._SERVICE_TOKEN ?? '');
7
+ adminClient.addHeader('x-service-token', env._SERVICE_TOKEN ?? '');
7
8
  /*
8
9
  const accounts = new Account(adminClient);
9
10
  const databases = new Databases(adminClient);
@@ -0,0 +1,5 @@
1
+ export declare const env: Readonly<{
2
+ APPCONDA_ENDPOINT: string;
3
+ APPCONDA_CLIENT_ENDPOINT: string;
4
+ _SERVICE_TOKEN: string;
5
+ }>;
@@ -0,0 +1,118 @@
1
+ import { createEnv } from "@t3-oss/env-nextjs";
2
+ import { z } from "zod";
3
+ export const env = createEnv({
4
+ /*
5
+ * Serverside Environment variables, not available on the client.
6
+ * Will throw if you access these variables on the client.
7
+ */
8
+ server: {
9
+ APPCONDA_ENDPOINT: z.string(),
10
+ APPCONDA_CLIENT_ENDPOINT: z.string(),
11
+ _SERVICE_TOKEN: z.string(),
12
+ /* AI_AZURE_LLM_API_KEY: z.string().optional(),
13
+ AI_AZURE_EMBEDDINGS_DEPLOYMENT_ID: z.string().optional(),
14
+ AI_AZURE_LLM_DEPLOYMENT_ID: z.string().optional(),
15
+ AI_AZURE_EMBEDDINGS_RESSOURCE_NAME: z.string().optional(),
16
+ AI_AZURE_LLM_RESSOURCE_NAME: z.string().optional(),
17
+ AIRTABLE_CLIENT_ID: z.string().optional(),
18
+ AZUREAD_CLIENT_ID: z.string().optional(),
19
+ AZUREAD_CLIENT_SECRET: z.string().optional(),
20
+ AZUREAD_TENANT_ID: z.string().optional(),
21
+ CRON_SECRET: z.string().min(10),
22
+ CUSTOMER_IO_API_KEY: z.string().optional(),
23
+ CUSTOMER_IO_SITE_ID: z.string().optional(),
24
+ DATABASE_URL: z.string().url(),
25
+ DEBUG: z.enum(["1", "0"]).optional(),
26
+ DEFAULT_ORGANIZATION_ID: z.string().optional(),
27
+ DEFAULT_ORGANIZATION_ROLE: z.enum(["owner", "manager", "member", "billing"]).optional(),
28
+ E2E_TESTING: z.enum(["1", "0"]).optional(),
29
+ EMAIL_AUTH_DISABLED: z.enum(["1", "0"]).optional(),
30
+ EMAIL_VERIFICATION_DISABLED: z.enum(["1", "0"]).optional(),
31
+ ENCRYPTION_KEY: z.string().length(64).or(z.string().length(32)),
32
+ ENTERPRISE_LICENSE_KEY: z.string().optional(),
33
+ FORMBRICKS_ENCRYPTION_KEY: z.string().length(24).or(z.string().length(0)).optional(),
34
+ GITHUB_ID: z.string().optional(),
35
+ GITHUB_SECRET: z.string().optional(),
36
+ GOOGLE_CLIENT_ID: z.string().optional(),
37
+ GOOGLE_CLIENT_SECRET: z.string().optional(),
38
+ GOOGLE_SHEETS_CLIENT_ID: z.string().optional(),
39
+ GOOGLE_SHEETS_CLIENT_SECRET: z.string().optional(),
40
+ GOOGLE_SHEETS_REDIRECT_URL: z.string().optional(),
41
+ HTTP_PROXY: z.string().url().optional(),
42
+ HTTPS_PROXY: z.string().url().optional(),
43
+ IMPRINT_URL: z
44
+ .string()
45
+ .url()
46
+ .optional()
47
+ .or(z.string().refine((str) => str === "")),
48
+ IMPRINT_ADDRESS: z.string().optional(),
49
+ INVITE_DISABLED: z.enum(["1", "0"]).optional(),
50
+ INTERCOM_SECRET_KEY: z.string().optional(),
51
+ IS_FORMBRICKS_CLOUD: z.enum(["1", "0"]).optional(),
52
+ MAIL_FROM: z.string().email().optional(),
53
+ NEXTAUTH_SECRET: z.string().min(1),
54
+ NOTION_OAUTH_CLIENT_ID: z.string().optional(),
55
+ NOTION_OAUTH_CLIENT_SECRET: z.string().optional(),
56
+ OIDC_CLIENT_ID: z.string().optional(),
57
+ OIDC_CLIENT_SECRET: z.string().optional(),
58
+ OIDC_DISPLAY_NAME: z.string().optional(),
59
+ OIDC_ISSUER: z.string().optional(),
60
+ OIDC_SIGNING_ALGORITHM: z.string().optional(),
61
+ OPENTELEMETRY_LISTENER_URL: z.string().optional(),
62
+ REDIS_URL: z.string().optional(),
63
+ REDIS_HTTP_URL: z.string().optional(),
64
+ PASSWORD_RESET_DISABLED: z.enum(["1", "0"]).optional(),
65
+ PRIVACY_URL: z
66
+ .string()
67
+ .url()
68
+ .optional()
69
+ .or(z.string().refine((str) => str === "")),
70
+ RATE_LIMITING_DISABLED: z.enum(["1", "0"]).optional(),
71
+ S3_ACCESS_KEY: z.string().optional(),
72
+ S3_BUCKET_NAME: z.string().optional(),
73
+ S3_REGION: z.string().optional(),
74
+ S3_SECRET_KEY: z.string().optional(),
75
+ S3_ENDPOINT_URL: z.string().optional(),
76
+ S3_FORCE_PATH_STYLE: z.enum(["1", "0"]).optional(),
77
+ SHORT_URL_BASE: z.string().url().optional().or(z.string().length(0)),
78
+ SIGNUP_DISABLED: z.enum(["1", "0"]).optional(),
79
+ SLACK_CLIENT_ID: z.string().optional(),
80
+ SLACK_CLIENT_SECRET: z.string().optional(),
81
+ SMTP_HOST: z.string().min(1).optional(),
82
+ SMTP_PORT: z.string().min(1).optional(),
83
+ SMTP_SECURE_ENABLED: z.enum(["1", "0"]).optional(),
84
+ SMTP_USER: z.string().min(1).optional(),
85
+ SMTP_PASSWORD: z.string().min(1).optional(),
86
+ SMTP_AUTHENTICATED: z.enum(["1", "0"]).optional(),
87
+ SMTP_REJECT_UNAUTHORIZED_TLS: z.enum(["1", "0"]).optional(),
88
+ STRIPE_SECRET_KEY: z.string().optional(),
89
+ STRIPE_WEBHOOK_SECRET: z.string().optional(),
90
+ TELEMETRY_DISABLED: z.enum(["1", "0"]).optional(),
91
+ TERMS_URL: z
92
+ .string()
93
+ .url()
94
+ .optional()
95
+ .or(z.string().refine((str) => str === "")),
96
+ TURNSTILE_SECRET_KEY: z.string().optional(),
97
+ UPLOADS_DIR: z.string().min(1).optional(),
98
+ VERCEL_URL: z.string().optional(),
99
+ _ADMIN_DOMAIN: z.string().optional(),
100
+ ADMIN_URL: z.string().url().optional(),
101
+ UNSPLASH_ACCESS_KEY: z.string().optional(),
102
+ LANGFUSE_SECRET_KEY: z.string().optional(),
103
+ LANGFUSE_PUBLIC_KEY: z.string().optional(),
104
+ LANGFUSE_BASEURL: z.string().optional(), */
105
+ },
106
+ /*
107
+ * Due to how Next.js bundles environment variables on Edge and Client,
108
+ * we need to manually destructure them to make sure all are included in bundle.
109
+ *
110
+ * 💡 You'll get type errors if not all variables from `server` & `client` are included here.
111
+ */
112
+ runtimeEnv: {
113
+ APPCONDA_ENDPOINT: process.env.APPCONDA_ENDPOINT,
114
+ APPCONDA_CLIENT_ENDPOINT: process.env.APPCONDA_CLIENT_ENDPOINT,
115
+ _SERVICE_TOKEN: process.env._SERVICE_TOKEN,
116
+ },
117
+ });
118
+ console.log(env);
@@ -1,6 +1,6 @@
1
1
  'use server';
2
- import { getSDKForCurrentUser } from "@appconda/nextjs";
3
2
  import { actionClient } from "../../../actions/actionClient";
3
+ import { getSDKForCurrentUser } from "../../../getSDKForCurrentUser";
4
4
  export const getAllNodesAction = actionClient
5
5
  // .schema(listModelsSchema)
6
6
  .action(async ({ parsedInput }) => {
@@ -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
+ }
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.73",
5
+ "version": "1.0.75",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -1,4 +1,5 @@
1
1
  import { Client } from "./client";
2
+ import { env } from "./lib/env";
2
3
 
3
4
  function getPortAndHostname(urlString: string): { hostname: string; port: string; protocol: string } {
4
5
  try {
@@ -17,8 +18,8 @@ function getPortAndHostname(urlString: string): { hostname: string; port: string
17
18
  export async function getAppcondaClient() {
18
19
 
19
20
  let url;
20
- if (process.env.NEXT_PUBLIC_APPCONDA_CLIENT_ENDPOINT) {
21
- url = process.env.NEXT_PUBLIC_APPCONDA_CLIENT_ENDPOINT;
21
+ if (env.APPCONDA_ENDPOINT) {
22
+ url = env.APPCONDA_ENDPOINT;
22
23
  } else if (typeof window !== 'undefined') {
23
24
  const hostInfo = getPortAndHostname(window.location.href);
24
25
  if (hostInfo.port) {
@@ -27,7 +28,7 @@ export async function getAppcondaClient() {
27
28
  url = `${hostInfo.protocol}//${hostInfo.hostname}/v1`
28
29
  }
29
30
  } else {
30
- url = 'http://appconda/v1'
31
+ url = env.APPCONDA_ENDPOINT || 'http://appconda/v1'
31
32
  }
32
33
 
33
34
  /* if (ApplicationConfig.Port == null) {
@@ -17,6 +17,7 @@ import { WaitlistService } from "./modules/waitlist/service";
17
17
  import { Account } from "./modules/account/service";
18
18
  import { Node } from "./modules/ai/node/service";
19
19
  import { AgentService } from "./modules/agent/service";
20
+ import { ChatFlow } from "./services/chat-flow";
20
21
 
21
22
  export async function getSDKForCurrentUser() {
22
23
  const adminClient = await getAppcondaClient();
@@ -56,6 +57,7 @@ export async function getSDKForCurrentUser() {
56
57
  const node = new Node(adminClient);
57
58
  const waitlist = new WaitlistService(adminClient);
58
59
  const agent = new AgentService(adminClient);
60
+ const chatFlow = new ChatFlow(adminClient);
59
61
 
60
62
  return {
61
63
  currentUser,
@@ -76,6 +78,7 @@ export async function getSDKForCurrentUser() {
76
78
  // acl,
77
79
  node,
78
80
  waitlist,
79
- agent
81
+ agent,
82
+ chatFlow
80
83
  }
81
84
  }
@@ -1,11 +1,12 @@
1
1
  import { getAppcondaClient } from "./getAppcondaClient";
2
+ import { env } from "./lib/env";
2
3
  import { WaitlistService } from "./modules";
3
4
  import { Configuration } from "./services/configuration";
4
5
 
5
6
  export async function getSDKForService() {
6
7
  const adminClient = await getAppcondaClient();
7
8
 
8
- adminClient.addHeader('x-service-token', process.env._SERVICE_TOKEN ?? '');
9
+ adminClient.addHeader('x-service-token', env._SERVICE_TOKEN ?? '');
9
10
  /*
10
11
  const accounts = new Account(adminClient);
11
12
  const databases = new Databases(adminClient);
package/src/index.ts CHANGED
@@ -38,4 +38,4 @@ export { getSDKForCurrentUser } from './getSDKForCurrentUser';
38
38
  export { getSDKForService } from './getSDKForService';
39
39
  export { getAppcondaClient } from './getAppcondaClient';
40
40
  export * from './modules';
41
- export type { SafeActionFn } from 'next-safe-action';
41
+ export type { SafeActionFn } from 'next-safe-action';
package/src/lib/env.ts ADDED
@@ -0,0 +1,122 @@
1
+ import { createEnv } from "@t3-oss/env-nextjs";
2
+ import { z } from "zod";
3
+
4
+ export const env = createEnv({
5
+ /*
6
+ * Serverside Environment variables, not available on the client.
7
+ * Will throw if you access these variables on the client.
8
+ */
9
+ server: {
10
+ APPCONDA_ENDPOINT: z.string(),
11
+ APPCONDA_CLIENT_ENDPOINT: z.string(),
12
+ _SERVICE_TOKEN: z.string(),
13
+ /* AI_AZURE_LLM_API_KEY: z.string().optional(),
14
+ AI_AZURE_EMBEDDINGS_DEPLOYMENT_ID: z.string().optional(),
15
+ AI_AZURE_LLM_DEPLOYMENT_ID: z.string().optional(),
16
+ AI_AZURE_EMBEDDINGS_RESSOURCE_NAME: z.string().optional(),
17
+ AI_AZURE_LLM_RESSOURCE_NAME: z.string().optional(),
18
+ AIRTABLE_CLIENT_ID: z.string().optional(),
19
+ AZUREAD_CLIENT_ID: z.string().optional(),
20
+ AZUREAD_CLIENT_SECRET: z.string().optional(),
21
+ AZUREAD_TENANT_ID: z.string().optional(),
22
+ CRON_SECRET: z.string().min(10),
23
+ CUSTOMER_IO_API_KEY: z.string().optional(),
24
+ CUSTOMER_IO_SITE_ID: z.string().optional(),
25
+ DATABASE_URL: z.string().url(),
26
+ DEBUG: z.enum(["1", "0"]).optional(),
27
+ DEFAULT_ORGANIZATION_ID: z.string().optional(),
28
+ DEFAULT_ORGANIZATION_ROLE: z.enum(["owner", "manager", "member", "billing"]).optional(),
29
+ E2E_TESTING: z.enum(["1", "0"]).optional(),
30
+ EMAIL_AUTH_DISABLED: z.enum(["1", "0"]).optional(),
31
+ EMAIL_VERIFICATION_DISABLED: z.enum(["1", "0"]).optional(),
32
+ ENCRYPTION_KEY: z.string().length(64).or(z.string().length(32)),
33
+ ENTERPRISE_LICENSE_KEY: z.string().optional(),
34
+ FORMBRICKS_ENCRYPTION_KEY: z.string().length(24).or(z.string().length(0)).optional(),
35
+ GITHUB_ID: z.string().optional(),
36
+ GITHUB_SECRET: z.string().optional(),
37
+ GOOGLE_CLIENT_ID: z.string().optional(),
38
+ GOOGLE_CLIENT_SECRET: z.string().optional(),
39
+ GOOGLE_SHEETS_CLIENT_ID: z.string().optional(),
40
+ GOOGLE_SHEETS_CLIENT_SECRET: z.string().optional(),
41
+ GOOGLE_SHEETS_REDIRECT_URL: z.string().optional(),
42
+ HTTP_PROXY: z.string().url().optional(),
43
+ HTTPS_PROXY: z.string().url().optional(),
44
+ IMPRINT_URL: z
45
+ .string()
46
+ .url()
47
+ .optional()
48
+ .or(z.string().refine((str) => str === "")),
49
+ IMPRINT_ADDRESS: z.string().optional(),
50
+ INVITE_DISABLED: z.enum(["1", "0"]).optional(),
51
+ INTERCOM_SECRET_KEY: z.string().optional(),
52
+ IS_FORMBRICKS_CLOUD: z.enum(["1", "0"]).optional(),
53
+ MAIL_FROM: z.string().email().optional(),
54
+ NEXTAUTH_SECRET: z.string().min(1),
55
+ NOTION_OAUTH_CLIENT_ID: z.string().optional(),
56
+ NOTION_OAUTH_CLIENT_SECRET: z.string().optional(),
57
+ OIDC_CLIENT_ID: z.string().optional(),
58
+ OIDC_CLIENT_SECRET: z.string().optional(),
59
+ OIDC_DISPLAY_NAME: z.string().optional(),
60
+ OIDC_ISSUER: z.string().optional(),
61
+ OIDC_SIGNING_ALGORITHM: z.string().optional(),
62
+ OPENTELEMETRY_LISTENER_URL: z.string().optional(),
63
+ REDIS_URL: z.string().optional(),
64
+ REDIS_HTTP_URL: z.string().optional(),
65
+ PASSWORD_RESET_DISABLED: z.enum(["1", "0"]).optional(),
66
+ PRIVACY_URL: z
67
+ .string()
68
+ .url()
69
+ .optional()
70
+ .or(z.string().refine((str) => str === "")),
71
+ RATE_LIMITING_DISABLED: z.enum(["1", "0"]).optional(),
72
+ S3_ACCESS_KEY: z.string().optional(),
73
+ S3_BUCKET_NAME: z.string().optional(),
74
+ S3_REGION: z.string().optional(),
75
+ S3_SECRET_KEY: z.string().optional(),
76
+ S3_ENDPOINT_URL: z.string().optional(),
77
+ S3_FORCE_PATH_STYLE: z.enum(["1", "0"]).optional(),
78
+ SHORT_URL_BASE: z.string().url().optional().or(z.string().length(0)),
79
+ SIGNUP_DISABLED: z.enum(["1", "0"]).optional(),
80
+ SLACK_CLIENT_ID: z.string().optional(),
81
+ SLACK_CLIENT_SECRET: z.string().optional(),
82
+ SMTP_HOST: z.string().min(1).optional(),
83
+ SMTP_PORT: z.string().min(1).optional(),
84
+ SMTP_SECURE_ENABLED: z.enum(["1", "0"]).optional(),
85
+ SMTP_USER: z.string().min(1).optional(),
86
+ SMTP_PASSWORD: z.string().min(1).optional(),
87
+ SMTP_AUTHENTICATED: z.enum(["1", "0"]).optional(),
88
+ SMTP_REJECT_UNAUTHORIZED_TLS: z.enum(["1", "0"]).optional(),
89
+ STRIPE_SECRET_KEY: z.string().optional(),
90
+ STRIPE_WEBHOOK_SECRET: z.string().optional(),
91
+ TELEMETRY_DISABLED: z.enum(["1", "0"]).optional(),
92
+ TERMS_URL: z
93
+ .string()
94
+ .url()
95
+ .optional()
96
+ .or(z.string().refine((str) => str === "")),
97
+ TURNSTILE_SECRET_KEY: z.string().optional(),
98
+ UPLOADS_DIR: z.string().min(1).optional(),
99
+ VERCEL_URL: z.string().optional(),
100
+ _ADMIN_DOMAIN: z.string().optional(),
101
+ ADMIN_URL: z.string().url().optional(),
102
+ UNSPLASH_ACCESS_KEY: z.string().optional(),
103
+ LANGFUSE_SECRET_KEY: z.string().optional(),
104
+ LANGFUSE_PUBLIC_KEY: z.string().optional(),
105
+ LANGFUSE_BASEURL: z.string().optional(), */
106
+ },
107
+
108
+ /*
109
+ * Due to how Next.js bundles environment variables on Edge and Client,
110
+ * we need to manually destructure them to make sure all are included in bundle.
111
+ *
112
+ * 💡 You'll get type errors if not all variables from `server` & `client` are included here.
113
+ */
114
+ runtimeEnv: {
115
+ APPCONDA_ENDPOINT: process.env.APPCONDA_ENDPOINT,
116
+ APPCONDA_CLIENT_ENDPOINT: process.env.APPCONDA_CLIENT_ENDPOINT,
117
+ _SERVICE_TOKEN: process.env._SERVICE_TOKEN,
118
+ },
119
+ });
120
+
121
+
122
+ console.log(env);
@@ -1,8 +1,8 @@
1
1
  'use server';
2
2
 
3
- import { getSDKForCurrentUser } from "@appconda/nextjs";
4
3
  import { z } from "zod";
5
4
  import { actionClient } from "../../../actions/actionClient";
5
+ import { getSDKForCurrentUser } from "../../../getSDKForCurrentUser";
6
6
 
7
7
  export const getAllNodesAction = actionClient
8
8
  // .schema(listModelsSchema)
@@ -0,0 +1,32 @@
1
+
2
+ import { Payload } from "../client";
3
+ import { ServiceClient } from "../service-client";
4
+
5
+ export class ChatFlow extends ServiceClient {
6
+ protected getServiceName(): string {
7
+ return 'com.appconda.service.chat-flow';
8
+ }
9
+
10
+ public async createChatFlow(id: string, name: string, flowData: object): Promise<any[]> {
11
+ const payload: Payload = {};
12
+ payload['id'] = id;
13
+ payload['name'] = name;
14
+ payload['flowData'] = JSON.stringify(flowData);
15
+ return await this.actionCall('CreateChatFlow', payload);
16
+ }
17
+
18
+ public async updateChatFlow(id: string, name: string, flowData: object): Promise<any[]> {
19
+ const payload: Payload = {};
20
+ payload['id'] = id;
21
+ payload['name'] = name;
22
+ payload['flowData'] = JSON.stringify(flowData);
23
+ return await this.actionCall('UpdateChatFlow', payload);
24
+ }
25
+
26
+ public async get(id: string): Promise<any[]> {
27
+ const payload: Payload = {};
28
+ payload['id'] = id;
29
+ return await this.actionCall('GetChatFlow', payload);
30
+ }
31
+
32
+ }