Skip to content

Commit 83642b2

Browse files
authored
chore: seeds upt (#269)
* wip: seeds upt * chore(hasura): seeds review * feat(hasura): add "is_approved" thread field + seeds * chore: mb-genql upt
1 parent 4940a30 commit 83642b2

File tree

11 files changed

+857
-1118
lines changed

11 files changed

+857
-1118
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Could not auto-generate a down migration.
2+
-- Please write an appropriate down migration for the SQL below:
3+
-- alter table "public"."thread" add column "is_approved" boolean
4+
-- null default 'false';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
alter table "public"."thread" add column "is_approved" boolean
2+
null default 'false';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
alter table "public"."thread" alter column "is_public" set default 'false';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
alter table "public"."thread" alter column "is_public" set default 'true';

apps/hasura/seeds/masterbots/1724271272084_init_threads_seeds.sql

Lines changed: 784 additions & 849 deletions
Large diffs are not rendered by default.

apps/hasura/seeds/masterbots/1724271332200_init_messages_seeds.sql

Lines changed: 0 additions & 247 deletions
Large diffs are not rendered by default.

apps/masterbots.ai/services/hasura/hasura.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ export async function getBrowseThreads({
451451
}
452452
}
453453
: {}),
454-
isPublic: { _eq: true }
454+
isPublic: { _eq: true },
455+
isApproved: { _eq: true },
455456
},
456457
limit: limit || 30,
457458
offset: offset || 0

packages/mb-genql/generated/index.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
// @ts-nocheck
2-
import type {
3-
query_rootGenqlSelection,
4-
query_root,
5-
mutation_rootGenqlSelection,
6-
mutation_root,
7-
subscription_rootGenqlSelection,
8-
subscription_root,
9-
} from './schema'
102
import {
11-
linkTypeMap,
123
createClient as createClientOriginal,
134
generateGraphqlOperation,
5+
GenqlError,
6+
linkTypeMap,
7+
type ClientOptions,
148
type FieldsSelection,
159
type GraphqlOperation,
16-
type ClientOptions,
17-
GenqlError,
1810
} from './runtime'
11+
import type {
12+
mutation_root,
13+
mutation_rootGenqlSelection,
14+
query_root,
15+
query_rootGenqlSelection,
16+
subscription_root,
17+
subscription_rootGenqlSelection,
18+
} from './schema'
1919
export type { FieldsSelection } from './runtime'
2020
export { GenqlError }
2121

packages/mb-genql/generated/schema.graphql

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3593,7 +3593,7 @@ unique or primary key constraints on table "prompt_chatbot"
35933593
"""
35943594
enum PromptChatbotConstraint {
35953595
"""
3596-
unique or primary key constraint on columns "chabot_id", "prompt_id"
3596+
unique or primary key constraint on columns "prompt_id", "chabot_id"
35973597
"""
35983598
prompt_chatbot_pkey
35993599
}
@@ -4901,6 +4901,7 @@ type Thread {
49014901
chatbot: Chatbot!
49024902
chatbotId: Int!
49034903
createdAt: timestamptz!
4904+
isApproved: Boolean
49044905
isPublic: Boolean
49054906

49064907
"""An array relationship"""
@@ -5030,6 +5031,7 @@ input ThreadBoolExp {
50305031
chatbot: ChatbotBoolExp
50315032
chatbotId: IntComparisonExp
50325033
createdAt: TimestamptzComparisonExp
5034+
isApproved: BooleanComparisonExp
50335035
isPublic: BooleanComparisonExp
50345036
messages: MessageBoolExp
50355037
messagesAggregate: MessageAggregateBoolExp
@@ -5070,6 +5072,7 @@ input ThreadInsertInput {
50705072
chatbot: ChatbotObjRelInsertInput
50715073
chatbotId: Int
50725074
createdAt: timestamptz
5075+
isApproved: Boolean
50735076
isPublic: Boolean
50745077
messages: MessageArrRelInsertInput
50755078
model: ModelsEnumEnum
@@ -5155,6 +5158,7 @@ input ThreadOrderBy {
51555158
chatbot: ChatbotOrderBy
51565159
chatbotId: OrderBy
51575160
createdAt: OrderBy
5161+
isApproved: OrderBy
51585162
isPublic: OrderBy
51595163
messagesAggregate: MessageAggregateOrderBy
51605164
model: OrderBy
@@ -5180,6 +5184,9 @@ enum ThreadSelectColumn {
51805184
"""column name"""
51815185
createdAt
51825186

5187+
"""column name"""
5188+
isApproved
5189+
51835190
"""column name"""
51845191
isPublic
51855192

@@ -5200,6 +5207,9 @@ enum ThreadSelectColumn {
52005207
select "threadAggregateBoolExpBool_andArgumentsColumns" columns of table "thread"
52015208
"""
52025209
enum ThreadSelectColumnThreadAggregateBoolExpBool_andArgumentsColumns {
5210+
"""column name"""
5211+
isApproved
5212+
52035213
"""column name"""
52045214
isPublic
52055215
}
@@ -5208,6 +5218,9 @@ enum ThreadSelectColumnThreadAggregateBoolExpBool_andArgumentsColumns {
52085218
select "threadAggregateBoolExpBool_orArgumentsColumns" columns of table "thread"
52095219
"""
52105220
enum ThreadSelectColumnThreadAggregateBoolExpBool_orArgumentsColumns {
5221+
"""column name"""
5222+
isApproved
5223+
52115224
"""column name"""
52125225
isPublic
52135226
}
@@ -5218,6 +5231,7 @@ input type for updating data in table "thread"
52185231
input ThreadSetInput {
52195232
chatbotId: Int
52205233
createdAt: timestamptz
5234+
isApproved: Boolean
52215235
isPublic: Boolean
52225236
model: ModelsEnumEnum
52235237
threadId: uuid
@@ -5276,6 +5290,7 @@ input ThreadStreamCursorInput {
52765290
input ThreadStreamCursorValueInput {
52775291
chatbotId: Int
52785292
createdAt: timestamptz
5293+
isApproved: Boolean
52795294
isPublic: Boolean
52805295
model: ModelsEnumEnum
52815296
threadId: uuid
@@ -5305,6 +5320,9 @@ enum ThreadUpdateColumn {
53055320
"""column name"""
53065321
createdAt
53075322

5323+
"""column name"""
5324+
isApproved
5325+
53085326
"""column name"""
53095327
isPublic
53105328

packages/mb-genql/generated/schema.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,6 +1681,7 @@ export interface Thread {
16811681
chatbot: Chatbot
16821682
chatbotId: Scalars['Int']
16831683
createdAt: Scalars['timestamptz']
1684+
isApproved: (Scalars['Boolean'] | null)
16841685
isPublic: (Scalars['Boolean'] | null)
16851686
/** An array relationship */
16861687
messages: Message[]
@@ -1767,15 +1768,15 @@ export interface ThreadMutationResponse {
17671768

17681769

17691770
/** select columns of table "thread" */
1770-
export type ThreadSelectColumn = 'chatbotId' | 'createdAt' | 'isPublic' | 'model' | 'threadId' | 'updatedAt' | 'userId'
1771+
export type ThreadSelectColumn = 'chatbotId' | 'createdAt' | 'isApproved' | 'isPublic' | 'model' | 'threadId' | 'updatedAt' | 'userId'
17711772

17721773

17731774
/** select "threadAggregateBoolExpBool_andArgumentsColumns" columns of table "thread" */
1774-
export type ThreadSelectColumnThreadAggregateBoolExpBool_andArgumentsColumns = 'isPublic'
1775+
export type ThreadSelectColumnThreadAggregateBoolExpBool_andArgumentsColumns = 'isApproved' | 'isPublic'
17751776

17761777

17771778
/** select "threadAggregateBoolExpBool_orArgumentsColumns" columns of table "thread" */
1778-
export type ThreadSelectColumnThreadAggregateBoolExpBool_orArgumentsColumns = 'isPublic'
1779+
export type ThreadSelectColumnThreadAggregateBoolExpBool_orArgumentsColumns = 'isApproved' | 'isPublic'
17791780

17801781

17811782
/** aggregate stddev on columns */
@@ -1807,7 +1808,7 @@ export interface ThreadSumFields {
18071808

18081809

18091810
/** update columns of table "thread" */
1810-
export type ThreadUpdateColumn = 'chatbotId' | 'createdAt' | 'isPublic' | 'model' | 'threadId' | 'updatedAt' | 'userId'
1811+
export type ThreadUpdateColumn = 'chatbotId' | 'createdAt' | 'isApproved' | 'isPublic' | 'model' | 'threadId' | 'updatedAt' | 'userId'
18111812

18121813

18131814
/** aggregate varPop on columns */
@@ -5717,6 +5718,7 @@ export interface ThreadGenqlSelection{
57175718
chatbot?: ChatbotGenqlSelection
57185719
chatbotId?: boolean | number
57195720
createdAt?: boolean | number
5721+
isApproved?: boolean | number
57205722
isPublic?: boolean | number
57215723
/** An array relationship */
57225724
messages?: (MessageGenqlSelection & { __args?: {
@@ -5807,15 +5809,15 @@ export interface ThreadAvgOrderBy {chatbotId?: (OrderBy | null)}
58075809

58085810

58095811
/** Boolean expression to filter rows from the table "thread". All fields are combined with a logical 'AND'. */
5810-
export interface ThreadBoolExp {_and?: (ThreadBoolExp[] | null),_not?: (ThreadBoolExp | null),_or?: (ThreadBoolExp[] | null),chatbot?: (ChatbotBoolExp | null),chatbotId?: (IntComparisonExp | null),createdAt?: (TimestamptzComparisonExp | null),isPublic?: (BooleanComparisonExp | null),messages?: (MessageBoolExp | null),messagesAggregate?: (MessageAggregateBoolExp | null),model?: (ModelsEnumEnumComparisonExp | null),modelsEnum?: (ModelsEnumBoolExp | null),threadId?: (UuidComparisonExp | null),updatedAt?: (TimestamptzComparisonExp | null),user?: (UserBoolExp | null),userId?: (UuidComparisonExp | null)}
5812+
export interface ThreadBoolExp {_and?: (ThreadBoolExp[] | null),_not?: (ThreadBoolExp | null),_or?: (ThreadBoolExp[] | null),chatbot?: (ChatbotBoolExp | null),chatbotId?: (IntComparisonExp | null),createdAt?: (TimestamptzComparisonExp | null),isApproved?: (BooleanComparisonExp | null),isPublic?: (BooleanComparisonExp | null),messages?: (MessageBoolExp | null),messagesAggregate?: (MessageAggregateBoolExp | null),model?: (ModelsEnumEnumComparisonExp | null),modelsEnum?: (ModelsEnumBoolExp | null),threadId?: (UuidComparisonExp | null),updatedAt?: (TimestamptzComparisonExp | null),user?: (UserBoolExp | null),userId?: (UuidComparisonExp | null)}
58115813

58125814

58135815
/** input type for incrementing numeric columns in table "thread" */
58145816
export interface ThreadIncInput {chatbotId?: (Scalars['Int'] | null)}
58155817

58165818

58175819
/** input type for inserting data into table "thread" */
5818-
export interface ThreadInsertInput {chatbot?: (ChatbotObjRelInsertInput | null),chatbotId?: (Scalars['Int'] | null),createdAt?: (Scalars['timestamptz'] | null),isPublic?: (Scalars['Boolean'] | null),messages?: (MessageArrRelInsertInput | null),model?: (ModelsEnumEnum | null),modelsEnum?: (ModelsEnumObjRelInsertInput | null),threadId?: (Scalars['uuid'] | null),updatedAt?: (Scalars['timestamptz'] | null),user?: (UserObjRelInsertInput | null),userId?: (Scalars['uuid'] | null)}
5820+
export interface ThreadInsertInput {chatbot?: (ChatbotObjRelInsertInput | null),chatbotId?: (Scalars['Int'] | null),createdAt?: (Scalars['timestamptz'] | null),isApproved?: (Scalars['Boolean'] | null),isPublic?: (Scalars['Boolean'] | null),messages?: (MessageArrRelInsertInput | null),model?: (ModelsEnumEnum | null),modelsEnum?: (ModelsEnumObjRelInsertInput | null),threadId?: (Scalars['uuid'] | null),updatedAt?: (Scalars['timestamptz'] | null),user?: (UserObjRelInsertInput | null),userId?: (Scalars['uuid'] | null)}
58195821

58205822

58215823
/** aggregate max on columns */
@@ -5872,15 +5874,15 @@ export interface ThreadOnConflict {constraint: ThreadConstraint,updateColumns?:
58725874

58735875

58745876
/** Ordering options when selecting data from "thread". */
5875-
export interface ThreadOrderBy {chatbot?: (ChatbotOrderBy | null),chatbotId?: (OrderBy | null),createdAt?: (OrderBy | null),isPublic?: (OrderBy | null),messagesAggregate?: (MessageAggregateOrderBy | null),model?: (OrderBy | null),modelsEnum?: (ModelsEnumOrderBy | null),threadId?: (OrderBy | null),updatedAt?: (OrderBy | null),user?: (UserOrderBy | null),userId?: (OrderBy | null)}
5877+
export interface ThreadOrderBy {chatbot?: (ChatbotOrderBy | null),chatbotId?: (OrderBy | null),createdAt?: (OrderBy | null),isApproved?: (OrderBy | null),isPublic?: (OrderBy | null),messagesAggregate?: (MessageAggregateOrderBy | null),model?: (OrderBy | null),modelsEnum?: (ModelsEnumOrderBy | null),threadId?: (OrderBy | null),updatedAt?: (OrderBy | null),user?: (UserOrderBy | null),userId?: (OrderBy | null)}
58765878

58775879

58785880
/** primary key columns input for table: thread */
58795881
export interface ThreadPkColumnsInput {threadId: Scalars['uuid']}
58805882

58815883

58825884
/** input type for updating data in table "thread" */
5883-
export interface ThreadSetInput {chatbotId?: (Scalars['Int'] | null),createdAt?: (Scalars['timestamptz'] | null),isPublic?: (Scalars['Boolean'] | null),model?: (ModelsEnumEnum | null),threadId?: (Scalars['uuid'] | null),updatedAt?: (Scalars['timestamptz'] | null),userId?: (Scalars['uuid'] | null)}
5885+
export interface ThreadSetInput {chatbotId?: (Scalars['Int'] | null),createdAt?: (Scalars['timestamptz'] | null),isApproved?: (Scalars['Boolean'] | null),isPublic?: (Scalars['Boolean'] | null),model?: (ModelsEnumEnum | null),threadId?: (Scalars['uuid'] | null),updatedAt?: (Scalars['timestamptz'] | null),userId?: (Scalars['uuid'] | null)}
58845886

58855887

58865888
/** aggregate stddev on columns */
@@ -5928,7 +5930,7 @@ ordering?: (CursorOrdering | null)}
59285930

59295931

59305932
/** Initial value of the column from where the streaming should start */
5931-
export interface ThreadStreamCursorValueInput {chatbotId?: (Scalars['Int'] | null),createdAt?: (Scalars['timestamptz'] | null),isPublic?: (Scalars['Boolean'] | null),model?: (ModelsEnumEnum | null),threadId?: (Scalars['uuid'] | null),updatedAt?: (Scalars['timestamptz'] | null),userId?: (Scalars['uuid'] | null)}
5933+
export interface ThreadStreamCursorValueInput {chatbotId?: (Scalars['Int'] | null),createdAt?: (Scalars['timestamptz'] | null),isApproved?: (Scalars['Boolean'] | null),isPublic?: (Scalars['Boolean'] | null),model?: (ModelsEnumEnum | null),threadId?: (Scalars['uuid'] | null),updatedAt?: (Scalars['timestamptz'] | null),userId?: (Scalars['uuid'] | null)}
59325934

59335935

59345936
/** aggregate sum on columns */
@@ -10198,6 +10200,7 @@ export const enumThreadConstraint = {
1019810200
export const enumThreadSelectColumn = {
1019910201
chatbotId: 'chatbotId' as const,
1020010202
createdAt: 'createdAt' as const,
10203+
isApproved: 'isApproved' as const,
1020110204
isPublic: 'isPublic' as const,
1020210205
model: 'model' as const,
1020310206
threadId: 'threadId' as const,
@@ -10206,16 +10209,19 @@ export const enumThreadSelectColumn = {
1020610209
}
1020710210

1020810211
export const enumThreadSelectColumnThreadAggregateBoolExpBoolAndArgumentsColumns = {
10212+
isApproved: 'isApproved' as const,
1020910213
isPublic: 'isPublic' as const
1021010214
}
1021110215

1021210216
export const enumThreadSelectColumnThreadAggregateBoolExpBoolOrArgumentsColumns = {
10217+
isApproved: 'isApproved' as const,
1021310218
isPublic: 'isPublic' as const
1021410219
}
1021510220

1021610221
export const enumThreadUpdateColumn = {
1021710222
chatbotId: 'chatbotId' as const,
1021810223
createdAt: 'createdAt' as const,
10224+
isApproved: 'isApproved' as const,
1021910225
isPublic: 'isPublic' as const,
1022010226
model: 'model' as const,
1022110227
threadId: 'threadId' as const,

0 commit comments

Comments
 (0)