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

Function seedOne

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

Source from the content-addressed store, hash-verified

12import { upsertServer } from '../src/server';
13
14async function seedOne() {
15 const server = mockServerWithFlags({
16 id: '402',
17 flags: {
18 anonymizeMessages: false,
19 considerAllMessagesPublic: true,
20 readTheRulesConsentEnabled: true,
21 },
22 });
23 const channel = mockChannelWithFlags(server, {
24 flags: {
25 indexingEnabled: true,
26 autoThreadEnabled: false,
27 forumGuidelinesConsentEnabled: false,
28 markSolutionEnabled: true,
29 sendMarkSolutionInstructionsInNewThreads: true,
30 },
31 inviteCode: 'invite-code',
32 type: ChannelType.GuildForum,
33 });
34 const thread = mockThread(channel, {
35 type: ChannelType.PublicThread,
36 });
37 const account = mockDiscordAccount();
38 const messagesToMock = 10;
39 const messages = Array.from({ length: messagesToMock }, (_, i) =>
40 mockMessage(server, thread, account, {
41 id: (BigInt(thread.id) + BigInt(i)).toString(),
42 parentChannelId: channel.id,
43 }),
44 );
45 await upsertServer({
46 create: server,
47 update: server,
48 });
49 await upsertChannel({
50 create: channel,
51 update: channel,
52 });
53 await upsertChannel({
54 create: thread,
55 update: thread,
56 });
57 await upsertDiscordAccount(account);
58 await upsertManyMessages(messages);
59}
60
61async function seedTwo() {
62 const server = mockServerWithFlags({

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