MCPcopy Index your code
hub / github.com/AnswerOverflow/AnswerOverflow / seedTwo

Function seedTwo

packages/core/scripts/seed.ts:61–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61async function seedTwo() {
62 const server = mockServerWithFlags({
63 id: '300',
64 customDomain: 'tenant:3001',
65 flags: {
66 anonymizeMessages: false,
67 considerAllMessagesPublic: true,
68 readTheRulesConsentEnabled: true,
69 },
70 });
71 const channel = mockChannelWithFlags(server, {
72 flags: {
73 indexingEnabled: true,
74 autoThreadEnabled: false,
75 forumGuidelinesConsentEnabled: false,
76 markSolutionEnabled: true,
77 sendMarkSolutionInstructionsInNewThreads: true,
78 },
79 type: ChannelType.GuildForum,
80 });
81 const thread = mockThread(channel, {
82 type: ChannelType.PublicThread,
83 });
84 const account = mockDiscordAccount();
85 const messagesToMock = 10;
86 const messages = Array.from({ length: messagesToMock }, (_, i) =>
87 mockMessage(server, thread, account, {
88 id: (BigInt(thread.id) + BigInt(i)).toString(),
89 parentChannelId: channel.id,
90 }),
91 );
92 messages.push(
93 mockMessage(server, thread, account, {
94 id: '100',
95 parentChannelId: channel.id,
96 content:
97 'Can you make sure that your internal address is composed of http://ip:port, ',
98 }),
99 );
100 await upsertServer({
101 create: server,
102 update: server,
103 });
104 await upsertChannel({
105 create: channel,
106 update: channel,
107 });
108 await upsertChannel({
109 create: thread,
110 update: thread,
111 });
112 await upsertDiscordAccount(account);
113 await upsertManyMessages(messages);
114}
115
116void (async () => {
117 console.log('Seeding the database...');

Callers 1

seed.tsFile · 0.85

Calls 9

mockServerWithFlagsFunction · 0.90
mockChannelWithFlagsFunction · 0.90
mockThreadFunction · 0.90
mockDiscordAccountFunction · 0.90
mockMessageFunction · 0.90
upsertServerFunction · 0.90
upsertChannelFunction · 0.90
upsertDiscordAccountFunction · 0.90
upsertManyMessagesFunction · 0.90

Tested by

no test coverage detected