diff --git a/.gitignore b/.gitignore
index 32251b6b..15948cca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,5 +5,6 @@ node_modules
.DS_Store
_dev
.vercel
-__dev
-.vercel
+__dev
+.vercel
+.vscode/
diff --git a/apps/hasura/metadata/databases/masterbots/tables/public_chatbot.yaml b/apps/hasura/metadata/databases/masterbots/tables/public_chatbot.yaml
index b442cfeb..aa0a832e 100644
--- a/apps/hasura/metadata/databases/masterbots/tables/public_chatbot.yaml
+++ b/apps/hasura/metadata/databases/masterbots/tables/public_chatbot.yaml
@@ -29,6 +29,13 @@ array_relationships:
table:
name: chat
schema: public
+ - name: followers
+ using:
+ foreign_key_constraint_on:
+ column: followee_id_chatbot
+ table:
+ name: social_following
+ schema: public
- name: metadataLabels
using:
foreign_key_constraint_on:
diff --git a/apps/hasura/metadata/databases/masterbots/tables/public_social_following.yaml b/apps/hasura/metadata/databases/masterbots/tables/public_social_following.yaml
index 062cc3a0..2a2b153c 100644
--- a/apps/hasura/metadata/databases/masterbots/tables/public_social_following.yaml
+++ b/apps/hasura/metadata/databases/masterbots/tables/public_social_following.yaml
@@ -2,6 +2,9 @@ table:
name: social_following
schema: public
object_relationships:
+ - name: chatbot
+ using:
+ foreign_key_constraint_on: followee_id_chatbot
- name: user
using:
foreign_key_constraint_on: followee_id
@@ -9,6 +12,19 @@ object_relationships:
using:
foreign_key_constraint_on: follower_id
insert_permissions:
+ - role: moderator
+ permission:
+ check:
+ _and:
+ - followee_id:
+ _eq: X-Hasura-User-Id
+ - follower_id:
+ _eq: X-Hasura-User-Id
+ columns:
+ - followee_id
+ - followee_id_chatbot
+ - follower_id
+ comment: ""
- role: user
permission:
check:
@@ -19,22 +35,74 @@ insert_permissions:
_neq: X-Hasura-User-Id
columns:
- followee_id
+ - followee_id_chatbot
- follower_id
comment: ""
select_permissions:
+ - role: anonymous
+ permission:
+ columns:
+ - created_at
+ - followee_id
+ - followee_id_chatbot
+ - follower_id
+ filter: {}
+ comment: ""
+ - role: moderator
+ permission:
+ columns:
+ - created_at
+ - followee_id
+ - followee_id_chatbot
+ - follower_id
+ filter: {}
+ comment: ""
- role: user
permission:
columns:
- followee_id
+ - followee_id_chatbot
- follower_id
filter:
_or:
- follower_id:
_eq: X-Hasura-User-Id
- followee_id:
+ _neq: X-Hasura-User-Id
+ comment: ""
+update_permissions:
+ - role: moderator
+ permission:
+ columns:
+ - followee_id
+ - followee_id_chatbot
+ - follower_id
+ filter:
+ follower_id:
+ _eq: X-Hasura-User-Id
+ check: null
+ comment: ""
+ - role: user
+ permission:
+ columns:
+ - followee_id
+ - followee_id_chatbot
+ - follower_id
+ filter:
+ _and:
+ - follower_id:
_eq: X-Hasura-User-Id
+ - followee_id:
+ _neq: X-Hasura-User-Id
+ check: null
comment: ""
delete_permissions:
+ - role: moderator
+ permission:
+ filter:
+ follower_id:
+ _eq: X-Hasura-User-Id
+ comment: ""
- role: user
permission:
filter:
diff --git a/apps/hasura/metadata/databases/masterbots/tables/public_user.yaml b/apps/hasura/metadata/databases/masterbots/tables/public_user.yaml
index 354c518a..0ddd14e7 100644
--- a/apps/hasura/metadata/databases/masterbots/tables/public_user.yaml
+++ b/apps/hasura/metadata/databases/masterbots/tables/public_user.yaml
@@ -1,7 +1,6 @@
table:
name: user
schema: public
-
array_relationships:
- name: chats
using:
@@ -31,7 +30,6 @@ array_relationships:
table:
name: preference
schema: public
-
- name: prompts
using:
foreign_key_constraint_on:
@@ -39,7 +37,6 @@ array_relationships:
table:
name: prompt_user
schema: public
-
- name: referrals
using:
foreign_key_constraint_on:
@@ -47,7 +44,6 @@ array_relationships:
table:
name: referral
schema: public
-
- name: referralsByUserId
using:
foreign_key_constraint_on:
@@ -55,7 +51,6 @@ array_relationships:
table:
name: referral
schema: public
-
- name: threads
using:
foreign_key_constraint_on:
diff --git a/apps/hasura/migrations/masterbots/1734184725302_delete_fk_public_social_following_social_following_followee_id_fkey/down.sql b/apps/hasura/migrations/masterbots/1734184725302_delete_fk_public_social_following_social_following_followee_id_fkey/down.sql
new file mode 100644
index 00000000..e5d74d0b
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734184725302_delete_fk_public_social_following_social_following_followee_id_fkey/down.sql
@@ -0,0 +1,5 @@
+alter table "public"."social_following"
+ add constraint "social_following_followee_id_fkey"
+ foreign key ("followee_id")
+ references "public"."user"
+ ("user_id") on update restrict on delete restrict;
diff --git a/apps/hasura/migrations/masterbots/1734184725302_delete_fk_public_social_following_social_following_followee_id_fkey/up.sql b/apps/hasura/migrations/masterbots/1734184725302_delete_fk_public_social_following_social_following_followee_id_fkey/up.sql
new file mode 100644
index 00000000..03bf030c
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734184725302_delete_fk_public_social_following_social_following_followee_id_fkey/up.sql
@@ -0,0 +1 @@
+alter table "public"."social_following" drop constraint "social_following_followee_id_fkey";
diff --git a/apps/hasura/migrations/masterbots/1734184748787_run_sql_migration/down.sql b/apps/hasura/migrations/masterbots/1734184748787_run_sql_migration/down.sql
new file mode 100644
index 00000000..e5eaabaf
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734184748787_run_sql_migration/down.sql
@@ -0,0 +1,4 @@
+-- Could not auto-generate a down migration.
+-- Please write an appropriate down migration for the SQL below:
+-- ALTER TABLE social_following
+-- DROP CONSTRAINT IF EXISTS social_following_followee_id_fkey;
diff --git a/apps/hasura/migrations/masterbots/1734184748787_run_sql_migration/up.sql b/apps/hasura/migrations/masterbots/1734184748787_run_sql_migration/up.sql
new file mode 100644
index 00000000..9090b302
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734184748787_run_sql_migration/up.sql
@@ -0,0 +1,2 @@
+ALTER TABLE social_following
+DROP CONSTRAINT IF EXISTS social_following_followee_id_fkey;
diff --git a/apps/hasura/migrations/masterbots/1734196561972_alter_table_public_social_following_alter_column_follower_id/down.sql b/apps/hasura/migrations/masterbots/1734196561972_alter_table_public_social_following_alter_column_follower_id/down.sql
new file mode 100644
index 00000000..ce5422ce
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734196561972_alter_table_public_social_following_alter_column_follower_id/down.sql
@@ -0,0 +1 @@
+alter table "public"."social_following" rename column "follower_id_n" to "follower_id";
diff --git a/apps/hasura/migrations/masterbots/1734196561972_alter_table_public_social_following_alter_column_follower_id/up.sql b/apps/hasura/migrations/masterbots/1734196561972_alter_table_public_social_following_alter_column_follower_id/up.sql
new file mode 100644
index 00000000..c3b0a520
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734196561972_alter_table_public_social_following_alter_column_follower_id/up.sql
@@ -0,0 +1 @@
+alter table "public"."social_following" rename column "follower_id" to "follower_id_n";
diff --git a/apps/hasura/migrations/masterbots/1734196575364_alter_table_public_social_following_alter_column_follower_id_n/down.sql b/apps/hasura/migrations/masterbots/1734196575364_alter_table_public_social_following_alter_column_follower_id_n/down.sql
new file mode 100644
index 00000000..c3b0a520
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734196575364_alter_table_public_social_following_alter_column_follower_id_n/down.sql
@@ -0,0 +1 @@
+alter table "public"."social_following" rename column "follower_id" to "follower_id_n";
diff --git a/apps/hasura/migrations/masterbots/1734196575364_alter_table_public_social_following_alter_column_follower_id_n/up.sql b/apps/hasura/migrations/masterbots/1734196575364_alter_table_public_social_following_alter_column_follower_id_n/up.sql
new file mode 100644
index 00000000..ce5422ce
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734196575364_alter_table_public_social_following_alter_column_follower_id_n/up.sql
@@ -0,0 +1 @@
+alter table "public"."social_following" rename column "follower_id_n" to "follower_id";
diff --git a/apps/hasura/migrations/masterbots/1734292953319_set_fk_public_social_following_followee_id/down.sql b/apps/hasura/migrations/masterbots/1734292953319_set_fk_public_social_following_followee_id/down.sql
new file mode 100644
index 00000000..03bf030c
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734292953319_set_fk_public_social_following_followee_id/down.sql
@@ -0,0 +1 @@
+alter table "public"."social_following" drop constraint "social_following_followee_id_fkey";
diff --git a/apps/hasura/migrations/masterbots/1734292953319_set_fk_public_social_following_followee_id/up.sql b/apps/hasura/migrations/masterbots/1734292953319_set_fk_public_social_following_followee_id/up.sql
new file mode 100644
index 00000000..e5d74d0b
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734292953319_set_fk_public_social_following_followee_id/up.sql
@@ -0,0 +1,5 @@
+alter table "public"."social_following"
+ add constraint "social_following_followee_id_fkey"
+ foreign key ("followee_id")
+ references "public"."user"
+ ("user_id") on update restrict on delete restrict;
diff --git a/apps/hasura/migrations/masterbots/1734300490458_alter_table_public_social_following_add_column_followee_id_chatbot/down.sql b/apps/hasura/migrations/masterbots/1734300490458_alter_table_public_social_following_add_column_followee_id_chatbot/down.sql
new file mode 100644
index 00000000..9398e11e
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734300490458_alter_table_public_social_following_add_column_followee_id_chatbot/down.sql
@@ -0,0 +1,4 @@
+-- Could not auto-generate a down migration.
+-- Please write an appropriate down migration for the SQL below:
+-- alter table "public"."social_following" add column "followee_id_chatbot" integer
+-- null;
diff --git a/apps/hasura/migrations/masterbots/1734300490458_alter_table_public_social_following_add_column_followee_id_chatbot/up.sql b/apps/hasura/migrations/masterbots/1734300490458_alter_table_public_social_following_add_column_followee_id_chatbot/up.sql
new file mode 100644
index 00000000..9919c59a
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734300490458_alter_table_public_social_following_add_column_followee_id_chatbot/up.sql
@@ -0,0 +1,2 @@
+alter table "public"."social_following" add column "followee_id_chatbot" integer
+ null;
diff --git a/apps/hasura/migrations/masterbots/1734300526426_set_fk_public_social_following_followee_id_chatbot/down.sql b/apps/hasura/migrations/masterbots/1734300526426_set_fk_public_social_following_followee_id_chatbot/down.sql
new file mode 100644
index 00000000..f802bd7e
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734300526426_set_fk_public_social_following_followee_id_chatbot/down.sql
@@ -0,0 +1 @@
+alter table "public"."social_following" drop constraint "social_following_followee_id_chatbot_fkey";
diff --git a/apps/hasura/migrations/masterbots/1734300526426_set_fk_public_social_following_followee_id_chatbot/up.sql b/apps/hasura/migrations/masterbots/1734300526426_set_fk_public_social_following_followee_id_chatbot/up.sql
new file mode 100644
index 00000000..df6d60e2
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734300526426_set_fk_public_social_following_followee_id_chatbot/up.sql
@@ -0,0 +1,5 @@
+alter table "public"."social_following"
+ add constraint "social_following_followee_id_chatbot_fkey"
+ foreign key ("followee_id_chatbot")
+ references "public"."chatbot"
+ ("chatbot_id") on update restrict on delete restrict;
diff --git a/apps/hasura/migrations/masterbots/1734356983533_alter_table_public_social_following_alter_column_followee_id/down.sql b/apps/hasura/migrations/masterbots/1734356983533_alter_table_public_social_following_alter_column_followee_id/down.sql
new file mode 100644
index 00000000..0533b897
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734356983533_alter_table_public_social_following_alter_column_followee_id/down.sql
@@ -0,0 +1 @@
+alter table "public"."social_following" alter column "followee_id" set not null;
diff --git a/apps/hasura/migrations/masterbots/1734356983533_alter_table_public_social_following_alter_column_followee_id/up.sql b/apps/hasura/migrations/masterbots/1734356983533_alter_table_public_social_following_alter_column_followee_id/up.sql
new file mode 100644
index 00000000..c3ed363a
--- /dev/null
+++ b/apps/hasura/migrations/masterbots/1734356983533_alter_table_public_social_following_alter_column_followee_id/up.sql
@@ -0,0 +1 @@
+alter table "public"."social_following" alter column "followee_id" drop not null;
diff --git a/apps/masterbots.ai/app/(browse)/page.tsx b/apps/masterbots.ai/app/(browse)/page.tsx
index ded04fd7..0b9d5a18 100644
--- a/apps/masterbots.ai/app/(browse)/page.tsx
+++ b/apps/masterbots.ai/app/(browse)/page.tsx
@@ -1,5 +1,6 @@
import BrowseList from '@/components/routes/browse/browse-list'
import { BrowseSearchInput } from '@/components/routes/browse/browse-search-input'
+// export { generateMbMetadata as generateMetadata } from '@/lib/metadata'
export default async function HomePage() {
return (
diff --git a/apps/masterbots.ai/app/actions/ai-executers.ts b/apps/masterbots.ai/app/actions/ai-executers.ts
index 435ab222..a2ca39d4 100644
--- a/apps/masterbots.ai/app/actions/ai-executers.ts
+++ b/apps/masterbots.ai/app/actions/ai-executers.ts
@@ -127,33 +127,19 @@ export async function getWebSearchTool({
throw new Error('Web Search could not be completed.')
}
- if (!response.outputs['web search']?.output) {
+ if (
+ !response.outputs['web search']?.output &&
+ !response.outputs['web search']?.logs
+ ) {
throw new Error('No output given. Web search could not be completed')
}
- return `${response.outputs['web search'].output}
-
- ## EXAMPLE:
-
- **Resume:**
- Brewers: 9
- Dodgers: 2
-
- **Summary**
- Yelich, Perkins power Brewers to 9-2 victory over Dodgers and avoid being swept in weekend series. — Christian Yelich and Blake Perkins both homered, had three hits and drove in three runs as the Milwaukee Brewers beat the Los Angeles Dodgers 9-2 Sunday to snap a seven-game losing streak at Dodger Stadium.
-
- **Homeruns:**
- Yelich
-
- **Winning Pitcher:**
- J. Junis
-
- **Sources**:
-
- 1. [https://website1.com/](https://website1.com/)
- 2. [https://website2.com/](https://website2.com/)`
+ return `## INPUT:
+
+ ${response.outputs['web search']?.output ?? response.outputs['web search']?.logs}`
} catch (error) {
- console.error('Error fetching app data: ', error)
- throw error
+ return `Something went wrong with web search that failed to provide results. Please try again later.
+
+ [ERROR LOG]: ${JSON.stringify(error, null, 2)}`
}
}
diff --git a/apps/masterbots.ai/app/actions/ai-main-call.ts b/apps/masterbots.ai/app/actions/ai-main-call.ts
index 0aaa9b60..b01c9d6a 100644
--- a/apps/masterbots.ai/app/actions/ai-main-call.ts
+++ b/apps/masterbots.ai/app/actions/ai-main-call.ts
@@ -223,7 +223,7 @@ export async function createResponseStream(
temperature: 0.4,
tools,
maxRetries: 2,
- maxToolRoundtrips: 1
+ maxToolRoundtrips: 2
})
responseStream = response.toDataStreamResponse().body as ReadableStream
break
@@ -242,7 +242,7 @@ export async function createResponseStream(
maxTokens: 300,
tools,
maxRetries: 2,
- maxToolRoundtrips: 1
+ maxToolRoundtrips: 2
})
responseStream = response.toDataStreamResponse().body as ReadableStream
break
@@ -262,7 +262,7 @@ export async function createResponseStream(
maxTokens: 1000,
tools,
maxRetries: 2,
- maxToolRoundtrips: 1
+ maxToolRoundtrips: 2
})
responseStream = response.toDataStreamResponse().body as ReadableStream
break
diff --git a/apps/masterbots.ai/app/api/og/edge-client.ts b/apps/masterbots.ai/app/api/og/edge-client.ts
new file mode 100644
index 00000000..4df79a89
--- /dev/null
+++ b/apps/masterbots.ai/app/api/og/edge-client.ts
@@ -0,0 +1,57 @@
+import { endpoints } from "mb-env"
+import { UUID } from '@/types/types'
+
+export async function getThreadForOG(threadId: UUID) {
+
+ const env = process.env.NEXT_PUBLIC_APP_ENV
+ if (!env || !['prod', 'test', 'local'].includes(env)) {
+ throw new Error('Invalid environment configuration')
+ }
+ const endpoint = endpoints[env as 'prod' | 'test' | 'local']
+ if (!endpoint) {
+ throw new Error('API endpoint not configured')
+ }
+
+ try {
+ const response = await fetch(endpoint, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ query: `
+ query GetThread($threadId: uuid!) {
+ thread(where: {threadId: {_eq: $threadId}}) {
+ chatbot {
+ name
+ avatar
+ categories {
+ category {
+ name
+ }
+ }
+ }
+ user {
+ username
+ profilePicture
+ }
+ messages {
+ content
+ role
+ }
+ }
+ }
+ `,
+ variables: { threadId }
+ })
+ })
+ const data = await response.json()
+ if (data.errors) {
+ throw new Error(data.errors[0].message)
+ }
+ return data.data
+ } catch (error: any) {
+ throw new Error('Unknown error occurred while fetching thread')
+ }
+ }
+
\ No newline at end of file
diff --git a/apps/masterbots.ai/app/api/og/route.tsx b/apps/masterbots.ai/app/api/og/route.tsx
index a9312a62..eb2f7892 100644
--- a/apps/masterbots.ai/app/api/og/route.tsx
+++ b/apps/masterbots.ai/app/api/og/route.tsx
@@ -1,39 +1,71 @@
-//import { ImageResponse } from '@vercel/og'
-// generates the image with error ↑
import { ImageResponse } from 'next/og'
import { NextRequest } from 'next/server'
-import { getThread } from '@/services/hasura'
-import '@/app/globals.css'
+import { getThreadForOG } from './edge-client'
import OGImage from '@/components/shared/og-image'
+import { UUID } from '@/types/types'
+export const runtime = 'edge'
-// export const runtime = 'edge'
+const defaultContent = {
+ thread: {
+ chatbot: {
+ name: 'Masterbots',
+ avatar: process.env.NEXT_PUBLIC_BASE_URL + '/images/masterbots.png',
+ categories: [{ category: { name: 'AI' } }]
+ }
+ },
+ question:
+ 'Elevating AI Beyond ChatGPT: Specialized Chatbots, Social Sharing and User-Friendly Innovation',
+ answer:
+ 'Elevating AI Beyond ChatGPT: Specialized Chatbots, Social Sharing and User-Friendly Innovation',
+ username: 'Masterbots',
+ user_avatar: process.env.NEXT_PUBLIC_BASE_URL + '/images/masterbots.png',
+ isLightTheme: false
+}
export async function GET(req: NextRequest) {
try {
const { searchParams } = req.nextUrl
- const threadId = searchParams.get('threadId')
- const thread = await getThread({ threadId, jwt: '' })
+ const rawThreadId = searchParams.get('threadId')
+ const threadId = rawThreadId?.match(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)
+ ? (rawThreadId as UUID)
+ : null
+
+ if (!threadId) {
+ return new ImageResponse( , {
+ width: 1200,
+ height: 627
+ })
+ }
+ const thread = await getThreadForOG(threadId)
+
+ if (!thread?.thread?.length) {
+ // Use metadata when thread not found
+ return new ImageResponse( , {
+ width: 1200,
+ height: 627
+ })
+ }
+
+ const threadData = thread.thread[0]
const question =
- thread.messages.find(m => m.role === 'user')?.content || 'not found'
+ threadData?.messages?.find((m: { role: string }) => m.role === 'user')
+ ?.content || 'not found'
const answer =
- thread.messages.find(m => m.role === 'assistant')?.content || 'not found'
- const username = thread.user?.username
- const user_avatar = thread.user?.profilePicture || ''
+ threadData?.messages?.find(
+ (m: { role: string }) => m.role === 'assistant'
+ )?.content || 'not found'
+ const username = threadData?.user?.username || 'Anonymous'
+ const user_avatar = threadData?.user?.profilePicture || ''
- let theme = 'dark'
- if (typeof window !== 'undefined') {
- theme = localStorage.getItem('theme') || 'dark'
- }
- const isLightTheme = theme === 'light'
return new ImageResponse(
(
),
{
@@ -42,12 +74,9 @@ export async function GET(req: NextRequest) {
}
)
} catch (e: any) {
- console.log(`${e.message}`)
- return new Response(`Failed to generate the image`, {
+ console.error('OG Image generation error:', e)
+ return new Response(`Failed to generate the image: ${e.message}`, {
status: 500
})
}
}
-function useTheme() {
- throw new Error('Function not implemented.')
-}
diff --git a/apps/masterbots.ai/app/b/[id]/page.tsx b/apps/masterbots.ai/app/b/[id]/page.tsx
index ebc482c7..881d6bcd 100644
--- a/apps/masterbots.ai/app/b/[id]/page.tsx
+++ b/apps/masterbots.ai/app/b/[id]/page.tsx
@@ -8,7 +8,7 @@ import type { Metadata } from 'next'
const PAGE_SIZE = 50
export default async function BotThreadsPage({
- params,
+ params
}: {
params: { id: string }
}) {
@@ -17,24 +17,31 @@ export default async function BotThreadsPage({
chatbot = await getChatbot({
chatbotName: botNames.get(params.id),
jwt: '',
- threads: true,
+ threads: true
})
if (!chatbot) throw new Error(`Chatbot ${botNames.get(params.id)} not found`)
// session will always be defined
threads = await getBrowseThreads({
chatbotName: botNames.get(params.id),
- limit: PAGE_SIZE,
+ limit: PAGE_SIZE
})
return (
-
- {chatbot ?
: ''}
+
+ {chatbot ? (
+
+ ) : (
+ ''
+ )}
@@ -43,22 +50,24 @@ export default async function BotThreadsPage({
}
export async function generateMetadata({
- params,
+ params
}: {
params: { id: string }
}): Promise
{
const chatbot = await getChatbot({
chatbotName: botNames.get(params.id),
jwt: '',
- threads: true,
+ threads: true
})
const seoData = {
title: chatbot?.name || '',
description: chatbot?.description || '',
ogType: 'website',
- ogImageUrl: chatbot?.avatar || '',
- twitterCard: 'summary_large_image',
+ ogImageUrl: chatbot?.threads?.[0]?.threadId
+ ? `${process.env.BASE_URL || ''}/api/og?threadId=${chatbot.threads[0].threadId}`
+ : `${process.env.BASE_URL || ''}/api/og`,
+ twitterCard: 'summary_large_image'
}
return generateMetadataFromSEO(seoData)
diff --git a/apps/masterbots.ai/app/c/page.tsx b/apps/masterbots.ai/app/c/page.tsx
index 93b59a0f..72478f01 100644
--- a/apps/masterbots.ai/app/c/page.tsx
+++ b/apps/masterbots.ai/app/c/page.tsx
@@ -41,7 +41,7 @@ export async function generateMetadata(): Promise {
description:
'Welcome to the chatbot page. Interact with our AI-powered chatbot and get answers to your questions.',
ogType: 'website',
- ogImageUrl: '',
+ ogImageUrl: `${process.env.BASE_URL || ''}/api/og`,
twitterCard: 'summary'
}
diff --git a/apps/masterbots.ai/app/globals.css b/apps/masterbots.ai/app/globals.css
index 34a12fe1..cbe3e762 100644
--- a/apps/masterbots.ai/app/globals.css
+++ b/apps/masterbots.ai/app/globals.css
@@ -1,7 +1,6 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
-
@layer base {
:root {
--background: 0 0% 100%;
@@ -49,6 +48,13 @@
--tertiary: 288, 82%, 50%;
--tertiary-foreground: 0 0% 98%;
--font-size-base: 1rem;
+
+ --background-chat-gradient: linear-gradient(180deg, rgba(115, 201, 97, 0.2) 0%, rgba(122, 214, 104, 0.4) 100%);
+ --background-chat-hover-gradient: linear-gradient(-180deg, rgba(113, 199, 96, 0.1) 0%, rgba(117, 205, 99, 0.3) 100%);
+
+ /* Public route gradients */
+ --background-public-gradient: linear-gradient(180deg, rgba(155, 22, 232, 0.2) 0%, rgba(190, 22, 232, 0.53) 100%);
+ --background-public-hover-gradient: linear-gradient(-180deg, rgba(166, 22, 232, 0.1) 0%, rgba(190, 22, 232, 0.3) 100%);
}
.dark {
@@ -94,6 +100,13 @@
--tertiary: 120, 100%, 65%;
--tertiary-foreground: 0 0% 98%;
+
+ --background-chat-gradient: linear-gradient(180deg, rgba(115, 201, 97, 0.2) 0%, rgba(122, 214, 104, 0.4) 100%);
+ --background-chat-hover-gradient: linear-gradient(-180deg, rgba(113, 199, 96, 0.1) 0%, rgba(117, 205, 99, 0.3) 100%);
+
+ /* Public route gradients */
+ --background-public-gradient: linear-gradient(180deg, rgba(155, 22, 232, 0.2) 0%, rgba(190, 22, 232, 0.53) 100%);
+ --background-public-hover-gradient: linear-gradient(-180deg, rgba(166, 22, 232, 0.1) 0%, rgba(190, 22, 232, 0.3) 100%);
}
}
@@ -303,5 +316,31 @@
}
.lucide {
- stroke-width: 1px;
+ stroke-width: 1.25px;
+}
+
+/* Base sidebar gradient styles *//* Chat route styles */
+
+.sidebar-gradient {
+ transition: background-image 0.3s ease;
+}
+
+/* Chat route styles */
+[data-route="chat"] .sidebar-gradient:hover:not(.selected) {
+ background-image: var(--background-chat-hover-gradient);
}
+
+[data-route="chat"] .sidebar-gradient.selected {
+ background-image: var(--background-chat-gradient);
+}
+
+/* Public route styles */
+[data-route="public"] .sidebar-gradient:hover:not(.selected) {
+ background-image: var(--background-public-hover-gradient);
+}
+
+[data-route="public"] .sidebar-gradient.selected {
+ background-image: var(--background-public-gradient);
+}
+
+
diff --git a/apps/masterbots.ai/app/layout.tsx b/apps/masterbots.ai/app/layout.tsx
index 2daa17a3..074efcc2 100644
--- a/apps/masterbots.ai/app/layout.tsx
+++ b/apps/masterbots.ai/app/layout.tsx
@@ -1,7 +1,5 @@
import { GeistMono } from 'geist/font/mono'
import { GeistSans } from 'geist/font/sans'
-import { Toaster } from 'react-hot-toast'
-
import '@/app/globals.css'
import { Header } from '@/components/layout/header/header'
import { Providers } from '@/components/layout/providers'
@@ -9,6 +7,7 @@ import { cn } from '@/lib/utils'
import { GoogleAnalytics } from '@next/third-parties/google'
import { Metadata } from 'next'
import NextTopLoader from 'nextjs-toploader'
+import { Toaster } from '@/components/ui/sonner'
export default function RootLayout({ children }: RootLayoutProps) {
return (
@@ -57,7 +56,7 @@ export const metadata: Metadata = {
siteName: 'Masterbots',
images: [
{
- url: 'https://masterbots.ai/images/masterbots.png',
+ url: `${process.env.BASE_URL || ''}/api/og`,
width: 1232,
height: 928,
alt: 'Masterbots'
@@ -72,7 +71,7 @@ export const metadata: Metadata = {
card: 'summary_large_image',
images: [
{
- url: 'https://masterbots.ai/images/masterbots.png',
+ url: `${process.env.BASE_URL || ''}/api/og`,
width: 1232,
height: 928,
alt: 'Masterbots'
diff --git a/apps/masterbots.ai/components/auth/forgot-password-form.tsx b/apps/masterbots.ai/components/auth/forgot-password-form.tsx
index 0d866fb8..9fedae2d 100644
--- a/apps/masterbots.ai/components/auth/forgot-password-form.tsx
+++ b/apps/masterbots.ai/components/auth/forgot-password-form.tsx
@@ -3,15 +3,16 @@
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
+import { useSonner } from '@/lib/hooks/useSonner'
import { validateEmail } from '@/lib/utils'
import type React from 'react'
import { useState } from 'react'
-import { toast } from 'react-hot-toast'
export default function ForgotPasswordForm() {
const [email, setEmail] = useState('')
const [isLoading, setIsLoading] = useState(false)
const [emailError, setEmailError] = useState('')
+ const { customSonner } = useSonner()
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
@@ -34,14 +35,14 @@ export default function ForgotPasswordForm() {
const data = await response.json()
if (response.ok) {
- toast.success(data.message)
+ customSonner({ type: 'success', text: data.message })
setEmail('')
} else {
- toast.error(data.error || 'An error occurred')
+ customSonner({ type: 'error', text: data.error || 'An error occurred' })
}
} catch (error) {
console.error('Error:', error)
- toast.error('An unexpected error occurred')
+ customSonner({ type: 'error', text: 'An unexpected error occurred' })
} finally {
setIsLoading(false)
}
diff --git a/apps/masterbots.ai/components/auth/reset-password-form.tsx b/apps/masterbots.ai/components/auth/reset-password-form.tsx
index 56f8a1df..b2d7effa 100644
--- a/apps/masterbots.ai/components/auth/reset-password-form.tsx
+++ b/apps/masterbots.ai/components/auth/reset-password-form.tsx
@@ -8,8 +8,8 @@ import { isPasswordStrong } from '@/lib/password'
import { Eye, EyeOff } from 'lucide-react'
import { useRouter } from 'next/navigation'
import type React from 'react'
-import { toast } from 'react-hot-toast'
import { useSetState } from 'react-use'
+import { useSonner } from '@/lib/hooks/useSonner'
interface FormState {
password: string
@@ -29,6 +29,7 @@ export default function ResetPasswordForm({ token }: { token: string }) {
showPassword: false,
showConfirmPassword: false
})
+ const { customSonner } = useSonner()
const router = useRouter()
@@ -48,13 +49,13 @@ export default function ResetPasswordForm({ token }: { token: string }) {
setState({ isLoading: true })
if (!isPasswordStrong(state.password)) {
- toast.error('Please choose a stronger password')
+ customSonner({ type: 'error', text: 'Please choose a stronger password' })
setState({ isLoading: false })
return
}
if (state.password !== state.confirmPassword) {
- toast.error('Passwords do not match')
+ customSonner({ type: 'error', text: 'Passwords do not match' })
setState({ isLoading: false })
return
}
@@ -69,14 +70,14 @@ export default function ResetPasswordForm({ token }: { token: string }) {
const data = await response.json()
if (response.ok) {
- toast.success(data.message)
+ customSonner({ type: 'success', text: data.message })
router.push('/auth/signin')
} else {
- toast.error(data.error || 'An error occurred')
+ customSonner({ type: 'error', text: data.error || 'An error occurred' })
}
} catch (error) {
console.error('Error:', error)
- toast.error('An unexpected error occurred')
+ customSonner({ type: 'error', text: 'An unexpected error occurred' })
} finally {
setState({ isLoading: false })
}
diff --git a/apps/masterbots.ai/components/auth/signup-form.tsx b/apps/masterbots.ai/components/auth/signup-form.tsx
index 3397551a..5c55ea71 100644
--- a/apps/masterbots.ai/components/auth/signup-form.tsx
+++ b/apps/masterbots.ai/components/auth/signup-form.tsx
@@ -5,31 +5,31 @@ import { PasswordStrengthMeter } from '@/components/shared/password-strength-met
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
+import { useSonner } from '@/lib/hooks/useSonner'
import { isPasswordStrong, verifyPassword } from '@/lib/password'
import { Eye, EyeOff } from 'lucide-react'
import { useRouter } from 'next/navigation'
import type React from 'react'
import { useState } from 'react'
-import toast from 'react-hot-toast'
interface SignupState {
- email: string;
- password: string;
- username: string;
- passwordVerify: string;
- isLoading: boolean;
- showVerificationNotice: boolean;
- showPassword: boolean;
- showPasswordVerify: boolean;
+ email: string
+ password: string
+ username: string
+ passwordVerify: string
+ isLoading: boolean
+ showVerificationNotice: boolean
+ showPassword: boolean
+ showPasswordVerify: boolean
}
interface SignupState {
- email: string;
- password: string;
- username: string;
- passwordVerify: string;
- isLoading: boolean;
- showVerificationNotice: boolean;
+ email: string
+ password: string
+ username: string
+ passwordVerify: string
+ isLoading: boolean
+ showVerificationNotice: boolean
}
export default function SignUpForm() {
@@ -43,7 +43,7 @@ export default function SignUpForm() {
showPassword: false,
showPasswordVerify: false
})
-
+ const { customSonner } = useSonner()
const router = useRouter()
const handleSubmit = async (e: React.FormEvent) => {
@@ -51,13 +51,13 @@ export default function SignUpForm() {
setState(prev => ({ ...prev, isLoading: true }))
if (state.password !== state.passwordVerify) {
- toast.error('Passwords do not match')
+ customSonner({ type: 'error', text: 'Passwords do not match' })
setState(prev => ({ ...prev, isLoading: false }))
return
}
if (!isPasswordStrong(state.password)) {
- toast.error('Please choose a stronger password')
+ customSonner({ type: 'error', text: 'Please choose a stronger password' })
setState(prev => ({ ...prev, isLoading: false }))
return
}
@@ -77,13 +77,16 @@ export default function SignUpForm() {
if (response.ok) {
setState(prev => ({ ...prev, showVerificationNotice: true }))
- toast.success('Account created successfully! Please check your email to verify your account.')
+ customSonner({
+ type: 'success',
+ text: 'Account created successfully! Please check your email to verify your account.'
+ })
} else {
- toast.error(data.error || 'Failed to sign up')
+ customSonner({ type: 'error', text: data.error || 'Failed to sign up' })
}
} catch (error) {
console.error(error)
- toast.error('An unexpected error occurred')
+ customSonner({ type: 'error', text: 'An unexpected error occurred' })
} finally {
setState(prev => ({ ...prev, isLoading: false }))
}
@@ -94,7 +97,9 @@ export default function SignUpForm() {
setState(prev => ({ ...prev, [name]: value }))
}
- const togglePasswordVisibility = (field: 'showPassword' | 'showPasswordVerify') => {
+ const togglePasswordVisibility = (
+ field: 'showPassword' | 'showPasswordVerify'
+ ) => {
setState(prev => ({ ...prev, [field]: !prev[field] }))
}
@@ -106,14 +111,11 @@ export default function SignUpForm() {
We've sent a verification link to {state.email}
- Please check your email and click the verification link to activate your account.
- The verification link will expire in 15 days.
+ Please check your email and click the verification link to activate
+ your account. The verification link will expire in 15 days.
- router.push('/auth/signin')}
- >
+ router.push('/auth/signin')}>
Go to Sign In
@@ -135,7 +137,9 @@ export default function SignUpForm() {
/>
- Email
+
+ Email
+
-
Password
+
+ Password
+
-
Verify Password
+
+ Verify Password
+
togglePasswordVisibility('showPasswordVerify')}
className="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-400 hover:text-gray-600"
>
- {state.showPasswordVerify ? : }
+ {state.showPasswordVerify ? (
+
+ ) : (
+
+ )}
-
+
{state.isLoading ? 'Signing up...' : 'Sign Up'}
)
-}
\ No newline at end of file
+}
diff --git a/apps/masterbots.ai/components/layout/header/header.tsx b/apps/masterbots.ai/components/layout/header/header.tsx
index 7e926359..bc58e012 100644
--- a/apps/masterbots.ai/components/layout/header/header.tsx
+++ b/apps/masterbots.ai/components/layout/header/header.tsx
@@ -20,12 +20,8 @@ export function Header() {
- {appConfig.features.devMode && (
- <>
-
-
- >
- )}
+
+ {appConfig.features.devMode && }
diff --git a/apps/masterbots.ai/components/layout/header/user-menu.tsx b/apps/masterbots.ai/components/layout/header/user-menu.tsx
index 76f63009..2c96b83c 100644
--- a/apps/masterbots.ai/components/layout/header/user-menu.tsx
+++ b/apps/masterbots.ai/components/layout/header/user-menu.tsx
@@ -15,7 +15,7 @@ import Link from 'next/link'
import { toSlugWithUnderScore } from 'mb-lib'
import { ThemeToggle } from '@/components/shared/theme-toggle'
import { useTheme } from 'next-themes'
-
+import { urlBuilders } from '@/lib/url'
export interface UserMenuProps {
user: Session['user']
@@ -27,11 +27,12 @@ function getUserInitials(name: string) {
}
function truncateUsername(username: string | null | undefined, maxLength = 10) {
- if (!username) return '';
- return username.length > maxLength ? `${username.slice(0, maxLength - 4)}` : username;
+ if (!username) return ''
+ return username.length > maxLength
+ ? `${username.slice(0, maxLength - 4)}`
+ : username
}
-
export function UserMenu({ user }: UserMenuProps) {
const { theme } = useTheme()
return (
@@ -59,7 +60,12 @@ export function UserMenu({ user }: UserMenuProps) {
-
{user?.name}
@@ -69,7 +75,9 @@ export function UserMenu({ user }: UserMenuProps) {
- {theme === 'dark' ? 'Light Mode' : 'Dark Mode'}
+
+ {theme === 'dark' ? 'Light Mode' : 'Dark Mode'}
+
@@ -88,4 +96,4 @@ export function UserMenu({ user }: UserMenuProps) {
)
-}
\ No newline at end of file
+}
diff --git a/apps/masterbots.ai/components/layout/profile/profile-page-sidebar.tsx b/apps/masterbots.ai/components/layout/profile/profile-page-sidebar.tsx
index ec04a729..5db87ff8 100644
--- a/apps/masterbots.ai/components/layout/profile/profile-page-sidebar.tsx
+++ b/apps/masterbots.ai/components/layout/profile/profile-page-sidebar.tsx
@@ -12,6 +12,7 @@ import { useSidebar } from '@/lib/hooks/use-sidebar';
import { useProfile } from '@/lib/hooks/use-profile';
import { useSession } from 'next-auth/react';
import { useAsync } from 'react-use'
+import { urlBuilders } from '@/lib/url';
export const ProfileSidebar = ({ children }: any) => {
const pathname = usePathname()
@@ -28,6 +29,7 @@ export const ProfileSidebar = ({ children }: any) => {
return currentUser;
}, [slug, currentUser]);
+ const userSlug = slug as string
const sameUser = isSameUser(user?.userId)
const handleToggleThreads = () => {
@@ -70,7 +72,7 @@ export const ProfileSidebar = ({ children }: any) => {
{/* Threads Accordion */}
+
diff --git a/apps/masterbots.ai/components/layout/sidebar/profile-sidebar.tsx b/apps/masterbots.ai/components/layout/sidebar/profile-sidebar.tsx
index 7707d1e3..4b2e37e7 100644
--- a/apps/masterbots.ai/components/layout/sidebar/profile-sidebar.tsx
+++ b/apps/masterbots.ai/components/layout/sidebar/profile-sidebar.tsx
@@ -11,6 +11,7 @@ import { signOut } from 'next-auth/react'
import Image from 'next/image'
import { useRouter } from 'next/navigation'
import { useCallback, useState } from 'react'
+import { urlBuilders } from '@/lib/url'
interface ProfileSidebarProps {
user: Session['user'] & {
@@ -49,7 +50,9 @@ export function ProfileSidebar({ user }: ProfileSidebarProps) {
const userSlug = toSlugWithUnderScore(user.name || '')
if (userSlug) {
setIsOpen(false)
- router.push(`/u/${userSlug}/t`)
+ router.push(urlBuilders.userProfileUrl({
+ userSlug
+ }))
}
}, [router, user.name])
@@ -115,32 +118,31 @@ export function ProfileSidebar({ user }: ProfileSidebarProps) {
Chat
- {appConfig.features.devMode && (
- handleNavigation('/c/p')}
- >
- Pro
-
- )}
-
handleNavigation('/')}
>
- Browse
+ Public
{appConfig.features.devMode && (
- handleNavigation('/wordware')}
- >
- Ww
-
+ <>
+ handleNavigation('/c/p')}
+ >
+ Pro
+
+ handleNavigation('/wordware')}
+ >
+ Ww
+
+ >
)}
diff --git a/apps/masterbots.ai/components/layout/sidebar/sidebar-actions.tsx b/apps/masterbots.ai/components/layout/sidebar/sidebar-actions.tsx
index d89be026..4af1acf9 100644
--- a/apps/masterbots.ai/components/layout/sidebar/sidebar-actions.tsx
+++ b/apps/masterbots.ai/components/layout/sidebar/sidebar-actions.tsx
@@ -12,17 +12,22 @@ import {
AlertDialogTitle
} from '@/components/ui/alert-dialog'
import { Button } from '@/components/ui/button'
-import { IconCheck, IconShare, IconSpinner, IconTrash } from '@/components/ui/icons'
+import {
+ IconCheck,
+ IconShare,
+ IconSpinner,
+ IconTrash
+} from '@/components/ui/icons'
import {
Tooltip,
TooltipContent,
TooltipTrigger
} from '@/components/ui/tooltip'
import { useSidebar } from '@/lib/hooks/use-sidebar'
+import { useSonner } from '@/lib/hooks/useSonner'
import { ServerActionResult, type Chat } from '@/types/types'
import { useRouter } from 'next/navigation'
import * as React from 'react'
-import { toast } from 'react-hot-toast'
interface SidebarActionsProps {
chat: Chat
@@ -39,21 +44,17 @@ export function SidebarActions({
const [deleteDialogOpen, setDeleteDialogOpen] = React.useState(false)
const [shareDialogOpen, setShareDialogOpen] = React.useState(false)
const [isRemovePending, startRemoveTransition] = React.useTransition()
- const {
- isFilterMode,
- selectedChats,
- setSelectedChats,
- filterValue
- } = useSidebar()
+ const { isFilterMode, selectedChats, setSelectedChats, filterValue } =
+ useSidebar()
+ const { customSonner } = useSonner()
const isSelected = selectedChats.includes(chat.id)
- const isVisible = !filterValue || chat.title.toLowerCase().includes(filterValue.toLowerCase())
+ const isVisible =
+ !filterValue || chat.title.toLowerCase().includes(filterValue.toLowerCase())
const handleSelect = React.useCallback(() => {
setSelectedChats(prev =>
- isSelected
- ? prev.filter(id => id !== chat.id)
- : [...prev, chat.id]
+ isSelected ? prev.filter(id => id !== chat.id) : [...prev, chat.id]
)
}, [chat.id, isSelected, setSelectedChats])
@@ -65,15 +66,14 @@ export function SidebarActions({
})
if (result && 'error' in result) {
- toast.error(result.error)
+ customSonner({ type: 'error', text: result.error })
return
}
setDeleteDialogOpen(false)
router.refresh()
router.push('/')
- toast.success('Chat deleted')
-
+ customSonner({ type: 'success', text: 'Chat deleted' })
// Remove the chat from selected chats if it was selected
if (isSelected) {
setSelectedChats(prev => prev.filter(id => id !== chat.id))
@@ -99,10 +99,14 @@ export function SidebarActions({
onClick={handleSelect}
>
{isSelected ? : }
- {isSelected ? 'Deselect' : 'Select'}
+
+ {isSelected ? 'Deselect' : 'Select'}
+
- {isSelected ? 'Deselect chat' : 'Select chat'}
+
+ {isSelected ? 'Deselect chat' : 'Select chat'}
+
) : (
<>
@@ -167,4 +171,4 @@ export function SidebarActions({
>
)
-}
\ No newline at end of file
+}
diff --git a/apps/masterbots.ai/components/layout/sidebar/sidebar-category-general.tsx b/apps/masterbots.ai/components/layout/sidebar/sidebar-category-general.tsx
index f97d3355..73e86f3d 100644
--- a/apps/masterbots.ai/components/layout/sidebar/sidebar-category-general.tsx
+++ b/apps/masterbots.ai/components/layout/sidebar/sidebar-category-general.tsx
@@ -5,7 +5,7 @@ import { useSidebar } from '@/lib/hooks/use-sidebar'
export function SidebarCategoryGeneral({ page }: { page?: string }) {
const { filteredCategories, isFilterMode } = useSidebar()
-
+
if (!filteredCategories.length) return No matching categories found
return (
diff --git a/apps/masterbots.ai/components/layout/sidebar/sidebar-link.tsx b/apps/masterbots.ai/components/layout/sidebar/sidebar-link.tsx
index 57b5595e..528a795a 100755
--- a/apps/masterbots.ai/components/layout/sidebar/sidebar-link.tsx
+++ b/apps/masterbots.ai/components/layout/sidebar/sidebar-link.tsx
@@ -1,11 +1,11 @@
'use client'
-import { Checkbox } from "@/components/ui/checkbox"
+import { Checkbox } from '@/components/ui/checkbox'
import { IconCaretRight } from '@/components/ui/icons'
import { useSidebar } from '@/lib/hooks/use-sidebar'
import { urlBuilders } from '@/lib/url'
-import { cn } from '@/lib/utils'
-import { Category, Chatbot } from 'mb-genql'
+import { cn, getRouteType } from '@/lib/utils'
+import type { Category, Chatbot } from 'mb-genql'
import { toSlug } from 'mb-lib'
import Image from 'next/image'
import Link from 'next/link'
@@ -18,10 +18,15 @@ interface SidebarLinkProps {
page?: string
}
-export default function SidebarLink({ category, isFilterMode, page }: SidebarLinkProps) {
+export default function SidebarLink({
+ category,
+ isFilterMode,
+ page
+}: SidebarLinkProps) {
const router = useRouter()
const pathname = usePathname()
const isBrowse = !/^\/(?:c|u)(?:\/|$)/.test(pathname)
+ const routeType = getRouteType(pathname)
const { slug } = useParams()
const {
@@ -30,7 +35,6 @@ export default function SidebarLink({ category, isFilterMode, page }: SidebarLin
activeChatbot,
setActiveChatbot,
selectedCategories,
- selectedChatbots,
setSelectedCategories,
setSelectedChatbots,
expandedCategories,
@@ -39,51 +43,73 @@ export default function SidebarLink({ category, isFilterMode, page }: SidebarLin
} = useSidebar()
const isExpanded = expandedCategories.includes(category.categoryId)
- const handleClickCategory = useCallback((e: React.MouseEvent) => {
- e.stopPropagation()
- if (!isFilterMode) {
- setExpandedCategories(prev =>
- prev.includes(category.categoryId)
- ? []
- : [category.categoryId]
- )
- setActiveCategory(prev => {
- const newCategory = prev === category.categoryId ? null : category.categoryId
- if (newCategory) {
- setActiveChatbot(null)
- navigateTo({
- page,
- slug: typeof slug === 'string' ? slug : undefined,
- categoryName: toSlug(category.name.toLowerCase()),
- isBrowse
- })
-
- }
- else {
- setActiveChatbot(null)
- navigateTo({
- page,
- slug: typeof slug === 'string' ? slug : undefined,
- isBrowse
- })
- }
- return newCategory
- })
- }
- }, [category.categoryId, category.name, setActiveCategory, setExpandedCategories, setActiveChatbot, router, isFilterMode, isBrowse])
+ // biome-ignore lint/correctness/useExhaustiveDependencies: not required
+ const handleClickCategory = useCallback(
+ (e: React.MouseEvent) => {
+ e.stopPropagation()
+ if (!isFilterMode) {
+ setExpandedCategories(prev =>
+ prev.includes(category.categoryId) ? [] : [category.categoryId]
+ )
+ setActiveCategory(prev => {
+ const newCategory =
+ prev === category.categoryId ? null : category.categoryId
+ if (newCategory) {
+ setActiveChatbot(null)
+ navigateTo({
+ page,
+ slug: typeof slug === 'string' ? slug : undefined,
+ categoryName: toSlug(category.name.toLowerCase()),
+ isBrowse
+ })
+ } else {
+ setActiveChatbot(null)
+ navigateTo({
+ page,
+ slug: typeof slug === 'string' ? slug : undefined,
+ isBrowse
+ })
+ }
+ return newCategory
+ })
+ }
+ },
+ [
+ category.categoryId,
+ category.name,
+ setActiveCategory,
+ setExpandedCategories,
+ setActiveChatbot,
+ router,
+ isFilterMode,
+ isBrowse
+ ]
+ )
- const handleCheckboxChange = useCallback((checked: boolean) => {
- setSelectedCategories(prev =>
- checked
- ? [...prev, category.categoryId]
- : prev.filter(id => id !== category.categoryId)
- )
- setSelectedChatbots(prev =>
- checked
- ? [...prev, ...category.chatbots.map(chatbot => chatbot.chatbot.chatbotId)]
- : prev.filter(id => !category.chatbots.some(chatbot => chatbot.chatbot.chatbotId === id))
- )
- }, [category.categoryId, category.chatbots])
+ // biome-ignore lint/correctness/useExhaustiveDependencies: not required
+ const handleCheckboxChange = useCallback(
+ (checked: boolean) => {
+ setSelectedCategories(prev =>
+ checked
+ ? [...prev, category.categoryId]
+ : prev.filter(id => id !== category.categoryId)
+ )
+ setSelectedChatbots(prev =>
+ checked
+ ? [
+ ...prev,
+ ...category.chatbots.map(chatbot => chatbot.chatbot.chatbotId)
+ ]
+ : prev.filter(
+ id =>
+ !category.chatbots.some(
+ chatbot => chatbot.chatbot.chatbotId === id
+ )
+ )
+ )
+ },
+ [category.categoryId, category.chatbots]
+ )
const isActive = activeCategory === category.categoryId
const isSelected = selectedCategories.includes(category.categoryId)
@@ -94,7 +120,7 @@ export default function SidebarLink({ category, isFilterMode, page }: SidebarLin
e.stopPropagation()}
+ onClick={e => e.stopPropagation()}
className="mr-2"
/>
)}
@@ -110,12 +136,14 @@ export default function SidebarLink({ category, isFilterMode, page }: SidebarLin
const childrenContent = (isExpanded || isFilterMode) && (
- {category.chatbots.map((chatbotCategory) => (
+ {category.chatbots.map(chatbotCategory => (
+
+ {/* biome-ignore lint/a11y/useKeyWithClickEvents:
*/}
@@ -142,19 +171,20 @@ export default function SidebarLink({ category, isFilterMode, page }: SidebarLin
}
return (
-
+
+ {/* biome-ignore lint/a11y/useButtonType:
*/}
{
- e.stopPropagation();
- handleClickCategory(e);
+ onClick={e => {
+ e.stopPropagation()
+ handleClickCategory(e)
}}
>
{categoryContent}
@@ -173,84 +203,102 @@ interface ChatbotComponentProps {
page?: string
}
-const ChatbotComponent: React.FC = React.memo(function ChatbotComponent({
- chatbot,
- category,
- isActive,
- setActiveChatbot,
- isFilterMode,
- page
-}) {
- const { selectedChatbots, toggleChatbotSelection, navigateTo } = useSidebar()
- const pathname = usePathname()
- const isBrowse = !/^\/(?:c|u)(?:\/|$)/.test(pathname)
- const { slug } = useParams()
+const ChatbotComponent: React.FC = React.memo(
+ function ChatbotComponent({
+ chatbot,
+ category,
+ isActive,
+ setActiveChatbot,
+ isFilterMode,
+ page
+ }) {
+ const { selectedChatbots, toggleChatbotSelection, navigateTo } =
+ useSidebar()
+ const pathname = usePathname()
+ const isBrowse = !/^\/(?:c|u)(?:\/|$)/.test(pathname)
+ const routeType = getRouteType(pathname)
+ const { slug } = useParams()
- const handleChatbotClick = useCallback((e: React.MouseEvent) => {
- e.preventDefault()
- setActiveChatbot(chatbot)
- if (chatbot) {
- navigateTo({
- page,
- slug: slug as string,
- categoryName: toSlug(category.name.toLowerCase()),
- chatbotName: chatbot.name.toLowerCase(),
- isBrowse
- })
- }
- }, [chatbot, setActiveChatbot, isFilterMode])
+ // biome-ignore lint/correctness/useExhaustiveDependencies:
+ const handleChatbotClick = useCallback(
+ (e: React.MouseEvent) => {
+ e.preventDefault()
+ setActiveChatbot(chatbot)
+ if (chatbot) {
+ navigateTo({
+ page,
+ slug: slug as string,
+ categoryName: toSlug(category.name.toLowerCase()),
+ chatbotName: chatbot.name.toLowerCase(),
+ isBrowse
+ })
+ }
+ },
+ [chatbot, setActiveChatbot, isFilterMode]
+ )
- const isSelected = selectedChatbots.includes(chatbot.chatbotId)
+ const isSelected = selectedChatbots.includes(chatbot.chatbotId)
- const handleCheckboxChange = useCallback(() => {
- toggleChatbotSelection(chatbot.chatbotId)
- }, [chatbot.chatbotId])
+ // biome-ignore lint/correctness/useExhaustiveDependencies:
+ const handleCheckboxChange = useCallback(() => {
+ toggleChatbotSelection(chatbot.chatbotId)
+ }, [chatbot.chatbotId])
- if (!isFilterMode && !isSelected) return null
+ if (!isFilterMode && !isSelected) return null
- return isFilterMode || isBrowse ? (
-
- {isFilterMode && (
-
e.stopPropagation()}
- className="mr-2"
+ return isFilterMode ? (
+
+ {isFilterMode && (
+ e.stopPropagation()}
+ className="mr-2"
+ />
+ )}
+
- )}
-
- {chatbot.name}
-
- ) : (
-
-
- {chatbot.name}
-
- )
-})
\ No newline at end of file
+ {chatbot.name}
+
+ ) : (
+
+
+ {chatbot.name}
+
+ )
+ }
+)
+
diff --git a/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx b/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx
index 308ff070..4e91568c 100644
--- a/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx
+++ b/apps/masterbots.ai/components/layout/sidebar/sidebar.tsx
@@ -3,27 +3,29 @@
import { SidebarCategoryGeneral } from '@/components/layout/sidebar/sidebar-category-general'
import { SidebarHeader } from '@/components/layout/sidebar/sidebar-header'
import { useSidebar } from '@/lib/hooks/use-sidebar'
+import { useThread } from '@/lib/hooks/use-thread'
import { cn } from '@/lib/utils'
-import React from 'react'
import { usePathname } from 'next/navigation'
-import { useThread } from '@/lib/hooks/use-thread'
+import React from 'react'
export function Sidebar({ className }: React.ComponentProps<'div'>) {
const { isSidebarOpen, isLoading } = useSidebar()
- const prevPathRef = React.useRef(usePathname());
- const pathname = usePathname();
- const { setActiveThread, setIsOpenPopup } = useThread()
- const rootAndChatRegex = /^\/(?:c)?$/;
+ const prevPathRef = React.useRef(usePathname())
+ const pathname = usePathname()
+ const { setActiveThread, setIsOpenPopup } = useThread()
+ const rootAndChatRegex = /^\/(?:c)?$/
+ const isChatRoute = pathname?.startsWith('/c')
+ // biome-ignore lint/correctness/useExhaustiveDependencies: not required
React.useEffect(() => {
if (rootAndChatRegex.test(pathname)) {
- setActiveThread(null);
- setIsOpenPopup(false);
+ setActiveThread(null)
+ setIsOpenPopup(false)
}
- prevPathRef.current = pathname;
- }, [pathname]);
+ prevPathRef.current = pathname
+ }, [pathname])
+
-
if (isLoading) return null
return (
@@ -32,12 +34,15 @@ export function Sidebar({ className }: React.ComponentProps<'div'>) {
data-state={isSidebarOpen ? 'open' : 'closed'}
className={cn(
className,
- 'h-full flex flex-col dark:bg-zinc-950 z-40'
+ 'h-full flex flex-col z-40',
+ isChatRoute
+ ? 'bg-[#eeffea] dark:bg-[#081D02]' // For /c routes
+ : 'bg-[#fae8ff] dark:bg-[#17021D]' // For other routes
)}
>
-
@@ -45,3 +50,5 @@ export function Sidebar({ className }: React.ComponentProps<'div'>) {
>
)
}
+
+export default Sidebar;
\ No newline at end of file
diff --git a/apps/masterbots.ai/components/routes/browse/browse-chat-messages.tsx b/apps/masterbots.ai/components/routes/browse/browse-chat-messages.tsx
index 86527087..4a280dd3 100644
--- a/apps/masterbots.ai/components/routes/browse/browse-chat-messages.tsx
+++ b/apps/masterbots.ai/components/routes/browse/browse-chat-messages.tsx
@@ -60,7 +60,14 @@ export function BrowseChatMessages({
return (
-
+ {chatbot ? (
+
+ ) : (
+ ''
+ )}
+
+
+
+
+
+ Back to browse
+
+
+
+
+
+
+ {isWelcomeView ? 'Welcome to Masterbots!' : chatbot.name}
+
+
+
+
+
+
+
+
+ bio:
+
+
+
+
+
+
+
+
+
+
+
+ New Chat
+
+
+
+
+
+ {hasMultiplePoints ? (
+ <>
+
+ {descriptionPoints[0]}
+
+
+ {descriptionPoints.slice(1).map((point, index) => (
+
+ index
+ }`}
+ className="text-gray-400"
+ >
+ • {point}
+
+ ))}
+
+ >
+ ) : (
+
{chatbot.description}
+ )}
+
+
+
+
+
+
+
+
+
+ Threads:{' '}
+
+ {numberShortener(chatbot.threads.length)}
+
+
+
+
+
+
+
+
+
+
+ Followers:
+ {numberShortener(3200)}
+
+
+
+
+ Follow
+
+
+
+
+
+
+
+ )
+}
diff --git a/apps/masterbots.ai/components/routes/browse/browse-chatbot-details.tsx b/apps/masterbots.ai/components/routes/browse/browse-chatbot-details.tsx
index 42ebc4ae..73912e76 100644
--- a/apps/masterbots.ai/components/routes/browse/browse-chatbot-details.tsx
+++ b/apps/masterbots.ai/components/routes/browse/browse-chatbot-details.tsx
@@ -1,102 +1,97 @@
-import ShareLink from '@/components/routes/thread/thread-share-link'
-import { Separator } from '@/components/ui/separator'
-import type { Chatbot } from 'mb-genql'
+'use client'
+
import { toSlug } from 'mb-lib'
-import Image from 'next/image'
-import Link from 'next/link'
+import { nanoid } from '@/lib/utils'
+import { useState } from 'react'
+import { useModel } from '@/lib/hooks/use-model'
+import { useChat } from 'ai/react'
+import { UserPersonalityPrompt } from '@/lib/constants/prompts'
+import type { BrowseChatbotDetailsProps } from '@/types/types'
+import { BrowseChatbotDesktopDetails } from '@/components/routes/browse/browse-chatbot-desktop-details'
+import { BrowseChatbotMobileDetails } from '@/components/routes/browse/browse-chatbot-mobile-details'
+import { useSonner } from '@/lib/hooks/useSonner'
-/**
- * BrowseChatbotDetails Component
- *
- * This component displays detailed information about a specific chatbot.
- * It includes the chatbot's name, primary category, description, and the number of threads associated with it.
- *
- * Props:
- * - chatbot: An optional Chatbot object containing details about the chatbot.
- *
- * Key Features:
- * - Conditional Rendering: Displays a message if no chatbot data is available.
- * - Dynamic URL Generation: Creates a URL for chatting with the chatbot based on its category and name.
- * - Responsive Design: Utilizes Tailwind CSS for styling and layout.
- */
export default function BrowseChatbotDetails({
- chatbot
-}: {
- chatbot?: Chatbot
-}) {
+ chatbot,
+ variant = 'default'
+}: BrowseChatbotDetailsProps) {
+ const [isLoading, setIsLoading] = useState(false)
+ const [generateType, setGenerateType] = useState
('')
+ const [lastMessage, setLastMessage] = useState(null)
+ const { selectedModel, clientType } = useModel()
+
+ const {customSonner} = useSonner()
+ const { append } = useChat({
+ id: nanoid(),
+ body: {
+ id: nanoid(),
+ model: selectedModel,
+ clientType
+ },
+ onResponse(response) {
+ if (response.status === 401) {
+ customSonner({ type: 'error', text: response.statusText })
+ } else if (!response.ok) {
+ customSonner({ type: 'error', text: 'Failed to process request'})
+ }
+ setIsLoading(false)
+ },
+ onError(error) {
+ customSonner({ type: 'error', text: 'An error occurred' })
+ setIsLoading(false)
+ },
+ async onFinish(message) {
+ setLastMessage(message.content)
+ }
+ })
+
if (!chatbot?.categories?.length) {
return No chatbot data available
}
+
const primaryCategory = chatbot.categories[0].category
const botUrl = `/c/${toSlug(primaryCategory.name)}/${chatbot.name.toLowerCase()}`
+ const isWelcomeView = variant === 'default' && !chatbot.name.includes('Bot')
- return (
-
-
-
- {/* biome-ignore lint/a11y/noSvgWithoutTitle: */}
-
-
-
- Back to browse
-
+ const descriptionPoints =
+ chatbot.description?.split(';').map(point => point.trim()) || []
+ const hasMultiplePoints = descriptionPoints.length > 1
-
-
-
-
-
- {chatbot?.categories[0].category.name}.
-
-
-
- {chatbot?.description ?
{chatbot?.description}
: ''}
-
-
- Threads:
-
- {chatbot?.threads.length ?? 1}
-
-
-
+ const generateBio = async () => {
+ try {
+ setIsLoading(true)
+ setGenerateType('bio')
+ const promptContent = UserPersonalityPrompt('bio', [])
+ return append({
+ id: nanoid(),
+ content: promptContent,
+ role: 'system',
+ createdAt: new Date()
+ })
+ } catch (error) {
+ setIsLoading(false)
+ customSonner({ type: 'error', text: 'Failed to generate content' })
+ console.error('Bio generation failed:', error)
+ }
+ }
-
- Chat with {chatbot?.name} >
-
-
+ const sharedProps = {
+ chatbot,
+ variant,
+ isLoading,
+ generateType,
+ lastMessage,
+ onGenerateBio: generateBio,
+ isWelcomeView,
+ descriptionPoints,
+ hasMultiplePoints,
+ botUrl
+ }
-
-
-
-
-
-
+ return (
+ <>
+
+
+ >
)
-}
\ No newline at end of file
+}
diff --git a/apps/masterbots.ai/components/routes/browse/browse-chatbot-mobile-details.tsx b/apps/masterbots.ai/components/routes/browse/browse-chatbot-mobile-details.tsx
new file mode 100644
index 00000000..0cbee6fb
--- /dev/null
+++ b/apps/masterbots.ai/components/routes/browse/browse-chatbot-mobile-details.tsx
@@ -0,0 +1,152 @@
+'use client'
+
+import { Button } from '@/components/ui/button'
+import { Card, CardContent, CardFooter, CardHeader } from '@/components/ui/card'
+import { cn, numberShortener } from '@/lib/utils'
+import type { BrowseChatbotLayoutProps } from '@/types/types'
+import {
+ Bot,
+ MessageSquareIcon,
+ ChevronLeft,
+ MessageSquarePlusIcon,
+ Users
+} from 'lucide-react'
+import Image from 'next/image'
+import Link from 'next/link'
+
+export function BrowseChatbotMobileDetails({
+ chatbot,
+ isLoading,
+ generateType,
+ onGenerateBio,
+ isWelcomeView,
+ botUrl
+}: BrowseChatbotLayoutProps) {
+ return (
+
+
+
+
+
+
+ Back to browse
+
+
+
+
+
+
+
+ {chatbot.name}
+
+
+
+
+ Threads: {chatbot.threads.length}
+
+
+
+
+ bio:
+
+
+
+
+
+
+
+
+
+
+
+
+ {chatbot.description}
+
+
+
+
+
+
+
+
+ New Chat
+
+
+
+
+
+
+
+ Following
+
+
+
+
+ {numberShortener(313)}
+
+
+
+
+
+ Followers
+
+
+
+
+
+ {numberShortener(3200)}
+
+
+
+ Follow
+
+
+
+
+
+
+
+
+
+
+ )
+}
diff --git a/apps/masterbots.ai/components/routes/browse/browse-list.tsx b/apps/masterbots.ai/components/routes/browse/browse-list.tsx
index b37c78c8..ba2ff206 100644
--- a/apps/masterbots.ai/components/routes/browse/browse-list.tsx
+++ b/apps/masterbots.ai/components/routes/browse/browse-list.tsx
@@ -30,6 +30,7 @@ import { searchThreadContent } from '@/lib/search'
import { getBrowseThreads } from '@/services/hasura'
import { debounce } from 'lodash'
import type { Thread } from 'mb-genql'
+import { useSession } from 'next-auth/react'
import React from 'react'
const PAGE_SIZE = 50
@@ -42,6 +43,8 @@ export default function BrowseList() {
const [loading, setLoading] = React.useState(false)
const [count, setCount] = React.useState(0)
const { selectedCategories, selectedChatbots, activeCategory, activeChatbot } = useSidebar()
+ const { data: session } = useSession()
+ const userId = session?.user?.id
const fetchThreads = async ({
categoriesId,
@@ -59,11 +62,13 @@ export default function BrowseList() {
? {
categoryId: activeCategory,
chatbotName: activeChatbot?.name,
+ ...(userId ? { followedUserId: userId } : {})
}
: {
categoriesId,
chatbotsId,
keyword,
+ ...(userId ? { followedUserId: userId } : {})
}),
limit: PAGE_SIZE,
})
@@ -115,7 +120,7 @@ export default function BrowseList() {
categoriesId: selectedCategories,
chatbotsId: selectedChatbots
})
- }, [selectedCategories, selectedChatbots, activeCategory, activeChatbot])
+ }, [selectedCategories, selectedChatbots, activeCategory, activeChatbot, session])
// biome-ignore lint/correctness/useExhaustiveDependencies:
@@ -135,7 +140,7 @@ export default function BrowseList() {
{filteredThreads.map((thread: Thread, key) => (
(false)
+ const [followers, setFollowers] = useState(activeChatbot?.followers || []);
+
const [threadNum, setThreadNum] = useState(0)
const [categoryName, setCategoryName] = useState('')
- const { slug } = useParams()
-
-
- if (status === "loading") return
+ const [isLoading, setIsLoading] = useState(true)
+ const router = useRouter();
+ const {customSonner} = useSonner()
+
+ const handleFollow = async () => {
+ try {
+ if (!session) {
+ customSonner({type: 'error', text: 'Please sign in to follow user'})
+ router.push('/auth/signin')
+ return
+ }
+ setIsFollowLoading(true)
+ const followerId = session.user?.id
+ const followeeId = activeChatbot?.chatbotId
+ if (!followerId) {
+ customSonner({type: 'error', text: 'Invalid user data'})
+ return;
+ }
+
+ if (!followeeId) {
+ customSonner({type: 'error', text: 'Invalid chatbot data, please select a chatbot'})
+ return;
+ }
+ const {success, error, follow} = await chatbotFollowOrUnfollow({followerId, followeeId, jwt: session.user.hasuraJwt as string})
+ if(!success){
+ console.error('Failed to follow/Unfolow bot:', error)
+ customSonner({type: 'error', text: error || 'Failed to follow/unfollow bot'})
+ return
+ }
+ if(follow){
+ setFollowers([
+ ...followers,
+ {
+ followerId: followerId,
+ followeeId: null,
+ followeeIdChatbot: followeeId,
+ chatbot: null,
+ createdAt: new Date().toISOString(),
+ userByFollowerId: null as unknown,
+ user: null,
+ __typename: 'SocialFollowing'
+ } as SocialFollowing
+ ]);
+ }else{
+ setFollowers(followers.filter(follower => !(follower.followerId === followerId && follower.followeeIdChatbot === followeeId)))
+ }
+
+ customSonner({type: 'success', text: follow ? `You have followed ${activeChatbot?.name} successfully` : `You have unfollowed ${activeChatbot?.name}`})
+ } catch (error) {
+ setIsFollowLoading(false)
+ customSonner({type: 'error', text: 'Failed to follow user'})
+ console.error('Failed to follow user:', error)
+ } finally {
+ setIsFollowLoading(false)
+ }
+ }
const getThreadNum = async () => {
if (!session?.user) return
- const threads = await getThreads({
- jwt: session?.user?.hasuraJwt as string,
- categoryId: activeCategory,
- userId: session?.user.id as string
- })
- setThreadNum(threads?.length ?? 0)
+ try {
+ const threads = await getThreads({
+ jwt: session?.user?.hasuraJwt as string,
+ categoryId: activeCategory,
+ userId: session?.user.id as string
+ })
+ setThreadNum(threads?.length ?? 0)
+ } catch (error) {
+ console.error('Error fetching threads:', error)
+ }
}
const getCategoryName = async () => {
- const category = await getCategory({ categoryId: activeCategory as number })
- setCategoryName(category.name)
+ try {
+ const category = await getCategory({
+ categoryId: activeCategory as number
+ })
+ setCategoryName(category.name)
+ } catch (error) {
+ console.error('Error fetching category:', error)
+ }
}
-
// eslint-disable-next-line react-hooks/rules-of-hooks
+
+ // biome-ignore lint/correctness/useExhaustiveDependencies:
useEffect(() => {
- if (!activeCategory) {
- getThreadNum()
- } else {
- getCategoryName()
+ const fetchData = async () => {
+ setIsLoading(true)
+ try {
+ if (!activeCategory) {
+ await getThreadNum()
+ } else {
+ await getCategoryName()
+ }
+ } finally {
+ setIsLoading(false)
+ }
}
- }, [activeCategory, activeChatbot, session?.user])
-
- const botName = activeChatbot?.name || 'BuildBot'
-
- return (
-
-
- {/* Card Header */}
-
-
- Welcome to Masterbots!
-
-
- {/* Separator Line - Extended to edges */}
-
- {/* Floating Avatar - Responsive sizing */}
-
-
+ fetchData()
+ }, [activeCategory, activeChatbot])
- {/* Description with right margin to avoid avatar overlap */}
-
-
- Here you can create new threads and share them to your network!
- Navigate with the sidebar and pick any bot of your interest.
-
-
+ if (isLoading || !session?.user) return
- {/* Card Content */}
-
-
-
- Your Journey Begins Here!
-
-
- Try and start with: {botName}
-
-
-
-
-
-
-
-
- Threads:{' '}
-
- {activeChatbot
- ? (activeChatbot?.threads?.length ?? 0)
- : threadNum}
-
-
-
+ const botName = activeChatbot?.name || 'BuildBot'
+ const isWelcomeView = !activeChatbot?.name
-
-
-
-
- Followers:{' '}
-
- 3.2k
-
-
-
+ // Event handlers
+ const handleNewChat = () => {
+ // new chat logic
+ console.log('Starting new chat with:', botName)
+ }
-
- Follow
-
-
-
+
+ const sharedProps = {
+ botName,
+ avatar: activeChatbot?.avatar || randomChatbot?.avatar || '',
+ description: activeChatbot?.description,
+ threadCount: activeChatbot
+ ? (activeChatbot?.threads?.length ?? 0)
+ : threadNum,
+ followersCount: followers.length || 0, // This nees to be changed once following feat is ready
+ isWelcomeView,
+ categoryName,
+ onNewChat: handleNewChat,
+ onFollow: handleFollow,
+ followers
+ }
-
-
- New Chat With {botName}
-
-
-
-
-
+
+ return (
+ <>
+
+ {isWelcomeView ? (
+
+ ) : (
+
+ )}{' '}
+ >
)
}
diff --git a/apps/masterbots.ai/components/routes/chat/chat-clickable-text.tsx b/apps/masterbots.ai/components/routes/chat/chat-clickable-text.tsx
index 99d1d0f4..43cc9523 100644
--- a/apps/masterbots.ai/components/routes/chat/chat-clickable-text.tsx
+++ b/apps/masterbots.ai/components/routes/chat/chat-clickable-text.tsx
@@ -1,51 +1,137 @@
import {
cleanClickableText,
- extractTextFromReactNode,
- parseClickableText
-} from '@/lib/utils'
-
-interface ClickableTextProps {
- children: React.ReactNode
- isListItem: boolean
- sendMessageFromResponse?: (message: string) => void
-}
+ extractTextFromReactNodeNormal,
+ extractTextFromReactNodeWeb,
+ parseClickableText,
+ transformLink,
+} from '@/lib/clickable-results'
+import { useThread } from '@/lib/hooks/use-thread'
+import { cn } from '@/lib/utils'
+import type { ClickableTextProps } from '@/types/types'
+import React from 'react'
-/**
- * ClickableText component
- * Renders phrases as clickable links, triggering a message when clicked.
- */
export function ClickableText({
children,
isListItem,
- sendMessageFromResponse
+ sendMessageFromResponse,
+ webSearchResults = [],
+ onReferenceFound,
}: ClickableTextProps) {
- const fullText = extractTextFromReactNode(children)
- const { clickableText, restText } = parseClickableText(fullText)
+ const { webSearch } = useThread()
+
+ const extractedContent = webSearch
+ ? extractTextFromReactNodeWeb(children)
+ : extractTextFromReactNodeNormal(children)
- const handleClick = () => {
- if (sendMessageFromResponse && clickableText.trim()) {
- const cleanedText = cleanClickableText(clickableText)
+ const createClickHandler = (text: string) => () => {
+ if (sendMessageFromResponse && text.trim()) {
+ const cleanedText = cleanClickableText(text)
sendMessageFromResponse(`Tell me more about ${cleanedText}`)
}
}
- if (!clickableText.trim()) {
- return <>{fullText}>
+ const processLink = (linkElement: React.ReactElement) => {
+ const href = linkElement.props.href
+ // Buscar la referencia correspondiente
+ const reference = webSearchResults.find((result) => result.url === href)
+
+ if (reference && onReferenceFound) {
+ onReferenceFound(reference)
+ return null // Remover el link inline
+ }
+
+ return linkElement // Mantener links que no son de búsqueda web
}
- return (
+ const renderClickableContent = (clickableText: string, restText: string) => (
<>
- {/* biome-ignore lint/a11y/useKeyWithClickEvents: Click handler is supplementary */}
-
- role="button"
- tabIndex={0}
+
{clickableText}
-
+
{restText}
>
)
-}
\ No newline at end of file
+
+ if (Array.isArray(extractedContent)) {
+ return extractedContent.map((content, index) => {
+ if (React.isValidElement(content)) {
+ if (content.type === 'a' && webSearch) {
+ return processLink(content)
+ }
+ // Manejo de elementos strong
+ if (content.type === 'strong') {
+ const strongContent = extractTextFromReactNodeNormal(
+ (content.props as { children: React.ReactNode }).children,
+ )
+ const { clickableText, restText } = parseClickableText(strongContent + ':')
+
+ if (clickableText.trim()) {
+ return (
+
+ {strongContent}
+
+ )
+ }
+ return content
+ }
+
+ // Manejo de links cuando webSearch está activo
+ if (content.type === 'a' && webSearch) {
+ const parentContext = extractedContent
+ .filter(
+ (item) =>
+ typeof item === 'string' || (React.isValidElement(item) && item.type === 'strong'),
+ )
+ .map((item) =>
+ typeof item === 'string'
+ ? item
+ : extractTextFromReactNodeNormal(
+ (item.props as { children: React.ReactNode }).children,
+ ),
+ )
+ .join(' ')
+ return transformLink(content, parentContext)
+ }
+
+ return content
+ }
+
+ const { clickableText, restText } = parseClickableText(String(content))
+
+ if (!clickableText.trim()) {
+ return content
+ }
+
+ return (
+
+ {renderClickableContent(clickableText, restText)}
+
+ )
+ })
+ }
+
+ if (React.isValidElement(extractedContent)) {
+ return extractedContent
+ }
+
+ const { clickableText, restText } = parseClickableText(String(extractedContent))
+
+ if (!clickableText.trim()) {
+ return <>{extractedContent}>
+ }
+
+ return renderClickableContent(clickableText, restText)
+}
diff --git a/apps/masterbots.ai/components/routes/chat/chat-combobox.tsx b/apps/masterbots.ai/components/routes/chat/chat-combobox.tsx
index f42d0b2e..112ef3b7 100644
--- a/apps/masterbots.ai/components/routes/chat/chat-combobox.tsx
+++ b/apps/masterbots.ai/components/routes/chat/chat-combobox.tsx
@@ -31,7 +31,7 @@ import { usePowerUp } from '@/lib/hooks/use-power-up'
//* Model options available in the combobox, each with label, value, and logo icon.
const models = [
- { label: 'GPT-4o', value: AIModels.Default, logo: "MB" },
+ { label: 'GPT-4o', value: AIModels.Default, logo: 'MB' },
{ label: 'GPT-4', value: AIModels.GPT4, logo: },
{ label: 'Claude3', value: AIModels.Claude3, logo: },
{ label: 'llama3_8', value: AIModels.llama3_8b, logo: },
@@ -45,6 +45,7 @@ export function ChatCombobox() {
const [open, setOpen] = React.useState(false)
const [value, setValue] = React.useState(selectedModel as string)
const { isPowerUp } = usePowerUp()
+ const isDevEnv = process.env.NEXT_PUBLIC_APP_ENV !== 'prod'
return (
@@ -54,8 +55,11 @@ export function ChatCombobox() {
role="combobox"
aria-expanded={open}
className={cn(
- buttonVariants({ size: 'sm', variant: isPowerUp ? 'powerUp' : 'outline' }),
- 'absolute left-0 top-4 size-8 rounded-full p-0 sm:left-4'
+ buttonVariants({
+ size: 'sm',
+ variant: isPowerUp ? 'powerUp' : 'outline'
+ }),
+ 'absolute left-0 top-5 size-8 rounded-full p-0 sm:left-4'
)}
>
{/* Renders the selected model's logo or default icon */}
@@ -74,32 +78,52 @@ export function ChatCombobox() {
No model found.
- {/* Iterates over models to create selectable items */}
- {models.map(model => (
- {
+ {/* Render models only in dev or local environments, otherwise show default */}
+ {isDevEnv ? (
+ models.map(model => (
+ {
process.env.NEXT_PUBLIC_APP_ENV !== 'prod'
- ? (setValue(currentValue === value ? '' : currentValue), changeModel(currentValue as AIModels))
- : ''
- setOpen(false) // Closes the popover after selection.
+ ? (setValue(currentValue === value ? '' : currentValue),
+ changeModel(currentValue as AIModels))
+ : ''
+ setOpen(false) // Closes the popover after selection.
+ }}
+ >
+ {model.label}
+
+
+ ))
+ ) : (
+ {
+ setValue(AIModels.Default)
+ changeModel(AIModels.Default)
+ setOpen(false)
}}
>
- {model.label}
- {/* Visual checkmark icon for the selected model */}
+ Masterbot's Model
- ))}
+ )}
)
-}
\ No newline at end of file
+}
diff --git a/apps/masterbots.ai/components/routes/chat/chat-message.tsx b/apps/masterbots.ai/components/routes/chat/chat-message.tsx
index 7c0541d7..063efcba 100644
--- a/apps/masterbots.ai/components/routes/chat/chat-message.tsx
+++ b/apps/masterbots.ai/components/routes/chat/chat-message.tsx
@@ -1,35 +1,59 @@
-// Inspired by Chatbot-UI and modified to fit the needs of this project
-// @see https://github.com/mckaywrigley/chatbot-ui/blob/main/components/Chat/ChatcleanMessage.tsx
-
import { ChatMessageActions } from '@/components/routes/chat/chat-message-actions'
import { MemoizedReactMarkdown } from '@/components/shared/markdown'
import { CodeBlock } from '@/components/ui/codeblock'
import { cleanPrompt } from '@/lib/helpers/ai-helpers'
import { cn } from '@/lib/utils'
-import type { Message } from 'ai'
-import type { Chatbot } from 'mb-genql'
-import { ClickableText } from './chat-clickable-text'
-
+import type { ChatMessageProps, WebSearchResult } from '@/types/types'
+import { useState } from 'react'
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'
-
-//* Define the props interface for the ChatMessage component
-export interface ChatMessageProps {
- message: Message // The chat message to display
- sendMessageFromResponse?: (message: string) => void // Callback to send a new message
- chatbot?: Chatbot // Chatbot configuration
- actionRequired?: boolean // Whether to show message actions
-}
+import { ClickableText } from './chat-clickable-text'
export function ChatMessage({
message,
sendMessageFromResponse,
chatbot,
actionRequired = true,
+ webSearchResults = [],
...props
}: ChatMessageProps) {
- //* Clean the message content using the cleanPrompt utility
const cleanMessage = { ...message, content: cleanPrompt(message.content) }
+ const [references, setReferences] = useState([])
+
+ const ReferencesSection = () => {
+ if (references.length === 0) return null
+
+ return (
+
+
References
+
+ {references.map((ref, index) => (
+
+ {ref.thumbnail?.src && (
+ // eslint-disable-next-line @next/next/no-img-element
+
+ )}
+
+
+ ))}
+
+
+ )
+ }
return (
@@ -38,7 +62,7 @@ export function ChatMessage({
className="min-w-full prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0"
remarkPlugins={[remarkGfm, remarkMath]}
components={{
- p({ node, children }) {
+ p({ children }) {
return (
{cleanMessage.role === 'user' ? (
@@ -47,6 +71,10 @@ export function ChatMessage({
+ setReferences(prev => [...prev, ref])
+ }
>
{children}
@@ -54,57 +82,61 @@ export function ChatMessage({
)
},
- //* Custom list item component with clickable text
- li({ node, children }) {
+ li({ children }) {
return (
-
-
+
+
{children}
)
},
- ol({ children }) {
- return {children}
- },
ul({ children }) {
- return
+ return
+ },
+ ol({ children }) {
+ return (
+
+ {children}
+
+ )
},
- a({ node, children, ...props }) {
+ a({ href, children, ...props }) {
return (
{children}
)
},
- code({ node, inline, className, children, ...props }) {
- //* Handle cursor animation for streaming responses
+ code({ inline, className, children, ...props }) {
if (children.length) {
- if (children[0] == '▍')
+ if (children[0] == '▍') {
return (
▍
)
-
- children[0] = (children[0] as string).replace('`▍`', '▍')
+ }
+ children[0] = (children[0] as string).replace('▍', '▍')
}
- //* Extract language from className for syntax highlighting
const match = /language-(\w+)/.exec(className || '')
- //* Handle inline code differently from code blocks
- if (inline)
+ if (inline) {
return (
{children}
)
+ }
- //* Render full code block with syntax highlighting
return (
{cleanMessage.content}
- {actionRequired ? : ''}
-
-
+ {
+ actionRequired ? (
+
+ ) : null
+ }
+
+
+
)
}
diff --git a/apps/masterbots.ai/components/routes/chat/chat-onboarding-chatbot-mobile.tsx b/apps/masterbots.ai/components/routes/chat/chat-onboarding-chatbot-mobile.tsx
new file mode 100644
index 00000000..7db24577
--- /dev/null
+++ b/apps/masterbots.ai/components/routes/chat/chat-onboarding-chatbot-mobile.tsx
@@ -0,0 +1,36 @@
+import { Card, CardHeader } from '@/components/ui/card'
+import { PanelLeft } from 'lucide-react'
+
+export function OnboardingMobileView() {
+ return (
+
+
+
+
+
+
+ Welcome to Masterbots!
+
+
+
+
+
+
+ Here you can create new threads and share them to your network!
+ Navigate with the sidebar and pick any bot of your interest.
+
+
+
+
+
+
+ Go To Sidebar And Select One Bot
+
+
+
+
+
+
+
+ )
+}
diff --git a/apps/masterbots.ai/components/routes/chat/chat-options.tsx b/apps/masterbots.ai/components/routes/chat/chat-options.tsx
index 06c9f68a..4c8cd12e 100644
--- a/apps/masterbots.ai/components/routes/chat/chat-options.tsx
+++ b/apps/masterbots.ai/components/routes/chat/chat-options.tsx
@@ -1,4 +1,3 @@
-import { FontSizeSelector } from '@/components/shared/font-size-selector'
import {
AlertDialog,
AlertDialogAction,
@@ -19,13 +18,13 @@ import {
} from '@/components/ui/dropdown-menu'
import { IconSpinner } from '@/components/ui/icons'
import { useThreadVisibility } from '@/lib/hooks/use-thread-visibility'
-import { BadgeCheck, Eye, EyeOff, MoreVertical, Trash } from 'lucide-react'
+import { Eye, EyeOff, MoreVertical, Trash } from 'lucide-react'
import type { Thread } from 'mb-genql'
import { toSlug } from 'mb-lib'
import type React from 'react'
import { useState } from 'react'
-import toast from 'react-hot-toast'
import { ShareButton } from './share-button'
+import { useSonner } from '@/lib/hooks/useSonner'
interface ChatOptionsProps {
threadId: string
@@ -43,6 +42,7 @@ export function ChatOptions({ threadId, thread, isBrowse }: ChatOptionsProps) {
const url = `/${toSlug(thread.chatbot.categories[0].category.name)}/${thread.threadId}`
const [isDeleteOpen, setIsDeleteOpen] = useState(false)
const [isDeleting, setIsDeleting] = useState(false)
+ const { customSonner } = useSonner()
const handleDelete = async (
e: React.MouseEvent
@@ -51,9 +51,9 @@ export function ChatOptions({ threadId, thread, isBrowse }: ChatOptionsProps) {
setIsDeleting(true)
const result = await initiateDeleteThread(threadId)
if (result?.success) {
- toast.success(result.message)
+ customSonner({ type: 'success', text: result.message })
} else {
- toast.error(result?.message)
+ customSonner({ type: 'error', text: result?.error })
}
setIsDeleting(false)
setIsDeleteOpen(false)
@@ -100,13 +100,6 @@ export function ChatOptions({ threadId, thread, isBrowse }: ChatOptionsProps) {
{!isBrowse && (
-
- {thread?.isApproved ? (
-
- ) : (
-
- )}
-
{thread?.isPublic ? 'Public' : 'Private'}
@@ -130,13 +123,6 @@ export function ChatOptions({ threadId, thread, isBrowse }: ChatOptionsProps) {
align="end"
className="w-[160px] sm:w-[180px] px-0"
>
- {/* Font Size Selector */}
- event.preventDefault()}
- >
-
-
{/* Toggle thread visibility option (only for thread owner) */}
{isUser && (
diff --git a/apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx b/apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx
new file mode 100644
index 00000000..da28a282
--- /dev/null
+++ b/apps/masterbots.ai/components/routes/chat/chat-selected-chatbot-mobile.tsx
@@ -0,0 +1,78 @@
+import { Card, CardFooter, CardHeader } from '@/components/ui/card'
+import { cn } from '@/lib/utils'
+import { Bot, ArrowBigDown } from 'lucide-react'
+import Image from 'next/image'
+
+interface SelectedBotMobileViewProps {
+ botName: string
+ description: string
+ avatar: string
+ onNewChat: () => void
+}
+
+export function SelectedBotMobileView({
+ botName,
+ description,
+ avatar,
+ onNewChat
+}: SelectedBotMobileViewProps) {
+ return (
+
+
+
+
+
+
+ {botName}
+
+
+
+
+
+ bio:
+
+
+
+ {/* Avatar container positioned absolutely */}
+
+
+ {/* Separator line */}
+
+
+
+
+
+
+
+
+
+
+ Start Chatting Below
+
+
+
+
+ )
+}
+
+export default SelectedBotMobileView
diff --git a/apps/masterbots.ai/components/routes/chat/chat-share-dialog.tsx b/apps/masterbots.ai/components/routes/chat/chat-share-dialog.tsx
index a33cb7a4..6d039d78 100644
--- a/apps/masterbots.ai/components/routes/chat/chat-share-dialog.tsx
+++ b/apps/masterbots.ai/components/routes/chat/chat-share-dialog.tsx
@@ -4,7 +4,6 @@
import * as React from 'react'
import type { DialogProps } from '@radix-ui/react-dialog'
-import { toast } from 'react-hot-toast'
import type { Chat } from '@/types/types'
import { Button } from '@/components/ui/button'
import {
@@ -17,11 +16,12 @@ import {
} from '@/components/ui/dialog'
import { IconSpinner } from '@/components/ui/icons'
import { useCopyToClipboard } from '@/lib/hooks/use-copy-to-clipboard'
+import { useSonner } from '@/lib/hooks/useSonner'
interface ChatShareDialogProps extends DialogProps {
- chat: Pick // Chat details including ID, title, and messages for sharing
+ chat: Pick // Chat details including ID, title, and messages for sharing
// shareChat: (id: string) => ServerActionResult
- onCopy: () => void // Callback for after the link is copied
+ onCopy: () => void // Callback for after the link is copied
}
export function ChatShareDialog({
@@ -31,29 +31,22 @@ export function ChatShareDialog({
}: ChatShareDialogProps) {
const { copyToClipboard } = useCopyToClipboard({ timeout: 1000 })
const [isSharePending, startShareTransition] = React.useTransition()
+ const { customSonner } = useSonner()
const copyShareLink = React.useCallback(
async (chat: Chat) => {
if (!chat.sharePath) {
- return toast.error('Could not copy share link to clipboard')
+ return customSonner({
+ type: 'error',
+ text: 'Could not copy share link to clipboard'
+ })
}
const url = new URL(window.location.href)
url.pathname = chat.sharePath
copyToClipboard(url.toString())
onCopy()
- toast.success('Share link copied to clipboard', {
- style: {
- borderRadius: '10px',
- background: '#333',
- color: '#fff',
- fontSize: '14px'
- },
- iconTheme: {
- primary: 'white',
- secondary: 'black'
- }
- })
+ customSonner({ type: 'success', text: 'Share link copied to clipboard' })
},
[copyToClipboard, onCopy]
)
@@ -69,17 +62,14 @@ export function ChatShareDialog({
{chat.title}
-
- {chat.messages.length}
-
+
{chat.messages.length}
{
// @ts-ignore
- startShareTransition(async () => {
- })
+ startShareTransition(async () => {})
}}
>
{isSharePending ? (
@@ -95,4 +85,4 @@ export function ChatShareDialog({
)
-}
\ No newline at end of file
+}
diff --git a/apps/masterbots.ai/components/routes/chat/new-chat.tsx b/apps/masterbots.ai/components/routes/chat/new-chat.tsx
index 12c744bc..7ff55bdc 100644
--- a/apps/masterbots.ai/components/routes/chat/new-chat.tsx
+++ b/apps/masterbots.ai/components/routes/chat/new-chat.tsx
@@ -26,13 +26,13 @@
import { ChatPanel } from '@/components/routes/chat/chat-panel'
import { useChat, type Message, type CreateMessage } from 'ai/react'
-import toast from 'react-hot-toast'
import type { ChatRequestOptions } from 'ai'
import type { Chatbot } from 'mb-genql'
import { useRouter } from 'next/navigation'
import { createThread, saveNewMessage } from '@/services/hasura'
import { useSession } from 'next-auth/react'
import { useModel } from '@/lib/hooks/use-model'
+import { useSonner } from '@/lib/hooks/useSonner'
export default function NewChat({
id,
@@ -53,13 +53,14 @@ export default function NewChat({
},
onResponse(response) {
if (response.status === 401) {
- toast.error(response.statusText)
+ customSonner({ type: 'error', text: response.statusText })
}
},
onFinish() {
console.log('NEW CHAT FINISHED FIRST, NOT GOOD')
}
})
+ const { customSonner } = useSonner()
const appendToNewChat = async (
userMessage: Message | CreateMessage,
diff --git a/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx
new file mode 100644
index 00000000..1fc72908
--- /dev/null
+++ b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-details.tsx
@@ -0,0 +1,136 @@
+import { Card, CardContent, CardFooter, CardHeader } from '@/components/ui/card'
+import { ArrowBigLeft, ArrowBigDown, Bot, BotMessageSquareIcon, Users } from 'lucide-react'
+import { cn, numberShortener, isFollowed } from '@/lib/utils'
+import type { ChatbotDetailsProps } from '@/types/types'
+import Image from 'next/image'
+import { useSession } from 'next-auth/react'
+import { Button } from '@/components/ui/button'
+
+export function OnboardingChatbotDetails({
+ botName,
+ avatar = '',
+ description,
+ isWelcomeView = true,
+ onNewChat,
+ onFollow,
+ followers,
+ threadCount
+}: ChatbotDetailsProps) {
+
+ const { data: session } = useSession()
+ const followed = isFollowed({followers, userId: session?.user?.id || ''})
+
+ return (
+ //
+ //
+
+
+
+
+ {isWelcomeView ? 'Welcome to Masterbots!' : botName}
+
+ {!isWelcomeView && (
+
+
+ bio:
+
+ )}
+
+
+
+
+
+ {isWelcomeView
+ ? 'Here you can create new threads and share them to your network! Navigate with the sidebar and pick any bot of your interest.'
+ : description}
+
+
+ {isWelcomeView && (
+
+
+
+ Go To Sidebar And Select One Bot
+
+
+ )}
+
+
+ {!isWelcomeView && (
+
+
+
+
+
+ Start Chatting Below
+
+
+
+
+ )}
+
+
+
+
+
+
+ Threads: {numberShortener(threadCount || 0)}
+
+
+
+
+
+ Followers:{' '}
+ {numberShortener(followers?.length || 0)}
+
+
+
+ {followed ? 'Following' : 'Follow'}
+
+
+
+
+
+ {' '}
+
+ New Chat With {botName}
+
+
+
+
+
+
+ )
+}
diff --git a/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-mobile-details.tsx b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-mobile-details.tsx
new file mode 100644
index 00000000..c6787397
--- /dev/null
+++ b/apps/masterbots.ai/components/routes/chat/onboarding-chatbot-mobile-details.tsx
@@ -0,0 +1,154 @@
+import { Button } from '@/components/ui/button'
+import { Card, CardContent, CardFooter, CardHeader } from '@/components/ui/card'
+import { cn, numberShortener, isFollowed } from '@/lib/utils'
+import type { ChatbotDetailsProps } from '@/types/types'
+import { Bot, BotMessageSquareIcon, Users } from 'lucide-react'
+import Image from 'next/image'
+import { useSession } from 'next-auth/react'
+
+export function OnboardingMobileChatbotDetails({
+ botName = 'BuildBot',
+ avatar = '',
+ description,
+ threadCount = 0,
+ followersCount = 3200,
+ isWelcomeView = true,
+ categoryName,
+ onNewChat,
+ onFollow,
+ followers
+}: ChatbotDetailsProps) {
+
+ const { data: session } = useSession()
+ const followed = isFollowed({followers, userId: session?.user?.id || ''})
+
+ return (
+
+
+
+
+ {isWelcomeView ? (
+ //* Onboarding View Layout
+ <>
+
+
+
+ Welcome to Masterbots!
+
+
+ Here you can create new threads and share them to your
+ network! Navigate with the sidebar and pick any bot of your
+ interest.
+
+
+
+
+
+
+
+
+ Your Journey
+
+ Begins Here!
+
+
+ Try and start with:
+ {botName}
+
+
+
+
+
+
+
+ >
+ ) : (
+ //* Selected Bot View Layout
+ <>
+
+ {botName}
+
+
+
+
+ {description}
+
+
+
+
+
+
+ >
+ )}
+
+
+
+
+
+
+
+ Threads: {numberShortener(threadCount)}
+
+
+
+
+
+
+
+ Followers: {numberShortener(followersCount)}
+
+
+
+ {followed ? 'Following' : 'Follow'}
+
+
+
+
+
+
+
+ New Chat With {botName}
+
+
+
+
+ )
+}
diff --git a/apps/masterbots.ai/components/routes/chat/prompt-form.tsx b/apps/masterbots.ai/components/routes/chat/prompt-form.tsx
index 664be586..379a8a11 100644
--- a/apps/masterbots.ai/components/routes/chat/prompt-form.tsx
+++ b/apps/masterbots.ai/components/routes/chat/prompt-form.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable tailwindcss/migration-from-tailwind-2 */
/**
* PromptForm Component
*
@@ -56,10 +57,20 @@ export function PromptForm({
disabled
}: PromptProps) {
const { isOpenPopup, activeThread } = useThread()
- const { activeChatbot } = useSidebar()
+ const { activeChatbot, setActiveChatbot } = useSidebar()
const { formRef, onKeyDown } = useEnterSubmit()
const inputRef = React.useRef
(null)
const [isFocused, setIsFocused] = React.useState(false)
+
+ const handleBotSelection = () => {
+ if (activeThread?.chatbot) {
+ setActiveChatbot(activeThread.chatbot)
+ // Focus textarea after bot selection
+ if (inputRef.current) {
+ inputRef.current.focus()
+ }
+ }
+ }
React.useEffect(() => {
if (inputRef.current) {
inputRef.current.focus()
@@ -89,8 +100,8 @@ export function PromptForm({
>
@@ -104,13 +115,14 @@ export function PromptForm({
onBlur={handleTextareaBlur}
value={input}
onChange={e => setInput(e.target.value)}
+ onClick={handleBotSelection}
placeholder={placeholder}
spellCheck={false}
disabled={disabled}
className={cn(
- "w-full resize-none bg-transparent px-4 focus-within:outline-none sm:text-sm",
- "min-h-[80px] md:min-h-[60px]", //? Smaller height on mobile
- "py-2 md:py-[1.3rem]" //? Adjusted padding for mobile
+ 'w-full resize-none bg-transparent px-4 py-1 my-1 focus-within:outline-none sm:text-sm',
+ 'min-h-[80px] md:min-h-[60px]', //? Smaller height on mobile
+ 'md:py-[1.3rem]' //? Adjusted padding for mobile
)}
/>
@@ -130,8 +142,21 @@ export function PromptForm({
{!activeChatbot || (isOpenPopup && !activeThread?.chatbot) ? (
-
- Select a bot to start a thread.
+ // biome-ignore lint/a11y/useKeyWithClickEvents:
+
+ Select{' '}
+
+ {activeThread?.chatbot?.name}
+ {' '}
+ to continue
) : null}
diff --git a/apps/masterbots.ai/components/routes/profile/user-card.tsx b/apps/masterbots.ai/components/routes/profile/user-card.tsx
index 20b2702e..33842baa 100644
--- a/apps/masterbots.ai/components/routes/profile/user-card.tsx
+++ b/apps/masterbots.ai/components/routes/profile/user-card.tsx
@@ -1,17 +1,30 @@
-import { Button } from '@/components/ui/button'
import { Separator } from '@/components/ui/separator'
-import { UserPersonalityPrompt } from '@/lib/constants/prompts'
-import { useUploadImagesCloudinary } from '@/lib/hooks/use-cloudinary-upload'
-import { useModel } from '@/lib/hooks/use-model'
+import Image from 'next/image'
+import {
+ BookUser,
+ BotIcon,
+ MessageSquareHeart,
+ Wand2,
+ ImagePlus,
+ Loader,
+ UserIcon,
+ Users
+} from 'lucide-react'
+import { Button } from '@/components/ui/button'
+import type { User } from 'mb-genql'
import { useProfile } from '@/lib/hooks/use-profile'
+import { type Message, useChat } from 'ai/react'
import { nanoid, removeSurroundingQuotes } from '@/lib/utils'
-import { type Message, useChat } from "ai/react"
-import { BookUser, BotIcon, ImagePlus, Loader, MessageSquareHeart, Wand2 } from 'lucide-react'
-import { User } from 'mb-genql'
-import Image from 'next/image'
+import { useModel } from '@/lib/hooks/use-model'
+import { UserPersonalityPrompt } from '@/lib/constants/prompts'
import { ChangeEvent, useCallback, useEffect, useState } from 'react'
-import toast from 'react-hot-toast'
-
+import { useUploadImagesCloudinary } from '@/lib/hooks/use-cloudinary-upload'
+import { formatNumber, isFollowed } from '@/lib/utils'
+import { useSession } from 'next-auth/react'
+import { userFollowOrUnfollow } from '@/services/hasura/hasura.service'
+import type { SocialFollowing } from 'mb-genql'
+import router from 'next/router'
+import { useSonner } from '@/lib/hooks/useSonner'
interface UserCardProps {
user: User | null
@@ -19,29 +32,39 @@ interface UserCardProps {
}
export function UserCard({ user, loading }: UserCardProps) {
const { isSameUser, updateUserInfo } = useProfile()
- const isOwner = isSameUser(user?.userId);
+ const isOwner = isSameUser(user?.userId)
const { selectedModel, clientType } = useModel()
const [isLoading, setIsLoading] = useState(false)
- const [generateType, setGenerateType] = useState("")
+ const [generateType, setGenerateType] = useState('')
const [bio, setBio] = useState(user?.bio)
- const [favouriteTopic, setFavouriteTopic] = useState(user?.favouriteTopic)
- const [userProfilePicture, setUserProfilePicture] = useState(user?.profilePicture)
- const [isUploadingImage, setIsUploadingImage] = useState(false);
- const { uploadFilesCloudinary, error: cloudinaryError } = useUploadImagesCloudinary();
-
+ const [favouriteTopic, setFavouriteTopic] = useState<
+ string | null | undefined
+ >(user?.favouriteTopic)
+ const [userProfilePicture, setUserProfilePicture] = useState<
+ string | null | undefined
+ >(user?.profilePicture)
+ const [isUploadingImage, setIsUploadingImage] = useState(false)
+ const { uploadFilesCloudinary, error: cloudinaryError } =
+ useUploadImagesCloudinary()
+ const { data: session } = useSession()
+ const [userData, setUserData] = useState(user)
+ const [isFollowLoading, setIsFollowLoading] = useState(false)
+ const { customSonner } = useSonner()
+
- const userQuestions = user?.threads.map((thread) => {
-
- if (!thread.messages?.length) {
- return null;
- }
- return {
- id: thread.threadId,
- content: thread.messages[0].content,
- createdAt: new Date(),
- role: "user" as Message["role"],
- }
- }).filter(Boolean) as Message[]
+ const userQuestions = user?.threads
+ .map(thread => {
+ if (!thread.messages?.length) {
+ return null
+ }
+ return {
+ id: thread.threadId,
+ content: thread.messages[0].content,
+ createdAt: new Date(),
+ role: 'user' as Message['role']
+ }
+ })
+ .filter(Boolean) as Message[]
const [lastMessage, setLastMessage] = useState(null)
const { append } = useChat({
@@ -50,54 +73,55 @@ export function UserCard({ user, loading }: UserCardProps) {
body: {
id: nanoid(),
model: selectedModel,
- clientType,
+ clientType
},
onResponse(response) {
if (response.status === 401) {
- toast.error(response.statusText)
+ customSonner({ type: 'error', text: response.statusText })
} else if (!response.ok) {
- toast.error('Failed to process request')
+ customSonner({ type: 'error', text: 'Failed to process request' })
}
setIsLoading(false)
},
onError(error) {
- toast.error('An error occurred')
+ customSonner({ type: 'error', text: 'An error occurred' })
setIsLoading(false)
},
async onFinish(message) {
setLastMessage(message.content)
- },
+ }
})
- const handleProfilePictureUpload = async (event: ChangeEvent) => {
- if (!event.target.files || event.target.files.length === 0) return;
- const file = event.target.files[0];
+ const handleProfilePictureUpload = async (
+ event: ChangeEvent
+ ) => {
+ if (!event.target.files || event.target.files.length === 0) return
+ const file = event.target.files[0]
// You can add validation for file type and size here
- setIsUploadingImage(true);
+ setIsUploadingImage(true)
try {
- const { data, success } = await uploadFilesCloudinary(file);
-
+ const { data, success } = await uploadFilesCloudinary(file)
if (!success) {
- console.error('Failed to upload image xx:', cloudinaryError);
- toast.error('Failed to upload image: \n' + cloudinaryError?.message);
- return;
+ console.error('Failed to upload image xx:', cloudinaryError)
+ customSonner({ type: 'error', text: 'Failed to upload image' })
+ return
}
- const imageUrl = data?.secure_url as string;
+ const imageUrl = data?.secure_url as string
// Update the user's profile picture
- await updateUserInfo(null, null, imageUrl);
+ await updateUserInfo(null, null, imageUrl)
// Update the user state
- setUserProfilePicture(imageUrl);
- toast.success('Profile picture updated successfully');
+ setUserProfilePicture(imageUrl)
+ customSonner({ type: 'success', text: 'Profile picture updated successfully' })
} catch (error) {
- toast.error('Failed to upload image: \n' + (error as Error).message);
+ customSonner({ type: 'error', text: 'Failed to upload image' })
} finally {
- setIsUploadingImage(false);
+ setIsUploadingImage(false)
}
- };
+ }
const handleUpdateUserInfo = useCallback(async () => {
if (lastMessage) {
@@ -110,7 +134,7 @@ export function UserCard({ user, loading }: UserCardProps) {
await updateUserInfo(removeSurroundingQuotes(lastMessage), null, null)
}
} catch (error) {
- toast.error('Failed to update user information')
+ customSonner({ type: 'error', text: 'Failed to update user information' })
} finally {
setIsLoading(false)
}
@@ -124,209 +148,345 @@ export function UserCard({ user, loading }: UserCardProps) {
}
}, [handleUpdateUserInfo, user?.profilePicture])
-
const generateBio = (type: string) => {
-
try {
setIsLoading(true)
setGenerateType(type)
if (!userQuestions?.length) {
- toast.error('No thread history available to generate content');
- setIsLoading(false);
- return;
+ customSonner({ type: 'error', text: 'No thread history available to generate content' })
+ setIsLoading(false)
+ return
}
const promptContent = UserPersonalityPrompt(type, userQuestions)
return append({
id: nanoid(),
content: promptContent,
role: 'system',
- createdAt: new Date(),
+ createdAt: new Date()
})
} catch (error) {
- setIsLoading(false);
- toast.error('Failed to generate content: \n' + (error as Error).message);
- console.error('Bio generation failed:', error);
+ setIsLoading(false)
+ customSonner({ type: 'error', text: 'Failed to generate content' })
+ console.error('Bio generation failed:', error)
}
}
useEffect(() => {
return () => {
- setLastMessage(null);
- setIsLoading(false);
- };
- }, []);
+ setLastMessage(null)
+ setIsLoading(false)
+ }
+ }, [])
useEffect(() => {
// update bio and topic when user changes
setBio(user?.bio)
setFavouriteTopic(user?.favouriteTopic)
+ setUserData(user)
+ }, [user])
+
+ const handleFollowUser = async () => {
+ if (isFollowLoading) return
+ try {
+ // if no session is found, redirect to login\
+ if (!session) {
+ customSonner({ type: 'error', text: 'Please sign in to follow user' })
+ router.push('/auth/signin')
+ return
+ }
+ setIsFollowLoading(true)
+ const followerId = session.user?.id
+ const followeeId = user?.userId
+ if (!followerId || !followeeId) {
+ customSonner({ type: 'error', text: 'Invalid user data' })
+ return
+ }
+ if (followerId === followeeId) {
+ customSonner({ type: 'error', text: 'You cannot follow yourself' })
+ return
+ }
+ const { success, error, follow } = await userFollowOrUnfollow({
+ followerId,
+ followeeId,
+ jwt: session.user.hasuraJwt as string
+ })
+ if (!success) {
+ console.error('Failed to follow/Unfollow user:', error)
+ customSonner({ type: 'error', text: error || 'Failed to follow/Unfollow user' })
+ return
+ }
+
+ if (follow) {
+ setUserData(prevUser => {
+ if (!prevUser) return prevUser
+
+ const newFollower: SocialFollowing = {
+ followerId,
+ followeeId,
+ createdAt: new Date().toISOString(),
+ user: prevUser,
+ userByFollowerId: prevUser,
+ chatbot: null,
+ followeeIdChatbot: null,
+ __typename: 'SocialFollowing'
+ }
+
+ return {
+ ...prevUser,
+ followers: [...(prevUser.followers || []), newFollower]
+ } as User // Assert the entire object as User type
+ })
+ customSonner({ type: 'success', text: `You are now following ${user?.username}` })
+ } else {
+ setUserData(prevUser => {
+ if (!prevUser) return prevUser
+
+ return {
+ ...prevUser,
+ followers: prevUser.followers.filter(
+ follower =>
+ follower.followerId !== followerId ||
+ follower.followeeId !== followeeId
+ )
+ }
+ })
+ customSonner({ type: 'success', text: `You have unfollowed ${user?.username}` })
+ }
+ } catch (error) {
+ customSonner({ type: 'error', text: 'Failed to follow user' })
+ console.error('Failed to follow user:', error)
+ } finally {
+ setIsFollowLoading(false)
+ }
}
- , [user])
+
+ const followed = isFollowed({
+ followers: userData?.followers,
+ userId: session?.user?.id || ''
+ })
return (
{
- loading && !user && (
-
-
-
- )
- }
- {
- !loading && user && (
-
-
- {/* Profile Name */}
-
-
{user?.username}
-
+ >
+ {' '}
+ {loading && !user && (
+
+
+
+ )}
+ {!loading && user && (
+
+
+ {/* Profile Name */}
+
+
+ {user?.username}
+
+
+
+ Threads:
+ {user?.threads.length}
+
+
+
+
bio:
+
+
+ {isOwner && (
+ generateBio('bio')}
+ className="text-sm text-gray-500 border py-[2px] px-[8px] border-black dark:border-gray-400 hover:text-black dark:hover:text-gray-400"
+ >
+ {bio ? 're-generate' : 'generate'}
+ {isLoading && generateType === 'bio' ? (
+
+ ) : (
+
+ )}
+
+ )}
+
+
+
+
+
+ {/* Bio Section */}
+
+ {isOwner && !bio && (
+
+ click{' '}
+
+ {' '}
+ generate
+
+ to create a Masterbots biography based on your thread history.
+
+ )}
+ {bio && (
+
+ {bio}
+
+ )}
+
+
+ {/* Stats Section */}
+
+
+
Threads:
- {user?.threads.length}
+ {user?.threads.length}
-
-
-
bio:
-
+
+
+
+
Favourite topic:
{isOwner && (
-
generateBio('bio')} className="text-sm text-gray-500 border py-[2px] px-[8px] border-black dark:border-gray-400 hover:text-black dark:hover:text-gray-400">
- {bio ? 're-generate' : 'generate'}
- {isLoading && generateType === 'bio' ? : }
+ generateBio('topic')}
+ className="text-sm text-gray-500 border py-[2px] px-[8px] border-black dark:border-gray-400 hover:text-black dark:hover:text-gray-400"
+ >
+ {favouriteTopic ? 're-generate' : 'generate'}
+ {isLoading && generateType === 'topic' ? (
+
+ ) : (
+
+ )}
)}
-
-
+ {isOwner && !favouriteTopic && (
+
+ click{' '}
+ generateBio('topic')}
+ disabled={isLoading && generateType === 'topic'}
+ className="text-xs text-gray-500 p-1 hover:text-black dark:hover:text-gray-400"
+ >
+ {' '}
+ generate
+ {isLoading && generateType === 'topic' ? (
+
+ ) : (
+
+ )}
+
+ and know your most common topic.
+
+ )}
+ {favouriteTopic && (
+
+ {favouriteTopic}
+
+ )}
-
- {/* Bio Section */}
-
- {isOwner && !bio && (
-
- click generate
- to create a Masterbots biography based on your thread history.
-
- )}
- {bio && (
-
{bio}
-
+
+ {!isOwner && (
+
+ {isFollowLoading ? (
+
+ ) : (
+ <>{followed ? 'Following' : 'Follow'}>
+ )}
+
)}
-
-
- {/* Stats Section */}
-
-
-
-
-
Threads:
-
{user?.threads.length}
+
+
+
Following
+
+
+
+ {formatNumber(userData?.following?.length || 0)}
+
+
-
-
+
+
Followers
-
-
Favourite topic:
- {isOwner && (
-
generateBio('topic')} className="text-sm text-gray-500 border py-[2px] px-[8px] border-black dark:border-gray-400 hover:text-black dark:hover:text-gray-400">
- {favouriteTopic ? 're-generate' : 'generate'}
- {isLoading && generateType === 'topic' ? : }
-
- )}
+
+
+ {formatNumber(userData?.followers?.length || 0)}
+
- {isOwner && !favouriteTopic && (
-
- click generateBio('topic')}
- disabled={isLoading && generateType === 'topic'}
- className="text-xs text-gray-500 p-1 hover:text-black dark:hover:text-gray-400"> generate
- {isLoading && generateType === 'topic' ? : }
-
- and know your most common topic.
-
- )}
- {favouriteTopic && (
-
{favouriteTopic}
- )}
- {/* Implementation for this comes next :) */}
- {/*
- {!isOwner && (
-
- Follow
-
- )}
-
-
-
Following
-
-
- 313
-
-
-
-
-
*/}
+ {/* Profile Image and Follow Button Section */}
+
+
+
+ {
+ e.currentTarget.src =
+ 'https://api.dicebear.com/9.x/identicon/svg?seed=default_masterbots_ai_user_avatar'
+ }}
+ />
-
-
- {/* Profile Image and Follow Button Section */}
-
- )
- }
-
+
+ )}
)
-}
+}
\ No newline at end of file
diff --git a/apps/masterbots.ai/components/routes/thread/thread-popup.tsx b/apps/masterbots.ai/components/routes/thread/thread-popup.tsx
index 28606385..eee649e4 100644
--- a/apps/masterbots.ai/components/routes/thread/thread-popup.tsx
+++ b/apps/masterbots.ai/components/routes/thread/thread-popup.tsx
@@ -169,7 +169,6 @@ export function ThreadPopUpCardHeader({ messages }: { messages: AiMessage[] }) {
-
diff --git a/apps/masterbots.ai/components/routes/thread/thread-share-link.tsx b/apps/masterbots.ai/components/routes/thread/thread-share-link.tsx
index 4d193f10..eff795b7 100644
--- a/apps/masterbots.ai/components/routes/thread/thread-share-link.tsx
+++ b/apps/masterbots.ai/components/routes/thread/thread-share-link.tsx
@@ -5,8 +5,13 @@ import { Button } from '@/components/ui/button'
import { AnimatePresence } from 'framer-motion'
import { LucideCheck, LucideLoader2, LucideX } from 'lucide-react'
import { useState } from 'react'
+import { cn } from '@/lib/utils'
-export default function ShareLink() {
+interface ShareLinkProps {
+ variant?: 'default' | 'active'
+}
+
+export default function ShareLink({ variant = 'default' }: ShareLinkProps) {
const [status, setStatus] = useState<
'default' | 'loading' | 'copied' | 'error'
>('default')
@@ -15,7 +20,6 @@ export default function ShareLink() {
setStatus('loading')
try {
const { data, error } = await generateShortLink(window.location.pathname)
- console.log('result:')
if (error) throw new Error(`Error generating link: ${error}`)
if (!data) throw new Error('No data received from link generation')
navigator.clipboard.writeText(data.shortLink)
@@ -29,37 +33,52 @@ export default function ShareLink() {
return () => clearTimeout(timer)
}
}
-
+
+ const getIconColor = () => {
+ switch (status) {
+ case 'copied':
+ return 'stroke-success'
+ case 'error':
+ return 'stroke-destructive'
+ case 'loading':
+ return 'stroke-muted-secondary'
+ default:
+ return variant === 'active' ? 'fill-[#388DE2]' : 'fill-[#FAFAFA]'
+ }
+ }
+
const iconsMap = {
loading: (
-
+
),
- copied:
,
- error:
,
+ copied:
,
+ error:
,
default: (
// biome-ignore lint/a11y/noSvgWithoutTitle:
-
-
+
)
}
-
+
return (
-
+
{iconsMap[status]}
)
-}
\ No newline at end of file
+}
diff --git a/apps/masterbots.ai/components/routes/thread/user-thread-panel.tsx b/apps/masterbots.ai/components/routes/thread/user-thread-panel.tsx
index b62a1432..95a319bb 100755
--- a/apps/masterbots.ai/components/routes/thread/user-thread-panel.tsx
+++ b/apps/masterbots.ai/components/routes/thread/user-thread-panel.tsx
@@ -211,12 +211,13 @@ export default function UserThreadPanel({
const showNoResults = !loading && searchTerm && threads.length === 0
const showChatbotDetails = !loading && !searchTerm && threads.length === 0
-
return (
<>
-
-
-
+ {threads.length > 0 && (
+
+
+
+ )}
{loading ? (
diff --git a/apps/masterbots.ai/components/ui/card.tsx b/apps/masterbots.ai/components/ui/card.tsx
index afa13ecf..63b48d0c 100644
--- a/apps/masterbots.ai/components/ui/card.tsx
+++ b/apps/masterbots.ai/components/ui/card.tsx
@@ -23,7 +23,7 @@ const CardHeader = React.forwardRef<
>(({ className, ...props }, ref) => (
))
diff --git a/apps/masterbots.ai/components/ui/sonner.tsx b/apps/masterbots.ai/components/ui/sonner.tsx
new file mode 100644
index 00000000..1746470c
--- /dev/null
+++ b/apps/masterbots.ai/components/ui/sonner.tsx
@@ -0,0 +1,32 @@
+'use client'
+
+import { useTheme } from 'next-themes'
+import { Toaster as Sonner } from 'sonner'
+
+type ToasterProps = React.ComponentProps
+
+const Toaster = ({ ...props }: ToasterProps) => {
+ const { theme = 'system' } = useTheme()
+
+ return (
+
+ )
+}
+
+export { Toaster }
diff --git a/apps/masterbots.ai/components/ui/tooltip.tsx b/apps/masterbots.ai/components/ui/tooltip.tsx
index af1d48be..30fc44d9 100644
--- a/apps/masterbots.ai/components/ui/tooltip.tsx
+++ b/apps/masterbots.ai/components/ui/tooltip.tsx
@@ -1,9 +1,9 @@
-'use client'
+"use client"
-import * as React from 'react'
-import * as TooltipPrimitive from '@radix-ui/react-tooltip'
+import * as React from "react"
+import * as TooltipPrimitive from "@radix-ui/react-tooltip"
-import { cn } from '@/lib/utils'
+import { cn } from "@/lib/utils"
const TooltipProvider = TooltipPrimitive.Provider
@@ -19,7 +19,7 @@ const TooltipContent = React.forwardRef<
ref={ref}
sideOffset={sideOffset}
className={cn(
- 'z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs font-medium text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1',
+ "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
className
)}
{...props}
diff --git a/apps/masterbots.ai/lib/clickable-results.ts b/apps/masterbots.ai/lib/clickable-results.ts
new file mode 100644
index 00000000..e37e0f38
--- /dev/null
+++ b/apps/masterbots.ai/lib/clickable-results.ts
@@ -0,0 +1,141 @@
+import type { ReactNode } from 'react'
+import React from 'react'
+
+export const GENERAL_PATTERN = /(.*?)([:.,])(?:\s|$)/g
+
+// * List of predefined unique phrases to detect in text
+export const UNIQUE_PHRASES = [
+ 'Unique, lesser-known',
+ 'Unique insight',
+ 'Unique Tip',
+ 'Unique, lesser-known solution',
+ 'Unique Solution',
+ 'Unique, lesser-known option',
+ 'Unique Insight: Lesser-Known Solution',
+ 'Unique Recommendation',
+ 'Lesser-Known Gem',
+ 'For a UNIQUE, LESSER-KNOWN phrase',
+ 'Unique, Lesser-Known Destination',
+ 'For more detailed insights'
+] as const
+
+export interface ParsedText {
+ clickableText: string
+ restText: string
+}
+
+// ? It recursively extracts text from a ReactNode, preserving React elements and returning plain text for strings, numbers, and arrays.
+export function extractTextFromReactNodeWeb(node: ReactNode): ReactNode {
+ // Si es un elemento React válido
+ if (React.isValidElement(node)) {
+ // Si es un strong, preservamos su contenido original
+ if (node.type === 'strong') {
+ return {
+ ...node,
+ props: {
+ ...node.props,
+ children: extractTextFromReactNodeWeb(node.props.children)
+ }
+ }
+ }
+ return node
+ }
+
+ if (typeof node === 'string') return node
+ if (typeof node === 'number') return node.toString()
+ if (Array.isArray(node)) {
+ return node.map(extractTextFromReactNodeWeb)
+ }
+ if (typeof node === 'object' && node !== null && 'props' in node) {
+ const children = extractTextFromReactNodeWeb(node.props.children)
+ if (React.isValidElement(children) || Array.isArray(children)) {
+ return children
+ }
+ return String(children)
+ }
+ return ''
+}
+
+// ? Tthis does the following: extracts plain text from a ReactNode, ignoring React elements and returning concatenated strings from arrays
+export function extractTextFromReactNodeNormal(node: ReactNode): string {
+ if (typeof node === 'string') return node
+ if (typeof node === 'number') return node.toString()
+ if (Array.isArray(node))
+ return node.map(extractTextFromReactNodeNormal).join('')
+ if (typeof node === 'object' && node !== null && 'props' in node) {
+ return extractTextFromReactNodeNormal(node.props.children)
+ }
+ return ''
+}
+
+// * Creates a regex pattern for unique phrases
+export function createUniquePattern(): RegExp {
+ return new RegExp(`(?:${UNIQUE_PHRASES.join('|')}):\\s*([^.:]+[.])`, 'i')
+}
+
+export function parseClickableText(fullText: string): ParsedText {
+ if (typeof fullText === 'string' && fullText.match(/https?:\/\/[^\s]+/)) {
+ return {
+ clickableText: '',
+ restText: fullText
+ }
+ }
+
+ const titlePattern = /^([^:]+?):\s*(.*)/
+ const titleMatch = fullText.match(titlePattern)
+
+ if (titleMatch) {
+ const title = titleMatch[1].trim()
+ if (!title || title.match(/^[.\s]+$/)) {
+ return {
+ clickableText: '',
+ restText: fullText
+ }
+ }
+
+ const strongPattern = /(.*?)<\/strong>/
+ const strongMatch = title.match(strongPattern)
+ const finalTitle = strongMatch ? strongMatch[1] : title
+
+ return {
+ clickableText: finalTitle,
+ restText: ':' + titleMatch[2]
+ }
+ }
+
+ return {
+ clickableText: '',
+ restText: fullText
+ }
+}
+
+export function cleanClickableText(text: string): string {
+ return text.replace(/[,.()[\]]$/, '').trim()
+}
+
+/**
+ * transformLink transforms a given link element by updating its text content based on the context.
+ * If the original text includes 'read more' or 'learn more', it leaves the link unchanged.
+ * Otherwise, it generates a new descriptive text based on the content context and updates the link.
+ */
+export function transformLink(
+ linkElement: React.ReactElement,
+ contentContext: string
+): React.ReactElement {
+ const href = linkElement.props.href
+ const currentText = extractTextFromReactNodeNormal(linkElement.props.children)
+
+ if (
+ currentText.toLowerCase().includes('read more') ||
+ currentText.toLowerCase().includes('learn more')
+ ) {
+ return linkElement
+ }
+
+ const descriptiveText = `Read more about ${contentContext.split(':')[0].toLowerCase()} here`
+
+ return React.cloneElement(linkElement, {
+ ...linkElement.props,
+ children: descriptiveText
+ })
+}
diff --git a/apps/masterbots.ai/lib/constants/prompts.ts b/apps/masterbots.ai/lib/constants/prompts.ts
index a945d673..79a80ea0 100644
--- a/apps/masterbots.ai/lib/constants/prompts.ts
+++ b/apps/masterbots.ai/lib/constants/prompts.ts
@@ -67,8 +67,37 @@ export function createBotConfigurationPrompt(chatbot: Chatbot) {
` +
`**Important Guidelines:**
` +
- '- Do not change the response tone, length or complexity level, only format whenever requested as additional instructions and/or examples. ' +
- '- You may be capable of performing Web Search. When available, use it to verify information before making assumptions. '
+ '- Do not change the response tone, length or complexity level, only format whenever you are requested to follow any format below. ' +
+ '- You may be capable of performing Web Search. When available, use it to verify information before making assumptions. ' +
+ '- Whenever you are capable of performing Web Search, you must provide the source of the information at the end. Use the "thumbnail.original" to render an initial image from the given input. ' +
+ `- When performing Web Search, your response format will be in the following format example:
+
+ ## Example: ##
+
+ **Resume:**
+ Brewers: 9
+ Dodgers: 2
+
+ **Summary**
+ Yelich, Perkins power Brewers to 9-2 victory over Dodgers and avoid being swept in weekend series. — Christian Yelich and Blake Perkins both homered, had three hits and drove in three runs as the Milwaukee Brewers beat the Los Angeles Dodgers 9-2 Sunday to snap a seven-game losing streak at Dodger Stadium.
+
+ **Homeruns:**
+ Yelich
+
+ **Winning Pitcher:**
+ J. Junis
+
+ **Sources**:
+
+ | [https://website1.com/](https://website1.com/) |
+ |--|
+ | Website1 Metadata Description |
+ |  |
+
+ | [https://website2.com/](https://website2.com/) |
+ |--|
+ | Website2 Metadata Description |
+ |  |`
// `- The chatbot that you are configuring has ID ${chatbot.chatbotId} and the domain Category ID is ${chatbot.categories[0].categoryId}. You will need this information for later tasks.`
)
}
diff --git a/apps/masterbots.ai/lib/hooks/use-mb-chat.ts b/apps/masterbots.ai/lib/hooks/use-mb-chat.ts
index 98390289..a4d74bdf 100644
--- a/apps/masterbots.ai/lib/hooks/use-mb-chat.ts
+++ b/apps/masterbots.ai/lib/hooks/use-mb-chat.ts
@@ -1,9 +1,6 @@
import { improveMessage } from '@/app/actions'
import { formatSystemPrompts } from '@/lib/actions'
-import {
- followingQuestionsPrompt,
- setDefaultUserPreferencesPrompt
-} from '@/lib/constants/prompts'
+import { followingQuestionsPrompt, setDefaultUserPreferencesPrompt } from '@/lib/constants/prompts'
import { useModel } from '@/lib/hooks/use-model'
import { useSidebar } from '@/lib/hooks/use-sidebar'
import { useThread } from '@/lib/hooks/use-thread'
@@ -13,22 +10,18 @@ import {
deleteThread,
getMessages,
getThread,
- saveNewMessage
+ saveNewMessage,
} from '@/services/hasura'
import type { AiClientType, AiToolCall } from '@/types/types'
-import type {
- Message as AiMessage,
- ChatRequestOptions,
- CreateMessage
-} from 'ai'
+import type { Message as AiMessage, ChatRequestOptions, CreateMessage } from 'ai'
import { useChat } from 'ai/react'
import { uniqBy } from 'lodash'
import type { Chatbot, Message, Thread } from 'mb-genql'
import { useSession } from 'next-auth/react'
import { useParams } from 'next/navigation'
import { useEffect, useRef } from 'react'
-import toast from 'react-hot-toast'
import { useAsync, useSetState } from 'react-use'
+import { useSonner } from './useSonner'
export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
const { threadId: threadIdProps, chatbot: chatbotProps } = config ?? {}
@@ -42,7 +35,7 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
setIsNewResponse,
setIsOpenPopup,
setActiveTool,
- setLoadingState
+ setLoadingState,
} = useThread()
const { activeChatbot } = useSidebar()
const userContentRef = useRef('')
@@ -54,17 +47,16 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
}>({
isInitLoaded: false,
webSearch: false,
- messagesFromDB: [] as Message[]
+ messagesFromDB: [] as Message[],
})
-
+ const { customSonner } = useSonner()
// console.log('[HOOK] webSearch', webSearch)
const params = useParams<{ chatbot: string; threadId: string }>()
const { selectedModel, clientType } = useModel()
const chatbotSystemPrompts: AiMessage[] = formatSystemPrompts(
- (activeThread?.chatbot ?? (activeChatbot as Chatbot) ?? chatbotProps)
- ?.prompts
+ (activeThread?.chatbot ?? (activeChatbot as Chatbot) ?? chatbotProps)?.prompts,
)
const userPreferencesPrompts: AiMessage[] = activeThread
@@ -73,11 +65,11 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
// format all user prompts and chatgpt 'assistant' messages
const userAndAssistantMessages: AiMessage[] = activeThread
- ? messagesFromDB.map(m => ({
+ ? messagesFromDB.map((m) => ({
id: m.messageId,
role: m.role as AiMessage['role'],
content: m.content,
- createdAt: m.createdAt
+ createdAt: m.createdAt,
}))
: []
@@ -87,27 +79,17 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
.concat(userAndAssistantMessages)
const isNewChat = Boolean(!params.threadId && !activeThread)
- const threadId =
- threadIdProps || activeThread?.threadId || randomThreadId.current
+ const threadId = threadIdProps || activeThread?.threadId || randomThreadId.current
const chatbot = chatbotProps || activeThread?.chatbot || activeChatbot
- const {
- input,
- messages,
- isLoading,
- stop,
- append,
- reload,
- setInput,
- setMessages
- } = useChat({
+ const { input, messages, isLoading, stop, append, reload, setInput, setMessages } = useChat({
initialMessages,
id: params.threadId || isNewChat ? threadId : activeThread?.threadId,
body: {
id: params.threadId || isNewChat ? threadId : activeThread?.threadId,
model: selectedModel,
clientType,
- webSearch
+ webSearch,
// chatbot:
// activeChatbot && activeChatbot?.categories?.length
// ? {
@@ -118,63 +100,74 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
},
async onResponse(response) {
if (response.status >= 400) {
- toast.error(response.statusText)
+ customSonner({ type: 'error', text: response.statusText })
if (isNewChat) {
await deleteThread({
threadId: params?.threadId ?? activeThread?.threadId,
- jwt: session!.user?.hasuraJwt,
- userId: session!.user.id
+ jwt: session?.user?.hasuraJwt,
+ userId: session?.user.id,
})
}
}
},
- async onFinish(message) {
+ async onFinish(message, options) {
+ setLoadingState(undefined)
+ setActiveTool(undefined)
+ setIsNewResponse(false)
+
+ if (options.finishReason === 'error') {
+ customSonner({ type: 'error', text: 'Failed to send message. Please try again.' })
+
+ if (isNewChat) {
+ await deleteThread({
+ threadId: params?.threadId ?? activeThread?.threadId,
+ jwt: session?.user?.hasuraJwt,
+ userId: session?.user.id,
+ })
+ }
+
+ return
+ }
+
await Promise.all([
saveNewMessage({
role: 'user',
- threadId:
- params.threadId || isNewChat ? threadId : activeThread?.threadId,
+ threadId: params.threadId || isNewChat ? threadId : activeThread?.threadId,
content: userContentRef.current,
- jwt: session!.user?.hasuraJwt
+ jwt: session?.user?.hasuraJwt,
}),
// ? Adding a delay to securely keep the order of messages
delayFetch(),
saveNewMessage({
role: 'assistant',
- threadId:
- params.threadId || isNewChat ? threadId : activeThread?.threadId,
+ threadId: params.threadId || isNewChat ? threadId : activeThread?.threadId,
content: message.content,
- jwt: session!.user?.hasuraJwt
- })
+ jwt: session?.user?.hasuraJwt,
+ }),
])
-
- setLoadingState(undefined)
- setActiveTool(undefined)
},
onToolCall({ toolCall }) {
console.log('Tool call:', toolCall)
-
- toast.success(`Tool call executed: ${toolCall.toolName}`)
+ customSonner({ type: 'info', text: `Tool call executed: ${toolCall.toolName}` })
setActiveTool(toolCall as AiToolCall)
},
async onError(error) {
console.error('Error in chat: ', error)
- toast.error('Failed to send message. Please try again.')
+ customSonner({ type: 'error', text: 'Failed to send message. Please try again.' })
setLoadingState(undefined)
setActiveTool(undefined)
setIsNewResponse(false)
- stop()
if (isNewChat) {
await deleteThread({
threadId: params?.threadId ?? activeThread?.threadId,
- jwt: session!.user?.hasuraJwt,
- userId: session!.user.id
+ jwt: session?.user?.hasuraJwt,
+ userId: session?.user.id,
})
}
- }
+ },
})
//* Updates the thread ID when popup is closed
@@ -188,8 +181,7 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
// ? fetch messages from db on active thread change
const { loading } = useAsync(async () => {
if (
- (activeThread?.chatbot?.prompts?.length ||
- activeThread?.chatbot?.name === 'BlankBot') &&
+ (activeThread?.chatbot?.prompts?.length || activeThread?.chatbot?.name === 'BlankBot') &&
!isInitLoaded &&
!loading
) {
@@ -198,6 +190,7 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
}
}, [activeThread])
+ // biome-ignore lint/correctness/useExhaustiveDependencies: only activeThread is needed
useEffect(() => {
if (!activeThread) {
setState({ messagesFromDB: [], isInitLoaded: false })
@@ -212,15 +205,15 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
const newAllMessages = uniqBy(
allMessages?.concat(
- (newThread?.messages || []).map(m => ({
+ (newThread?.messages || []).map((m) => ({
id: m.messageId,
role: m.role as AiMessage['role'],
content: m.content,
- createdAt: m.createdAt || new Date().toISOString()
- }))
+ createdAt: m.createdAt || new Date().toISOString(),
+ })),
),
- 'content'
- ).filter(m => m.role !== 'system')
+ 'content',
+ ).filter((m) => m.role !== 'system')
setMessages(newAllMessages)
setActiveThread(newThread)
@@ -232,7 +225,7 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
const { content, error } = await processUserMessage(
userMessage.content,
clientType as AiClientType,
- selectedModel
+ selectedModel,
)
userContentRef.current = content
@@ -240,59 +233,73 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
}
const appendNewMessage = async (userMessage: AiMessage | CreateMessage) => {
- setLoadingState('ready')
-
- if (isNewChat && chatbot) {
- await createThread({
- threadId: threadId as string,
- chatbotId: chatbot.chatbotId,
- jwt: session!.user?.hasuraJwt,
- userId: session!.user.id,
- isPublic: activeChatbot?.name !== 'BlankBot'
- })
+ setLoadingState('generating')
- // * Loading: Here is the information you need... 'finish'
- const thread = await getThread({
- threadId: threadId as string,
- jwt: session!.user?.hasuraJwt
- })
+ try {
+ if (isNewChat && chatbot) {
+ await createThread({
+ threadId: threadId as string,
+ chatbotId: chatbot.chatbotId,
+ jwt: session?.user?.hasuraJwt,
+ userId: session?.user.id,
+ isPublic: activeChatbot?.name !== 'BlankBot',
+ })
- updateActiveThread(thread)
- }
+ // * Loading: Here is the information you need... 'finish'
+ const thread = await getThread({
+ threadId: threadId as string,
+ jwt: session?.user?.hasuraJwt,
+ })
- const appendResponse = await append(
- isNewChat
- ? { ...userMessage, content: userContentRef.current }
- : {
- ...userMessage,
- content: followingQuestionsPrompt(userContentRef.current, messages)
- }
- // ? Provide chat attachments here...
- // {
- // experimental_attachments: [],
- // }
- )
+ updateActiveThread(thread)
+ }
+
+ const appendResponse = await append(
+ isNewChat
+ ? { ...userMessage, content: userContentRef.current }
+ : {
+ ...userMessage,
+ content: followingQuestionsPrompt(userContentRef.current, messages),
+ },
+ // ? Provide chat attachments here...
+ // {
+ // experimental_attachments: [],
+ // }
+ )
+
+ setLoadingState('finished')
+ return appendResponse
+ } catch (error) {
+ setLoadingState(undefined)
+ stop()
- setLoadingState('finished')
- return appendResponse
+ console.error('Error appending new message: ', error)
+
+ return null
+ }
}
// we extend append function to add our system prompts
const appendWithMbContextPrompts = async (
userMessage: AiMessage | CreateMessage,
- chatRequestOptions?: ChatRequestOptions
+ chatRequestOptions?: ChatRequestOptions,
) => {
if (!session?.user || !chatbot) {
console.error('User is not logged in or session expired.')
- toast.error('Failed to start conversation. Please reload and try again.')
+ customSonner({
+ type: 'error',
+ text: 'Failed to start conversation. Please reload and try again.',
+ })
return
}
+ setIsNewResponse(true)
+
if (isNewChat) {
const optimisticThread: Thread = {
threadId,
- chatbotId: chatbot!.chatbotId,
- chatbot: chatbot!,
+ chatbotId: chatbot?.chatbotId,
+ chatbot,
createdAt: new Date().toISOString(),
isApproved: false,
isBlocked: false,
@@ -303,14 +310,13 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
messageId: userMessage.id,
createdAt: new Date().toISOString(),
role: userMessage.role,
- content: userMessage.content
- }
+ content: userMessage.content,
+ },
],
- userId: session!.user.id
+ userId: session?.user.id,
}
updateActiveThread(optimisticThread)
- setIsNewResponse(true)
}
try {
@@ -323,10 +329,7 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
// TODO: improve response velocity here (split this fn to yet another cb fn? 🤔)
setIsOpenPopup(true)
} catch (error) {
- console.error(
- 'Error processing user message. Using og message. Error: ',
- error
- )
+ console.error('Error processing user message. Using og message. Error: ', error)
} finally {
await appendNewMessage(userMessage)
}
@@ -336,15 +339,15 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
setState({ isInitLoaded: true })
try {
const messagesFromDB = await getMessages({
- threadId: activeThread?.threadId
+ threadId: activeThread?.threadId,
})
setState({
- messagesFromDB
+ messagesFromDB,
})
setMessages(chatbotSystemPrompts)
} catch (error) {
console.error('Error fetching messages:', error)
- toast.error('Failed to load messages. Please try again.')
+ customSonner({ type: 'error', text: 'Failed to load messages. Please try again.' })
}
}
@@ -354,14 +357,13 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
appendWithMbContextPrompts({
id: params?.threadId || activeThread?.threadId,
content: fullMessage,
- role: 'user'
+ role: 'user',
})
}
- const allMessages = uniqBy(
- initialMessages?.concat(messages),
- 'content'
- ).filter(m => m.role !== 'system')
+ const allMessages = uniqBy(initialMessages?.concat(messages), 'content').filter(
+ (m) => m.role !== 'system',
+ )
const toggleWebSearch = () => {
setWebSearch(!webSearch)
@@ -377,7 +379,7 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
allMessages,
initialMessages,
isLoadingMessages: loading,
- newChatThreadId: threadId
+ newChatThreadId: threadId,
},
{
// ? temp ignore...
@@ -389,15 +391,15 @@ export function useMBChat(config?: MBChatHookConfig): MBChatHookCallback {
setInput,
append,
reload,
- stop
- }
+ stop,
+ },
]
}
async function processUserMessage(
content: string,
clientType: AiClientType,
- model: string
+ model: string,
): Promise<{ content: string; error?: Error }> {
try {
const improved = await improveMessage(content, clientType, model)
@@ -433,16 +435,14 @@ export type MBChatHookState = {
export type MBChatHookActions = {
appendWithMbContextPrompts: (
userMessage: AiMessage | CreateMessage,
- chatRequestOptions?: ChatRequestOptions
+ chatRequestOptions?: ChatRequestOptions,
) => Promise
sendMessageFromResponse: (bulletContent: string) => void
append: (
message: AiMessage | CreateMessage,
- chatRequestOptions?: ChatRequestOptions
- ) => Promise
- reload: (
- chatRequestOptions?: ChatRequestOptions
+ chatRequestOptions?: ChatRequestOptions,
) => Promise
+ reload: (chatRequestOptions?: ChatRequestOptions) => Promise
stop: () => void
toggleWebSearch: () => void
setInput: React.Dispatch>
diff --git a/apps/masterbots.ai/lib/hooks/use-profile.tsx b/apps/masterbots.ai/lib/hooks/use-profile.tsx
index 69acbc31..3cb04b5f 100644
--- a/apps/masterbots.ai/lib/hooks/use-profile.tsx
+++ b/apps/masterbots.ai/lib/hooks/use-profile.tsx
@@ -1,22 +1,20 @@
'use client'
import { getUserBySlug, updateUserPersonality } from '@/services/hasura'
-import { User } from 'mb-genql'
+import type { User } from 'mb-genql'
import { useSession } from 'next-auth/react'
import * as React from 'react'
-import toast from 'react-hot-toast'
+import { useSonner } from './useSonner'
interface profileContextProps {
getuserInfo: (username: string) => Promise
isSameUser: (userId: string) => boolean
updateUserInfo: (bio: string | null, topic: string | null, profilePicture: string | null) => void
- currentUser: User | null,
+ currentUser: User | null
setCurrentUser: React.Dispatch>
}
-const profileContext = React.createContext(
- undefined
-)
+const profileContext = React.createContext(undefined)
export function useProfile() {
const context = React.useContext(profileContext)
@@ -33,19 +31,20 @@ interface ProfileProviderProps {
export function ProfileProvider({ children }: ProfileProviderProps) {
const { data: session } = useSession()
-
-
const [currentUser, setCurrentUser] = React.useState(null)
+ const { customSonner } = useSonner()
const getuserInfo = async (slug: string): Promise => {
if (!slug?.trim()) {
throw new Error('Slug is required')
}
try {
- const sessionSlug = session?.user.slug ? session?.user.slug.toLowerCase() : session?.user.name?.toLowerCase()
+ const sessionSlug = session?.user.slug
+ ? session?.user.slug.toLowerCase()
+ : session?.user.name?.toLowerCase()
const userInfo = await getUserBySlug({
slug,
- isSameUser: sessionSlug === slug
+ isSameUser: sessionSlug === slug,
})
if (!userInfo) {
throw new Error('User not found')
@@ -65,11 +64,15 @@ export function ProfileProvider({ children }: ProfileProviderProps) {
return session?.user.id === userId
}
- const updateUserInfo = async (bio: string | null, topic: string | null, profilePicture: string | null) => {
+ const updateUserInfo = async (
+ bio: string | null,
+ topic: string | null,
+ profilePicture: string | null,
+ ) => {
try {
- const jwt = session?.user?.hasuraJwt;
+ const jwt = session?.user?.hasuraJwt
if (!jwt || !session.user?.id) {
- throw new Error('User not authenticated');
+ throw new Error('User not authenticated')
}
await updateUserPersonality({
userId: session?.user.id,
@@ -79,14 +82,20 @@ export function ProfileProvider({ children }: ProfileProviderProps) {
profilePicture,
})
} catch (error) {
- console.error('Failed to update user info', error);
- toast.error('Failed to update user info');
+ console.error('Failed to update user info', error)
+ customSonner({ type: 'error', text: 'Failed to update user info' })
}
}
return (
{children}
diff --git a/apps/masterbots.ai/lib/hooks/use-thread-visibility.tsx b/apps/masterbots.ai/lib/hooks/use-thread-visibility.tsx
index cdd34176..e267ac24 100644
--- a/apps/masterbots.ai/lib/hooks/use-thread-visibility.tsx
+++ b/apps/masterbots.ai/lib/hooks/use-thread-visibility.tsx
@@ -1,190 +1,193 @@
-"use client"
-import React , { useEffect, useState } from 'react';
-import { getThreads, UpdateThreadVisibility, deleteThread, approveThread, getUnapprovedThreads } from '@/services/hasura';
-import { useSession } from 'next-auth/react';
-import type { Thread } from 'mb-genql';
-import toast from 'react-hot-toast';
-
+'use client'
+import React, { useEffect, useState } from 'react'
+import {
+ getThreads,
+ UpdateThreadVisibility,
+ deleteThread,
+ approveThread,
+ getUnapprovedThreads
+} from '@/services/hasura'
+import { useSession } from 'next-auth/react'
+import type { Thread } from 'mb-genql'
+import { useSonner } from './useSonner'
interface DeleteThreadResponse {
- success: boolean;
- message: string;
- error: string | null;
+ success: boolean
+ message: string
+ error: string | null
}
-
interface ThreadVisibilityContextProps {
- isPublic: boolean;
- toggleVisibility: (newIsPublic: boolean, threadId: string) => void;
+ isPublic: boolean
+ toggleVisibility: (newIsPublic: boolean, threadId: string) => void
threads: Thread[]
- isSameUser: (thread: Thread) => boolean,
- initiateDeleteThread: (threadId: string) => Promise;
+ isSameUser: (thread: Thread) => boolean
+ initiateDeleteThread: (threadId: string) => Promise
handleToggleAdminMode: () => void
adminApproveThread: (threadId: string) => void
isAdminMode: boolean
}
-
-const ThreadVisibilityContext = React.createContext(undefined)
+const ThreadVisibilityContext = React.createContext<
+ ThreadVisibilityContextProps | undefined
+>(undefined)
export function useThreadVisibility() {
const context = React.useContext(ThreadVisibilityContext)
if (!context) {
- throw new Error('useThreadVisibilityContext must be used within a ThreadVisibilityProvider')
+ throw new Error(
+ 'useThreadVisibilityContext must be used within a ThreadVisibilityProvider'
+ )
}
return context
}
-
interface ThreadVisibilityProviderProps {
children: React.ReactNode
}
-export function ThreadVisibilityProvider({ children }: ThreadVisibilityProviderProps) {
- const [isPublic, setIsPublic] = useState(false);
- const [threads, setThreads] = useState([]);
- const [isAdminMode, setIsAdminMode] = React.useState(false);
-
- const session = useSession();
- const jwt = session?.data?.user?.hasuraJwt;
+export function ThreadVisibilityProvider({
+ children
+}: ThreadVisibilityProviderProps) {
+ const [isPublic, setIsPublic] = useState(false)
+ const [threads, setThreads] = useState([])
+ const [isAdminMode, setIsAdminMode] = React.useState(false)
+ const { customSonner } = useSonner()
+ const session = useSession()
+ const jwt = session?.data?.user?.hasuraJwt
useEffect(() => {
- getThreadForUser();
+ getThreadForUser()
}, [jwt])
-
const toggleVisibility = async (newIsPublic: boolean, threadId: string) => {
try {
- setIsPublic(newIsPublic);
- await UpdateThreadVisibility({ isPublic: newIsPublic, threadId, jwt });
- await getThreadForUser();
+ setIsPublic(newIsPublic)
+ await UpdateThreadVisibility({ isPublic: newIsPublic, threadId, jwt })
+ await getThreadForUser()
} catch (error) {
- console.error('Failed to update thread visibility:', error);
+ console.error('Failed to update thread visibility:', error)
}
- };
+ }
const getThreadForUser = async () => {
try {
- if (!jwt || !session?.data?.user?.id) return;
-
+ if (!jwt || !session?.data?.user?.id) return
+
const fetchedThreads = await getThreads({
jwt,
userId: session?.data?.user.id
- });
-
+ })
+
if (fetchedThreads) {
- setThreads(fetchedThreads);
+ setThreads(fetchedThreads)
}
} catch (error) {
- console.error('Error fetching threads:', error);
+ console.error('Error fetching threads:', error)
}
- };
-
+ }
const isSameUser = (thread: Thread) => {
- if (!session?.data?.user?.id) return false;
- return thread.userId === session?.data?.user?.id;
- };
-
+ if (!session?.data?.user?.id) return false
+ return thread.userId === session?.data?.user?.id
+ }
- const initiateDeleteThread = async (threadId: string): Promise => {
-
+ const initiateDeleteThread = async (
+ threadId: string
+ ): Promise => {
try {
if (!session?.data?.user?.id || !jwt) {
return {
success: false,
message: 'User session not found',
error: 'User session not found. Please log in again.'
- };
- };
- const deleteT = await deleteThread({
+ }
+ }
+ const deleteT = await deleteThread({
threadId,
jwt,
userId: session?.data?.user.id
- });
- await getThreadForUser();
- if(deleteT.success){
+ })
+ await getThreadForUser()
+ if (deleteT.success) {
return {
success: true,
message: 'Thread deleted successfully',
error: null
- };
+ }
}
return {
success: false,
message: deleteT.error || 'Failed to delete thread',
error: deleteT.error || 'An unknown error occurred'
- };
-
+ }
} catch (error) {
- console.error('Error deleting thread:', error);
+ console.error('Error deleting thread:', error)
return {
success: false,
message: 'Failed to delete thread',
- error: error instanceof Error ? error.message : 'An unknown error occurred'
- };
+ error:
+ error instanceof Error ? error.message : 'An unknown error occurred'
+ }
}
}
const loadUnapprovedThreads = async () => {
try {
if (!jwt) {
- toast.error('Authentication required');
- return;
- }
- const unapprovedThreads = await getUnapprovedThreads({ jwt });
- setThreads(unapprovedThreads);
+ customSonner({ type: 'error', text: 'Authentication required' })
+ return
+ }
+ const unapprovedThreads = await getUnapprovedThreads({ jwt })
+ setThreads(unapprovedThreads)
} catch (error) {
- console.error('Error fetching unapproved threads:', error);
+ console.error('Error fetching unapproved threads:', error)
}
}
- const handleToggleAdminMode = async() => {
- if(!isAdminMode){
- await loadUnapprovedThreads();
- }else{
- await getThreadForUser();
+ const handleToggleAdminMode = async () => {
+ if (!isAdminMode) {
+ await loadUnapprovedThreads()
+ } else {
+ await getThreadForUser()
}
-
- setIsAdminMode(!isAdminMode);
+
+ setIsAdminMode(!isAdminMode)
}
const adminApproveThread = async (threadId: string) => {
try {
- if (!session || !jwt) {
- toast.error('User session not found. Please log in again.');
- return;
- }
+ if (!session || !jwt) {
+ customSonner({ type: 'error', text: 'User session not found. Please log in again.' })
+ return
+ }
await approveThread({
threadId,
jwt
})
- toast.success('Thread approved successfully.')
- await loadUnapprovedThreads();
+ customSonner({ type: 'success', text: 'Thread approved successfully.' })
+ await loadUnapprovedThreads()
} catch (error) {
console.error('Error approving thread:', error)
- toast.error('Failed to approve thread. Please try again.')
+ customSonner({ type: 'error', text: 'Failed to approve thread. Please try again.' })
}
}
-
-
-
-
return (
-
+
{children}
- );
-}
\ No newline at end of file
+ )
+}
diff --git a/apps/masterbots.ai/lib/hooks/useSonner.tsx b/apps/masterbots.ai/lib/hooks/useSonner.tsx
new file mode 100644
index 00000000..df421d6c
--- /dev/null
+++ b/apps/masterbots.ai/lib/hooks/useSonner.tsx
@@ -0,0 +1,100 @@
+import { cn } from '@/lib/utils'
+import { Check, Info, AlertTriangle, X } from 'lucide-react'
+import { toast } from 'sonner'
+
+export type customSonnerProps = {
+ type?: 'success' | 'error' | 'info'
+ text?: string | null
+}
+
+/**
+ * Custom hook for displaying toast notifications with predefined styles.
+ *
+ * @returns {Object} An object containing the `customSonner` function for displaying notifications.
+ * @returns {function} customSonner - Function to display styled toast notifications.
+ */
+
+/**
+ * Creates a custom notification based on the provided configuration.
+ *
+ * @param {customSonnerProps} options - Configuration for the notification.
+ * @returns {import('sonner').ToastT} The created toast instance.
+ *
+ * @example
+ * // Import the hook
+ * import { useSonner } from '@/lib/hooks/useSonner';
+ *
+ * const { customSonner } = useSonner();
+ *
+ * // Trigger a success notification
+ * customSonner({ type: 'success', text: 'Operation completed successfully!' });
+ *
+ * // Default texts for each type:
+ * // Success: "Changes and been applied successfully"
+ * // Error: "Failed to update the information. Please try again"
+ * // Info: "Your changes has been applied 5 minutes ago."
+ */
+
+export function useSonner() {
+ const customSonner = ({ type = 'success', text }: customSonnerProps) => {
+ const toastConfigs = {
+ success: {
+ title: 'Success',
+ text: text ?? 'Changes and been applied successfully',
+ button: ,
+ icon:
+ },
+ error: {
+ title: 'Error',
+ text: text ?? 'Failed to update the information. Please try again',
+ button: 'Retry',
+ icon:
+ },
+ info: {
+ title: 'Changes applied',
+ text: text ?? 'Your changes has been applied 5 minutes ago.',
+ button: 'Undo',
+ icon:
+ }
+ }
+
+ return toast.custom(t => {
+ const config = toastConfigs[type]
+ return (
+
+
+ {config.icon}
+
+ {config.title}
+
+
+
+ {config.text}
+
+
+
+ toast.dismiss(t)}
+ >
+ {config.button}
+
+
+
+ )
+ })
+ }
+
+ return { customSonner }
+}
+const styles = {
+ success: 'border-[#83E56A]',
+ error: 'border-[#F93333]',
+ info: 'border-[#388DE2]'
+}
diff --git a/apps/masterbots.ai/lib/metadata.ts b/apps/masterbots.ai/lib/metadata.ts
index 1a7cd0e7..a1961034 100644
--- a/apps/masterbots.ai/lib/metadata.ts
+++ b/apps/masterbots.ai/lib/metadata.ts
@@ -119,3 +119,21 @@ export async function generateMbMetadata({
}
}
}
+
+
+export const defaultContent = {
+ thread: {
+ chatbot: {
+ name: 'Masterbots',
+ avatar: null,
+ categories: [{ category: { name: 'AI' } }]
+ }
+ },
+ question:
+ 'Elevating AI Beyond ChatGPT: Specialized Chatbots, Social Sharing and User-Friendly Innovation',
+ answer:
+ 'Elevating AI Beyond ChatGPT: Specialized Chatbots, Social Sharing and User-Friendly Innovation',
+ username: 'Masterbots',
+ user_avatar: '',
+ isLightTheme: false
+}
\ No newline at end of file
diff --git a/apps/masterbots.ai/lib/threads.ts b/apps/masterbots.ai/lib/threads.ts
index 6fe4658f..3c9320a8 100644
--- a/apps/masterbots.ai/lib/threads.ts
+++ b/apps/masterbots.ai/lib/threads.ts
@@ -2,6 +2,7 @@ import { extractBetweenMarkers } from '@/lib/utils'
import type * as AI from 'ai'
import type { Message, Thread } from 'mb-genql'
import { toSlug } from 'mb-lib'
+import { urlBuilders } from './url'
export interface MessagePair {
userMessage: Message | AI.Message
diff --git a/apps/masterbots.ai/lib/url.ts b/apps/masterbots.ai/lib/url.ts
index 8e1e6355..20467391 100644
--- a/apps/masterbots.ai/lib/url.ts
+++ b/apps/masterbots.ai/lib/url.ts
@@ -1,5 +1,5 @@
-import { z, ZodSchema } from 'zod'
import { toSlug } from 'mb-lib'
+import { type ZodSchema, z } from 'zod'
// Zod schema for validating slug strings
export const SlugSchema: ZodSchema = z
@@ -7,7 +7,6 @@ export const SlugSchema: ZodSchema = z
.min(1)
.regex(/^[a-z0-9]+[a-z0-9+_-]*[a-z0-9]+$/, 'Invalid slug format.')
-
//Encodes a string for use in a URL, replacing spaces with the '+' character.
export const encodeQuery = (input: string): string => {
return encodeURIComponent(input).replace(/%20/g, '+').replace(/ /g, '+')
@@ -19,81 +18,79 @@ export const decodeQuery = (input: string): string => {
return decodeURIComponent(input.replace(/\+/g, ' '))
}
-
interface ThreadUrlParams {
- slug?: string;
- category?: string;
- chatbot?: string;
- threadId?: string;
+ slug?: string
+ category?: string
+ chatbot?: string
+ threadId?: string
}
interface ProfileUrlParams {
- slug?: string;
- category?: string;
- chatbot?: string;
+ slug?: string
+ category?: string
+ chatbot?: string
}
interface UserProfileParams {
- userSlug?: string;
+ userSlug?: string
}
export const urlBuilders = {
threadUrl: (params: ThreadUrlParams): string => {
try {
- const { slug, category, chatbot, threadId } = params;
+ const { slug, category, chatbot, threadId } = params
if (!slug || !category || !chatbot || !threadId) {
const missing = Object.entries(params)
.filter(([_, value]) => !value)
.map(([key]) => key)
- .join(', ');
-
- console.error(`Missing required parameters for thread URL: ${missing}`);
- return '/';
+ .join(', ')
+
+ console.error(`Missing required parameters for thread URL: ${missing}`)
+ return '/'
}
- return `/u/${encodeURIComponent(slug)}/t/${toSlug(category)}/${toSlug(chatbot)}/${threadId}`;
+ return `/u/${encodeURIComponent(slug)}/t/${toSlug(category)}/${toSlug(chatbot)}/${threadId}`
} catch (error) {
- console.error('Error constructing thread URL:', error);
- return '/';
+ console.error('Error constructing thread URL:', error)
+ return '/'
}
},
userChatbotUrl: (params: ProfileUrlParams): string => {
try {
- const { slug, category, chatbot } = params;
+ const { slug, category, chatbot } = params
if (!slug || !category || !chatbot) {
const missing = Object.entries(params)
.filter(([_, value]) => !value)
.map(([key]) => key)
- .join(', ');
-
- console.error(`Missing required parameters for profile URL: ${missing}`);
- return '/';
+ .join(', ')
+
+ console.error(`Missing required parameters for profile URL: ${missing}`)
+ return '/'
}
- return `/u/${encodeURIComponent(slug)}/t/${toSlug(category)}/${chatbot.toLowerCase()}`;
+ return `/u/${encodeURIComponent(slug)}/t/${toSlug(category)}/${toSlug(chatbot)}`
} catch (error) {
- console.error('Error constructing profile URL:', error);
- return '/';
+ console.error('Error constructing profile URL:', error)
+ return '/'
}
},
userProfileUrl: (params: UserProfileParams): string => {
try {
- const { userSlug } = params;
+ const { userSlug } = params
if (!userSlug) {
- console.error('Missing user slug for profile URL');
- return '/';
+ console.error('Missing user slug for profile URL')
+ return '/'
}
- return `/u/${encodeURIComponent(userSlug)}/t`;
+ return `/u/${encodeURIComponent(userSlug)}/t`
} catch (error) {
- console.error('Error constructing user profile URL:', error);
- return '/';
+ console.error('Error constructing user profile URL:', error)
+ return '/'
}
},
-};
-
+}
diff --git a/apps/masterbots.ai/lib/utils.ts b/apps/masterbots.ai/lib/utils.ts
index c6c30628..e0723a68 100644
--- a/apps/masterbots.ai/lib/utils.ts
+++ b/apps/masterbots.ai/lib/utils.ts
@@ -1,7 +1,7 @@
import { cleanPrompt } from '@/lib/helpers/ai-helpers'
import type { Message as AIMessage } from 'ai/react'
import { type ClassValue, clsx } from 'clsx'
-import type { Message } from 'mb-genql'
+import type { Message, SocialFollowing } from 'mb-genql'
import { customAlphabet } from 'nanoid'
import type { ReactNode } from 'react'
import { twMerge } from 'tailwind-merge'
@@ -12,13 +12,10 @@ export function cn(...inputs: ClassValue[]) {
export const nanoid = customAlphabet(
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
- 7
+ 7,
) // 7-character random string
-export async function fetcher(
- input: RequestInfo,
- init?: RequestInit
-): Promise {
+export async function fetcher(input: RequestInfo, init?: RequestInit): Promise {
const res = await fetch(input, init)
if (!res.ok) {
@@ -29,16 +26,16 @@ export async function fetcher(
}
error.status = res.status
throw error
- } else {
- throw new Error('An unexpected error occurred')
}
+
+ throw new Error('An unexpected error occurred')
}
return res.json()
}
export function delayFetch(ms = 200) {
- return new Promise(resolve => {
+ return new Promise((resolve) => {
const timeout = setTimeout(() => {
clearTimeout(timeout)
resolve(true)
@@ -51,19 +48,17 @@ export function formatDate(input: string | number | Date): string {
return date.toLocaleDateString('en-US', {
month: 'long',
day: 'numeric',
- year: 'numeric'
+ year: 'numeric',
})
}
export function extractBetweenMarkers(
str: string,
startMarker: string,
- endMarker?: string // endMarker is now optional
+ endMarker?: string, // endMarker is now optional
): string {
let startIndex = str.indexOf(startMarker)
- const endIndex = endMarker
- ? str.indexOf(endMarker, startIndex + startMarker.length)
- : str.length
+ const endIndex = endMarker ? str.indexOf(endMarker, startIndex + startMarker.length) : str.length
if (startIndex === -1) {
// Start marker not found, return the whole string
@@ -95,14 +90,13 @@ export function createMessagePairs(messages: Message[] | AIMessage[]) {
const chatGptMessage = findNextAssistantMessage(messages, j)
if (!chatGptMessage) {
break
- } else {
- chatGptMessages.push(chatGptMessage)
- continue
}
+ chatGptMessages.push(chatGptMessage)
+ break
}
messagePairs.push({
userMessage,
- chatGptMessage: chatGptMessages
+ chatGptMessage: chatGptMessages,
})
}
}
@@ -110,14 +104,11 @@ export function createMessagePairs(messages: Message[] | AIMessage[]) {
return messagePairs
}
-const findNextAssistantMessage = (
- messages: Message[] | AIMessage[],
- startIndex: number
-) => {
+const findNextAssistantMessage = (messages: Message[] | AIMessage[], startIndex: number) => {
if (messages[startIndex]?.role === 'assistant') {
return {
...messages[startIndex],
- content: cleanPrompt(messages[startIndex].content)
+ content: cleanPrompt(messages[startIndex].content),
}
}
return null
@@ -160,7 +151,7 @@ export const scrollToBottomOfElement = (element?: HTMLElement) => {
elapsed,
element.scrollTop,
targetScroll - element.scrollTop,
- duration
+ duration,
)
element.scrollTop = position
@@ -175,7 +166,7 @@ export const scrollToBottomOfElement = (element?: HTMLElement) => {
}
export async function sleep(time: number) {
- return new Promise(resolve => setTimeout(resolve, time))
+ return new Promise((resolve) => setTimeout(resolve, time))
}
export const plans = [
@@ -184,18 +175,15 @@ export const plans = [
duration: 'monthly',
price: 4.5,
features_title: 'Everything from Free plan plus:',
- features: ['Access to our Professional tools']
+ features: ['Access to our Professional tools'],
},
{
id: 'yearly',
duration: 'yearly',
price: 3.99,
features_title: 'Everything from Monthly plan plus: ',
- features: [
- '11% of discount every month.',
- 'Access to pre-release content to chat with.'
- ]
- }
+ features: ['11% of discount every month.', 'Access to pre-release content to chat with.'],
+ },
]
export function getDate(timestamp: number) {
@@ -207,7 +195,7 @@ export function getDate(timestamp: number) {
}
const options: Intl.DateTimeFormatOptions = {
month: 'long',
- day: 'numeric'
+ day: 'numeric',
}
const dateString = date.toLocaleString('en-US', options)
@@ -218,7 +206,7 @@ export function getCurrentOrTargetDate() {
const today = new Date()
return today.toLocaleDateString('en-US', {
month: 'long',
- day: 'numeric'
+ day: 'numeric',
})
}
@@ -260,7 +248,7 @@ export const UNIQUE_PHRASES = [
'Unique Recommendation',
'Lesser-Known Gem',
'For a UNIQUE, LESSER-KNOWN phrase',
- 'Unique, Lesser-Known Destination'
+ 'Unique, Lesser-Known Destination',
] as const
export interface ParsedText {
@@ -295,9 +283,7 @@ export function parseClickableText(fullText: string): ParsedText {
// Check for unique phrase match first
if (uniqueMatch) {
const clickableText = uniqueMatch[1]
- const restText = fullText.slice(
- fullText.indexOf(clickableText) + clickableText.length
- )
+ const restText = fullText.slice(fullText.indexOf(clickableText) + clickableText.length)
return { clickableText, restText }
}
@@ -306,15 +292,72 @@ export function parseClickableText(fullText: string): ParsedText {
if (generalMatch) {
return {
clickableText: generalMatch[0],
- restText: fullText.slice(generalMatch[0].length)
+ restText: fullText.slice(generalMatch[0].length),
}
}
return {
clickableText: '',
- restText: fullText
+ restText: fullText,
}
}
export function cleanClickableText(text: string): string {
return text.replace(/(:|\.|\,)\s*$/, '')
}
+
+export const formatNumber = (num: number) => {
+ const lookup = [
+ { value: 1e9, symbol: 'B' },
+ { value: 1e6, symbol: 'M' },
+ { value: 1e3, symbol: 'K' },
+ ]
+
+ // Handle negative numbers
+ const isNegative = num < 0
+ const absNum = Math.abs(num)
+
+ // Find the appropriate suffix
+ const item = lookup.find((item) => absNum >= item.value)
+
+ if (!item) {
+ // If number is smaller than 1000, return as is
+ return isNegative ? `-${absNum}` : absNum.toString()
+ }
+
+ // Calculate the formatted value with one decimal place
+ const formattedValue = (absNum / item.value).toFixed(1)
+
+ // Remove .0 if it exists
+ const cleanValue = formattedValue.replace('.0', '')
+
+ return `${isNegative ? '-' : ''}${cleanValue}${item.symbol}`
+}
+
+interface IProps {
+ followers: readonly SocialFollowing[] | undefined | null
+ userId: string
+}
+export const isFollowed = ({ followers, userId }: IProps): boolean => {
+ return Boolean(followers?.some((follower) => follower.followerId === userId))
+}
+/**
+ * Short the large numbers to a more friendly format. Examples: 670, 3.2k, 1.22m, 3.445b
+ * **/
+export function numberShortener(number: number): string {
+ if (number < 1000) return number.toString()
+ if (number < 1000000) return (number / 1000).toFixed(1) + 'k'
+ if (number < 1000000000) return (number / 1000000).toFixed(2) + 'm'
+ return (number / 1000000000).toFixed(3) + 'b'
+}
+
+/**
+ * Determines the route type based on the pathname
+ * @param pathname - The current pathname from Next.js usePathname()
+ * @returns 'chat' | 'public' | ''
+ */
+export function getRouteType(pathname: string | null): 'chat' | 'public' | '' {
+ if (!pathname) return ''
+ if (pathname.startsWith('/c')) return 'chat'
+ if (pathname.startsWith('/')) return 'public'
+ return ''
+}
\ No newline at end of file
diff --git a/apps/masterbots.ai/package.json b/apps/masterbots.ai/package.json
index c5f9b62d..e6ba74d6 100644
--- a/apps/masterbots.ai/package.json
+++ b/apps/masterbots.ai/package.json
@@ -33,7 +33,7 @@
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.1",
- "@radix-ui/react-tooltip": "^1.1.3",
+ "@radix-ui/react-tooltip": "^1.1.6",
"@stripe/react-stripe-js": "^2.8.1",
"@stripe/stripe-js": "^3.5.0",
"@vercel/analytics": "^1.3.2",
@@ -51,22 +51,21 @@
"geist": "^1.3.1",
"lodash": "^4.17.21",
"lottie-react": "^2.4.0",
- "lucide-react": "^0.297.0",
+ "lucide-react": "^0.473.0",
"mb-env": "workspace:*",
"mb-genql": "workspace:*",
"mb-lib": "workspace:*",
"mb-types": "workspace:*",
- "nanoid": "latest",
+ "nanoid": "^3.3.6",
"next": "^14.2.17",
"next-auth": "^4.24.10",
- "next-themes": "^0.2.1",
+ "next-themes": "^0.4.4",
"nextjs-toploader": "^1.6.12",
"nodemailer": "^6.9.16",
"openai": "4.57.0",
"react": "^18.3.1",
"react-day-picker": "^8.10.1",
"react-dom": "^18.3.1",
- "react-hot-toast": "^2.4.1",
"react-intersection-observer": "^9.13.1",
"react-markdown": "^8.0.7",
"react-syntax-highlighter": "^15.6.1",
@@ -75,6 +74,7 @@
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"resend": "^3.5.0",
+ "sonner": "^1.7.1",
"stripe": "^15.12.0",
"zod": "^3.23.8"
},
@@ -82,7 +82,6 @@
"@tailwindcss/typography": "^0.5.15",
"@types/bcrypt": "^5.0.2",
"@types/lodash": "^4.17.13",
- "@types/node": "^20.17.6",
"@types/nodemailer": "^6.4.16",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
@@ -93,7 +92,7 @@
"eslint-config-next": "14.0.3",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-tailwindcss": "^3.17.5",
- "postcss": "latest",
+ "postcss": "^8.4.31",
"prettier": "^3.3.3",
"tailwind-merge": "^2.5.4",
"tailwindcss": "^3.4.14",
@@ -101,4 +100,4 @@
"typescript": "^5.7.2"
},
"packageManager": "pnpm@8.6.3"
-}
\ No newline at end of file
+}
diff --git a/apps/masterbots.ai/services/hasura/hasura.service.ts b/apps/masterbots.ai/services/hasura/hasura.service.ts
index 10b51eb3..ea6144ba 100755
--- a/apps/masterbots.ai/services/hasura/hasura.service.ts
+++ b/apps/masterbots.ai/services/hasura/hasura.service.ts
@@ -1,25 +1,23 @@
import { processWithAi } from '@/app/actions'
import { AIModels } from '@/app/api/chat/models/models'
-import {
- createChatbotMetadataPrompt,
- setDefaultPrompt
-} from '@/lib/constants/prompts'
+import { createChatbotMetadataPrompt, setDefaultPrompt } from '@/lib/constants/prompts'
import { cleanResult } from '@/lib/helpers/ai-helpers'
import type {
AiClientType,
ChatbotMetadataHeaders,
- ReturnFetchChatbotMetadata
+ ReturnFetchChatbotMetadata,
} from '@/types/types'
import { validateMbEnv } from 'mb-env'
import {
type Category,
type Chatbot,
type LabelChatbotCategory,
+ type MbClient,
type Message,
type Thread,
type User,
createMbClient,
- everything
+ everything,
} from 'mb-genql'
import type {
CreateThreadParams,
@@ -32,7 +30,7 @@ import type {
GetThreadsParams,
SaveNewMessageParams,
UpdateUserArgs,
- UpsertUserParams
+ UpsertUserParams,
} from './hasura.service.type'
function getHasuraClient({ jwt, adminSecret }: GetHasuraClientParams) {
@@ -40,7 +38,7 @@ function getHasuraClient({ jwt, adminSecret }: GetHasuraClientParams) {
jwt,
adminSecret,
debug: process.env.DEBUG === 'true',
- env: validateMbEnv(process.env.NEXT_PUBLIC_APP_ENV)
+ env: validateMbEnv(process.env.NEXT_PUBLIC_APP_ENV),
})
}
@@ -50,15 +48,20 @@ export async function getCategories() {
category: {
chatbots: {
chatbot: {
- ...everything
+ followers: {
+ followeeId: true,
+ followerId: true,
+ followeeIdChatbot: true,
+ },
+ ...everything,
},
- ...everything
+ ...everything,
},
...everything,
__args: {
- limit: 20
- }
- }
+ limit: 20,
+ },
+ },
})
return category as Category[]
@@ -69,39 +72,35 @@ export async function getCategory({ categoryId }: { categoryId: number }) {
const { category } = await client.query({
category: {
__args: {
- where: { categoryId: { _eq: categoryId } }
+ where: { categoryId: { _eq: categoryId } },
},
name: true,
- categoryId: true
- }
+ categoryId: true,
+ },
})
return category[0] as Category
}
-export async function getChatbots({
- limit,
- offset,
- categoryId
-}: GetChatbotsParams) {
+export async function getChatbots({ limit, offset, categoryId }: GetChatbotsParams) {
const client = getHasuraClient({})
const { chatbot } = await client.query({
chatbot: {
threads: {
- threadId: true
+ threadId: true,
},
categories: {
categoryId: true,
category: {
- name: true
- }
+ name: true,
+ },
},
...everything,
__args: {
limit: limit ? limit : 20,
...(offset
? {
- offset
+ offset,
}
: {}),
...(categoryId
@@ -109,14 +108,14 @@ export async function getChatbots({
where: {
categories: {
categoryId: {
- _eq: categoryId
- }
- }
- }
+ _eq: categoryId,
+ },
+ },
+ },
}
- : {})
- }
- }
+ : {}),
+ },
+ },
})
return chatbot as Chatbot[]
@@ -128,7 +127,7 @@ export async function getThreads({
userId,
limit,
offset,
- categoryId
+ categoryId,
}: GetThreadsParams) {
const client = getHasuraClient({ jwt })
@@ -138,23 +137,23 @@ export async function getThreads({
...everything,
categories: {
category: {
- ...everything
+ ...everything,
},
- ...everything
+ ...everything,
},
threads: {
- threadId: true
+ threadId: true,
},
prompts: {
- prompt: everything
- }
+ prompt: everything,
+ },
},
messages: {
...everything,
__args: {
orderBy: [{ createdAt: 'ASC' }],
- limit: 2
- }
+ limit: 2,
+ },
},
isApproved: true,
isPublic: true,
@@ -164,7 +163,7 @@ export async function getThreads({
limit: limit ? limit : 20,
...(offset
? {
- offset
+ offset,
}
: {}),
...(chatbotName || categoryId
@@ -173,27 +172,25 @@ export async function getThreads({
chatbot: {
...(chatbotName
? {
- name: { _eq: chatbotName }
+ name: { _eq: chatbotName },
}
: {}),
- ...(categoryId
- ? { categories: { categoryId: { _eq: categoryId } } }
- : {})
+ ...(categoryId ? { categories: { categoryId: { _eq: categoryId } } } : {}),
},
- ...(userId ? { userId: { _eq: userId } } : {})
- }
+ ...(userId ? { userId: { _eq: userId } } : {}),
+ },
}
: userId
? { where: { userId: { _eq: userId } } }
- : {})
- }
- }
+ : {}),
+ },
+ },
})
return thread as Thread[]
}
-export async function getThread({ threadId, jwt }: GetThreadParams) {
+export async function getThread({ threadId, jwt }: Partial) {
let client = getHasuraClient({})
if (jwt) client = getHasuraClient({ jwt })
const { thread } = await client.query({
@@ -202,54 +199,49 @@ export async function getThread({ threadId, jwt }: GetThreadParams) {
...everything,
categories: {
category: {
- ...everything
+ ...everything,
},
- ...everything
+ ...everything,
},
threads: {
- threadId: true
+ threadId: true,
},
prompts: {
- prompt: everything
- }
+ prompt: everything,
+ },
},
user: {
username: true,
- profilePicture: true
+ profilePicture: true,
},
messages: {
...everything,
__args: {
- orderBy: [{ createdAt: 'ASC' }]
- }
+ orderBy: [{ createdAt: 'ASC' }],
+ },
},
...everything,
__args: {
- where: { threadId: { _eq: threadId } }
- }
- }
+ where: { threadId: { _eq: threadId } },
+ },
+ },
})
-
return thread[0] as Thread
}
-export async function saveNewMessage({ jwt, ...object }: SaveNewMessageParams) {
+export async function saveNewMessage({ jwt, ...object }: Partial) {
const client = getHasuraClient({ jwt })
await client.mutation({
insertMessageOne: {
__args: {
- object
+ object,
},
- ...everything
- }
+ ...everything,
+ },
})
}
-export async function upsertUser({
- adminSecret,
- username,
- ...object
-}: UpsertUserParams) {
+export async function upsertUser({ adminSecret, username, ...object }: UpsertUserParams) {
const client = getHasuraClient({ adminSecret })
// Generate base slug from the user's name
@@ -262,11 +254,11 @@ export async function upsertUser({
const { user } = await client.query({
user: {
__args: {
- where: { slug: { _eq: slug } }
+ where: { slug: { _eq: slug } },
},
slug: true,
- email: true
- }
+ email: true,
+ },
})
if (!user?.length || user[0]?.email === object.email) {
// Found a unique slug
@@ -282,15 +274,15 @@ export async function upsertUser({
object: {
username,
slug,
- ...object
+ ...object,
},
onConflict: {
constraint: 'user_email_key',
- updateColumns: ['profilePicture']
- }
+ updateColumns: ['profilePicture'],
+ },
},
- ...everything
- }
+ ...everything,
+ },
})
return insertUserOne as User
@@ -301,44 +293,38 @@ export async function createThread({
threadId,
jwt,
userId,
- isPublic = true
-}: CreateThreadParams) {
+ isPublic = true,
+}: Partial) {
const client = getHasuraClient({ jwt })
const { insertThreadOne } = await client.mutation({
insertThreadOne: {
__args: {
- object: { threadId, chatbotId, userId, isPublic }
+ object: { threadId, chatbotId, userId, isPublic },
},
- threadId: true
- }
+ threadId: true,
+ },
})
return insertThreadOne?.threadId as string
}
-export async function getChatbot({
- chatbotId,
- chatbotName,
- threads,
- jwt
-}: GetChatbotParams) {
- if (!chatbotId && !chatbotName)
- throw new Error('You need to pass chatbotId or chatbotName')
+export async function getChatbot({ chatbotId, chatbotName, threads, jwt }: GetChatbotParams) {
+ if (!chatbotId && !chatbotName) throw new Error('You need to pass chatbotId or chatbotName')
let client = getHasuraClient({})
if (jwt) client = getHasuraClient({ jwt })
const { chatbot } = await client.query({
chatbot: {
__args: {
- where: { name: { _eq: chatbotName } }
+ where: { name: { _eq: chatbotName } },
},
...everything,
categories: {
category: {
- ...everything
+ ...everything,
},
- ...everything
+ ...everything,
},
prompts: {
- prompt: everything
+ prompt: everything,
},
...(threads
? {
@@ -347,13 +333,13 @@ export async function getChatbot({
messages: {
...everything,
__args: {
- orderBy: [{ createdAt: 'ASC' }]
- }
- }
- }
+ orderBy: [{ createdAt: 'ASC' }],
+ },
+ },
+ },
}
- : {})
- }
+ : {}),
+ },
})
return chatbot[0] as Chatbot
@@ -368,80 +354,89 @@ export async function getBrowseThreads({
userId,
limit,
offset,
- slug
+ slug,
+ followedUserId,
}: GetBrowseThreadsParams) {
const client = getHasuraClient({})
- const { thread } = await client.query({
+ const baseWhereConditions = {
+ ...(categoryId
+ ? {
+ chatbot: {
+ categories: {
+ categoryId: { _eq: categoryId },
+ },
+ },
+ }
+ : {}),
+ ...(categoriesId
+ ? {
+ chatbot: {
+ categories: {
+ categoryId: { _in: categoriesId },
+ },
+ },
+ }
+ : {}),
+ ...(chatbotName
+ ? {
+ chatbot: {
+ name: { _eq: chatbotName },
+ },
+ }
+ : {}),
+ ...(chatbotsId
+ ? {
+ chatbot: {
+ chatbotId: { _in: chatbotsId },
+ },
+ }
+ : {}),
+ ...(userId
+ ? {
+ userId: {
+ _eq: userId,
+ },
+ }
+ : {}),
+ ...(slug
+ ? {
+ user: {
+ slug: {
+ _eq: slug,
+ },
+ },
+ }
+ : {}),
+ isPublic: { _eq: true },
+ isApproved: { _eq: true },
+ }
+
+ const { thread: allThreads } = await client.query({
thread: {
__args: {
orderBy: [{ createdAt: 'DESC' }],
- where: {
- ...(categoryId
- ? {
- chatbot: {
- categories: {
- categoryId: { _eq: categoryId }
- }
- }
- }
- : {}),
- ...(categoriesId
- ? {
- chatbot: {
- categories: {
- categoryId: { _in: categoriesId }
- }
- }
- }
- : {}),
- ...(chatbotName
- ? {
- chatbot: {
- name: { _eq: chatbotName }
- }
- }
- : {}),
- ...(chatbotsId
- ? {
- chatbot: {
- chatbotId: { _in: chatbotsId }
- }
- }
- : {}),
- ...(userId
- ? {
- userId: {
- _eq: userId
- }
- }
- : {}),
- ...(slug
- ? {
- user: {
- slug: {
- _eq: slug
- }
- }
- }
- : {}),
- isPublic: { _eq: true },
- isApproved: { _eq: true }
- },
- limit: limit || 30,
- offset: offset || 0
+ where: baseWhereConditions,
+ limit: (limit || 30) * 2,
+ offset: offset || 0,
},
+ threadId: true,
chatbot: {
+ chatbotId: true,
+ name: true,
categories: {
category: {
- ...everything
+ ...everything,
},
- ...everything
+ ...everything,
+ },
+ followers: {
+ followerId: true,
},
threads: {
- threadId: true
+ threadId: true,
},
- ...everything
+ ...everything,
},
messages: {
...everything,
@@ -450,44 +445,92 @@ export async function getBrowseThreads({
...(keyword
? {
where: {
- _or: [
- {
- content: {
- _iregex: keyword
- }
- },
- {
- content: {
- _eq: keyword
- }
- }
- ]
- }
+ _or: [{ content: { _iregex: keyword } }, { content: { _eq: keyword } }],
+ },
}
: ''),
- limit: 2
- }
+ limit: 2,
+ },
},
user: {
username: true,
profilePicture: true,
- slug: true
+ slug: true,
+ followers: {
+ followerId: true,
+ },
},
isApproved: true,
isPublic: true,
- ...everything
+ userId: true,
+ ...everything,
+ },
+ })
+
+ if (!allThreads) return []
+
+ const threads = allThreads as Thread[]
+
+ // Separate following content (both from followed bots and users)
+ const followingThreads = threads.filter((thread) => {
+ if (followedUserId) {
+ // Exclude user's own posts
+ if (thread.userId === followedUserId) {
+ return false
+ }
+
+ // For bot content
+ const isFollowingBot = thread.chatbot?.followers?.some((follower) => {
+ return follower.followerId === followedUserId
+ })
+
+ // For user content
+ const isFollowingUser = thread.user?.followers?.some((follower) => {
+ return follower.followerId === followedUserId
+ })
+
+ return isFollowingBot || isFollowingUser
}
+ return false
})
- return thread as Thread[]
+ // Organic content (neither from followed bots nor followed users)
+ const organicThreads = threads.filter(
+ (thread) =>
+ !thread.chatbot?.followers?.some((follower) => follower.followerId === followedUserId) &&
+ !thread.user?.followers?.some((follower) => follower.followerId === followedUserId),
+ )
+
+ const interweavedThreads: Thread[] = []
+ let followingIndex = 0
+ let organicIndex = 0
+
+ while (
+ (followingIndex < followingThreads.length || organicIndex < organicThreads.length) &&
+ interweavedThreads.length < (limit || 30)
+ ) {
+ // Add up to 4 following threads
+ for (
+ let i = 0;
+ i < 4 &&
+ followingIndex < followingThreads.length &&
+ interweavedThreads.length < (limit || 30);
+ i++
+ ) {
+ interweavedThreads.push(followingThreads[followingIndex])
+ followingIndex++
+ }
+
+ // Add 1 organic thread if available
+ if (organicIndex < organicThreads.length && interweavedThreads.length < (limit || 30)) {
+ interweavedThreads.push(organicThreads[organicIndex])
+ organicIndex++
+ }
+ }
+ return interweavedThreads
}
-export async function getMessages({
- threadId,
- limit,
- offset,
- jwt
-}: GetMessagesParams) {
+export async function getMessages({ threadId, limit, offset, jwt }: GetMessagesParams) {
let client = getHasuraClient({})
if (jwt) client = getHasuraClient({ jwt })
const { message } = await client.query({
@@ -498,29 +541,26 @@ export async function getMessages({
orderBy: [{ createdAt: 'ASC' }],
...(limit
? {
- limit
+ limit,
}
: {}),
...(offset
? {
- offset
+ offset,
}
- : {})
- }
- }
+ : {}),
+ },
+ },
})
return message as Message[]
}
-export async function getChatbotsCount({
- categoryId,
- jwt
-}: GetChatbotsParams & { jwt: string }) {
+export async function getChatbotsCount({ categoryId, jwt }: GetChatbotsParams & { jwt: string }) {
const client = getHasuraClient({ jwt })
const { chatbotAggregate } = await client.query({
chatbotAggregate: {
aggregate: {
- count: true
+ count: true,
},
__args: {
...(categoryId
@@ -528,18 +568,16 @@ export async function getChatbotsCount({
where: {
categories: {
categoryId: {
- _eq: categoryId
- }
- }
- }
+ _eq: categoryId,
+ },
+ },
+ },
}
- : {})
- }
- }
+ : {}),
+ },
+ },
})
- return chatbotAggregate.aggregate?.count
- ? chatbotAggregate.aggregate.count
- : 0
+ return chatbotAggregate.aggregate?.count ? chatbotAggregate.aggregate.count : 0
}
export async function getUserInfoFromBrowse(slug: string) {
@@ -551,11 +589,11 @@ export async function getUserInfoFromBrowse(slug: string) {
__args: {
where: {
slug: {
- _eq: slug
- }
- }
- }
- }
+ _eq: slug,
+ },
+ },
+ },
+ },
})
return user[0]
}
@@ -567,16 +605,16 @@ export async function getThreadsWithoutJWT() {
chatbot: {
categories: {
category: {
- name: true
- }
+ name: true,
+ },
},
- name: true
+ name: true,
},
...everything,
__args: {
- orderBy: [{ createdAt: 'DESC' }]
- }
- }
+ orderBy: [{ createdAt: 'DESC' }],
+ },
+ },
})
return thread as Thread[]
@@ -586,8 +624,8 @@ export async function getUsers() {
const client = getHasuraClient({})
const { user } = await client.query({
user: {
- slug: true
- }
+ slug: true,
+ },
})
return user as User[]
}
@@ -595,7 +633,7 @@ export async function getUsers() {
export async function UpdateThreadVisibility({
threadId,
isPublic,
- jwt
+ jwt,
}: {
threadId: string
isPublic: boolean
@@ -607,11 +645,11 @@ export async function UpdateThreadVisibility({
updateThreadByPk: {
__args: {
pkColumns: { threadId },
- _set: { isApproved: true }
+ _set: { isApproved: true },
},
threadId: true,
- isApproved: true
- }
+ isApproved: true,
+ },
})
return { success: true }
} catch (error) {
@@ -621,7 +659,7 @@ export async function UpdateThreadVisibility({
export async function fetchChatbotMetadata({
chatbot,
- domain
+ domain,
}: ChatbotMetadataHeaders): Promise {
try {
const client = getHasuraClient({})
@@ -630,16 +668,16 @@ export async function fetchChatbotMetadata({
__args: {
where: {
chatbotId: { _eq: chatbot },
- categoryId: { _eq: domain }
- }
+ categoryId: { _eq: domain },
+ },
},
label: {
questions: true,
categories: true,
subCategories: true,
- tags: true
- }
- }
+ tags: true,
+ },
+ },
})
if (!chatbotMetadata[0]) {
@@ -656,7 +694,7 @@ export async function fetchChatbotMetadata({
export async function approveThread({
threadId,
- jwt
+ jwt,
}: {
threadId: string
jwt: string | undefined
@@ -667,11 +705,11 @@ export async function approveThread({
updateThreadByPk: {
__args: {
pkColumns: { threadId },
- _set: { isApproved: true }
+ _set: { isApproved: true },
},
threadId: true,
- isApproved: true
- }
+ isApproved: true,
+ },
})
return { success: true }
} catch (error) {
@@ -681,7 +719,7 @@ export async function approveThread({
}
export async function getUserRoleByEmail({
- email
+ email,
}: {
email: string | null | undefined
}) {
@@ -690,11 +728,11 @@ export async function getUserRoleByEmail({
const { user } = await client.query({
user: {
__args: {
- where: { email: { _eq: email } }
+ where: { email: { _eq: email } },
},
role: true,
- slug: true
- }
+ slug: true,
+ },
})
return { users: user as User[] }
} catch (error) {
@@ -706,7 +744,7 @@ export async function getUserRoleByEmail({
export async function deleteThread({
threadId,
jwt,
- userId
+ userId,
}: {
threadId: string
jwt: string | undefined
@@ -721,13 +759,13 @@ export async function deleteThread({
await client.mutation({
deleteThread: {
__args: {
- where: { threadId: { _eq: threadId }, userId: { _eq: userId } }
+ where: { threadId: { _eq: threadId }, userId: { _eq: userId } },
},
returning: {
- threadId: true
+ threadId: true,
},
- affectedRows: true
- }
+ affectedRows: true,
+ },
})
return { success: true }
@@ -748,34 +786,34 @@ export async function getUnapprovedThreads({ jwt }: { jwt: string }) {
__args: {
where: { isApproved: { _eq: false } },
orderBy: [{ createdAt: 'DESC' }],
- limit: 20
+ limit: 20,
},
chatbot: {
...everything,
categories: {
category: {
- ...everything
+ ...everything,
},
- ...everything
+ ...everything,
},
threads: {
- threadId: true
+ threadId: true,
},
prompts: {
- prompt: everything
- }
+ prompt: everything,
+ },
},
messages: {
...everything,
__args: {
orderBy: [{ createdAt: 'ASC' }],
- limit: 2
- }
+ limit: 2,
+ },
},
isApproved: true,
isPublic: true,
- ...everything
- }
+ ...everything,
+ },
})
return thread as Thread[]
@@ -783,7 +821,7 @@ export async function getUnapprovedThreads({ jwt }: { jwt: string }) {
export async function getUserBySlug({
slug,
- isSameUser
+ isSameUser,
}: {
slug: string
isSameUser: boolean
@@ -795,9 +833,9 @@ export async function getUserBySlug({
__args: {
where: {
slug: {
- _eq: slug
- }
- }
+ _eq: slug,
+ },
+ },
},
userId: true,
username: true,
@@ -810,44 +848,35 @@ export async function getUserBySlug({
where: isSameUser
? {}
: {
- _and: [
- { isApproved: { _eq: true } },
- { isPublic: { _eq: true } }
- ]
- }
+ _and: [{ isApproved: { _eq: true } }, { isPublic: { _eq: true } }],
+ },
},
threadId: true,
isApproved: true,
isPublic: true,
chatbot: {
- name: true
+ name: true,
},
messages: {
- content: true
- }
- }
- // followers: {
- // followeeId: true,
- // followerId: true,
- // userByFollowerId: {
- // username: true
- // }
- // },
- // follower: {
- // followeeId: true,
- // followerId: true,
- // userByFollowerId: {
- // username: true
- // }
- // },
- // following: {
- // followeeId: true,
- // followerId: true,
- // userByFollowerId: {
- // username: true
- // }
- // }
- }
+ content: true,
+ },
+ },
+ followers: {
+ followeeId: true,
+ followerId: true,
+ userByFollowerId: {
+ username: true,
+ },
+ },
+
+ following: {
+ followeeId: true,
+ followerId: true,
+ userByFollowerId: {
+ username: true,
+ },
+ },
+ },
} as const)
if (!user || user.length === 0) {
@@ -856,24 +885,24 @@ export async function getUserBySlug({
}
return {
user: user[0], // Return the first matching user
- error: null
+ error: null,
}
} catch (error) {
console.error('Error fetching user by username:', {
error,
slug,
- timestamp: new Date().toISOString()
+ timestamp: new Date().toISOString(),
})
if (error instanceof Error) {
return {
user: null,
- error: error.message || 'Failed to fetch user by username.'
+ error: error.message || 'Failed to fetch user by username.',
}
}
return {
user: null,
- error: 'An unexpected error occurred while fetching user.'
+ error: 'An unexpected error occurred while fetching user.',
}
}
}
@@ -883,7 +912,7 @@ export async function updateUserPersonality({
bio,
topic,
jwt,
- profilePicture
+ profilePicture,
}: {
userId: string | undefined
bio: string | null
@@ -900,13 +929,13 @@ export async function updateUserPersonality({
// Build update arguments based on non-null values
const updateArgs: UpdateUserArgs = {
- pkColumns: { userId }
+ pkColumns: { userId },
}
updateArgs._set = {
...(bio !== null && { bio }),
...(topic !== null && { favouriteTopic: topic }),
- ...(profilePicture !== null && { profilePicture })
+ ...(profilePicture !== null && { profilePicture }),
}
await client.mutation({
@@ -914,8 +943,8 @@ export async function updateUserPersonality({
__args: updateArgs,
userId: true,
bio: true,
- favouriteTopic: true
- }
+ favouriteTopic: true,
+ },
})
return { success: true }
@@ -928,23 +957,153 @@ export async function updateUserPersonality({
export async function subtractChatbotMetadataLabels(
metadataHeaders: ChatbotMetadataHeaders,
userPrompt: string,
- clientType: AiClientType
+ clientType: AiClientType,
) {
const chatbotMetadata = await fetchChatbotMetadata(metadataHeaders)
if (!chatbotMetadata) {
- console.error(
- 'Chatbot metadata not found. Generating response without them.'
- )
+ console.error('Chatbot metadata not found. Generating response without them.')
return setDefaultPrompt(userPrompt)
}
- const prompt = createChatbotMetadataPrompt(
- metadataHeaders,
- chatbotMetadata,
- userPrompt
- )
+ const prompt = createChatbotMetadataPrompt(metadataHeaders, chatbotMetadata, userPrompt)
const response = await processWithAi(prompt, clientType, AIModels.Default)
return cleanResult(response)
}
+
+const getFollowStatus = async (client: MbClient, followerId: string, followeeId: string) => {
+ const { socialFollowing } = await client.query({
+ socialFollowing: {
+ __args: {
+ where: { followerId: { _eq: followerId }, followeeId: { _eq: followeeId } },
+ },
+ followeeId: true,
+ followerId: true,
+ },
+ })
+ return socialFollowing?.length > 0
+}
+
+const followUser = async (client: MbClient, followerId: string, followeeId: string) => {
+ return client.mutation({
+ insertSocialFollowingOne: {
+ __args: {
+ object: { followerId, followeeId },
+ },
+ followeeId: true,
+ followerId: true,
+ userByFollowerId: { username: true },
+ },
+ })
+}
+
+const unfollowUser = async (client: MbClient, followerId: string, followeeId: string) => {
+ return client.mutation({
+ deleteSocialFollowing: {
+ __args: {
+ where: { followerId: { _eq: followerId }, followeeId: { _eq: followeeId } },
+ },
+ affectedRows: true,
+ returning: { followeeId: true, followerId: true },
+ },
+ })
+}
+
+export async function userFollowOrUnfollow({
+ followerId,
+ followeeId,
+ jwt,
+}: {
+ followerId: string
+ followeeId: string
+ jwt: string
+}) {
+ if (!jwt) throw new Error('Authentication required to follow/unfollow user')
+
+ const client = getHasuraClient({ jwt })
+ try {
+ const isFollowing = await getFollowStatus(client, followerId, followeeId)
+ if (!isFollowing) {
+ await followUser(client, followerId, followeeId)
+ return { success: true, follow: true }
+ }
+ await unfollowUser(client, followerId, followeeId)
+ return { success: true, follow: false }
+ } catch (error) {
+ console.error('Error following/unfollowing user:', error)
+ return {
+ success: false,
+ error: error instanceof Error ? error.message : 'Failed to follow/unfollow user.',
+ }
+ }
+}
+
+// chatbot follow or unfollow function
+
+const getChatbotFollowStatus = async (client: MbClient, followerId: string, followeeId: number) => {
+ const { socialFollowing } = await client.query({
+ socialFollowing: {
+ __args: {
+ where: { followerId: { _eq: followerId }, followeeIdChatbot: { _eq: followeeId } },
+ },
+ followeeIdChatbot: true,
+ followerId: true,
+ },
+ })
+ return socialFollowing?.length > 0
+}
+
+const followChatbot = async (client: MbClient, followerId: string, followeeId: number) => {
+ return client.mutation({
+ insertSocialFollowingOne: {
+ __args: {
+ object: { followerId, followeeIdChatbot: followeeId },
+ },
+ followeeIdChatbot: true,
+ followerId: true,
+ chatbot: { name: true },
+ },
+ })
+}
+
+const unfollowChatbot = async (client: MbClient, followerId: string, followeeId: number) => {
+ return client.mutation({
+ deleteSocialFollowing: {
+ __args: {
+ where: { followerId: { _eq: followerId }, followeeIdChatbot: { _eq: followeeId } },
+ },
+ affectedRows: true,
+ returning: { followeeIdChatbot: true, followerId: true },
+ },
+ })
+}
+
+export async function chatbotFollowOrUnfollow({
+ followerId,
+ followeeId,
+ jwt,
+}: {
+ followerId: string
+ followeeId: number
+ jwt: string
+}) {
+ if (!jwt) throw new Error('Authentication required to follow/unfollow chatbot')
+
+ const client = getHasuraClient({ jwt })
+ try {
+ const isFollowing = await getChatbotFollowStatus(client, followerId, followeeId)
+ if (!isFollowing) {
+ await followChatbot(client, followerId, followeeId)
+ return { success: true, follow: true }
+ }
+ await unfollowChatbot(client, followerId, followeeId)
+ return { success: true, follow: false }
+ } catch (error) {
+ console.error('Error following/unfollowing chatbot:', error)
+ return {
+ success: false,
+ error: error instanceof Error ? error.message : 'Failed to follow/unfollow chatbot.',
+ }
+ }
+}
diff --git a/apps/masterbots.ai/services/hasura/hasura.service.type.ts b/apps/masterbots.ai/services/hasura/hasura.service.type.ts
index 98ac8a33..be332c77 100644
--- a/apps/masterbots.ai/services/hasura/hasura.service.type.ts
+++ b/apps/masterbots.ai/services/hasura/hasura.service.type.ts
@@ -59,6 +59,7 @@ export interface GetBrowseThreadsParams {
slug?: string | null
limit?: number
offset?: number
+ followedUserId?: string
}
export interface GetChatbotsParams {
diff --git a/apps/masterbots.ai/tailwind.config.js b/apps/masterbots.ai/tailwind.config.js
index 929319a9..9566854f 100644
--- a/apps/masterbots.ai/tailwind.config.js
+++ b/apps/masterbots.ai/tailwind.config.js
@@ -4,7 +4,8 @@ module.exports = {
content: [
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
- './src/**/*.{ts,tsx}'
+ './src/**/*.{ts,tsx}',
+ './lib/**/*.{ts,tsx}'
],
theme: {
container: {
diff --git a/apps/masterbots.ai/types/types.ts b/apps/masterbots.ai/types/types.ts
index 1e48f51e..3959e94c 100644
--- a/apps/masterbots.ai/types/types.ts
+++ b/apps/masterbots.ai/types/types.ts
@@ -1,10 +1,11 @@
import type { WordWareFlowPaths } from '@/types/wordware-flows.types'
import type { Message } from 'ai'
import type { UserRole } from 'mb-drizzle'
-import type { Chatbot, LabelChatbotCategory } from 'mb-genql'
+import type { Chatbot, LabelChatbotCategory, SocialFollowing } from 'mb-genql'
import 'next-auth'
import type { DefaultSession, DefaultUser } from 'next-auth'
import type { ChatCompletionMessageParam } from 'openai/resources'
+import type React from 'react'
import type Stripe from 'stripe'
// * Chat types
@@ -118,17 +119,17 @@ export type Card = {
}
export const initialStateSubscription = {
customer: {
- name: ''
+ name: '',
},
plan: {
amount: 0,
interval: '',
product: {
- name: ''
- }
+ name: '',
+ },
},
current_period_start: 0,
- status: ''
+ status: '',
}
// * AI SDK related types
@@ -223,6 +224,34 @@ export interface ChatPageProps {
}
}
+export interface ChatMessageProps {
+ message: Message
+ sendMessageFromResponse?: (message: string) => void
+ chatbot?: Chatbot
+ actionRequired?: boolean
+ webSearchResults?: WebSearchResult[]
+}
+
+//* Reference result manipulations props
+export interface WebSearchResult {
+ title: string
+ url: string
+ description: string
+ thumbnail?: {
+ src: string
+ }
+ profile: {
+ name: string
+ }
+}
+
+export interface ClickableTextProps {
+ children: React.ReactNode
+ isListItem: boolean
+ sendMessageFromResponse?: (message: string) => void
+ webSearchResults?: WebSearchResult[]
+ onReferenceFound?: (ref: WebSearchResult) => void
+}
// * Drizzle Admin types
export type AdminUserUpdate = {
isBlocked?: boolean
@@ -231,3 +260,37 @@ export type AdminUserUpdate = {
getFreeMonth?: boolean
role?: (typeof UserRole)[keyof typeof UserRole]
}
+
+// * Chatbot details types
+export interface ChatbotDetailsProps {
+ botName?: string
+ avatar?: string
+ description?: string | null
+ threadCount?: number
+ followersCount?: number
+ isWelcomeView?: boolean
+ categoryName?: string
+ onNewChat?: () => void
+ followers?: SocialFollowing[]
+ onFollow?: () => void
+}
+
+export interface BrowseChatbotDetailsProps {
+ chatbot?: Chatbot
+ variant?: 'default' | 'selected'
+}
+
+export interface BrowseChatbotLayoutProps {
+ chatbot: Chatbot
+ variant: 'default' | 'selected'
+ isLoading: boolean
+ generateType?: string | undefined
+ lastMessage: string | null
+ onGenerateBio: () => void
+ isWelcomeView: boolean
+ descriptionPoints: string[]
+ hasMultiplePoints: boolean
+ botUrl: string
+}
+
+export type UUID = `${string}-${string}-${string}-${string}-${string}`
diff --git a/bun.lockb b/bun.lockb
index f9475d7e..a39867ee 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package.json b/package.json
index 56326831..8df8a8ee 100644
--- a/package.json
+++ b/package.json
@@ -12,21 +12,26 @@
"format": "prettier --write \"**/*.{ts,tsx,md}\""
},
"devDependencies": {
- "@types/node": "^20.17.6",
+ "@types/node": "^20.x",
"eslint": "^8.57.1",
"prettier": "^3.3.3",
"turbo": "^1.13.4"
},
+ "engines": {
+ "node": ">=20.0.0"
+ },
"workspaces": [
"apps/*",
"packages/*"
],
- "packageManager": "bun@1.0.14",
+ "packageManager": "bun@1.1.31",
"dependencies": {
"@ai-sdk/anthropic": "^0.0.49",
"@types/bcryptjs": "^2.4.6",
"axios": "^1.7.7",
+ "crypto": "^1.0.1",
+ "lucide-react": "latest",
"nextjs-toploader": "^1.6.12",
- "lucide-react": "latest"
+ "react-hot-toast": "^2.5.1"
}
}
\ No newline at end of file
diff --git a/packages/mb-genql/generated/index.ts b/packages/mb-genql/generated/index.ts
index 43017283..89358117 100644
--- a/packages/mb-genql/generated/index.ts
+++ b/packages/mb-genql/generated/index.ts
@@ -35,7 +35,7 @@ export interface Client {
export const createClient = function (options?: ClientOptions): Client {
return createClientOriginal({
- url: 'https://dev-api.masterbots.ai/v1/graphql',
+ url: 'http://localhost:8080/v1/graphql',
...options,
queryRoot: typeMap.Query!,
diff --git a/packages/mb-genql/generated/schema.graphql b/packages/mb-genql/generated/schema.graphql
index d6e41f9a..d40de06d 100644
--- a/packages/mb-genql/generated/schema.graphql
+++ b/packages/mb-genql/generated/schema.graphql
@@ -798,6 +798,42 @@ type Chatbot {
defaultType: String
description: String
+ """An array relationship"""
+ followers(
+ """distinct select on columns"""
+ distinctOn: [SocialFollowingSelectColumn!]
+
+ """limit the number of rows returned"""
+ limit: Int
+
+ """skip the first n rows. Use only with order_by"""
+ offset: Int
+
+ """sort the rows by one or more columns"""
+ orderBy: [SocialFollowingOrderBy!]
+
+ """filter the rows returned"""
+ where: SocialFollowingBoolExp
+ ): [SocialFollowing!]!
+
+ """An aggregate relationship"""
+ followersAggregate(
+ """distinct select on columns"""
+ distinctOn: [SocialFollowingSelectColumn!]
+
+ """limit the number of rows returned"""
+ limit: Int
+
+ """skip the first n rows. Use only with order_by"""
+ offset: Int
+
+ """sort the rows by one or more columns"""
+ orderBy: [SocialFollowingOrderBy!]
+
+ """filter the rows returned"""
+ where: SocialFollowingBoolExp
+ ): SocialFollowingAggregate!
+
"""An object relationship"""
lengthEnum: LengthEnum
@@ -1041,6 +1077,8 @@ input ChatbotBoolExp {
defaultTone: StringComparisonExp
defaultType: StringComparisonExp
description: StringComparisonExp
+ followers: SocialFollowingBoolExp
+ followersAggregate: SocialFollowingAggregateBoolExp
lengthEnum: LengthEnumBoolExp
metadataLabels: LabelChatbotCategoryBoolExp
metadataLabelsAggregate: LabelChatbotCategoryAggregateBoolExp
@@ -1434,6 +1472,7 @@ input ChatbotInsertInput {
defaultTone: String
defaultType: String
description: String
+ followers: SocialFollowingArrRelInsertInput
lengthEnum: LengthEnumObjRelInsertInput
metadataLabels: LabelChatbotCategoryArrRelInsertInput
name: String
@@ -1543,6 +1582,7 @@ input ChatbotOrderBy {
defaultTone: OrderBy
defaultType: OrderBy
description: OrderBy
+ followersAggregate: SocialFollowingAggregateOrderBy
lengthEnum: LengthEnumOrderBy
metadataLabelsAggregate: LabelChatbotCategoryAggregateOrderBy
name: OrderBy
@@ -5623,12 +5663,15 @@ input ReferralUpdates {
This junction table records social following relationships between users. Each record represents a follower-followee relationship.
"""
type SocialFollowing {
+ """An object relationship"""
+ chatbot: Chatbot
createdAt: timestamptz!
- followeeId: uuid!
+ followeeId: uuid
+ followeeIdChatbot: Int
followerId: uuid!
"""An object relationship"""
- user: User!
+ user: User
"""An object relationship"""
userByFollowerId: User!
@@ -5650,18 +5693,34 @@ input SocialFollowingAggregateBoolExp {
aggregate fields of "social_following"
"""
type SocialFollowingAggregateFields {
+ avg: SocialFollowingAvgFields
count(columns: [SocialFollowingSelectColumn!], distinct: Boolean): Int!
max: SocialFollowingMaxFields
min: SocialFollowingMinFields
+ stddev: SocialFollowingStddevFields
+ stddevPop: SocialFollowingStddevPopFields
+ stddevSamp: SocialFollowingStddevSampFields
+ sum: SocialFollowingSumFields
+ varPop: SocialFollowingVarPopFields
+ varSamp: SocialFollowingVarSampFields
+ variance: SocialFollowingVarianceFields
}
"""
order by aggregate values of table "social_following"
"""
input SocialFollowingAggregateOrderBy {
+ avg: SocialFollowingAvgOrderBy
count: OrderBy
max: SocialFollowingMaxOrderBy
min: SocialFollowingMinOrderBy
+ stddev: SocialFollowingStddevOrderBy
+ stddevPop: SocialFollowingStddevPopOrderBy
+ stddevSamp: SocialFollowingStddevSampOrderBy
+ sum: SocialFollowingSumOrderBy
+ varPop: SocialFollowingVarPopOrderBy
+ varSamp: SocialFollowingVarSampOrderBy
+ variance: SocialFollowingVarianceOrderBy
}
"""
@@ -5671,6 +5730,18 @@ input SocialFollowingArrRelInsertInput {
data: [SocialFollowingInsertInput!]!
}
+"""aggregate avg on columns"""
+type SocialFollowingAvgFields {
+ followeeIdChatbot: Float
+}
+
+"""
+order by avg() on columns of table "social_following"
+"""
+input SocialFollowingAvgOrderBy {
+ followeeIdChatbot: OrderBy
+}
+
"""
Boolean expression to filter rows from the table "social_following". All fields are combined with a logical 'AND'.
"""
@@ -5678,19 +5749,30 @@ input SocialFollowingBoolExp {
_and: [SocialFollowingBoolExp!]
_not: SocialFollowingBoolExp
_or: [SocialFollowingBoolExp!]
+ chatbot: ChatbotBoolExp
createdAt: TimestamptzComparisonExp
followeeId: UuidComparisonExp
+ followeeIdChatbot: IntComparisonExp
followerId: UuidComparisonExp
user: UserBoolExp
userByFollowerId: UserBoolExp
}
+"""
+input type for incrementing numeric columns in table "social_following"
+"""
+input SocialFollowingIncInput {
+ followeeIdChatbot: Int
+}
+
"""
input type for inserting data into table "social_following"
"""
input SocialFollowingInsertInput {
+ chatbot: ChatbotObjRelInsertInput
createdAt: timestamptz
followeeId: uuid
+ followeeIdChatbot: Int
followerId: uuid
user: UserObjRelInsertInput
userByFollowerId: UserObjRelInsertInput
@@ -5700,6 +5782,7 @@ input SocialFollowingInsertInput {
type SocialFollowingMaxFields {
createdAt: timestamptz
followeeId: uuid
+ followeeIdChatbot: Int
followerId: uuid
}
@@ -5709,6 +5792,7 @@ order by max() on columns of table "social_following"
input SocialFollowingMaxOrderBy {
createdAt: OrderBy
followeeId: OrderBy
+ followeeIdChatbot: OrderBy
followerId: OrderBy
}
@@ -5716,6 +5800,7 @@ input SocialFollowingMaxOrderBy {
type SocialFollowingMinFields {
createdAt: timestamptz
followeeId: uuid
+ followeeIdChatbot: Int
followerId: uuid
}
@@ -5725,6 +5810,7 @@ order by min() on columns of table "social_following"
input SocialFollowingMinOrderBy {
createdAt: OrderBy
followeeId: OrderBy
+ followeeIdChatbot: OrderBy
followerId: OrderBy
}
@@ -5741,8 +5827,10 @@ type SocialFollowingMutationResponse {
"""Ordering options when selecting data from "social_following"."""
input SocialFollowingOrderBy {
+ chatbot: ChatbotOrderBy
createdAt: OrderBy
followeeId: OrderBy
+ followeeIdChatbot: OrderBy
followerId: OrderBy
user: UserOrderBy
userByFollowerId: UserOrderBy
@@ -5758,6 +5846,9 @@ enum SocialFollowingSelectColumn {
"""column name"""
followeeId
+ """column name"""
+ followeeIdChatbot
+
"""column name"""
followerId
}
@@ -5768,9 +5859,46 @@ input type for updating data in table "social_following"
input SocialFollowingSetInput {
createdAt: timestamptz
followeeId: uuid
+ followeeIdChatbot: Int
followerId: uuid
}
+"""aggregate stddev on columns"""
+type SocialFollowingStddevFields {
+ followeeIdChatbot: Float
+}
+
+"""
+order by stddev() on columns of table "social_following"
+"""
+input SocialFollowingStddevOrderBy {
+ followeeIdChatbot: OrderBy
+}
+
+"""aggregate stddevPop on columns"""
+type SocialFollowingStddevPopFields {
+ followeeIdChatbot: Float
+}
+
+"""
+order by stddevPop() on columns of table "social_following"
+"""
+input SocialFollowingStddevPopOrderBy {
+ followeeIdChatbot: OrderBy
+}
+
+"""aggregate stddevSamp on columns"""
+type SocialFollowingStddevSampFields {
+ followeeIdChatbot: Float
+}
+
+"""
+order by stddevSamp() on columns of table "social_following"
+"""
+input SocialFollowingStddevSampOrderBy {
+ followeeIdChatbot: OrderBy
+}
+
"""
Streaming cursor of the table "social_following"
"""
@@ -5786,10 +5914,26 @@ input SocialFollowingStreamCursorInput {
input SocialFollowingStreamCursorValueInput {
createdAt: timestamptz
followeeId: uuid
+ followeeIdChatbot: Int
followerId: uuid
}
+"""aggregate sum on columns"""
+type SocialFollowingSumFields {
+ followeeIdChatbot: Int
+}
+
+"""
+order by sum() on columns of table "social_following"
+"""
+input SocialFollowingSumOrderBy {
+ followeeIdChatbot: OrderBy
+}
+
input SocialFollowingUpdates {
+ """increments the numeric columns with given value of the filtered values"""
+ _inc: SocialFollowingIncInput
+
"""sets the columns of the filtered rows to the given values"""
_set: SocialFollowingSetInput
@@ -5797,6 +5941,42 @@ input SocialFollowingUpdates {
where: SocialFollowingBoolExp!
}
+"""aggregate varPop on columns"""
+type SocialFollowingVarPopFields {
+ followeeIdChatbot: Float
+}
+
+"""
+order by varPop() on columns of table "social_following"
+"""
+input SocialFollowingVarPopOrderBy {
+ followeeIdChatbot: OrderBy
+}
+
+"""aggregate varSamp on columns"""
+type SocialFollowingVarSampFields {
+ followeeIdChatbot: Float
+}
+
+"""
+order by varSamp() on columns of table "social_following"
+"""
+input SocialFollowingVarSampOrderBy {
+ followeeIdChatbot: OrderBy
+}
+
+"""aggregate variance on columns"""
+type SocialFollowingVarianceFields {
+ followeeIdChatbot: Float
+}
+
+"""
+order by variance() on columns of table "social_following"
+"""
+input SocialFollowingVarianceOrderBy {
+ followeeIdChatbot: OrderBy
+}
+
"""
Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'.
"""
@@ -9379,6 +9559,9 @@ type mutation_root {
update data of the table: "social_following"
"""
updateSocialFollowing(
+ """increments the numeric columns with given value of the filtered values"""
+ _inc: SocialFollowingIncInput
+
"""sets the columns of the filtered rows to the given values"""
_set: SocialFollowingSetInput
diff --git a/packages/mb-genql/generated/schema.ts b/packages/mb-genql/generated/schema.ts
index abb0bc9f..1b4b6b1e 100644
--- a/packages/mb-genql/generated/schema.ts
+++ b/packages/mb-genql/generated/schema.ts
@@ -314,6 +314,10 @@ export interface Chatbot {
defaultTone: (Scalars['String'] | null)
defaultType: (Scalars['String'] | null)
description: (Scalars['String'] | null)
+ /** An array relationship */
+ followers: SocialFollowing[]
+ /** An aggregate relationship */
+ followersAggregate: SocialFollowingAggregate
/** An object relationship */
lengthEnum: (LengthEnum | null)
/** An array relationship */
@@ -1979,11 +1983,14 @@ export type ReferralUpdateColumn = 'referralCode' | 'referrerId' | 'userId'
/** This junction table records social following relationships between users. Each record represents a follower-followee relationship. */
export interface SocialFollowing {
+ /** An object relationship */
+ chatbot: (Chatbot | null)
createdAt: Scalars['timestamptz']
- followeeId: Scalars['uuid']
+ followeeId: (Scalars['uuid'] | null)
+ followeeIdChatbot: (Scalars['Int'] | null)
followerId: Scalars['uuid']
/** An object relationship */
- user: User
+ user: (User | null)
/** An object relationship */
userByFollowerId: User
__typename: 'SocialFollowing'
@@ -2000,17 +2007,33 @@ export interface SocialFollowingAggregate {
/** aggregate fields of "social_following" */
export interface SocialFollowingAggregateFields {
+ avg: (SocialFollowingAvgFields | null)
count: Scalars['Int']
max: (SocialFollowingMaxFields | null)
min: (SocialFollowingMinFields | null)
+ stddev: (SocialFollowingStddevFields | null)
+ stddevPop: (SocialFollowingStddevPopFields | null)
+ stddevSamp: (SocialFollowingStddevSampFields | null)
+ sum: (SocialFollowingSumFields | null)
+ varPop: (SocialFollowingVarPopFields | null)
+ varSamp: (SocialFollowingVarSampFields | null)
+ variance: (SocialFollowingVarianceFields | null)
__typename: 'SocialFollowingAggregateFields'
}
+/** aggregate avg on columns */
+export interface SocialFollowingAvgFields {
+ followeeIdChatbot: (Scalars['Float'] | null)
+ __typename: 'SocialFollowingAvgFields'
+}
+
+
/** aggregate max on columns */
export interface SocialFollowingMaxFields {
createdAt: (Scalars['timestamptz'] | null)
followeeId: (Scalars['uuid'] | null)
+ followeeIdChatbot: (Scalars['Int'] | null)
followerId: (Scalars['uuid'] | null)
__typename: 'SocialFollowingMaxFields'
}
@@ -2020,6 +2043,7 @@ export interface SocialFollowingMaxFields {
export interface SocialFollowingMinFields {
createdAt: (Scalars['timestamptz'] | null)
followeeId: (Scalars['uuid'] | null)
+ followeeIdChatbot: (Scalars['Int'] | null)
followerId: (Scalars['uuid'] | null)
__typename: 'SocialFollowingMinFields'
}
@@ -2036,7 +2060,56 @@ export interface SocialFollowingMutationResponse {
/** select columns of table "social_following" */
-export type SocialFollowingSelectColumn = 'createdAt' | 'followeeId' | 'followerId'
+export type SocialFollowingSelectColumn = 'createdAt' | 'followeeId' | 'followeeIdChatbot' | 'followerId'
+
+
+/** aggregate stddev on columns */
+export interface SocialFollowingStddevFields {
+ followeeIdChatbot: (Scalars['Float'] | null)
+ __typename: 'SocialFollowingStddevFields'
+}
+
+
+/** aggregate stddevPop on columns */
+export interface SocialFollowingStddevPopFields {
+ followeeIdChatbot: (Scalars['Float'] | null)
+ __typename: 'SocialFollowingStddevPopFields'
+}
+
+
+/** aggregate stddevSamp on columns */
+export interface SocialFollowingStddevSampFields {
+ followeeIdChatbot: (Scalars['Float'] | null)
+ __typename: 'SocialFollowingStddevSampFields'
+}
+
+
+/** aggregate sum on columns */
+export interface SocialFollowingSumFields {
+ followeeIdChatbot: (Scalars['Int'] | null)
+ __typename: 'SocialFollowingSumFields'
+}
+
+
+/** aggregate varPop on columns */
+export interface SocialFollowingVarPopFields {
+ followeeIdChatbot: (Scalars['Float'] | null)
+ __typename: 'SocialFollowingVarPopFields'
+}
+
+
+/** aggregate varSamp on columns */
+export interface SocialFollowingVarSampFields {
+ followeeIdChatbot: (Scalars['Float'] | null)
+ __typename: 'SocialFollowingVarSampFields'
+}
+
+
+/** aggregate variance on columns */
+export interface SocialFollowingVarianceFields {
+ followeeIdChatbot: (Scalars['Float'] | null)
+ __typename: 'SocialFollowingVarianceFields'
+}
/** columns and relationships of "thread" */
@@ -3823,6 +3896,30 @@ export interface ChatbotGenqlSelection{
defaultTone?: boolean | number
defaultType?: boolean | number
description?: boolean | number
+ /** An array relationship */
+ followers?: (SocialFollowingGenqlSelection & { __args?: {
+ /** distinct select on columns */
+ distinctOn?: (SocialFollowingSelectColumn[] | null),
+ /** limit the number of rows returned */
+ limit?: (Scalars['Int'] | null),
+ /** skip the first n rows. Use only with order_by */
+ offset?: (Scalars['Int'] | null),
+ /** sort the rows by one or more columns */
+ orderBy?: (SocialFollowingOrderBy[] | null),
+ /** filter the rows returned */
+ where?: (SocialFollowingBoolExp | null)} })
+ /** An aggregate relationship */
+ followersAggregate?: (SocialFollowingAggregateGenqlSelection & { __args?: {
+ /** distinct select on columns */
+ distinctOn?: (SocialFollowingSelectColumn[] | null),
+ /** limit the number of rows returned */
+ limit?: (Scalars['Int'] | null),
+ /** skip the first n rows. Use only with order_by */
+ offset?: (Scalars['Int'] | null),
+ /** sort the rows by one or more columns */
+ orderBy?: (SocialFollowingOrderBy[] | null),
+ /** filter the rows returned */
+ where?: (SocialFollowingBoolExp | null)} })
/** An object relationship */
lengthEnum?: LengthEnumGenqlSelection
/** An array relationship */
@@ -3983,7 +4080,7 @@ export interface ChatbotAvgOrderBy {chatbotId?: (OrderBy | null)}
/** Boolean expression to filter rows from the table "chatbot". All fields are combined with a logical 'AND'. */
-export interface ChatbotBoolExp {_and?: (ChatbotBoolExp[] | null),_not?: (ChatbotBoolExp | null),_or?: (ChatbotBoolExp[] | null),avatar?: (StringComparisonExp | null),categories?: (ChatbotCategoryBoolExp | null),categoriesAggregate?: (ChatbotCategoryAggregateBoolExp | null),chatbotId?: (IntComparisonExp | null),chats?: (ChatBoolExp | null),chatsAggregate?: (ChatAggregateBoolExp | null),complexityEnum?: (ComplexityEnumBoolExp | null),createdBy?: (StringComparisonExp | null),defaultComplexity?: (StringComparisonExp | null),defaultLength?: (StringComparisonExp | null),defaultTone?: (StringComparisonExp | null),defaultType?: (StringComparisonExp | null),description?: (StringComparisonExp | null),lengthEnum?: (LengthEnumBoolExp | null),metadataLabels?: (LabelChatbotCategoryBoolExp | null),metadataLabelsAggregate?: (LabelChatbotCategoryAggregateBoolExp | null),name?: (StringComparisonExp | null),preferences?: (PreferenceBoolExp | null),preferencesAggregate?: (PreferenceAggregateBoolExp | null),prompts?: (PromptChatbotBoolExp | null),promptsAggregate?: (PromptChatbotAggregateBoolExp | null),threads?: (ThreadBoolExp | null),threadsAggregate?: (ThreadAggregateBoolExp | null),toneEnum?: (ToneEnumBoolExp | null),typeEnum?: (TypeEnumBoolExp | null)}
+export interface ChatbotBoolExp {_and?: (ChatbotBoolExp[] | null),_not?: (ChatbotBoolExp | null),_or?: (ChatbotBoolExp[] | null),avatar?: (StringComparisonExp | null),categories?: (ChatbotCategoryBoolExp | null),categoriesAggregate?: (ChatbotCategoryAggregateBoolExp | null),chatbotId?: (IntComparisonExp | null),chats?: (ChatBoolExp | null),chatsAggregate?: (ChatAggregateBoolExp | null),complexityEnum?: (ComplexityEnumBoolExp | null),createdBy?: (StringComparisonExp | null),defaultComplexity?: (StringComparisonExp | null),defaultLength?: (StringComparisonExp | null),defaultTone?: (StringComparisonExp | null),defaultType?: (StringComparisonExp | null),description?: (StringComparisonExp | null),followers?: (SocialFollowingBoolExp | null),followersAggregate?: (SocialFollowingAggregateBoolExp | null),lengthEnum?: (LengthEnumBoolExp | null),metadataLabels?: (LabelChatbotCategoryBoolExp | null),metadataLabelsAggregate?: (LabelChatbotCategoryAggregateBoolExp | null),name?: (StringComparisonExp | null),preferences?: (PreferenceBoolExp | null),preferencesAggregate?: (PreferenceAggregateBoolExp | null),prompts?: (PromptChatbotBoolExp | null),promptsAggregate?: (PromptChatbotAggregateBoolExp | null),threads?: (ThreadBoolExp | null),threadsAggregate?: (ThreadAggregateBoolExp | null),toneEnum?: (ToneEnumBoolExp | null),typeEnum?: (TypeEnumBoolExp | null)}
/** Junction table to manage the many-to-many relationships between chatbots and their categories. */
@@ -4232,7 +4329,7 @@ export interface ChatbotIncInput {chatbotId?: (Scalars['Int'] | null)}
/** input type for inserting data into table "chatbot" */
-export interface ChatbotInsertInput {avatar?: (Scalars['String'] | null),categories?: (ChatbotCategoryArrRelInsertInput | null),chatbotId?: (Scalars['Int'] | null),chats?: (ChatArrRelInsertInput | null),complexityEnum?: (ComplexityEnumObjRelInsertInput | null),createdBy?: (Scalars['String'] | null),defaultComplexity?: (Scalars['String'] | null),defaultLength?: (Scalars['String'] | null),defaultTone?: (Scalars['String'] | null),defaultType?: (Scalars['String'] | null),description?: (Scalars['String'] | null),lengthEnum?: (LengthEnumObjRelInsertInput | null),metadataLabels?: (LabelChatbotCategoryArrRelInsertInput | null),name?: (Scalars['String'] | null),preferences?: (PreferenceArrRelInsertInput | null),prompts?: (PromptChatbotArrRelInsertInput | null),threads?: (ThreadArrRelInsertInput | null),toneEnum?: (ToneEnumObjRelInsertInput | null),typeEnum?: (TypeEnumObjRelInsertInput | null)}
+export interface ChatbotInsertInput {avatar?: (Scalars['String'] | null),categories?: (ChatbotCategoryArrRelInsertInput | null),chatbotId?: (Scalars['Int'] | null),chats?: (ChatArrRelInsertInput | null),complexityEnum?: (ComplexityEnumObjRelInsertInput | null),createdBy?: (Scalars['String'] | null),defaultComplexity?: (Scalars['String'] | null),defaultLength?: (Scalars['String'] | null),defaultTone?: (Scalars['String'] | null),defaultType?: (Scalars['String'] | null),description?: (Scalars['String'] | null),followers?: (SocialFollowingArrRelInsertInput | null),lengthEnum?: (LengthEnumObjRelInsertInput | null),metadataLabels?: (LabelChatbotCategoryArrRelInsertInput | null),name?: (Scalars['String'] | null),preferences?: (PreferenceArrRelInsertInput | null),prompts?: (PromptChatbotArrRelInsertInput | null),threads?: (ThreadArrRelInsertInput | null),toneEnum?: (ToneEnumObjRelInsertInput | null),typeEnum?: (TypeEnumObjRelInsertInput | null)}
/** aggregate max on columns */
@@ -4297,7 +4394,7 @@ export interface ChatbotOnConflict {constraint: ChatbotConstraint,updateColumns?
/** Ordering options when selecting data from "chatbot". */
-export interface ChatbotOrderBy {avatar?: (OrderBy | null),categoriesAggregate?: (ChatbotCategoryAggregateOrderBy | null),chatbotId?: (OrderBy | null),chatsAggregate?: (ChatAggregateOrderBy | null),complexityEnum?: (ComplexityEnumOrderBy | null),createdBy?: (OrderBy | null),defaultComplexity?: (OrderBy | null),defaultLength?: (OrderBy | null),defaultTone?: (OrderBy | null),defaultType?: (OrderBy | null),description?: (OrderBy | null),lengthEnum?: (LengthEnumOrderBy | null),metadataLabelsAggregate?: (LabelChatbotCategoryAggregateOrderBy | null),name?: (OrderBy | null),preferencesAggregate?: (PreferenceAggregateOrderBy | null),promptsAggregate?: (PromptChatbotAggregateOrderBy | null),threadsAggregate?: (ThreadAggregateOrderBy | null),toneEnum?: (ToneEnumOrderBy | null),typeEnum?: (TypeEnumOrderBy | null)}
+export interface ChatbotOrderBy {avatar?: (OrderBy | null),categoriesAggregate?: (ChatbotCategoryAggregateOrderBy | null),chatbotId?: (OrderBy | null),chatsAggregate?: (ChatAggregateOrderBy | null),complexityEnum?: (ComplexityEnumOrderBy | null),createdBy?: (OrderBy | null),defaultComplexity?: (OrderBy | null),defaultLength?: (OrderBy | null),defaultTone?: (OrderBy | null),defaultType?: (OrderBy | null),description?: (OrderBy | null),followersAggregate?: (SocialFollowingAggregateOrderBy | null),lengthEnum?: (LengthEnumOrderBy | null),metadataLabelsAggregate?: (LabelChatbotCategoryAggregateOrderBy | null),name?: (OrderBy | null),preferencesAggregate?: (PreferenceAggregateOrderBy | null),promptsAggregate?: (PromptChatbotAggregateOrderBy | null),threadsAggregate?: (ThreadAggregateOrderBy | null),toneEnum?: (ToneEnumOrderBy | null),typeEnum?: (TypeEnumOrderBy | null)}
/** primary key columns input for table: chatbot */
@@ -6862,8 +6959,11 @@ where: ReferralBoolExp}
/** This junction table records social following relationships between users. Each record represents a follower-followee relationship. */
export interface SocialFollowingGenqlSelection{
+ /** An object relationship */
+ chatbot?: ChatbotGenqlSelection
createdAt?: boolean | number
followeeId?: boolean | number
+ followeeIdChatbot?: boolean | number
followerId?: boolean | number
/** An object relationship */
user?: UserGenqlSelection
@@ -6887,34 +6987,59 @@ export interface SocialFollowingAggregateBoolExp {count?: (socialFollowingAggreg
/** aggregate fields of "social_following" */
export interface SocialFollowingAggregateFieldsGenqlSelection{
+ avg?: SocialFollowingAvgFieldsGenqlSelection
count?: { __args: {columns?: (SocialFollowingSelectColumn[] | null), distinct?: (Scalars['Boolean'] | null)} } | boolean | number
max?: SocialFollowingMaxFieldsGenqlSelection
min?: SocialFollowingMinFieldsGenqlSelection
+ stddev?: SocialFollowingStddevFieldsGenqlSelection
+ stddevPop?: SocialFollowingStddevPopFieldsGenqlSelection
+ stddevSamp?: SocialFollowingStddevSampFieldsGenqlSelection
+ sum?: SocialFollowingSumFieldsGenqlSelection
+ varPop?: SocialFollowingVarPopFieldsGenqlSelection
+ varSamp?: SocialFollowingVarSampFieldsGenqlSelection
+ variance?: SocialFollowingVarianceFieldsGenqlSelection
__typename?: boolean | number
__scalar?: boolean | number
}
/** order by aggregate values of table "social_following" */
-export interface SocialFollowingAggregateOrderBy {count?: (OrderBy | null),max?: (SocialFollowingMaxOrderBy | null),min?: (SocialFollowingMinOrderBy | null)}
+export interface SocialFollowingAggregateOrderBy {avg?: (SocialFollowingAvgOrderBy | null),count?: (OrderBy | null),max?: (SocialFollowingMaxOrderBy | null),min?: (SocialFollowingMinOrderBy | null),stddev?: (SocialFollowingStddevOrderBy | null),stddevPop?: (SocialFollowingStddevPopOrderBy | null),stddevSamp?: (SocialFollowingStddevSampOrderBy | null),sum?: (SocialFollowingSumOrderBy | null),varPop?: (SocialFollowingVarPopOrderBy | null),varSamp?: (SocialFollowingVarSampOrderBy | null),variance?: (SocialFollowingVarianceOrderBy | null)}
/** input type for inserting array relation for remote table "social_following" */
export interface SocialFollowingArrRelInsertInput {data: SocialFollowingInsertInput[]}
+/** aggregate avg on columns */
+export interface SocialFollowingAvgFieldsGenqlSelection{
+ followeeIdChatbot?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+
+/** order by avg() on columns of table "social_following" */
+export interface SocialFollowingAvgOrderBy {followeeIdChatbot?: (OrderBy | null)}
+
+
/** Boolean expression to filter rows from the table "social_following". All fields are combined with a logical 'AND'. */
-export interface SocialFollowingBoolExp {_and?: (SocialFollowingBoolExp[] | null),_not?: (SocialFollowingBoolExp | null),_or?: (SocialFollowingBoolExp[] | null),createdAt?: (TimestamptzComparisonExp | null),followeeId?: (UuidComparisonExp | null),followerId?: (UuidComparisonExp | null),user?: (UserBoolExp | null),userByFollowerId?: (UserBoolExp | null)}
+export interface SocialFollowingBoolExp {_and?: (SocialFollowingBoolExp[] | null),_not?: (SocialFollowingBoolExp | null),_or?: (SocialFollowingBoolExp[] | null),chatbot?: (ChatbotBoolExp | null),createdAt?: (TimestamptzComparisonExp | null),followeeId?: (UuidComparisonExp | null),followeeIdChatbot?: (IntComparisonExp | null),followerId?: (UuidComparisonExp | null),user?: (UserBoolExp | null),userByFollowerId?: (UserBoolExp | null)}
+
+
+/** input type for incrementing numeric columns in table "social_following" */
+export interface SocialFollowingIncInput {followeeIdChatbot?: (Scalars['Int'] | null)}
/** input type for inserting data into table "social_following" */
-export interface SocialFollowingInsertInput {createdAt?: (Scalars['timestamptz'] | null),followeeId?: (Scalars['uuid'] | null),followerId?: (Scalars['uuid'] | null),user?: (UserObjRelInsertInput | null),userByFollowerId?: (UserObjRelInsertInput | null)}
+export interface SocialFollowingInsertInput {chatbot?: (ChatbotObjRelInsertInput | null),createdAt?: (Scalars['timestamptz'] | null),followeeId?: (Scalars['uuid'] | null),followeeIdChatbot?: (Scalars['Int'] | null),followerId?: (Scalars['uuid'] | null),user?: (UserObjRelInsertInput | null),userByFollowerId?: (UserObjRelInsertInput | null)}
/** aggregate max on columns */
export interface SocialFollowingMaxFieldsGenqlSelection{
createdAt?: boolean | number
followeeId?: boolean | number
+ followeeIdChatbot?: boolean | number
followerId?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
@@ -6922,13 +7047,14 @@ export interface SocialFollowingMaxFieldsGenqlSelection{
/** order by max() on columns of table "social_following" */
-export interface SocialFollowingMaxOrderBy {createdAt?: (OrderBy | null),followeeId?: (OrderBy | null),followerId?: (OrderBy | null)}
+export interface SocialFollowingMaxOrderBy {createdAt?: (OrderBy | null),followeeId?: (OrderBy | null),followeeIdChatbot?: (OrderBy | null),followerId?: (OrderBy | null)}
/** aggregate min on columns */
export interface SocialFollowingMinFieldsGenqlSelection{
createdAt?: boolean | number
followeeId?: boolean | number
+ followeeIdChatbot?: boolean | number
followerId?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
@@ -6936,7 +7062,7 @@ export interface SocialFollowingMinFieldsGenqlSelection{
/** order by min() on columns of table "social_following" */
-export interface SocialFollowingMinOrderBy {createdAt?: (OrderBy | null),followeeId?: (OrderBy | null),followerId?: (OrderBy | null)}
+export interface SocialFollowingMinOrderBy {createdAt?: (OrderBy | null),followeeId?: (OrderBy | null),followeeIdChatbot?: (OrderBy | null),followerId?: (OrderBy | null)}
/** response of any mutation on the table "social_following" */
@@ -6951,11 +7077,47 @@ export interface SocialFollowingMutationResponseGenqlSelection{
/** Ordering options when selecting data from "social_following". */
-export interface SocialFollowingOrderBy {createdAt?: (OrderBy | null),followeeId?: (OrderBy | null),followerId?: (OrderBy | null),user?: (UserOrderBy | null),userByFollowerId?: (UserOrderBy | null)}
+export interface SocialFollowingOrderBy {chatbot?: (ChatbotOrderBy | null),createdAt?: (OrderBy | null),followeeId?: (OrderBy | null),followeeIdChatbot?: (OrderBy | null),followerId?: (OrderBy | null),user?: (UserOrderBy | null),userByFollowerId?: (UserOrderBy | null)}
/** input type for updating data in table "social_following" */
-export interface SocialFollowingSetInput {createdAt?: (Scalars['timestamptz'] | null),followeeId?: (Scalars['uuid'] | null),followerId?: (Scalars['uuid'] | null)}
+export interface SocialFollowingSetInput {createdAt?: (Scalars['timestamptz'] | null),followeeId?: (Scalars['uuid'] | null),followeeIdChatbot?: (Scalars['Int'] | null),followerId?: (Scalars['uuid'] | null)}
+
+
+/** aggregate stddev on columns */
+export interface SocialFollowingStddevFieldsGenqlSelection{
+ followeeIdChatbot?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+
+/** order by stddev() on columns of table "social_following" */
+export interface SocialFollowingStddevOrderBy {followeeIdChatbot?: (OrderBy | null)}
+
+
+/** aggregate stddevPop on columns */
+export interface SocialFollowingStddevPopFieldsGenqlSelection{
+ followeeIdChatbot?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+
+/** order by stddevPop() on columns of table "social_following" */
+export interface SocialFollowingStddevPopOrderBy {followeeIdChatbot?: (OrderBy | null)}
+
+
+/** aggregate stddevSamp on columns */
+export interface SocialFollowingStddevSampFieldsGenqlSelection{
+ followeeIdChatbot?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+
+/** order by stddevSamp() on columns of table "social_following" */
+export interface SocialFollowingStddevSampOrderBy {followeeIdChatbot?: (OrderBy | null)}
/** Streaming cursor of the table "social_following" */
@@ -6967,15 +7129,65 @@ ordering?: (CursorOrdering | null)}
/** Initial value of the column from where the streaming should start */
-export interface SocialFollowingStreamCursorValueInput {createdAt?: (Scalars['timestamptz'] | null),followeeId?: (Scalars['uuid'] | null),followerId?: (Scalars['uuid'] | null)}
+export interface SocialFollowingStreamCursorValueInput {createdAt?: (Scalars['timestamptz'] | null),followeeId?: (Scalars['uuid'] | null),followeeIdChatbot?: (Scalars['Int'] | null),followerId?: (Scalars['uuid'] | null)}
+
+
+/** aggregate sum on columns */
+export interface SocialFollowingSumFieldsGenqlSelection{
+ followeeIdChatbot?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+
+/** order by sum() on columns of table "social_following" */
+export interface SocialFollowingSumOrderBy {followeeIdChatbot?: (OrderBy | null)}
export interface SocialFollowingUpdates {
+/** increments the numeric columns with given value of the filtered values */
+_inc?: (SocialFollowingIncInput | null),
/** sets the columns of the filtered rows to the given values */
_set?: (SocialFollowingSetInput | null),
/** filter the rows which have to be updated */
where: SocialFollowingBoolExp}
+/** aggregate varPop on columns */
+export interface SocialFollowingVarPopFieldsGenqlSelection{
+ followeeIdChatbot?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+
+/** order by varPop() on columns of table "social_following" */
+export interface SocialFollowingVarPopOrderBy {followeeIdChatbot?: (OrderBy | null)}
+
+
+/** aggregate varSamp on columns */
+export interface SocialFollowingVarSampFieldsGenqlSelection{
+ followeeIdChatbot?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+
+/** order by varSamp() on columns of table "social_following" */
+export interface SocialFollowingVarSampOrderBy {followeeIdChatbot?: (OrderBy | null)}
+
+
+/** aggregate variance on columns */
+export interface SocialFollowingVarianceFieldsGenqlSelection{
+ followeeIdChatbot?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+
+/** order by variance() on columns of table "social_following" */
+export interface SocialFollowingVarianceOrderBy {followeeIdChatbot?: (OrderBy | null)}
+
+
/** Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'. */
export interface StringComparisonExp {_eq?: (Scalars['String'] | null),_gt?: (Scalars['String'] | null),_gte?: (Scalars['String'] | null),
/** does the column match the given case-insensitive pattern */
@@ -8914,6 +9126,8 @@ export interface mutation_rootGenqlSelection{
updates: ReferralUpdates[]} })
/** update data of the table: "social_following" */
updateSocialFollowing?: (SocialFollowingMutationResponseGenqlSelection & { __args: {
+ /** increments the numeric columns with given value of the filtered values */
+ _inc?: (SocialFollowingIncInput | null),
/** sets the columns of the filtered rows to the given values */
_set?: (SocialFollowingSetInput | null),
/** filter the rows which have to be updated */
@@ -11969,6 +12183,14 @@ export type SubscriptionGenqlSelection = subscription_rootGenqlSelection
+ const SocialFollowingAvgFields_possibleTypes: string[] = ['SocialFollowingAvgFields']
+ export const isSocialFollowingAvgFields = (obj?: { __typename?: any } | null): obj is SocialFollowingAvgFields => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSocialFollowingAvgFields"')
+ return SocialFollowingAvgFields_possibleTypes.includes(obj.__typename)
+ }
+
+
+
const SocialFollowingMaxFields_possibleTypes: string[] = ['SocialFollowingMaxFields']
export const isSocialFollowingMaxFields = (obj?: { __typename?: any } | null): obj is SocialFollowingMaxFields => {
if (!obj?.__typename) throw new Error('__typename is missing in "isSocialFollowingMaxFields"')
@@ -11993,6 +12215,62 @@ export type SubscriptionGenqlSelection = subscription_rootGenqlSelection
+ const SocialFollowingStddevFields_possibleTypes: string[] = ['SocialFollowingStddevFields']
+ export const isSocialFollowingStddevFields = (obj?: { __typename?: any } | null): obj is SocialFollowingStddevFields => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSocialFollowingStddevFields"')
+ return SocialFollowingStddevFields_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const SocialFollowingStddevPopFields_possibleTypes: string[] = ['SocialFollowingStddevPopFields']
+ export const isSocialFollowingStddevPopFields = (obj?: { __typename?: any } | null): obj is SocialFollowingStddevPopFields => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSocialFollowingStddevPopFields"')
+ return SocialFollowingStddevPopFields_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const SocialFollowingStddevSampFields_possibleTypes: string[] = ['SocialFollowingStddevSampFields']
+ export const isSocialFollowingStddevSampFields = (obj?: { __typename?: any } | null): obj is SocialFollowingStddevSampFields => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSocialFollowingStddevSampFields"')
+ return SocialFollowingStddevSampFields_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const SocialFollowingSumFields_possibleTypes: string[] = ['SocialFollowingSumFields']
+ export const isSocialFollowingSumFields = (obj?: { __typename?: any } | null): obj is SocialFollowingSumFields => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSocialFollowingSumFields"')
+ return SocialFollowingSumFields_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const SocialFollowingVarPopFields_possibleTypes: string[] = ['SocialFollowingVarPopFields']
+ export const isSocialFollowingVarPopFields = (obj?: { __typename?: any } | null): obj is SocialFollowingVarPopFields => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSocialFollowingVarPopFields"')
+ return SocialFollowingVarPopFields_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const SocialFollowingVarSampFields_possibleTypes: string[] = ['SocialFollowingVarSampFields']
+ export const isSocialFollowingVarSampFields = (obj?: { __typename?: any } | null): obj is SocialFollowingVarSampFields => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSocialFollowingVarSampFields"')
+ return SocialFollowingVarSampFields_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const SocialFollowingVarianceFields_possibleTypes: string[] = ['SocialFollowingVarianceFields']
+ export const isSocialFollowingVarianceFields = (obj?: { __typename?: any } | null): obj is SocialFollowingVarianceFields => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSocialFollowingVarianceFields"')
+ return SocialFollowingVarianceFields_possibleTypes.includes(obj.__typename)
+ }
+
+
+
const Thread_possibleTypes: string[] = ['Thread']
export const isThread = (obj?: { __typename?: any } | null): obj is Thread => {
if (!obj?.__typename) throw new Error('__typename is missing in "isThread"')
@@ -12689,6 +12967,7 @@ export const enumReferralUpdateColumn = {
export const enumSocialFollowingSelectColumn = {
createdAt: 'createdAt' as const,
followeeId: 'followeeId' as const,
+ followeeIdChatbot: 'followeeIdChatbot' as const,
followerId: 'followerId' as const
}
diff --git a/packages/mb-genql/generated/types.ts b/packages/mb-genql/generated/types.ts
index 217d00d6..fb499e52 100644
--- a/packages/mb-genql/generated/types.ts
+++ b/packages/mb-genql/generated/types.ts
@@ -59,31 +59,31 @@ export default {
514,
524,
528,
- 544,
- 549,
- 560,
- 572,
- 573,
- 574,
- 586,
- 599,
- 608,
- 612,
- 618,
- 627,
- 631,
- 637,
- 646,
- 650,
- 656,
- 666,
- 677,
- 687,
- 691,
- 693,
- 712,
- 714,
- 715
+ 547,
+ 566,
+ 577,
+ 589,
+ 590,
+ 591,
+ 603,
+ 616,
+ 625,
+ 629,
+ 635,
+ 644,
+ 648,
+ 654,
+ 663,
+ 667,
+ 673,
+ 683,
+ 694,
+ 704,
+ 708,
+ 710,
+ 729,
+ 731,
+ 732
],
"types": {
"Boolean": {},
@@ -116,7 +116,7 @@ export default {
0
],
"__typename": [
- 549
+ 566
]
},
"Category": {
@@ -212,10 +212,10 @@ export default {
}
],
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"CategoryAggregate": {
@@ -226,7 +226,7 @@ export default {
2
],
"__typename": [
- 549
+ 566
]
},
"CategoryAggregateFields": {
@@ -273,7 +273,7 @@ export default {
29
],
"__typename": [
- 549
+ 566
]
},
"CategoryAvgFields": {
@@ -281,7 +281,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"CategoryBoolExp": {
@@ -310,10 +310,10 @@ export default {
181
],
"name": [
- 550
+ 567
],
"__typename": [
- 549
+ 566
]
},
"CategoryConstraint": {},
@@ -322,7 +322,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"CategoryInsertInput": {
@@ -336,10 +336,10 @@ export default {
184
],
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"CategoryMaxFields": {
@@ -347,10 +347,10 @@ export default {
172
],
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"CategoryMinFields": {
@@ -358,10 +358,10 @@ export default {
172
],
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"CategoryMutationResponse": {
@@ -372,7 +372,7 @@ export default {
2
],
"__typename": [
- 549
+ 566
]
},
"CategoryObjRelInsertInput": {
@@ -383,7 +383,7 @@ export default {
14
],
"__typename": [
- 549
+ 566
]
},
"CategoryOnConflict": {
@@ -397,7 +397,7 @@ export default {
6
],
"__typename": [
- 549
+ 566
]
},
"CategoryOrderBy": {
@@ -414,7 +414,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"CategoryPkColumnsInput": {
@@ -422,7 +422,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"CategorySelectColumn": {},
@@ -431,10 +431,10 @@ export default {
172
],
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"CategoryStddevFields": {
@@ -442,7 +442,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"CategoryStddevPopFields": {
@@ -450,7 +450,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"CategoryStddevSampFields": {
@@ -458,7 +458,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"CategoryStreamCursorInput": {
@@ -469,7 +469,7 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"CategoryStreamCursorValueInput": {
@@ -477,10 +477,10 @@ export default {
172
],
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"CategorySumFields": {
@@ -488,7 +488,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"CategoryUpdateColumn": {},
@@ -503,7 +503,7 @@ export default {
6
],
"__typename": [
- 549
+ 566
]
},
"CategoryVarPopFields": {
@@ -511,7 +511,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"CategoryVarSampFields": {
@@ -519,7 +519,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"CategoryVarianceFields": {
@@ -527,12 +527,12 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"Chat": {
"addedBy": [
- 715
+ 732
],
"chatId": [
172
@@ -544,13 +544,13 @@ export default {
172
],
"conversationLink": [
- 549
+ 566
],
"user": [
- 652
+ 669
],
"__typename": [
- 549
+ 566
]
},
"ChatAggregate": {
@@ -561,15 +561,15 @@ export default {
30
],
"__typename": [
- 549
+ 566
]
},
"ChatAggregateBoolExp": {
"count": [
- 696
+ 713
],
"__typename": [
- 549
+ 566
]
},
"ChatAggregateFields": {
@@ -616,7 +616,7 @@ export default {
68
],
"__typename": [
- 549
+ 566
]
},
"ChatAggregateOrderBy": {
@@ -654,7 +654,7 @@ export default {
69
],
"__typename": [
- 549
+ 566
]
},
"ChatArrRelInsertInput": {
@@ -665,7 +665,7 @@ export default {
47
],
"__typename": [
- 549
+ 566
]
},
"ChatAvgFields": {
@@ -676,7 +676,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatAvgOrderBy": {
@@ -687,7 +687,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatBoolExp": {
@@ -701,7 +701,7 @@ export default {
38
],
"addedBy": [
- 695
+ 712
],
"chatId": [
173
@@ -713,13 +713,13 @@ export default {
173
],
"conversationLink": [
- 550
+ 567
],
"user": [
- 655
+ 672
],
"__typename": [
- 549
+ 566
]
},
"ChatConstraint": {},
@@ -731,12 +731,12 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatInsertInput": {
"addedBy": [
- 715
+ 732
],
"chatId": [
172
@@ -748,18 +748,18 @@ export default {
172
],
"conversationLink": [
- 549
+ 566
],
"user": [
- 661
+ 678
],
"__typename": [
- 549
+ 566
]
},
"ChatMaxFields": {
"addedBy": [
- 715
+ 732
],
"chatId": [
172
@@ -768,10 +768,10 @@ export default {
172
],
"conversationLink": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ChatMaxOrderBy": {
@@ -788,12 +788,12 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatMinFields": {
"addedBy": [
- 715
+ 732
],
"chatId": [
172
@@ -802,10 +802,10 @@ export default {
172
],
"conversationLink": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ChatMinOrderBy": {
@@ -822,7 +822,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatMutationResponse": {
@@ -833,7 +833,7 @@ export default {
30
],
"__typename": [
- 549
+ 566
]
},
"ChatOnConflict": {
@@ -847,7 +847,7 @@ export default {
38
],
"__typename": [
- 549
+ 566
]
},
"ChatOrderBy": {
@@ -867,10 +867,10 @@ export default {
324
],
"user": [
- 663
+ 680
],
"__typename": [
- 549
+ 566
]
},
"ChatPkColumnsInput": {
@@ -878,13 +878,13 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatSelectColumn": {},
"ChatSetInput": {
"addedBy": [
- 715
+ 732
],
"chatId": [
172
@@ -893,10 +893,10 @@ export default {
172
],
"conversationLink": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ChatStddevFields": {
@@ -907,7 +907,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatStddevOrderBy": {
@@ -918,7 +918,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatStddevPopFields": {
@@ -929,7 +929,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatStddevPopOrderBy": {
@@ -940,7 +940,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatStddevSampFields": {
@@ -951,7 +951,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatStddevSampOrderBy": {
@@ -962,7 +962,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatStreamCursorInput": {
@@ -973,12 +973,12 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"ChatStreamCursorValueInput": {
"addedBy": [
- 715
+ 732
],
"chatId": [
172
@@ -987,10 +987,10 @@ export default {
172
],
"conversationLink": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ChatSumFields": {
@@ -1001,7 +1001,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatSumOrderBy": {
@@ -1012,7 +1012,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatUpdateColumn": {},
@@ -1027,7 +1027,7 @@ export default {
38
],
"__typename": [
- 549
+ 566
]
},
"ChatVarPopFields": {
@@ -1038,7 +1038,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatVarPopOrderBy": {
@@ -1049,7 +1049,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatVarSampFields": {
@@ -1060,7 +1060,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatVarSampOrderBy": {
@@ -1071,7 +1071,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatVarianceFields": {
@@ -1082,7 +1082,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatVarianceOrderBy": {
@@ -1093,12 +1093,12 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"Chatbot": {
"avatar": [
- 549
+ 566
],
"categories": [
79,
@@ -1195,22 +1195,66 @@ export default {
151
],
"createdBy": [
- 549
+ 566
],
"defaultComplexity": [
- 549
+ 566
],
"defaultLength": [
- 549
+ 566
],
"defaultTone": [
- 549
+ 566
],
"defaultType": [
- 549
+ 566
],
"description": [
- 549
+ 566
+ ],
+ "followers": [
+ 530,
+ {
+ "distinctOn": [
+ 547,
+ "[SocialFollowingSelectColumn!]"
+ ],
+ "limit": [
+ 172
+ ],
+ "offset": [
+ 172
+ ],
+ "orderBy": [
+ 546,
+ "[SocialFollowingOrderBy!]"
+ ],
+ "where": [
+ 538
+ ]
+ }
+ ],
+ "followersAggregate": [
+ 531,
+ {
+ "distinctOn": [
+ 547,
+ "[SocialFollowingSelectColumn!]"
+ ],
+ "limit": [
+ 172
+ ],
+ "offset": [
+ 172
+ ],
+ "orderBy": [
+ 546,
+ "[SocialFollowingOrderBy!]"
+ ],
+ "where": [
+ 538
+ ]
+ }
],
"lengthEnum": [
242
@@ -1260,7 +1304,7 @@ export default {
}
],
"name": [
- 549
+ 566
],
"preferences": [
325,
@@ -1351,10 +1395,10 @@ export default {
}
],
"threads": [
- 551,
+ 568,
{
"distinctOn": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"limit": [
@@ -1364,19 +1408,19 @@ export default {
172
],
"orderBy": [
- 570,
+ 587,
"[ThreadOrderBy!]"
],
"where": [
- 559
+ 576
]
}
],
"threadsAggregate": [
- 552,
+ 569,
{
"distinctOn": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"limit": [
@@ -1386,22 +1430,22 @@ export default {
172
],
"orderBy": [
- 570,
+ 587,
"[ThreadOrderBy!]"
],
"where": [
- 559
+ 576
]
}
],
"toneEnum": [
- 614
+ 631
],
"typeEnum": [
- 633
+ 650
],
"__typename": [
- 549
+ 566
]
},
"ChatbotAggregate": {
@@ -1412,15 +1456,15 @@ export default {
70
],
"__typename": [
- 549
+ 566
]
},
"ChatbotAggregateBoolExp": {
"count": [
- 697
+ 714
],
"__typename": [
- 549
+ 566
]
},
"ChatbotAggregateFields": {
@@ -1467,7 +1511,7 @@ export default {
149
],
"__typename": [
- 549
+ 566
]
},
"ChatbotAggregateOrderBy": {
@@ -1505,7 +1549,7 @@ export default {
150
],
"__typename": [
- 549
+ 566
]
},
"ChatbotArrRelInsertInput": {
@@ -1516,7 +1560,7 @@ export default {
128
],
"__typename": [
- 549
+ 566
]
},
"ChatbotAvgFields": {
@@ -1524,7 +1568,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotAvgOrderBy": {
@@ -1532,7 +1576,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotBoolExp": {
@@ -1546,7 +1590,7 @@ export default {
78
],
"avatar": [
- 550
+ 567
],
"categories": [
87
@@ -1567,22 +1611,28 @@ export default {
154
],
"createdBy": [
- 550
+ 567
],
"defaultComplexity": [
- 550
+ 567
],
"defaultLength": [
- 550
+ 567
],
"defaultTone": [
- 550
+ 567
],
"defaultType": [
- 550
+ 567
],
"description": [
- 550
+ 567
+ ],
+ "followers": [
+ 538
+ ],
+ "followersAggregate": [
+ 532
],
"lengthEnum": [
245
@@ -1594,7 +1644,7 @@ export default {
181
],
"name": [
- 550
+ 567
],
"preferences": [
333
@@ -1609,19 +1659,19 @@ export default {
378
],
"threads": [
- 559
+ 576
],
"threadsAggregate": [
- 553
+ 570
],
"toneEnum": [
- 617
+ 634
],
"typeEnum": [
- 636
+ 653
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategory": {
@@ -1638,7 +1688,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryAggregate": {
@@ -1649,15 +1699,15 @@ export default {
79
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryAggregateBoolExp": {
"count": [
- 698
+ 715
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryAggregateFields": {
@@ -1704,7 +1754,7 @@ export default {
117
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryAggregateOrderBy": {
@@ -1742,7 +1792,7 @@ export default {
118
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryArrRelInsertInput": {
@@ -1753,7 +1803,7 @@ export default {
96
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryAvgFields": {
@@ -1764,7 +1814,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryAvgOrderBy": {
@@ -1775,7 +1825,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryBoolExp": {
@@ -1801,7 +1851,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryConstraint": {},
@@ -1813,7 +1863,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryInsertInput": {
@@ -1830,7 +1880,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryMaxFields": {
@@ -1841,7 +1891,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryMaxOrderBy": {
@@ -1852,7 +1902,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryMinFields": {
@@ -1863,7 +1913,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryMinOrderBy": {
@@ -1874,7 +1924,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryMutationResponse": {
@@ -1885,7 +1935,7 @@ export default {
79
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryOnConflict": {
@@ -1899,7 +1949,7 @@ export default {
87
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryOrderBy": {
@@ -1916,7 +1966,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryPkColumnsInput": {
@@ -1927,7 +1977,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategorySelectColumn": {},
@@ -1939,7 +1989,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryStddevFields": {
@@ -1950,7 +2000,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryStddevOrderBy": {
@@ -1961,7 +2011,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryStddevPopFields": {
@@ -1972,7 +2022,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryStddevPopOrderBy": {
@@ -1983,7 +2033,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryStddevSampFields": {
@@ -1994,7 +2044,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryStddevSampOrderBy": {
@@ -2005,7 +2055,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryStreamCursorInput": {
@@ -2016,7 +2066,7 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryStreamCursorValueInput": {
@@ -2027,7 +2077,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategorySumFields": {
@@ -2038,7 +2088,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategorySumOrderBy": {
@@ -2049,7 +2099,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryUpdateColumn": {},
@@ -2064,7 +2114,7 @@ export default {
87
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryVarPopFields": {
@@ -2075,7 +2125,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryVarPopOrderBy": {
@@ -2086,7 +2136,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryVarSampFields": {
@@ -2097,7 +2147,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryVarSampOrderBy": {
@@ -2108,7 +2158,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryVarianceFields": {
@@ -2119,7 +2169,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotCategoryVarianceOrderBy": {
@@ -2130,7 +2180,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotConstraint": {},
@@ -2139,12 +2189,12 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotInsertInput": {
"avatar": [
- 549
+ 566
],
"categories": [
84
@@ -2159,22 +2209,25 @@ export default {
160
],
"createdBy": [
- 549
+ 566
],
"defaultComplexity": [
- 549
+ 566
],
"defaultLength": [
- 549
+ 566
],
"defaultTone": [
- 549
+ 566
],
"defaultType": [
- 549
+ 566
],
"description": [
- 549
+ 566
+ ],
+ "followers": [
+ 535
],
"lengthEnum": [
251
@@ -2183,7 +2236,7 @@ export default {
184
],
"name": [
- 549
+ 566
],
"preferences": [
330
@@ -2192,48 +2245,48 @@ export default {
381
],
"threads": [
- 556
+ 573
],
"toneEnum": [
- 623
+ 640
],
"typeEnum": [
- 642
+ 659
],
"__typename": [
- 549
+ 566
]
},
"ChatbotMaxFields": {
"avatar": [
- 549
+ 566
],
"chatbotId": [
172
],
"createdBy": [
- 549
+ 566
],
"defaultComplexity": [
- 549
+ 566
],
"defaultLength": [
- 549
+ 566
],
"defaultTone": [
- 549
+ 566
],
"defaultType": [
- 549
+ 566
],
"description": [
- 549
+ 566
],
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ChatbotMaxOrderBy": {
@@ -2265,39 +2318,39 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotMinFields": {
"avatar": [
- 549
+ 566
],
"chatbotId": [
172
],
"createdBy": [
- 549
+ 566
],
"defaultComplexity": [
- 549
+ 566
],
"defaultLength": [
- 549
+ 566
],
"defaultTone": [
- 549
+ 566
],
"defaultType": [
- 549
+ 566
],
"description": [
- 549
+ 566
],
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ChatbotMinOrderBy": {
@@ -2329,7 +2382,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotMutationResponse": {
@@ -2340,7 +2393,7 @@ export default {
70
],
"__typename": [
- 549
+ 566
]
},
"ChatbotObjRelInsertInput": {
@@ -2351,7 +2404,7 @@ export default {
128
],
"__typename": [
- 549
+ 566
]
},
"ChatbotOnConflict": {
@@ -2365,7 +2418,7 @@ export default {
78
],
"__typename": [
- 549
+ 566
]
},
"ChatbotOrderBy": {
@@ -2402,6 +2455,9 @@ export default {
"description": [
324
],
+ "followersAggregate": [
+ 534
+ ],
"lengthEnum": [
253
],
@@ -2418,16 +2474,16 @@ export default {
380
],
"threadsAggregate": [
- 555
+ 572
],
"toneEnum": [
- 625
+ 642
],
"typeEnum": [
- 644
+ 661
],
"__typename": [
- 549
+ 566
]
},
"ChatbotPkColumnsInput": {
@@ -2435,40 +2491,40 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotSelectColumn": {},
"ChatbotSetInput": {
"avatar": [
- 549
+ 566
],
"chatbotId": [
172
],
"createdBy": [
- 549
+ 566
],
"defaultComplexity": [
- 549
+ 566
],
"defaultLength": [
- 549
+ 566
],
"defaultTone": [
- 549
+ 566
],
"defaultType": [
- 549
+ 566
],
"description": [
- 549
+ 566
],
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ChatbotStddevFields": {
@@ -2476,7 +2532,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotStddevOrderBy": {
@@ -2484,7 +2540,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotStddevPopFields": {
@@ -2492,7 +2548,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotStddevPopOrderBy": {
@@ -2500,7 +2556,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotStddevSampFields": {
@@ -2508,7 +2564,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotStddevSampOrderBy": {
@@ -2516,7 +2572,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotStreamCursorInput": {
@@ -2527,39 +2583,39 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"ChatbotStreamCursorValueInput": {
"avatar": [
- 549
+ 566
],
"chatbotId": [
172
],
"createdBy": [
- 549
+ 566
],
"defaultComplexity": [
- 549
+ 566
],
"defaultLength": [
- 549
+ 566
],
"defaultTone": [
- 549
+ 566
],
"defaultType": [
- 549
+ 566
],
"description": [
- 549
+ 566
],
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ChatbotSumFields": {
@@ -2567,7 +2623,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ChatbotSumOrderBy": {
@@ -2575,7 +2631,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotUpdateColumn": {},
@@ -2590,7 +2646,7 @@ export default {
78
],
"__typename": [
- 549
+ 566
]
},
"ChatbotVarPopFields": {
@@ -2598,7 +2654,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotVarPopOrderBy": {
@@ -2606,7 +2662,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotVarSampFields": {
@@ -2614,7 +2670,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotVarSampOrderBy": {
@@ -2622,7 +2678,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ChatbotVarianceFields": {
@@ -2630,7 +2686,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ChatbotVarianceOrderBy": {
@@ -2638,7 +2694,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnum": {
@@ -2731,10 +2787,10 @@ export default {
}
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumAggregate": {
@@ -2745,7 +2801,7 @@ export default {
151
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumAggregateFields": {
@@ -2768,7 +2824,7 @@ export default {
158
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumBoolExp": {
@@ -2794,10 +2850,10 @@ export default {
327
],
"value": [
- 550
+ 567
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumConstraint": {},
@@ -2809,26 +2865,26 @@ export default {
330
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumMaxFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumMinFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumMutationResponse": {
@@ -2839,7 +2895,7 @@ export default {
151
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumObjRelInsertInput": {
@@ -2850,7 +2906,7 @@ export default {
161
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumOnConflict": {
@@ -2864,7 +2920,7 @@ export default {
154
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumOrderBy": {
@@ -2878,24 +2934,24 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumPkColumnsInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumSelectColumn": {},
"ComplexityEnumSetInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumStreamCursorInput": {
@@ -2906,15 +2962,15 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumStreamCursorValueInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ComplexityEnumUpdateColumn": {},
@@ -2926,7 +2982,7 @@ export default {
154
],
"__typename": [
- 549
+ 566
]
},
"CursorOrdering": {},
@@ -2961,7 +3017,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"Label": {
@@ -2969,7 +3025,7 @@ export default {
0
],
"categories": [
- 549
+ 566
],
"labelId": [
172
@@ -3019,16 +3075,16 @@ export default {
}
],
"questions": [
- 549
+ 566
],
"subCategories": [
- 549
+ 566
],
"tags": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LabelAggregate": {
@@ -3039,7 +3095,7 @@ export default {
174
],
"__typename": [
- 549
+ 566
]
},
"LabelAggregateFields": {
@@ -3086,7 +3142,7 @@ export default {
241
],
"__typename": [
- 549
+ 566
]
},
"LabelAvgFields": {
@@ -3094,7 +3150,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelBoolExp": {
@@ -3111,7 +3167,7 @@ export default {
1
],
"categories": [
- 550
+ 567
],
"labelId": [
173
@@ -3123,16 +3179,16 @@ export default {
181
],
"questions": [
- 550
+ 567
],
"subCategories": [
- 550
+ 567
],
"tags": [
- 550
+ 567
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategory": {
@@ -3155,7 +3211,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryAggregate": {
@@ -3166,15 +3222,15 @@ export default {
179
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryAggregateBoolExp": {
"count": [
- 699
+ 716
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryAggregateFields": {
@@ -3221,7 +3277,7 @@ export default {
217
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryAggregateOrderBy": {
@@ -3259,7 +3315,7 @@ export default {
218
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryArrRelInsertInput": {
@@ -3270,7 +3326,7 @@ export default {
196
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryAvgFields": {
@@ -3284,7 +3340,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryAvgOrderBy": {
@@ -3298,7 +3354,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryBoolExp": {
@@ -3330,7 +3386,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryConstraint": {},
@@ -3345,7 +3401,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryInsertInput": {
@@ -3368,7 +3424,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryMaxFields": {
@@ -3382,7 +3438,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryMaxOrderBy": {
@@ -3396,7 +3452,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryMinFields": {
@@ -3410,7 +3466,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryMinOrderBy": {
@@ -3424,7 +3480,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryMutationResponse": {
@@ -3435,7 +3491,7 @@ export default {
179
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryOnConflict": {
@@ -3449,7 +3505,7 @@ export default {
187
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryOrderBy": {
@@ -3472,7 +3528,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryPkColumnsInput": {
@@ -3486,7 +3542,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategorySelectColumn": {},
@@ -3501,7 +3557,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryStddevFields": {
@@ -3515,7 +3571,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryStddevOrderBy": {
@@ -3529,7 +3585,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryStddevPopFields": {
@@ -3543,7 +3599,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryStddevPopOrderBy": {
@@ -3557,7 +3613,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryStddevSampFields": {
@@ -3571,7 +3627,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryStddevSampOrderBy": {
@@ -3585,7 +3641,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryStreamCursorInput": {
@@ -3596,7 +3652,7 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryStreamCursorValueInput": {
@@ -3610,7 +3666,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategorySumFields": {
@@ -3624,7 +3680,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategorySumOrderBy": {
@@ -3638,7 +3694,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryUpdateColumn": {},
@@ -3653,7 +3709,7 @@ export default {
187
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryVarPopFields": {
@@ -3667,7 +3723,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryVarPopOrderBy": {
@@ -3681,7 +3737,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryVarSampFields": {
@@ -3695,7 +3751,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryVarSampOrderBy": {
@@ -3709,7 +3765,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryVarianceFields": {
@@ -3723,7 +3779,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelChatbotCategoryVarianceOrderBy": {
@@ -3737,7 +3793,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelConstraint": {},
@@ -3746,7 +3802,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelInsertInput": {
@@ -3754,7 +3810,7 @@ export default {
0
],
"categories": [
- 549
+ 566
],
"labelId": [
172
@@ -3763,56 +3819,56 @@ export default {
184
],
"questions": [
- 549
+ 566
],
"subCategories": [
- 549
+ 566
],
"tags": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LabelMaxFields": {
"categories": [
- 549
+ 566
],
"labelId": [
172
],
"questions": [
- 549
+ 566
],
"subCategories": [
- 549
+ 566
],
"tags": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LabelMinFields": {
"categories": [
- 549
+ 566
],
"labelId": [
172
],
"questions": [
- 549
+ 566
],
"subCategories": [
- 549
+ 566
],
"tags": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LabelMutationResponse": {
@@ -3823,7 +3879,7 @@ export default {
174
],
"__typename": [
- 549
+ 566
]
},
"LabelObjRelInsertInput": {
@@ -3834,7 +3890,7 @@ export default {
226
],
"__typename": [
- 549
+ 566
]
},
"LabelOnConflict": {
@@ -3848,7 +3904,7 @@ export default {
178
],
"__typename": [
- 549
+ 566
]
},
"LabelOrderBy": {
@@ -3874,7 +3930,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LabelPkColumnsInput": {
@@ -3882,7 +3938,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelSelectColumn": {},
@@ -3891,22 +3947,22 @@ export default {
0
],
"categories": [
- 549
+ 566
],
"labelId": [
172
],
"questions": [
- 549
+ 566
],
"subCategories": [
- 549
+ 566
],
"tags": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LabelStddevFields": {
@@ -3914,7 +3970,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelStddevPopFields": {
@@ -3922,7 +3978,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelStddevSampFields": {
@@ -3930,7 +3986,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelStreamCursorInput": {
@@ -3941,7 +3997,7 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"LabelStreamCursorValueInput": {
@@ -3949,22 +4005,22 @@ export default {
0
],
"categories": [
- 549
+ 566
],
"labelId": [
172
],
"questions": [
- 549
+ 566
],
"subCategories": [
- 549
+ 566
],
"tags": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LabelSumFields": {
@@ -3972,7 +4028,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"LabelUpdateColumn": {},
@@ -3987,7 +4043,7 @@ export default {
178
],
"__typename": [
- 549
+ 566
]
},
"LabelVarPopFields": {
@@ -3995,7 +4051,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelVarSampFields": {
@@ -4003,7 +4059,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LabelVarianceFields": {
@@ -4011,7 +4067,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"LengthEnum": {
@@ -4104,10 +4160,10 @@ export default {
}
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumAggregate": {
@@ -4118,7 +4174,7 @@ export default {
242
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumAggregateFields": {
@@ -4141,7 +4197,7 @@ export default {
249
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumBoolExp": {
@@ -4167,10 +4223,10 @@ export default {
327
],
"value": [
- 550
+ 567
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumConstraint": {},
@@ -4182,26 +4238,26 @@ export default {
330
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumMaxFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumMinFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumMutationResponse": {
@@ -4212,7 +4268,7 @@ export default {
242
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumObjRelInsertInput": {
@@ -4223,7 +4279,7 @@ export default {
252
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumOnConflict": {
@@ -4237,7 +4293,7 @@ export default {
245
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumOrderBy": {
@@ -4251,24 +4307,24 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumPkColumnsInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumSelectColumn": {},
"LengthEnumSetInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumStreamCursorInput": {
@@ -4279,15 +4335,15 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumStreamCursorValueInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"LengthEnumUpdateColumn": {},
@@ -4299,33 +4355,33 @@ export default {
245
],
"__typename": [
- 549
+ 566
]
},
"Message": {
"content": [
- 549
+ 566
],
"createdAt": [
- 712
+ 729
],
"messageId": [
- 715
+ 732
],
"messageTypeEnum": [
282
],
"role": [
- 549
+ 566
],
"thread": [
- 551
+ 568
],
"threadId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"MessageAggregate": {
@@ -4336,15 +4392,15 @@ export default {
261
],
"__typename": [
- 549
+ 566
]
},
"MessageAggregateBoolExp": {
"count": [
- 700
+ 717
],
"__typename": [
- 549
+ 566
]
},
"MessageAggregateFields": {
@@ -4367,7 +4423,7 @@ export default {
272
],
"__typename": [
- 549
+ 566
]
},
"MessageAggregateOrderBy": {
@@ -4381,7 +4437,7 @@ export default {
273
],
"__typename": [
- 549
+ 566
]
},
"MessageArrRelInsertInput": {
@@ -4392,7 +4448,7 @@ export default {
275
],
"__typename": [
- 549
+ 566
]
},
"MessageBoolExp": {
@@ -4406,75 +4462,75 @@ export default {
267
],
"content": [
- 550
+ 567
],
"createdAt": [
- 594
+ 611
],
"messageId": [
- 695
+ 712
],
"messageTypeEnum": [
285
],
"role": [
- 550
+ 567
],
"thread": [
- 559
+ 576
],
"threadId": [
- 695
+ 712
],
"__typename": [
- 549
+ 566
]
},
"MessageConstraint": {},
"MessageInsertInput": {
"content": [
- 549
+ 566
],
"createdAt": [
- 712
+ 729
],
"messageId": [
- 715
+ 732
],
"messageTypeEnum": [
291
],
"role": [
- 549
+ 566
],
"thread": [
- 568
+ 585
],
"threadId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"MessageMaxFields": {
"content": [
- 549
+ 566
],
"createdAt": [
- 712
+ 729
],
"messageId": [
- 715
+ 732
],
"role": [
- 549
+ 566
],
"threadId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"MessageMaxOrderBy": {
@@ -4494,27 +4550,27 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"MessageMinFields": {
"content": [
- 549
+ 566
],
"createdAt": [
- 712
+ 729
],
"messageId": [
- 715
+ 732
],
"role": [
- 549
+ 566
],
"threadId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"MessageMinOrderBy": {
@@ -4534,7 +4590,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"MessageMutationResponse": {
@@ -4545,7 +4601,7 @@ export default {
261
],
"__typename": [
- 549
+ 566
]
},
"MessageOnConflict": {
@@ -4559,7 +4615,7 @@ export default {
267
],
"__typename": [
- 549
+ 566
]
},
"MessageOrderBy": {
@@ -4579,42 +4635,42 @@ export default {
324
],
"thread": [
- 570
+ 587
],
"threadId": [
324
],
"__typename": [
- 549
+ 566
]
},
"MessagePkColumnsInput": {
"messageId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"MessageSelectColumn": {},
"MessageSetInput": {
"content": [
- 549
+ 566
],
"createdAt": [
- 712
+ 729
],
"messageId": [
- 715
+ 732
],
"role": [
- 549
+ 566
],
"threadId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"MessageStreamCursorInput": {
@@ -4625,27 +4681,27 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"MessageStreamCursorValueInput": {
"content": [
- 549
+ 566
],
"createdAt": [
- 712
+ 729
],
"messageId": [
- 715
+ 732
],
"role": [
- 549
+ 566
],
"threadId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnum": {
@@ -4694,10 +4750,10 @@ export default {
}
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumAggregate": {
@@ -4708,7 +4764,7 @@ export default {
282
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumAggregateFields": {
@@ -4731,7 +4787,7 @@ export default {
289
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumBoolExp": {
@@ -4751,10 +4807,10 @@ export default {
263
],
"value": [
- 550
+ 567
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumConstraint": {},
@@ -4763,26 +4819,26 @@ export default {
266
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumMaxFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumMinFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumMutationResponse": {
@@ -4793,7 +4849,7 @@ export default {
282
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumObjRelInsertInput": {
@@ -4804,7 +4860,7 @@ export default {
292
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumOnConflict": {
@@ -4818,7 +4874,7 @@ export default {
285
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumOrderBy": {
@@ -4829,24 +4885,24 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumPkColumnsInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumSelectColumn": {},
"MessageTypeEnumSetInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumStreamCursorInput": {
@@ -4857,15 +4913,15 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumStreamCursorValueInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"MessageTypeEnumUpdateColumn": {},
@@ -4877,7 +4933,7 @@ export default {
285
],
"__typename": [
- 549
+ 566
]
},
"MessageUpdateColumn": {},
@@ -4889,18 +4945,18 @@ export default {
267
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnum": {
"name": [
- 549
+ 566
],
"threads": [
- 551,
+ 568,
{
"distinctOn": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"limit": [
@@ -4910,19 +4966,19 @@ export default {
172
],
"orderBy": [
- 570,
+ 587,
"[ThreadOrderBy!]"
],
"where": [
- 559
+ 576
]
}
],
"threadsAggregate": [
- 552,
+ 569,
{
"distinctOn": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"limit": [
@@ -4932,19 +4988,19 @@ export default {
172
],
"orderBy": [
- 570,
+ 587,
"[ThreadOrderBy!]"
],
"where": [
- 559
+ 576
]
}
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumAggregate": {
@@ -4955,7 +5011,7 @@ export default {
303
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumAggregateFields": {
@@ -4978,7 +5034,7 @@ export default {
312
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumBoolExp": {
@@ -4992,19 +5048,19 @@ export default {
306
],
"name": [
- 550
+ 567
],
"threads": [
- 559
+ 576
],
"threadsAggregate": [
- 553
+ 570
],
"value": [
- 550
+ 567
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumConstraint": {},
@@ -5026,43 +5082,43 @@ export default {
308
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumInsertInput": {
"name": [
- 549
+ 566
],
"threads": [
- 556
+ 573
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumMaxFields": {
"name": [
- 549
+ 566
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumMinFields": {
"name": [
- 549
+ 566
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumMutationResponse": {
@@ -5073,7 +5129,7 @@ export default {
303
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumObjRelInsertInput": {
@@ -5084,7 +5140,7 @@ export default {
315
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumOnConflict": {
@@ -5098,7 +5154,7 @@ export default {
306
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumOrderBy": {
@@ -5106,33 +5162,33 @@ export default {
324
],
"threadsAggregate": [
- 555
+ 572
],
"value": [
324
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumPkColumnsInput": {
"name": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumSelectColumn": {},
"ModelsEnumSetInput": {
"name": [
- 549
+ 566
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumStreamCursorInput": {
@@ -5143,18 +5199,18 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumStreamCursorValueInput": {
"name": [
- 549
+ 566
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ModelsEnumUpdateColumn": {},
@@ -5166,7 +5222,7 @@ export default {
306
],
"__typename": [
- 549
+ 566
]
},
"OrderBy": {},
@@ -5190,31 +5246,31 @@ export default {
172
],
"preferredComplexity": [
- 549
+ 566
],
"preferredLength": [
- 549
+ 566
],
"preferredTone": [
- 549
+ 566
],
"preferredType": [
- 549
+ 566
],
"toneEnum": [
- 614
+ 631
],
"typeEnum": [
- 633
+ 650
],
"user": [
- 652
+ 669
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PreferenceAggregate": {
@@ -5225,21 +5281,21 @@ export default {
325
],
"__typename": [
- 549
+ 566
]
},
"PreferenceAggregateBoolExp": {
"bool_and": [
- 701
+ 718
],
"bool_or": [
- 702
+ 719
],
"count": [
- 703
+ 720
],
"__typename": [
- 549
+ 566
]
},
"PreferenceAggregateFields": {
@@ -5286,7 +5342,7 @@ export default {
365
],
"__typename": [
- 549
+ 566
]
},
"PreferenceAggregateOrderBy": {
@@ -5324,7 +5380,7 @@ export default {
366
],
"__typename": [
- 549
+ 566
]
},
"PreferenceArrRelInsertInput": {
@@ -5335,7 +5391,7 @@ export default {
342
],
"__typename": [
- 549
+ 566
]
},
"PreferenceAvgFields": {
@@ -5346,7 +5402,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PreferenceAvgOrderBy": {
@@ -5357,7 +5413,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PreferenceBoolExp": {
@@ -5389,31 +5445,31 @@ export default {
173
],
"preferredComplexity": [
- 550
+ 567
],
"preferredLength": [
- 550
+ 567
],
"preferredTone": [
- 550
+ 567
],
"preferredType": [
- 550
+ 567
],
"toneEnum": [
- 617
+ 634
],
"typeEnum": [
- 636
+ 653
],
"user": [
- 655
+ 672
],
"userId": [
- 695
+ 712
],
"__typename": [
- 549
+ 566
]
},
"PreferenceConstraint": {},
@@ -5425,7 +5481,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PreferenceInsertInput": {
@@ -5448,31 +5504,31 @@ export default {
172
],
"preferredComplexity": [
- 549
+ 566
],
"preferredLength": [
- 549
+ 566
],
"preferredTone": [
- 549
+ 566
],
"preferredType": [
- 549
+ 566
],
"toneEnum": [
- 623
+ 640
],
"typeEnum": [
- 642
+ 659
],
"user": [
- 661
+ 678
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PreferenceMaxFields": {
@@ -5483,22 +5539,22 @@ export default {
172
],
"preferredComplexity": [
- 549
+ 566
],
"preferredLength": [
- 549
+ 566
],
"preferredTone": [
- 549
+ 566
],
"preferredType": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PreferenceMaxOrderBy": {
@@ -5524,7 +5580,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PreferenceMinFields": {
@@ -5535,22 +5591,22 @@ export default {
172
],
"preferredComplexity": [
- 549
+ 566
],
"preferredLength": [
- 549
+ 566
],
"preferredTone": [
- 549
+ 566
],
"preferredType": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PreferenceMinOrderBy": {
@@ -5576,7 +5632,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PreferenceMutationResponse": {
@@ -5587,7 +5643,7 @@ export default {
325
],
"__typename": [
- 549
+ 566
]
},
"PreferenceOnConflict": {
@@ -5601,7 +5657,7 @@ export default {
333
],
"__typename": [
- 549
+ 566
]
},
"PreferenceOrderBy": {
@@ -5636,19 +5692,19 @@ export default {
324
],
"toneEnum": [
- 625
+ 642
],
"typeEnum": [
- 644
+ 661
],
"user": [
- 663
+ 680
],
"userId": [
324
],
"__typename": [
- 549
+ 566
]
},
"PreferencePkColumnsInput": {
@@ -5656,7 +5712,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PreferenceSelectColumn": {},
@@ -5673,22 +5729,22 @@ export default {
172
],
"preferredComplexity": [
- 549
+ 566
],
"preferredLength": [
- 549
+ 566
],
"preferredTone": [
- 549
+ 566
],
"preferredType": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PreferenceStddevFields": {
@@ -5699,7 +5755,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PreferenceStddevOrderBy": {
@@ -5710,7 +5766,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PreferenceStddevPopFields": {
@@ -5721,7 +5777,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PreferenceStddevPopOrderBy": {
@@ -5732,7 +5788,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PreferenceStddevSampFields": {
@@ -5743,7 +5799,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PreferenceStddevSampOrderBy": {
@@ -5754,7 +5810,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PreferenceStreamCursorInput": {
@@ -5765,7 +5821,7 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"PreferenceStreamCursorValueInput": {
@@ -5779,22 +5835,22 @@ export default {
172
],
"preferredComplexity": [
- 549
+ 566
],
"preferredLength": [
- 549
+ 566
],
"preferredTone": [
- 549
+ 566
],
"preferredType": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PreferenceSumFields": {
@@ -5805,7 +5861,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PreferenceSumOrderBy": {
@@ -5816,7 +5872,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PreferenceUpdateColumn": {},
@@ -5831,7 +5887,7 @@ export default {
333
],
"__typename": [
- 549
+ 566
]
},
"PreferenceVarPopFields": {
@@ -5842,7 +5898,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PreferenceVarPopOrderBy": {
@@ -5853,7 +5909,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PreferenceVarSampFields": {
@@ -5864,7 +5920,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PreferenceVarSampOrderBy": {
@@ -5875,7 +5931,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PreferenceVarianceFields": {
@@ -5886,7 +5942,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PreferenceVarianceOrderBy": {
@@ -5897,7 +5953,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"Prompt": {
@@ -5946,19 +6002,19 @@ export default {
}
],
"content": [
- 549
+ 566
],
"promptId": [
172
],
"promptName": [
- 549
+ 566
],
"promptTypeEnum": [
440
],
"type": [
- 549
+ 566
],
"users": [
461,
@@ -6005,7 +6061,7 @@ export default {
}
],
"__typename": [
- 549
+ 566
]
},
"PromptAggregate": {
@@ -6016,15 +6072,15 @@ export default {
367
],
"__typename": [
- 549
+ 566
]
},
"PromptAggregateBoolExp": {
"count": [
- 704
+ 721
],
"__typename": [
- 549
+ 566
]
},
"PromptAggregateFields": {
@@ -6071,7 +6127,7 @@ export default {
505
],
"__typename": [
- 549
+ 566
]
},
"PromptAggregateOrderBy": {
@@ -6109,7 +6165,7 @@ export default {
506
],
"__typename": [
- 549
+ 566
]
},
"PromptArrRelInsertInput": {
@@ -6120,7 +6176,7 @@ export default {
425
],
"__typename": [
- 549
+ 566
]
},
"PromptAvgFields": {
@@ -6128,7 +6184,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptAvgOrderBy": {
@@ -6136,7 +6192,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptBoolExp": {
@@ -6156,19 +6212,19 @@ export default {
378
],
"content": [
- 550
+ 567
],
"promptId": [
173
],
"promptName": [
- 550
+ 567
],
"promptTypeEnum": [
443
],
"type": [
- 550
+ 567
],
"users": [
469
@@ -6177,7 +6233,7 @@ export default {
463
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbot": {
@@ -6194,7 +6250,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotAggregate": {
@@ -6205,15 +6261,15 @@ export default {
376
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotAggregateBoolExp": {
"count": [
- 705
+ 722
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotAggregateFields": {
@@ -6260,7 +6316,7 @@ export default {
414
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotAggregateOrderBy": {
@@ -6298,7 +6354,7 @@ export default {
415
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotArrRelInsertInput": {
@@ -6309,7 +6365,7 @@ export default {
393
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotAvgFields": {
@@ -6320,7 +6376,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotAvgOrderBy": {
@@ -6331,7 +6387,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotBoolExp": {
@@ -6357,7 +6413,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotConstraint": {},
@@ -6369,7 +6425,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotInsertInput": {
@@ -6386,7 +6442,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotMaxFields": {
@@ -6397,7 +6453,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotMaxOrderBy": {
@@ -6408,7 +6464,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotMinFields": {
@@ -6419,7 +6475,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotMinOrderBy": {
@@ -6430,7 +6486,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotMutationResponse": {
@@ -6441,7 +6497,7 @@ export default {
376
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotOnConflict": {
@@ -6455,7 +6511,7 @@ export default {
384
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotOrderBy": {
@@ -6472,7 +6528,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotPkColumnsInput": {
@@ -6483,7 +6539,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotSelectColumn": {},
@@ -6495,7 +6551,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotStddevFields": {
@@ -6506,7 +6562,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotStddevOrderBy": {
@@ -6517,7 +6573,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotStddevPopFields": {
@@ -6528,7 +6584,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotStddevPopOrderBy": {
@@ -6539,7 +6595,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotStddevSampFields": {
@@ -6550,7 +6606,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotStddevSampOrderBy": {
@@ -6561,7 +6617,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotStreamCursorInput": {
@@ -6572,7 +6628,7 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotStreamCursorValueInput": {
@@ -6583,7 +6639,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotSumFields": {
@@ -6594,7 +6650,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotSumOrderBy": {
@@ -6605,7 +6661,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotUpdateColumn": {},
@@ -6620,7 +6676,7 @@ export default {
384
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotVarPopFields": {
@@ -6631,7 +6687,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotVarPopOrderBy": {
@@ -6642,7 +6698,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotVarSampFields": {
@@ -6653,7 +6709,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotVarSampOrderBy": {
@@ -6664,7 +6720,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotVarianceFields": {
@@ -6675,7 +6731,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptChatbotVarianceOrderBy": {
@@ -6686,7 +6742,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptConstraint": {},
@@ -6695,7 +6751,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptInsertInput": {
@@ -6703,42 +6759,42 @@ export default {
381
],
"content": [
- 549
+ 566
],
"promptId": [
172
],
"promptName": [
- 549
+ 566
],
"promptTypeEnum": [
449
],
"type": [
- 549
+ 566
],
"users": [
466
],
"__typename": [
- 549
+ 566
]
},
"PromptMaxFields": {
"content": [
- 549
+ 566
],
"promptId": [
172
],
"promptName": [
- 549
+ 566
],
"type": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptMaxOrderBy": {
@@ -6755,24 +6811,24 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptMinFields": {
"content": [
- 549
+ 566
],
"promptId": [
172
],
"promptName": [
- 549
+ 566
],
"type": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptMinOrderBy": {
@@ -6789,7 +6845,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptMutationResponse": {
@@ -6800,7 +6856,7 @@ export default {
367
],
"__typename": [
- 549
+ 566
]
},
"PromptObjRelInsertInput": {
@@ -6811,7 +6867,7 @@ export default {
425
],
"__typename": [
- 549
+ 566
]
},
"PromptOnConflict": {
@@ -6825,7 +6881,7 @@ export default {
375
],
"__typename": [
- 549
+ 566
]
},
"PromptOrderBy": {
@@ -6851,7 +6907,7 @@ export default {
465
],
"__typename": [
- 549
+ 566
]
},
"PromptPkColumnsInput": {
@@ -6859,25 +6915,25 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptSelectColumn": {},
"PromptSetInput": {
"content": [
- 549
+ 566
],
"promptId": [
172
],
"promptName": [
- 549
+ 566
],
"type": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptStddevFields": {
@@ -6885,7 +6941,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptStddevOrderBy": {
@@ -6893,7 +6949,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptStddevPopFields": {
@@ -6901,7 +6957,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptStddevPopOrderBy": {
@@ -6909,7 +6965,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptStddevSampFields": {
@@ -6917,7 +6973,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptStddevSampOrderBy": {
@@ -6925,7 +6981,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptStreamCursorInput": {
@@ -6936,24 +6992,24 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"PromptStreamCursorValueInput": {
"content": [
- 549
+ 566
],
"promptId": [
172
],
"promptName": [
- 549
+ 566
],
"type": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptSumFields": {
@@ -6961,7 +7017,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptSumOrderBy": {
@@ -6969,7 +7025,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnum": {
@@ -7018,10 +7074,10 @@ export default {
}
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumAggregate": {
@@ -7032,7 +7088,7 @@ export default {
440
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumAggregateFields": {
@@ -7055,7 +7111,7 @@ export default {
447
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumBoolExp": {
@@ -7075,10 +7131,10 @@ export default {
369
],
"value": [
- 550
+ 567
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumConstraint": {},
@@ -7087,26 +7143,26 @@ export default {
372
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumMaxFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumMinFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumMutationResponse": {
@@ -7117,7 +7173,7 @@ export default {
440
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumObjRelInsertInput": {
@@ -7128,7 +7184,7 @@ export default {
450
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumOnConflict": {
@@ -7142,7 +7198,7 @@ export default {
443
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumOrderBy": {
@@ -7153,24 +7209,24 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumPkColumnsInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumSelectColumn": {},
"PromptTypeEnumSetInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumStreamCursorInput": {
@@ -7181,15 +7237,15 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumStreamCursorValueInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"PromptTypeEnumUpdateColumn": {},
@@ -7201,7 +7257,7 @@ export default {
443
],
"__typename": [
- 549
+ 566
]
},
"PromptUpdateColumn": {},
@@ -7216,7 +7272,7 @@ export default {
375
],
"__typename": [
- 549
+ 566
]
},
"PromptUser": {
@@ -7227,13 +7283,13 @@ export default {
172
],
"user": [
- 652
+ 669
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PromptUserAggregate": {
@@ -7244,15 +7300,15 @@ export default {
461
],
"__typename": [
- 549
+ 566
]
},
"PromptUserAggregateBoolExp": {
"count": [
- 706
+ 723
],
"__typename": [
- 549
+ 566
]
},
"PromptUserAggregateFields": {
@@ -7299,7 +7355,7 @@ export default {
499
],
"__typename": [
- 549
+ 566
]
},
"PromptUserAggregateOrderBy": {
@@ -7337,7 +7393,7 @@ export default {
500
],
"__typename": [
- 549
+ 566
]
},
"PromptUserArrRelInsertInput": {
@@ -7348,7 +7404,7 @@ export default {
478
],
"__typename": [
- 549
+ 566
]
},
"PromptUserAvgFields": {
@@ -7356,7 +7412,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptUserAvgOrderBy": {
@@ -7364,7 +7420,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptUserBoolExp": {
@@ -7384,13 +7440,13 @@ export default {
173
],
"user": [
- 655
+ 672
],
"userId": [
- 695
+ 712
],
"__typename": [
- 549
+ 566
]
},
"PromptUserConstraint": {},
@@ -7399,7 +7455,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptUserInsertInput": {
@@ -7410,13 +7466,13 @@ export default {
172
],
"user": [
- 661
+ 678
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PromptUserMaxFields": {
@@ -7424,10 +7480,10 @@ export default {
172
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PromptUserMaxOrderBy": {
@@ -7438,7 +7494,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptUserMinFields": {
@@ -7446,10 +7502,10 @@ export default {
172
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PromptUserMinOrderBy": {
@@ -7460,7 +7516,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptUserMutationResponse": {
@@ -7471,7 +7527,7 @@ export default {
461
],
"__typename": [
- 549
+ 566
]
},
"PromptUserOnConflict": {
@@ -7485,7 +7541,7 @@ export default {
469
],
"__typename": [
- 549
+ 566
]
},
"PromptUserOrderBy": {
@@ -7496,13 +7552,13 @@ export default {
324
],
"user": [
- 663
+ 680
],
"userId": [
324
],
"__typename": [
- 549
+ 566
]
},
"PromptUserPkColumnsInput": {
@@ -7510,10 +7566,10 @@ export default {
172
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PromptUserSelectColumn": {},
@@ -7522,10 +7578,10 @@ export default {
172
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PromptUserStddevFields": {
@@ -7533,7 +7589,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptUserStddevOrderBy": {
@@ -7541,7 +7597,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptUserStddevPopFields": {
@@ -7549,7 +7605,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptUserStddevPopOrderBy": {
@@ -7557,7 +7613,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptUserStddevSampFields": {
@@ -7565,7 +7621,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptUserStddevSampOrderBy": {
@@ -7573,7 +7629,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptUserStreamCursorInput": {
@@ -7584,7 +7640,7 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"PromptUserStreamCursorValueInput": {
@@ -7592,10 +7648,10 @@ export default {
172
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"PromptUserSumFields": {
@@ -7603,7 +7659,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"PromptUserSumOrderBy": {
@@ -7611,7 +7667,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptUserUpdateColumn": {},
@@ -7626,7 +7682,7 @@ export default {
469
],
"__typename": [
- 549
+ 566
]
},
"PromptUserVarPopFields": {
@@ -7634,7 +7690,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptUserVarPopOrderBy": {
@@ -7642,7 +7698,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptUserVarSampFields": {
@@ -7650,7 +7706,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptUserVarSampOrderBy": {
@@ -7658,7 +7714,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptUserVarianceFields": {
@@ -7666,7 +7722,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptUserVarianceOrderBy": {
@@ -7674,7 +7730,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptVarPopFields": {
@@ -7682,7 +7738,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptVarPopOrderBy": {
@@ -7690,7 +7746,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptVarSampFields": {
@@ -7698,7 +7754,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptVarSampOrderBy": {
@@ -7706,7 +7762,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"PromptVarianceFields": {
@@ -7714,7 +7770,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"PromptVarianceOrderBy": {
@@ -7722,27 +7778,27 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"Referral": {
"referralCode": [
- 549
+ 566
],
"referrerId": [
- 715
+ 732
],
"user": [
- 652
+ 669
],
"userByUserId": [
- 652
+ 669
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ReferralAggregate": {
@@ -7753,15 +7809,15 @@ export default {
507
],
"__typename": [
- 549
+ 566
]
},
"ReferralAggregateBoolExp": {
"count": [
- 707
+ 724
],
"__typename": [
- 549
+ 566
]
},
"ReferralAggregateFields": {
@@ -7784,7 +7840,7 @@ export default {
518
],
"__typename": [
- 549
+ 566
]
},
"ReferralAggregateOrderBy": {
@@ -7798,7 +7854,7 @@ export default {
519
],
"__typename": [
- 549
+ 566
]
},
"ReferralArrRelInsertInput": {
@@ -7809,7 +7865,7 @@ export default {
521
],
"__typename": [
- 549
+ 566
]
},
"ReferralBoolExp": {
@@ -7823,57 +7879,57 @@ export default {
513
],
"referralCode": [
- 550
+ 567
],
"referrerId": [
- 695
+ 712
],
"user": [
- 655
+ 672
],
"userByUserId": [
- 655
+ 672
],
"userId": [
- 695
+ 712
],
"__typename": [
- 549
+ 566
]
},
"ReferralConstraint": {},
"ReferralInsertInput": {
"referralCode": [
- 549
+ 566
],
"referrerId": [
- 715
+ 732
],
"user": [
- 661
+ 678
],
"userByUserId": [
- 661
+ 678
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ReferralMaxFields": {
"referralCode": [
- 549
+ 566
],
"referrerId": [
- 715
+ 732
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ReferralMaxOrderBy": {
@@ -7887,21 +7943,21 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ReferralMinFields": {
"referralCode": [
- 549
+ 566
],
"referrerId": [
- 715
+ 732
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ReferralMinOrderBy": {
@@ -7915,7 +7971,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ReferralMutationResponse": {
@@ -7926,7 +7982,7 @@ export default {
507
],
"__typename": [
- 549
+ 566
]
},
"ReferralOnConflict": {
@@ -7940,7 +7996,7 @@ export default {
513
],
"__typename": [
- 549
+ 566
]
},
"ReferralOrderBy": {
@@ -7951,39 +8007,39 @@ export default {
324
],
"user": [
- 663
+ 680
],
"userByUserId": [
- 663
+ 680
],
"userId": [
324
],
"__typename": [
- 549
+ 566
]
},
"ReferralPkColumnsInput": {
"referralCode": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ReferralSelectColumn": {},
"ReferralSetInput": {
"referralCode": [
- 549
+ 566
],
"referrerId": [
- 715
+ 732
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ReferralStreamCursorInput": {
@@ -7994,21 +8050,21 @@ export default {
170
],
"__typename": [
- 549
+ 566
]
},
"ReferralStreamCursorValueInput": {
"referralCode": [
- 549
+ 566
],
"referrerId": [
- 715
+ 732
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ReferralUpdateColumn": {},
@@ -8020,27 +8076,33 @@ export default {
513
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowing": {
+ "chatbot": [
+ 70
+ ],
"createdAt": [
- 712
+ 729
],
"followeeId": [
- 715
+ 732
+ ],
+ "followeeIdChatbot": [
+ 172
],
"followerId": [
- 715
+ 732
],
"user": [
- 652
+ 669
],
"userByFollowerId": [
- 652
+ 669
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingAggregate": {
@@ -8051,23 +8113,26 @@ export default {
530
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingAggregateBoolExp": {
"count": [
- 708
+ 725
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingAggregateFields": {
+ "avg": [
+ 536
+ ],
"count": [
172,
{
"columns": [
- 544,
+ 547,
"[SocialFollowingSelectColumn!]"
],
"distinct": [
@@ -8076,98 +8141,182 @@ export default {
}
],
"max": [
- 538
+ 541
],
"min": [
- 540
+ 543
],
- "__typename": [
+ "stddev": [
549
+ ],
+ "stddevPop": [
+ 551
+ ],
+ "stddevSamp": [
+ 553
+ ],
+ "sum": [
+ 557
+ ],
+ "varPop": [
+ 560
+ ],
+ "varSamp": [
+ 562
+ ],
+ "variance": [
+ 564
+ ],
+ "__typename": [
+ 566
]
},
"SocialFollowingAggregateOrderBy": {
+ "avg": [
+ 537
+ ],
"count": [
324
],
"max": [
- 539
+ 542
],
"min": [
- 541
+ 544
+ ],
+ "stddev": [
+ 550
+ ],
+ "stddevPop": [
+ 552
+ ],
+ "stddevSamp": [
+ 554
+ ],
+ "sum": [
+ 558
+ ],
+ "varPop": [
+ 561
+ ],
+ "varSamp": [
+ 563
+ ],
+ "variance": [
+ 565
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingArrRelInsertInput": {
"data": [
- 537
+ 540
],
"__typename": [
- 549
+ 566
+ ]
+ },
+ "SocialFollowingAvgFields": {
+ "followeeIdChatbot": [
+ 171
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingAvgOrderBy": {
+ "followeeIdChatbot": [
+ 324
+ ],
+ "__typename": [
+ 566
]
},
"SocialFollowingBoolExp": {
"_and": [
- 536
+ 538
],
"_not": [
- 536
+ 538
],
"_or": [
- 536
+ 538
+ ],
+ "chatbot": [
+ 78
],
"createdAt": [
- 594
+ 611
],
"followeeId": [
- 695
+ 712
+ ],
+ "followeeIdChatbot": [
+ 173
],
"followerId": [
- 695
+ 712
],
"user": [
- 655
+ 672
],
"userByFollowerId": [
- 655
+ 672
],
"__typename": [
- 549
+ 566
+ ]
+ },
+ "SocialFollowingIncInput": {
+ "followeeIdChatbot": [
+ 172
+ ],
+ "__typename": [
+ 566
]
},
"SocialFollowingInsertInput": {
+ "chatbot": [
+ 127
+ ],
"createdAt": [
- 712
+ 729
],
"followeeId": [
- 715
+ 732
+ ],
+ "followeeIdChatbot": [
+ 172
],
"followerId": [
- 715
+ 732
],
"user": [
- 661
+ 678
],
"userByFollowerId": [
- 661
+ 678
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingMaxFields": {
"createdAt": [
- 712
+ 729
],
"followeeId": [
- 715
+ 732
+ ],
+ "followeeIdChatbot": [
+ 172
],
"followerId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingMaxOrderBy": {
@@ -8177,25 +8326,31 @@ export default {
"followeeId": [
324
],
+ "followeeIdChatbot": [
+ 324
+ ],
"followerId": [
324
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingMinFields": {
"createdAt": [
- 712
+ 729
],
"followeeId": [
- 715
+ 732
+ ],
+ "followeeIdChatbot": [
+ 172
],
"followerId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingMinOrderBy": {
@@ -8205,11 +8360,14 @@ export default {
"followeeId": [
324
],
+ "followeeIdChatbot": [
+ 324
+ ],
"followerId": [
324
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingMutationResponse": {
@@ -8220,141 +8378,268 @@ export default {
530
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingOrderBy": {
+ "chatbot": [
+ 129
+ ],
"createdAt": [
324
],
"followeeId": [
324
],
+ "followeeIdChatbot": [
+ 324
+ ],
"followerId": [
324
],
"user": [
- 663
+ 680
],
"userByFollowerId": [
- 663
+ 680
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingSelectColumn": {},
"SocialFollowingSetInput": {
"createdAt": [
- 712
+ 729
],
"followeeId": [
- 715
+ 732
+ ],
+ "followeeIdChatbot": [
+ 172
],
"followerId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
+ ]
+ },
+ "SocialFollowingStddevFields": {
+ "followeeIdChatbot": [
+ 171
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingStddevOrderBy": {
+ "followeeIdChatbot": [
+ 324
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingStddevPopFields": {
+ "followeeIdChatbot": [
+ 171
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingStddevPopOrderBy": {
+ "followeeIdChatbot": [
+ 324
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingStddevSampFields": {
+ "followeeIdChatbot": [
+ 171
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingStddevSampOrderBy": {
+ "followeeIdChatbot": [
+ 324
+ ],
+ "__typename": [
+ 566
]
},
"SocialFollowingStreamCursorInput": {
"initialValue": [
- 547
+ 556
],
"ordering": [
170
],
"__typename": [
- 549
+ 566
]
},
"SocialFollowingStreamCursorValueInput": {
"createdAt": [
- 712
+ 729
],
"followeeId": [
- 715
+ 732
+ ],
+ "followeeIdChatbot": [
+ 172
],
"followerId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
+ ]
+ },
+ "SocialFollowingSumFields": {
+ "followeeIdChatbot": [
+ 172
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingSumOrderBy": {
+ "followeeIdChatbot": [
+ 324
+ ],
+ "__typename": [
+ 566
]
},
"SocialFollowingUpdates": {
+ "_inc": [
+ 539
+ ],
"_set": [
- 545
+ 548
],
"where": [
- 536
+ 538
],
"__typename": [
- 549
+ 566
+ ]
+ },
+ "SocialFollowingVarPopFields": {
+ "followeeIdChatbot": [
+ 171
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingVarPopOrderBy": {
+ "followeeIdChatbot": [
+ 324
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingVarSampFields": {
+ "followeeIdChatbot": [
+ 171
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingVarSampOrderBy": {
+ "followeeIdChatbot": [
+ 324
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingVarianceFields": {
+ "followeeIdChatbot": [
+ 171
+ ],
+ "__typename": [
+ 566
+ ]
+ },
+ "SocialFollowingVarianceOrderBy": {
+ "followeeIdChatbot": [
+ 324
+ ],
+ "__typename": [
+ 566
]
},
"String": {},
"StringComparisonExp": {
"_eq": [
- 549
+ 566
],
"_gt": [
- 549
+ 566
],
"_gte": [
- 549
+ 566
],
"_ilike": [
- 549
+ 566
],
"_in": [
- 549
+ 566
],
"_iregex": [
- 549
+ 566
],
"_isNull": [
0
],
"_like": [
- 549
+ 566
],
"_lt": [
- 549
+ 566
],
"_lte": [
- 549
+ 566
],
"_neq": [
- 549
+ 566
],
"_nilike": [
- 549
+ 566
],
"_nin": [
- 549
+ 566
],
"_niregex": [
- 549
+ 566
],
"_nlike": [
- 549
+ 566
],
"_nregex": [
- 549
+ 566
],
"_nsimilar": [
- 549
+ 566
],
"_regex": [
- 549
+ 566
],
"_similar": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"Thread": {
@@ -8365,7 +8650,7 @@ export default {
172
],
"createdAt": [
- 712
+ 729
],
"isApproved": [
0
@@ -8427,55 +8712,55 @@ export default {
303
],
"threadId": [
- 715
+ 732
],
"updatedAt": [
- 712
+ 729
],
"user": [
- 652
+ 669
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ThreadAggregate": {
"aggregate": [
- 554
+ 571
],
"nodes": [
- 551
+ 568
],
"__typename": [
- 549
+ 566
]
},
"ThreadAggregateBoolExp": {
"bool_and": [
- 709
+ 726
],
"bool_or": [
- 710
+ 727
],
"count": [
- 711
+ 728
],
"__typename": [
- 549
+ 566
]
},
"ThreadAggregateFields": {
"avg": [
- 557
+ 574
],
"count": [
172,
{
"columns": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"distinct": [
@@ -8484,83 +8769,83 @@ export default {
}
],
"max": [
- 563
+ 580
],
"min": [
- 565
+ 582
],
"stddev": [
- 576
+ 593
],
"stddevPop": [
- 578
+ 595
],
"stddevSamp": [
- 580
+ 597
],
"sum": [
- 584
+ 601
],
"varPop": [
- 588
+ 605
],
"varSamp": [
- 590
+ 607
],
"variance": [
- 592
+ 609
],
"__typename": [
- 549
+ 566
]
},
"ThreadAggregateOrderBy": {
"avg": [
- 558
+ 575
],
"count": [
324
],
"max": [
- 564
+ 581
],
"min": [
- 566
+ 583
],
"stddev": [
- 577
+ 594
],
"stddevPop": [
- 579
+ 596
],
"stddevSamp": [
- 581
+ 598
],
"sum": [
- 585
+ 602
],
"varPop": [
- 589
+ 606
],
"varSamp": [
- 591
+ 608
],
"variance": [
- 593
+ 610
],
"__typename": [
- 549
+ 566
]
},
"ThreadArrRelInsertInput": {
"data": [
- 562
+ 579
],
"onConflict": [
- 569
+ 586
],
"__typename": [
- 549
+ 566
]
},
"ThreadAvgFields": {
@@ -8568,7 +8853,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ThreadAvgOrderBy": {
@@ -8576,18 +8861,18 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ThreadBoolExp": {
"_and": [
- 559
+ 576
],
"_not": [
- 559
+ 576
],
"_or": [
- 559
+ 576
],
"chatbot": [
78
@@ -8596,7 +8881,7 @@ export default {
173
],
"createdAt": [
- 594
+ 611
],
"isApproved": [
1
@@ -8620,19 +8905,19 @@ export default {
306
],
"threadId": [
- 695
+ 712
],
"updatedAt": [
- 594
+ 611
],
"user": [
- 655
+ 672
],
"userId": [
- 695
+ 712
],
"__typename": [
- 549
+ 566
]
},
"ThreadConstraint": {},
@@ -8641,7 +8926,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ThreadInsertInput": {
@@ -8652,7 +8937,7 @@ export default {
172
],
"createdAt": [
- 712
+ 729
],
"isApproved": [
0
@@ -8673,19 +8958,19 @@ export default {
314
],
"threadId": [
- 715
+ 732
],
"updatedAt": [
- 712
+ 729
],
"user": [
- 661
+ 678
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ThreadMaxFields": {
@@ -8693,19 +8978,19 @@ export default {
172
],
"createdAt": [
- 712
+ 729
],
"threadId": [
- 715
+ 732
],
"updatedAt": [
- 712
+ 729
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ThreadMaxOrderBy": {
@@ -8725,7 +9010,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ThreadMinFields": {
@@ -8733,19 +9018,19 @@ export default {
172
],
"createdAt": [
- 712
+ 729
],
"threadId": [
- 715
+ 732
],
"updatedAt": [
- 712
+ 729
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ThreadMinOrderBy": {
@@ -8765,7 +9050,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ThreadMutationResponse": {
@@ -8773,35 +9058,35 @@ export default {
172
],
"returning": [
- 551
+ 568
],
"__typename": [
- 549
+ 566
]
},
"ThreadObjRelInsertInput": {
"data": [
- 562
+ 579
],
"onConflict": [
- 569
+ 586
],
"__typename": [
- 549
+ 566
]
},
"ThreadOnConflict": {
"constraint": [
- 560
+ 577
],
"updateColumns": [
- 586
+ 603
],
"where": [
- 559
+ 576
],
"__typename": [
- 549
+ 566
]
},
"ThreadOrderBy": {
@@ -8839,21 +9124,21 @@ export default {
324
],
"user": [
- 663
+ 680
],
"userId": [
324
],
"__typename": [
- 549
+ 566
]
},
"ThreadPkColumnsInput": {
"threadId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ThreadSelectColumn": {},
@@ -8864,7 +9149,7 @@ export default {
172
],
"createdAt": [
- 712
+ 729
],
"isApproved": [
0
@@ -8879,16 +9164,16 @@ export default {
308
],
"threadId": [
- 715
+ 732
],
"updatedAt": [
- 712
+ 729
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ThreadStddevFields": {
@@ -8896,7 +9181,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ThreadStddevOrderBy": {
@@ -8904,7 +9189,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ThreadStddevPopFields": {
@@ -8912,7 +9197,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ThreadStddevPopOrderBy": {
@@ -8920,7 +9205,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ThreadStddevSampFields": {
@@ -8928,7 +9213,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ThreadStddevSampOrderBy": {
@@ -8936,18 +9221,18 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ThreadStreamCursorInput": {
"initialValue": [
- 583
+ 600
],
"ordering": [
170
],
"__typename": [
- 549
+ 566
]
},
"ThreadStreamCursorValueInput": {
@@ -8955,7 +9240,7 @@ export default {
172
],
"createdAt": [
- 712
+ 729
],
"isApproved": [
0
@@ -8970,16 +9255,16 @@ export default {
308
],
"threadId": [
- 715
+ 732
],
"updatedAt": [
- 712
+ 729
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"ThreadSumFields": {
@@ -8987,7 +9272,7 @@ export default {
172
],
"__typename": [
- 549
+ 566
]
},
"ThreadSumOrderBy": {
@@ -8995,22 +9280,22 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ThreadUpdateColumn": {},
"ThreadUpdates": {
"_inc": [
- 561
+ 578
],
"_set": [
- 575
+ 592
],
"where": [
- 559
+ 576
],
"__typename": [
- 549
+ 566
]
},
"ThreadVarPopFields": {
@@ -9018,7 +9303,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ThreadVarPopOrderBy": {
@@ -9026,7 +9311,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ThreadVarSampFields": {
@@ -9034,7 +9319,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ThreadVarSampOrderBy": {
@@ -9042,7 +9327,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ThreadVarianceFields": {
@@ -9050,7 +9335,7 @@ export default {
171
],
"__typename": [
- 549
+ 566
]
},
"ThreadVarianceOrderBy": {
@@ -9058,53 +9343,53 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"TimestamptzComparisonExp": {
"_eq": [
- 712
+ 729
],
"_gt": [
- 712
+ 729
],
"_gte": [
- 712
+ 729
],
"_in": [
- 712
+ 729
],
"_isNull": [
0
],
"_lt": [
- 712
+ 729
],
"_lte": [
- 712
+ 729
],
"_neq": [
- 712
+ 729
],
"_nin": [
- 712
+ 729
],
"__typename": [
- 549
+ 566
]
},
"Token": {
"token": [
- 549
+ 566
],
"tokenExpiry": [
- 712
+ 729
],
"userTokens": [
- 670,
+ 687,
{
"distinctOn": [
- 687,
+ 704,
"[UserTokenSelectColumn!]"
],
"limit": [
@@ -9114,19 +9399,19 @@ export default {
172
],
"orderBy": [
- 685,
+ 702,
"[UserTokenOrderBy!]"
],
"where": [
- 676
+ 693
]
}
],
"userTokensAggregate": [
- 671,
+ 688,
{
"distinctOn": [
- 687,
+ 704,
"[UserTokenSelectColumn!]"
],
"limit": [
@@ -9136,27 +9421,27 @@ export default {
172
],
"orderBy": [
- 685,
+ 702,
"[UserTokenOrderBy!]"
],
"where": [
- 676
+ 693
]
}
],
"__typename": [
- 549
+ 566
]
},
"TokenAggregate": {
"aggregate": [
- 597
+ 614
],
"nodes": [
- 595
+ 612
],
"__typename": [
- 549
+ 566
]
},
"TokenAggregateFields": {
@@ -9164,7 +9449,7 @@ export default {
172,
{
"columns": [
- 608,
+ 625,
"[TokenSelectColumn!]"
],
"distinct": [
@@ -9173,76 +9458,76 @@ export default {
}
],
"max": [
- 601
+ 618
],
"min": [
- 602
+ 619
],
"__typename": [
- 549
+ 566
]
},
"TokenBoolExp": {
"_and": [
- 598
+ 615
],
"_not": [
- 598
+ 615
],
"_or": [
- 598
+ 615
],
"token": [
- 550
+ 567
],
"tokenExpiry": [
- 594
+ 611
],
"userTokens": [
- 676
+ 693
],
"userTokensAggregate": [
- 672
+ 689
],
"__typename": [
- 549
+ 566
]
},
"TokenConstraint": {},
"TokenInsertInput": {
"token": [
- 549
+ 566
],
"tokenExpiry": [
- 712
+ 729
],
"userTokens": [
- 675
+ 692
],
"__typename": [
- 549
+ 566
]
},
"TokenMaxFields": {
"token": [
- 549
+ 566
],
"tokenExpiry": [
- 712
+ 729
],
"__typename": [
- 549
+ 566
]
},
"TokenMinFields": {
"token": [
- 549
+ 566
],
"tokenExpiry": [
- 712
+ 729
],
"__typename": [
- 549
+ 566
]
},
"TokenMutationResponse": {
@@ -9250,35 +9535,35 @@ export default {
172
],
"returning": [
- 595
+ 612
],
"__typename": [
- 549
+ 566
]
},
"TokenObjRelInsertInput": {
"data": [
- 600
+ 617
],
"onConflict": [
- 605
+ 622
],
"__typename": [
- 549
+ 566
]
},
"TokenOnConflict": {
"constraint": [
- 599
+ 616
],
"updateColumns": [
- 612
+ 629
],
"where": [
- 598
+ 615
],
"__typename": [
- 549
+ 566
]
},
"TokenOrderBy": {
@@ -9289,64 +9574,64 @@ export default {
324
],
"userTokensAggregate": [
- 674
+ 691
],
"__typename": [
- 549
+ 566
]
},
"TokenPkColumnsInput": {
"token": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"TokenSelectColumn": {},
"TokenSetInput": {
"token": [
- 549
+ 566
],
"tokenExpiry": [
- 712
+ 729
],
"__typename": [
- 549
+ 566
]
},
"TokenStreamCursorInput": {
"initialValue": [
- 611
+ 628
],
"ordering": [
170
],
"__typename": [
- 549
+ 566
]
},
"TokenStreamCursorValueInput": {
"token": [
- 549
+ 566
],
"tokenExpiry": [
- 712
+ 729
],
"__typename": [
- 549
+ 566
]
},
"TokenUpdateColumn": {},
"TokenUpdates": {
"_set": [
- 609
+ 626
],
"where": [
- 598
+ 615
],
"__typename": [
- 549
+ 566
]
},
"ToneEnum": {
@@ -9439,21 +9724,21 @@ export default {
}
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumAggregate": {
"aggregate": [
- 616
+ 633
],
"nodes": [
- 614
+ 631
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumAggregateFields": {
@@ -9461,7 +9746,7 @@ export default {
172,
{
"columns": [
- 627,
+ 644,
"[ToneEnumSelectColumn!]"
],
"distinct": [
@@ -9470,24 +9755,24 @@ export default {
}
],
"max": [
- 620
+ 637
],
"min": [
- 621
+ 638
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumBoolExp": {
"_and": [
- 617
+ 634
],
"_not": [
- 617
+ 634
],
"_or": [
- 617
+ 634
],
"chatbots": [
78
@@ -9502,10 +9787,10 @@ export default {
327
],
"value": [
- 550
+ 567
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumConstraint": {},
@@ -9517,26 +9802,26 @@ export default {
330
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumMaxFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumMinFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumMutationResponse": {
@@ -9544,35 +9829,35 @@ export default {
172
],
"returning": [
- 614
+ 631
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumObjRelInsertInput": {
"data": [
- 619
+ 636
],
"onConflict": [
- 624
+ 641
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumOnConflict": {
"constraint": [
- 618
+ 635
],
"updateColumns": [
- 631
+ 648
],
"where": [
- 617
+ 634
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumOrderBy": {
@@ -9586,55 +9871,55 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumPkColumnsInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumSelectColumn": {},
"ToneEnumSetInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumStreamCursorInput": {
"initialValue": [
- 630
+ 647
],
"ordering": [
170
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumStreamCursorValueInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"ToneEnumUpdateColumn": {},
"ToneEnumUpdates": {
"_set": [
- 628
+ 645
],
"where": [
- 617
+ 634
],
"__typename": [
- 549
+ 566
]
},
"TypeEnum": {
@@ -9727,21 +10012,21 @@ export default {
}
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumAggregate": {
"aggregate": [
- 635
+ 652
],
"nodes": [
- 633
+ 650
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumAggregateFields": {
@@ -9749,7 +10034,7 @@ export default {
172,
{
"columns": [
- 646,
+ 663,
"[TypeEnumSelectColumn!]"
],
"distinct": [
@@ -9758,24 +10043,24 @@ export default {
}
],
"max": [
- 639
+ 656
],
"min": [
- 640
+ 657
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumBoolExp": {
"_and": [
- 636
+ 653
],
"_not": [
- 636
+ 653
],
"_or": [
- 636
+ 653
],
"chatbots": [
78
@@ -9790,10 +10075,10 @@ export default {
327
],
"value": [
- 550
+ 567
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumConstraint": {},
@@ -9805,26 +10090,26 @@ export default {
330
],
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumMaxFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumMinFields": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumMutationResponse": {
@@ -9832,35 +10117,35 @@ export default {
172
],
"returning": [
- 633
+ 650
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumObjRelInsertInput": {
"data": [
- 638
+ 655
],
"onConflict": [
- 643
+ 660
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumOnConflict": {
"constraint": [
- 637
+ 654
],
"updateColumns": [
- 650
+ 667
],
"where": [
- 636
+ 653
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumOrderBy": {
@@ -9874,60 +10159,60 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumPkColumnsInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumSelectColumn": {},
"TypeEnumSetInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumStreamCursorInput": {
"initialValue": [
- 649
+ 666
],
"ordering": [
170
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumStreamCursorValueInput": {
"value": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"TypeEnumUpdateColumn": {},
"TypeEnumUpdates": {
"_set": [
- 647
+ 664
],
"where": [
- 636
+ 653
],
"__typename": [
- 549
+ 566
]
},
"User": {
"bio": [
- 549
+ 566
],
"chats": [
30,
@@ -9974,19 +10259,19 @@ export default {
}
],
"dateJoined": [
- 712
+ 729
],
"email": [
- 549
+ 566
],
"favouriteTopic": [
- 549
+ 566
],
"followers": [
530,
{
"distinctOn": [
- 544,
+ 547,
"[SocialFollowingSelectColumn!]"
],
"limit": [
@@ -9996,11 +10281,11 @@ export default {
172
],
"orderBy": [
- 543,
+ 546,
"[SocialFollowingOrderBy!]"
],
"where": [
- 536
+ 538
]
}
],
@@ -10008,7 +10293,7 @@ export default {
531,
{
"distinctOn": [
- 544,
+ 547,
"[SocialFollowingSelectColumn!]"
],
"limit": [
@@ -10018,11 +10303,11 @@ export default {
172
],
"orderBy": [
- 543,
+ 546,
"[SocialFollowingOrderBy!]"
],
"where": [
- 536
+ 538
]
}
],
@@ -10030,7 +10315,7 @@ export default {
530,
{
"distinctOn": [
- 544,
+ 547,
"[SocialFollowingSelectColumn!]"
],
"limit": [
@@ -10040,11 +10325,11 @@ export default {
172
],
"orderBy": [
- 543,
+ 546,
"[SocialFollowingOrderBy!]"
],
"where": [
- 536
+ 538
]
}
],
@@ -10052,7 +10337,7 @@ export default {
531,
{
"distinctOn": [
- 544,
+ 547,
"[SocialFollowingSelectColumn!]"
],
"limit": [
@@ -10062,11 +10347,11 @@ export default {
172
],
"orderBy": [
- 543,
+ 546,
"[SocialFollowingOrderBy!]"
],
"where": [
- 536
+ 538
]
}
],
@@ -10080,10 +10365,10 @@ export default {
0
],
"lastLogin": [
- 712
+ 729
],
"password": [
- 549
+ 566
],
"preferences": [
325,
@@ -10130,10 +10415,10 @@ export default {
}
],
"proUserSubscriptionId": [
- 549
+ 566
],
"profilePicture": [
- 549
+ 566
],
"prompts": [
461,
@@ -10268,16 +10553,16 @@ export default {
}
],
"role": [
- 714
+ 731
],
"slug": [
- 549
+ 566
],
"threads": [
- 551,
+ 568,
{
"distinctOn": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"limit": [
@@ -10287,19 +10572,19 @@ export default {
172
],
"orderBy": [
- 570,
+ 587,
"[ThreadOrderBy!]"
],
"where": [
- 559
+ 576
]
}
],
"threadsAggregate": [
- 552,
+ 569,
{
"distinctOn": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"limit": [
@@ -10309,22 +10594,22 @@ export default {
172
],
"orderBy": [
- 570,
+ 587,
"[ThreadOrderBy!]"
],
"where": [
- 559
+ 576
]
}
],
"userId": [
- 715
+ 732
],
"userTokens": [
- 670,
+ 687,
{
"distinctOn": [
- 687,
+ 704,
"[UserTokenSelectColumn!]"
],
"limit": [
@@ -10334,19 +10619,19 @@ export default {
172
],
"orderBy": [
- 685,
+ 702,
"[UserTokenOrderBy!]"
],
"where": [
- 676
+ 693
]
}
],
"userTokensAggregate": [
- 671,
+ 688,
{
"distinctOn": [
- 687,
+ 704,
"[UserTokenSelectColumn!]"
],
"limit": [
@@ -10356,30 +10641,30 @@ export default {
172
],
"orderBy": [
- 685,
+ 702,
"[UserTokenOrderBy!]"
],
"where": [
- 676
+ 693
]
}
],
"username": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"UserAggregate": {
"aggregate": [
- 654
+ 671
],
"nodes": [
- 652
+ 669
],
"__typename": [
- 549
+ 566
]
},
"UserAggregateFields": {
@@ -10387,7 +10672,7 @@ export default {
172,
{
"columns": [
- 666,
+ 683,
"[UserSelectColumn!]"
],
"distinct": [
@@ -10396,27 +10681,27 @@ export default {
}
],
"max": [
- 658
+ 675
],
"min": [
- 659
+ 676
],
"__typename": [
- 549
+ 566
]
},
"UserBoolExp": {
"_and": [
- 655
+ 672
],
"_not": [
- 655
+ 672
],
"_or": [
- 655
+ 672
],
"bio": [
- 550
+ 567
],
"chats": [
38
@@ -10425,22 +10710,22 @@ export default {
32
],
"dateJoined": [
- 594
+ 611
],
"email": [
- 550
+ 567
],
"favouriteTopic": [
- 550
+ 567
],
"followers": [
- 536
+ 538
],
"followersAggregate": [
532
],
"following": [
- 536
+ 538
],
"followingAggregate": [
532
@@ -10455,10 +10740,10 @@ export default {
1
],
"lastLogin": [
- 594
+ 611
],
"password": [
- 550
+ 567
],
"preferences": [
333
@@ -10467,10 +10752,10 @@ export default {
327
],
"proUserSubscriptionId": [
- 550
+ 567
],
"profilePicture": [
- 550
+ 567
],
"prompts": [
469
@@ -10491,49 +10776,49 @@ export default {
509
],
"role": [
- 665
+ 682
],
"slug": [
- 550
+ 567
],
"threads": [
- 559
+ 576
],
"threadsAggregate": [
- 553
+ 570
],
"userId": [
- 695
+ 712
],
"userTokens": [
- 676
+ 693
],
"userTokensAggregate": [
- 672
+ 689
],
"username": [
- 550
+ 567
],
"__typename": [
- 549
+ 566
]
},
"UserConstraint": {},
"UserInsertInput": {
"bio": [
- 549
+ 566
],
"chats": [
35
],
"dateJoined": [
- 712
+ 729
],
"email": [
- 549
+ 566
],
"favouriteTopic": [
- 549
+ 566
],
"followers": [
535
@@ -10551,19 +10836,19 @@ export default {
0
],
"lastLogin": [
- 712
+ 729
],
"password": [
- 549
+ 566
],
"preferences": [
330
],
"proUserSubscriptionId": [
- 549
+ 566
],
"profilePicture": [
- 549
+ 566
],
"prompts": [
466
@@ -10575,107 +10860,107 @@ export default {
512
],
"role": [
- 714
+ 731
],
"slug": [
- 549
+ 566
],
"threads": [
- 556
+ 573
],
"userId": [
- 715
+ 732
],
"userTokens": [
- 675
+ 692
],
"username": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"UserMaxFields": {
"bio": [
- 549
+ 566
],
"dateJoined": [
- 712
+ 729
],
"email": [
- 549
+ 566
],
"favouriteTopic": [
- 549
+ 566
],
"lastLogin": [
- 712
+ 729
],
"password": [
- 549
+ 566
],
"proUserSubscriptionId": [
- 549
+ 566
],
"profilePicture": [
- 549
+ 566
],
"role": [
- 714
+ 731
],
"slug": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"username": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"UserMinFields": {
"bio": [
- 549
+ 566
],
"dateJoined": [
- 712
+ 729
],
"email": [
- 549
+ 566
],
"favouriteTopic": [
- 549
+ 566
],
"lastLogin": [
- 712
+ 729
],
"password": [
- 549
+ 566
],
"proUserSubscriptionId": [
- 549
+ 566
],
"profilePicture": [
- 549
+ 566
],
"role": [
- 714
+ 731
],
"slug": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"username": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"UserMutationResponse": {
@@ -10683,35 +10968,35 @@ export default {
172
],
"returning": [
- 652
+ 669
],
"__typename": [
- 549
+ 566
]
},
"UserObjRelInsertInput": {
"data": [
- 657
+ 674
],
"onConflict": [
- 662
+ 679
],
"__typename": [
- 549
+ 566
]
},
"UserOnConflict": {
"constraint": [
- 656
+ 673
],
"updateColumns": [
- 693
+ 710
],
"where": [
- 655
+ 672
],
"__typename": [
- 549
+ 566
]
},
"UserOrderBy": {
@@ -10776,74 +11061,74 @@ export default {
324
],
"threadsAggregate": [
- 555
+ 572
],
"userId": [
324
],
"userTokensAggregate": [
- 674
+ 691
],
"username": [
324
],
"__typename": [
- 549
+ 566
]
},
"UserPkColumnsInput": {
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"UserRoleComparisonExp": {
"_eq": [
- 714
+ 731
],
"_gt": [
- 714
+ 731
],
"_gte": [
- 714
+ 731
],
"_in": [
- 714
+ 731
],
"_isNull": [
0
],
"_lt": [
- 714
+ 731
],
"_lte": [
- 714
+ 731
],
"_neq": [
- 714
+ 731
],
"_nin": [
- 714
+ 731
],
"__typename": [
- 549
+ 566
]
},
"UserSelectColumn": {},
"UserSetInput": {
"bio": [
- 549
+ 566
],
"dateJoined": [
- 712
+ 729
],
"email": [
- 549
+ 566
],
"favouriteTopic": [
- 549
+ 566
],
"getFreeMonth": [
0
@@ -10855,56 +11140,56 @@ export default {
0
],
"lastLogin": [
- 712
+ 729
],
"password": [
- 549
+ 566
],
"proUserSubscriptionId": [
- 549
+ 566
],
"profilePicture": [
- 549
+ 566
],
"role": [
- 714
+ 731
],
"slug": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"username": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"UserStreamCursorInput": {
"initialValue": [
- 669
+ 686
],
"ordering": [
170
],
"__typename": [
- 549
+ 566
]
},
"UserStreamCursorValueInput": {
"bio": [
- 549
+ 566
],
"dateJoined": [
- 712
+ 729
],
"email": [
- 549
+ 566
],
"favouriteTopic": [
- 549
+ 566
],
"getFreeMonth": [
0
@@ -10916,67 +11201,67 @@ export default {
0
],
"lastLogin": [
- 712
+ 729
],
"password": [
- 549
+ 566
],
"proUserSubscriptionId": [
- 549
+ 566
],
"profilePicture": [
- 549
+ 566
],
"role": [
- 714
+ 731
],
"slug": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"username": [
- 549
+ 566
],
"__typename": [
- 549
+ 566
]
},
"UserToken": {
"token": [
- 549
+ 566
],
"tokenByToken": [
- 595
+ 612
],
"user": [
- 652
+ 669
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"UserTokenAggregate": {
"aggregate": [
- 673
+ 690
],
"nodes": [
- 670
+ 687
],
"__typename": [
- 549
+ 566
]
},
"UserTokenAggregateBoolExp": {
"count": [
- 713
+ 730
],
"__typename": [
- 549
+ 566
]
},
"UserTokenAggregateFields": {
@@ -10984,7 +11269,7 @@ export default {
172,
{
"columns": [
- 687,
+ 704,
"[UserTokenSelectColumn!]"
],
"distinct": [
@@ -10993,13 +11278,13 @@ export default {
}
],
"max": [
- 679
+ 696
],
"min": [
- 681
+ 698
],
"__typename": [
- 549
+ 566
]
},
"UserTokenAggregateOrderBy": {
@@ -11007,79 +11292,79 @@ export default {
324
],
"max": [
- 680
+ 697
],
"min": [
- 682
+ 699
],
"__typename": [
- 549
+ 566
]
},
"UserTokenArrRelInsertInput": {
"data": [
- 678
+ 695
],
"onConflict": [
- 684
+ 701
],
"__typename": [
- 549
+ 566
]
},
"UserTokenBoolExp": {
"_and": [
- 676
+ 693
],
"_not": [
- 676
+ 693
],
"_or": [
- 676
+ 693
],
"token": [
- 550
+ 567
],
"tokenByToken": [
- 598
+ 615
],
"user": [
- 655
+ 672
],
"userId": [
- 695
+ 712
],
"__typename": [
- 549
+ 566
]
},
"UserTokenConstraint": {},
"UserTokenInsertInput": {
"token": [
- 549
+ 566
],
"tokenByToken": [
- 604
+ 621
],
"user": [
- 661
+ 678
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"UserTokenMaxFields": {
"token": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"UserTokenMaxOrderBy": {
@@ -11090,18 +11375,18 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"UserTokenMinFields": {
"token": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"UserTokenMinOrderBy": {
@@ -11112,7 +11397,7 @@ export default {
324
],
"__typename": [
- 549
+ 566
]
},
"UserTokenMutationResponse": {
@@ -11120,24 +11405,24 @@ export default {
172
],
"returning": [
- 670
+ 687
],
"__typename": [
- 549
+ 566
]
},
"UserTokenOnConflict": {
"constraint": [
- 677
+ 694
],
"updateColumns": [
- 691
+ 708
],
"where": [
- 676
+ 693
],
"__typename": [
- 549
+ 566
]
},
"UserTokenOrderBy": {
@@ -11145,117 +11430,117 @@ export default {
324
],
"tokenByToken": [
- 606
+ 623
],
"user": [
- 663
+ 680
],
"userId": [
324
],
"__typename": [
- 549
+ 566
]
},
"UserTokenPkColumnsInput": {
"token": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"UserTokenSelectColumn": {},
"UserTokenSetInput": {
"token": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"UserTokenStreamCursorInput": {
"initialValue": [
- 690
+ 707
],
"ordering": [
170
],
"__typename": [
- 549
+ 566
]
},
"UserTokenStreamCursorValueInput": {
"token": [
- 549
+ 566
],
"userId": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"UserTokenUpdateColumn": {},
"UserTokenUpdates": {
"_set": [
- 688
+ 705
],
"where": [
- 676
+ 693
],
"__typename": [
- 549
+ 566
]
},
"UserUpdateColumn": {},
"UserUpdates": {
"_set": [
- 667
+ 684
],
"where": [
- 655
+ 672
],
"__typename": [
- 549
+ 566
]
},
"UuidComparisonExp": {
"_eq": [
- 715
+ 732
],
"_gt": [
- 715
+ 732
],
"_gte": [
- 715
+ 732
],
"_in": [
- 715
+ 732
],
"_isNull": [
0
],
"_lt": [
- 715
+ 732
],
"_lte": [
- 715
+ 732
],
"_neq": [
- 715
+ 732
],
"_nin": [
- 715
+ 732
],
"__typename": [
- 549
+ 566
]
},
"chatAggregateBoolExpCount": {
@@ -11272,7 +11557,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"chatbotAggregateBoolExpCount": {
@@ -11289,7 +11574,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"chatbotCategoryAggregateBoolExpCount": {
@@ -11306,7 +11591,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"labelChatbotCategoryAggregateBoolExpCount": {
@@ -11323,7 +11608,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"messageAggregateBoolExpCount": {
@@ -11340,7 +11625,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"preferenceAggregateBoolExpBool_and": {
@@ -11357,7 +11642,7 @@ export default {
1
],
"__typename": [
- 549
+ 566
]
},
"preferenceAggregateBoolExpBool_or": {
@@ -11374,7 +11659,7 @@ export default {
1
],
"__typename": [
- 549
+ 566
]
},
"preferenceAggregateBoolExpCount": {
@@ -11391,7 +11676,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"promptAggregateBoolExpCount": {
@@ -11408,7 +11693,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"promptChatbotAggregateBoolExpCount": {
@@ -11425,7 +11710,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"promptUserAggregateBoolExpCount": {
@@ -11442,7 +11727,7 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"referralAggregateBoolExpCount": {
@@ -11459,93 +11744,93 @@ export default {
173
],
"__typename": [
- 549
+ 566
]
},
"socialFollowingAggregateBoolExpCount": {
"arguments": [
- 544
+ 547
],
"distinct": [
0
],
"filter": [
- 536
+ 538
],
"predicate": [
173
],
"__typename": [
- 549
+ 566
]
},
"threadAggregateBoolExpBool_and": {
"arguments": [
- 573
+ 590
],
"distinct": [
0
],
"filter": [
- 559
+ 576
],
"predicate": [
1
],
"__typename": [
- 549
+ 566
]
},
"threadAggregateBoolExpBool_or": {
"arguments": [
- 574
+ 591
],
"distinct": [
0
],
"filter": [
- 559
+ 576
],
"predicate": [
1
],
"__typename": [
- 549
+ 566
]
},
"threadAggregateBoolExpCount": {
"arguments": [
- 572
+ 589
],
"distinct": [
0
],
"filter": [
- 559
+ 576
],
"predicate": [
173
],
"__typename": [
- 549
+ 566
]
},
"timestamptz": {},
"userTokenAggregateBoolExpCount": {
"arguments": [
- 687
+ 704
],
"distinct": [
0
],
"filter": [
- 676
+ 693
],
"predicate": [
173
],
"__typename": [
- 549
+ 566
]
},
"user_role": {},
@@ -11815,7 +12100,7 @@ export default {
151,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -11982,7 +12267,7 @@ export default {
242,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -12035,7 +12320,7 @@ export default {
261,
{
"messageId": [
- 715,
+ 732,
"uuid!"
]
}
@@ -12088,7 +12373,7 @@ export default {
282,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -12141,7 +12426,7 @@ export default {
303,
{
"name": [
- 549,
+ 566,
"String!"
]
}
@@ -12357,7 +12642,7 @@ export default {
440,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -12414,7 +12699,7 @@ export default {
"Int!"
],
"userId": [
- 715,
+ 732,
"uuid!"
]
}
@@ -12467,7 +12752,7 @@ export default {
507,
{
"referralCode": [
- 549,
+ 566,
"String!"
]
}
@@ -12476,7 +12761,7 @@ export default {
530,
{
"distinctOn": [
- 544,
+ 547,
"[SocialFollowingSelectColumn!]"
],
"limit": [
@@ -12486,11 +12771,11 @@ export default {
172
],
"orderBy": [
- 543,
+ 546,
"[SocialFollowingOrderBy!]"
],
"where": [
- 536
+ 538
]
}
],
@@ -12498,7 +12783,7 @@ export default {
531,
{
"distinctOn": [
- 544,
+ 547,
"[SocialFollowingSelectColumn!]"
],
"limit": [
@@ -12508,19 +12793,19 @@ export default {
172
],
"orderBy": [
- 543,
+ 546,
"[SocialFollowingOrderBy!]"
],
"where": [
- 536
+ 538
]
}
],
"thread": [
- 551,
+ 568,
{
"distinctOn": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"limit": [
@@ -12530,19 +12815,19 @@ export default {
172
],
"orderBy": [
- 570,
+ 587,
"[ThreadOrderBy!]"
],
"where": [
- 559
+ 576
]
}
],
"threadAggregate": [
- 552,
+ 569,
{
"distinctOn": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"limit": [
@@ -12552,28 +12837,28 @@ export default {
172
],
"orderBy": [
- 570,
+ 587,
"[ThreadOrderBy!]"
],
"where": [
- 559
+ 576
]
}
],
"threadByPk": [
- 551,
+ 568,
{
"threadId": [
- 715,
+ 732,
"uuid!"
]
}
],
"token": [
- 595,
+ 612,
{
"distinctOn": [
- 608,
+ 625,
"[TokenSelectColumn!]"
],
"limit": [
@@ -12583,19 +12868,19 @@ export default {
172
],
"orderBy": [
- 606,
+ 623,
"[TokenOrderBy!]"
],
"where": [
- 598
+ 615
]
}
],
"tokenAggregate": [
- 596,
+ 613,
{
"distinctOn": [
- 608,
+ 625,
"[TokenSelectColumn!]"
],
"limit": [
@@ -12605,28 +12890,28 @@ export default {
172
],
"orderBy": [
- 606,
+ 623,
"[TokenOrderBy!]"
],
"where": [
- 598
+ 615
]
}
],
"tokenByPk": [
- 595,
+ 612,
{
"token": [
- 549,
+ 566,
"String!"
]
}
],
"toneEnum": [
- 614,
+ 631,
{
"distinctOn": [
- 627,
+ 644,
"[ToneEnumSelectColumn!]"
],
"limit": [
@@ -12636,19 +12921,19 @@ export default {
172
],
"orderBy": [
- 625,
+ 642,
"[ToneEnumOrderBy!]"
],
"where": [
- 617
+ 634
]
}
],
"toneEnumAggregate": [
- 615,
+ 632,
{
"distinctOn": [
- 627,
+ 644,
"[ToneEnumSelectColumn!]"
],
"limit": [
@@ -12658,28 +12943,28 @@ export default {
172
],
"orderBy": [
- 625,
+ 642,
"[ToneEnumOrderBy!]"
],
"where": [
- 617
+ 634
]
}
],
"toneEnumByPk": [
- 614,
+ 631,
{
"value": [
- 549,
+ 566,
"String!"
]
}
],
"typeEnum": [
- 633,
+ 650,
{
"distinctOn": [
- 646,
+ 663,
"[TypeEnumSelectColumn!]"
],
"limit": [
@@ -12689,19 +12974,19 @@ export default {
172
],
"orderBy": [
- 644,
+ 661,
"[TypeEnumOrderBy!]"
],
"where": [
- 636
+ 653
]
}
],
"typeEnumAggregate": [
- 634,
+ 651,
{
"distinctOn": [
- 646,
+ 663,
"[TypeEnumSelectColumn!]"
],
"limit": [
@@ -12711,28 +12996,28 @@ export default {
172
],
"orderBy": [
- 644,
+ 661,
"[TypeEnumOrderBy!]"
],
"where": [
- 636
+ 653
]
}
],
"typeEnumByPk": [
- 633,
+ 650,
{
"value": [
- 549,
+ 566,
"String!"
]
}
],
"user": [
- 652,
+ 669,
{
"distinctOn": [
- 666,
+ 683,
"[UserSelectColumn!]"
],
"limit": [
@@ -12742,19 +13027,19 @@ export default {
172
],
"orderBy": [
- 663,
+ 680,
"[UserOrderBy!]"
],
"where": [
- 655
+ 672
]
}
],
"userAggregate": [
- 653,
+ 670,
{
"distinctOn": [
- 666,
+ 683,
"[UserSelectColumn!]"
],
"limit": [
@@ -12764,28 +13049,28 @@ export default {
172
],
"orderBy": [
- 663,
+ 680,
"[UserOrderBy!]"
],
"where": [
- 655
+ 672
]
}
],
"userByPk": [
- 652,
+ 669,
{
"userId": [
- 715,
+ 732,
"uuid!"
]
}
],
"userToken": [
- 670,
+ 687,
{
"distinctOn": [
- 687,
+ 704,
"[UserTokenSelectColumn!]"
],
"limit": [
@@ -12795,19 +13080,19 @@ export default {
172
],
"orderBy": [
- 685,
+ 702,
"[UserTokenOrderBy!]"
],
"where": [
- 676
+ 693
]
}
],
"userTokenAggregate": [
- 671,
+ 688,
{
"distinctOn": [
- 687,
+ 704,
"[UserTokenSelectColumn!]"
],
"limit": [
@@ -12817,29 +13102,29 @@ export default {
172
],
"orderBy": [
- 685,
+ 702,
"[UserTokenOrderBy!]"
],
"where": [
- 676
+ 693
]
}
],
"userTokenByPk": [
- 670,
+ 687,
{
"token": [
- 549,
+ 566,
"String!"
],
"userId": [
- 715,
+ 732,
"uuid!"
]
}
],
"__typename": [
- 549
+ 566
]
},
"Mutation": {
@@ -12932,7 +13217,7 @@ export default {
151,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -12994,7 +13279,7 @@ export default {
242,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -13012,7 +13297,7 @@ export default {
261,
{
"messageId": [
- 715,
+ 732,
"uuid!"
]
}
@@ -13030,7 +13315,7 @@ export default {
282,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -13048,7 +13333,7 @@ export default {
303,
{
"name": [
- 549,
+ 566,
"String!"
]
}
@@ -13124,7 +13409,7 @@ export default {
440,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -13146,7 +13431,7 @@ export default {
"Int!"
],
"userId": [
- 715,
+ 732,
"uuid!"
]
}
@@ -13164,128 +13449,128 @@ export default {
507,
{
"referralCode": [
- 549,
+ 566,
"String!"
]
}
],
"deleteSocialFollowing": [
- 542,
+ 545,
{
"where": [
- 536,
+ 538,
"SocialFollowingBoolExp!"
]
}
],
"deleteThread": [
- 567,
+ 584,
{
"where": [
- 559,
+ 576,
"ThreadBoolExp!"
]
}
],
"deleteThreadByPk": [
- 551,
+ 568,
{
"threadId": [
- 715,
+ 732,
"uuid!"
]
}
],
"deleteToken": [
- 603,
+ 620,
{
"where": [
- 598,
+ 615,
"TokenBoolExp!"
]
}
],
"deleteTokenByPk": [
- 595,
+ 612,
{
"token": [
- 549,
+ 566,
"String!"
]
}
],
"deleteToneEnum": [
- 622,
+ 639,
{
"where": [
- 617,
+ 634,
"ToneEnumBoolExp!"
]
}
],
"deleteToneEnumByPk": [
- 614,
+ 631,
{
"value": [
- 549,
+ 566,
"String!"
]
}
],
"deleteTypeEnum": [
- 641,
+ 658,
{
"where": [
- 636,
+ 653,
"TypeEnumBoolExp!"
]
}
],
"deleteTypeEnumByPk": [
- 633,
+ 650,
{
"value": [
- 549,
+ 566,
"String!"
]
}
],
"deleteUser": [
- 660,
+ 677,
{
"where": [
- 655,
+ 672,
"UserBoolExp!"
]
}
],
"deleteUserByPk": [
- 652,
+ 669,
{
"userId": [
- 715,
+ 732,
"uuid!"
]
}
],
"deleteUserToken": [
- 683,
+ 700,
{
"where": [
- 676,
+ 693,
"UserTokenBoolExp!"
]
}
],
"deleteUserTokenByPk": [
- 670,
+ 687,
{
"token": [
- 549,
+ 566,
"String!"
],
"userId": [
- 715,
+ 732,
"uuid!"
]
}
@@ -13699,10 +13984,10 @@ export default {
}
],
"insertSocialFollowing": [
- 542,
+ 545,
{
"objects": [
- 537,
+ 540,
"[SocialFollowingInsertInput!]!"
]
}
@@ -13711,152 +13996,152 @@ export default {
530,
{
"object": [
- 537,
+ 540,
"SocialFollowingInsertInput!"
]
}
],
"insertThread": [
- 567,
+ 584,
{
"objects": [
- 562,
+ 579,
"[ThreadInsertInput!]!"
],
"onConflict": [
- 569
+ 586
]
}
],
"insertThreadOne": [
- 551,
+ 568,
{
"object": [
- 562,
+ 579,
"ThreadInsertInput!"
],
"onConflict": [
- 569
+ 586
]
}
],
"insertToken": [
- 603,
+ 620,
{
"objects": [
- 600,
+ 617,
"[TokenInsertInput!]!"
],
"onConflict": [
- 605
+ 622
]
}
],
"insertTokenOne": [
- 595,
+ 612,
{
"object": [
- 600,
+ 617,
"TokenInsertInput!"
],
"onConflict": [
- 605
+ 622
]
}
],
"insertToneEnum": [
- 622,
+ 639,
{
"objects": [
- 619,
+ 636,
"[ToneEnumInsertInput!]!"
],
"onConflict": [
- 624
+ 641
]
}
],
"insertToneEnumOne": [
- 614,
+ 631,
{
"object": [
- 619,
+ 636,
"ToneEnumInsertInput!"
],
"onConflict": [
- 624
+ 641
]
}
],
"insertTypeEnum": [
- 641,
+ 658,
{
"objects": [
- 638,
+ 655,
"[TypeEnumInsertInput!]!"
],
"onConflict": [
- 643
+ 660
]
}
],
"insertTypeEnumOne": [
- 633,
+ 650,
{
"object": [
- 638,
+ 655,
"TypeEnumInsertInput!"
],
"onConflict": [
- 643
+ 660
]
}
],
"insertUser": [
- 660,
+ 677,
{
"objects": [
- 657,
+ 674,
"[UserInsertInput!]!"
],
"onConflict": [
- 662
+ 679
]
}
],
"insertUserOne": [
- 652,
+ 669,
{
"object": [
- 657,
+ 674,
"UserInsertInput!"
],
"onConflict": [
- 662
+ 679
]
}
],
"insertUserToken": [
- 683,
+ 700,
{
"objects": [
- 678,
+ 695,
"[UserTokenInsertInput!]!"
],
"onConflict": [
- 684
+ 701
]
}
],
"insertUserTokenOne": [
- 670,
+ 687,
{
"object": [
- 678,
+ 695,
"UserTokenInsertInput!"
],
"onConflict": [
- 684
+ 701
]
}
],
@@ -14482,232 +14767,235 @@ export default {
}
],
"updateSocialFollowing": [
- 542,
+ 545,
{
+ "_inc": [
+ 539
+ ],
"_set": [
- 545
+ 548
],
"where": [
- 536,
+ 538,
"SocialFollowingBoolExp!"
]
}
],
"updateSocialFollowingMany": [
- 542,
+ 545,
{
"updates": [
- 548,
+ 559,
"[SocialFollowingUpdates!]!"
]
}
],
"updateThread": [
- 567,
+ 584,
{
"_inc": [
- 561
+ 578
],
"_set": [
- 575
+ 592
],
"where": [
- 559,
+ 576,
"ThreadBoolExp!"
]
}
],
"updateThreadByPk": [
- 551,
+ 568,
{
"_inc": [
- 561
+ 578
],
"_set": [
- 575
+ 592
],
"pkColumns": [
- 571,
+ 588,
"ThreadPkColumnsInput!"
]
}
],
"updateThreadMany": [
- 567,
+ 584,
{
"updates": [
- 587,
+ 604,
"[ThreadUpdates!]!"
]
}
],
"updateToken": [
- 603,
+ 620,
{
"_set": [
- 609
+ 626
],
"where": [
- 598,
+ 615,
"TokenBoolExp!"
]
}
],
"updateTokenByPk": [
- 595,
+ 612,
{
"_set": [
- 609
+ 626
],
"pkColumns": [
- 607,
+ 624,
"TokenPkColumnsInput!"
]
}
],
"updateTokenMany": [
- 603,
+ 620,
{
"updates": [
- 613,
+ 630,
"[TokenUpdates!]!"
]
}
],
"updateToneEnum": [
- 622,
+ 639,
{
"_set": [
- 628
+ 645
],
"where": [
- 617,
+ 634,
"ToneEnumBoolExp!"
]
}
],
"updateToneEnumByPk": [
- 614,
+ 631,
{
"_set": [
- 628
+ 645
],
"pkColumns": [
- 626,
+ 643,
"ToneEnumPkColumnsInput!"
]
}
],
"updateToneEnumMany": [
- 622,
+ 639,
{
"updates": [
- 632,
+ 649,
"[ToneEnumUpdates!]!"
]
}
],
"updateTypeEnum": [
- 641,
+ 658,
{
"_set": [
- 647
+ 664
],
"where": [
- 636,
+ 653,
"TypeEnumBoolExp!"
]
}
],
"updateTypeEnumByPk": [
- 633,
+ 650,
{
"_set": [
- 647
+ 664
],
"pkColumns": [
- 645,
+ 662,
"TypeEnumPkColumnsInput!"
]
}
],
"updateTypeEnumMany": [
- 641,
+ 658,
{
"updates": [
- 651,
+ 668,
"[TypeEnumUpdates!]!"
]
}
],
"updateUser": [
- 660,
+ 677,
{
"_set": [
- 667
+ 684
],
"where": [
- 655,
+ 672,
"UserBoolExp!"
]
}
],
"updateUserByPk": [
- 652,
+ 669,
{
"_set": [
- 667
+ 684
],
"pkColumns": [
- 664,
+ 681,
"UserPkColumnsInput!"
]
}
],
"updateUserMany": [
- 660,
+ 677,
{
"updates": [
- 694,
+ 711,
"[UserUpdates!]!"
]
}
],
"updateUserToken": [
- 683,
+ 700,
{
"_set": [
- 688
+ 705
],
"where": [
- 676,
+ 693,
"UserTokenBoolExp!"
]
}
],
"updateUserTokenByPk": [
- 670,
+ 687,
{
"_set": [
- 688
+ 705
],
"pkColumns": [
- 686,
+ 703,
"UserTokenPkColumnsInput!"
]
}
],
"updateUserTokenMany": [
- 683,
+ 700,
{
"updates": [
- 692,
+ 709,
"[UserTokenUpdates!]!"
]
}
],
"__typename": [
- 549
+ 566
]
},
"Subscription": {
@@ -15039,7 +15327,7 @@ export default {
151,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -15254,7 +15542,7 @@ export default {
242,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -15323,7 +15611,7 @@ export default {
261,
{
"messageId": [
- 715,
+ 732,
"uuid!"
]
}
@@ -15392,7 +15680,7 @@ export default {
282,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -15461,7 +15749,7 @@ export default {
303,
{
"name": [
- 549,
+ 566,
"String!"
]
}
@@ -15741,7 +16029,7 @@ export default {
440,
{
"value": [
- 549,
+ 566,
"String!"
]
}
@@ -15814,7 +16102,7 @@ export default {
"Int!"
],
"userId": [
- 715,
+ 732,
"uuid!"
]
}
@@ -15883,7 +16171,7 @@ export default {
507,
{
"referralCode": [
- 549,
+ 566,
"String!"
]
}
@@ -15908,7 +16196,7 @@ export default {
530,
{
"distinctOn": [
- 544,
+ 547,
"[SocialFollowingSelectColumn!]"
],
"limit": [
@@ -15918,11 +16206,11 @@ export default {
172
],
"orderBy": [
- 543,
+ 546,
"[SocialFollowingOrderBy!]"
],
"where": [
- 536
+ 538
]
}
],
@@ -15930,7 +16218,7 @@ export default {
531,
{
"distinctOn": [
- 544,
+ 547,
"[SocialFollowingSelectColumn!]"
],
"limit": [
@@ -15940,11 +16228,11 @@ export default {
172
],
"orderBy": [
- 543,
+ 546,
"[SocialFollowingOrderBy!]"
],
"where": [
- 536
+ 538
]
}
],
@@ -15956,19 +16244,19 @@ export default {
"Int!"
],
"cursor": [
- 546,
+ 555,
"[SocialFollowingStreamCursorInput]!"
],
"where": [
- 536
+ 538
]
}
],
"thread": [
- 551,
+ 568,
{
"distinctOn": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"limit": [
@@ -15978,19 +16266,19 @@ export default {
172
],
"orderBy": [
- 570,
+ 587,
"[ThreadOrderBy!]"
],
"where": [
- 559
+ 576
]
}
],
"threadAggregate": [
- 552,
+ 569,
{
"distinctOn": [
- 572,
+ 589,
"[ThreadSelectColumn!]"
],
"limit": [
@@ -16000,44 +16288,44 @@ export default {
172
],
"orderBy": [
- 570,
+ 587,
"[ThreadOrderBy!]"
],
"where": [
- 559
+ 576
]
}
],
"threadByPk": [
- 551,
+ 568,
{
"threadId": [
- 715,
+ 732,
"uuid!"
]
}
],
"threadStream": [
- 551,
+ 568,
{
"batchSize": [
172,
"Int!"
],
"cursor": [
- 582,
+ 599,
"[ThreadStreamCursorInput]!"
],
"where": [
- 559
+ 576
]
}
],
"token": [
- 595,
+ 612,
{
"distinctOn": [
- 608,
+ 625,
"[TokenSelectColumn!]"
],
"limit": [
@@ -16047,19 +16335,19 @@ export default {
172
],
"orderBy": [
- 606,
+ 623,
"[TokenOrderBy!]"
],
"where": [
- 598
+ 615
]
}
],
"tokenAggregate": [
- 596,
+ 613,
{
"distinctOn": [
- 608,
+ 625,
"[TokenSelectColumn!]"
],
"limit": [
@@ -16069,44 +16357,44 @@ export default {
172
],
"orderBy": [
- 606,
+ 623,
"[TokenOrderBy!]"
],
"where": [
- 598
+ 615
]
}
],
"tokenByPk": [
- 595,
+ 612,
{
"token": [
- 549,
+ 566,
"String!"
]
}
],
"tokenStream": [
- 595,
+ 612,
{
"batchSize": [
172,
"Int!"
],
"cursor": [
- 610,
+ 627,
"[TokenStreamCursorInput]!"
],
"where": [
- 598
+ 615
]
}
],
"toneEnum": [
- 614,
+ 631,
{
"distinctOn": [
- 627,
+ 644,
"[ToneEnumSelectColumn!]"
],
"limit": [
@@ -16116,19 +16404,19 @@ export default {
172
],
"orderBy": [
- 625,
+ 642,
"[ToneEnumOrderBy!]"
],
"where": [
- 617
+ 634
]
}
],
"toneEnumAggregate": [
- 615,
+ 632,
{
"distinctOn": [
- 627,
+ 644,
"[ToneEnumSelectColumn!]"
],
"limit": [
@@ -16138,44 +16426,44 @@ export default {
172
],
"orderBy": [
- 625,
+ 642,
"[ToneEnumOrderBy!]"
],
"where": [
- 617
+ 634
]
}
],
"toneEnumByPk": [
- 614,
+ 631,
{
"value": [
- 549,
+ 566,
"String!"
]
}
],
"toneEnumStream": [
- 614,
+ 631,
{
"batchSize": [
172,
"Int!"
],
"cursor": [
- 629,
+ 646,
"[ToneEnumStreamCursorInput]!"
],
"where": [
- 617
+ 634
]
}
],
"typeEnum": [
- 633,
+ 650,
{
"distinctOn": [
- 646,
+ 663,
"[TypeEnumSelectColumn!]"
],
"limit": [
@@ -16185,19 +16473,19 @@ export default {
172
],
"orderBy": [
- 644,
+ 661,
"[TypeEnumOrderBy!]"
],
"where": [
- 636
+ 653
]
}
],
"typeEnumAggregate": [
- 634,
+ 651,
{
"distinctOn": [
- 646,
+ 663,
"[TypeEnumSelectColumn!]"
],
"limit": [
@@ -16207,44 +16495,44 @@ export default {
172
],
"orderBy": [
- 644,
+ 661,
"[TypeEnumOrderBy!]"
],
"where": [
- 636
+ 653
]
}
],
"typeEnumByPk": [
- 633,
+ 650,
{
"value": [
- 549,
+ 566,
"String!"
]
}
],
"typeEnumStream": [
- 633,
+ 650,
{
"batchSize": [
172,
"Int!"
],
"cursor": [
- 648,
+ 665,
"[TypeEnumStreamCursorInput]!"
],
"where": [
- 636
+ 653
]
}
],
"user": [
- 652,
+ 669,
{
"distinctOn": [
- 666,
+ 683,
"[UserSelectColumn!]"
],
"limit": [
@@ -16254,19 +16542,19 @@ export default {
172
],
"orderBy": [
- 663,
+ 680,
"[UserOrderBy!]"
],
"where": [
- 655
+ 672
]
}
],
"userAggregate": [
- 653,
+ 670,
{
"distinctOn": [
- 666,
+ 683,
"[UserSelectColumn!]"
],
"limit": [
@@ -16276,44 +16564,44 @@ export default {
172
],
"orderBy": [
- 663,
+ 680,
"[UserOrderBy!]"
],
"where": [
- 655
+ 672
]
}
],
"userByPk": [
- 652,
+ 669,
{
"userId": [
- 715,
+ 732,
"uuid!"
]
}
],
"userStream": [
- 652,
+ 669,
{
"batchSize": [
172,
"Int!"
],
"cursor": [
- 668,
+ 685,
"[UserStreamCursorInput]!"
],
"where": [
- 655
+ 672
]
}
],
"userToken": [
- 670,
+ 687,
{
"distinctOn": [
- 687,
+ 704,
"[UserTokenSelectColumn!]"
],
"limit": [
@@ -16323,19 +16611,19 @@ export default {
172
],
"orderBy": [
- 685,
+ 702,
"[UserTokenOrderBy!]"
],
"where": [
- 676
+ 693
]
}
],
"userTokenAggregate": [
- 671,
+ 688,
{
"distinctOn": [
- 687,
+ 704,
"[UserTokenSelectColumn!]"
],
"limit": [
@@ -16345,45 +16633,45 @@ export default {
172
],
"orderBy": [
- 685,
+ 702,
"[UserTokenOrderBy!]"
],
"where": [
- 676
+ 693
]
}
],
"userTokenByPk": [
- 670,
+ 687,
{
"token": [
- 549,
+ 566,
"String!"
],
"userId": [
- 715,
+ 732,
"uuid!"
]
}
],
"userTokenStream": [
- 670,
+ 687,
{
"batchSize": [
172,
"Int!"
],
"cursor": [
- 689,
+ 706,
"[UserTokenStreamCursorInput]!"
],
"where": [
- 676
+ 693
]
}
],
"__typename": [
- 549
+ 566
]
}
}