()
| 59 | } |
| 60 | |
| 61 | async 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 | |
| 116 | void (async () => { |
| 117 | console.log('Seeding the database...'); |
no test coverage detected