2023-03-31 20:17:26 +02:00
|
|
|
import {createServer as createHTTPServer} from 'node:http'
|
|
|
|
import {parse} from 'node:url'
|
|
|
|
import {createServer, TestPDS} from '../jest/test-pds'
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
let server: TestPDS
|
|
|
|
createHTTPServer(async (req, res) => {
|
|
|
|
const url = parse(req.url || '/', true)
|
|
|
|
if (req.method !== 'POST') {
|
|
|
|
return res.writeHead(200).end()
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
console.log('Closing old server')
|
|
|
|
await server?.close()
|
|
|
|
console.log('Starting new server')
|
2023-04-06 01:56:02 +02:00
|
|
|
const inviteRequired = url?.query && 'invite' in url.query
|
2024-01-19 05:48:51 +01:00
|
|
|
const phoneRequired = url?.query && 'phone' in url.query
|
|
|
|
server = await createServer({inviteRequired, phoneRequired})
|
2023-03-31 20:17:26 +02:00
|
|
|
console.log('Listening at', server.pdsUrl)
|
|
|
|
if (url?.query) {
|
|
|
|
if ('users' in url.query) {
|
|
|
|
console.log('Generating mock users')
|
|
|
|
await server.mocker.createUser('alice')
|
|
|
|
await server.mocker.createUser('bob')
|
|
|
|
await server.mocker.createUser('carla')
|
|
|
|
await server.mocker.users.alice.agent.upsertProfile(() => ({
|
|
|
|
displayName: 'Alice',
|
|
|
|
description: 'Test user 1',
|
|
|
|
}))
|
|
|
|
await server.mocker.users.bob.agent.upsertProfile(() => ({
|
|
|
|
displayName: 'Bob',
|
|
|
|
description: 'Test user 2',
|
|
|
|
}))
|
|
|
|
await server.mocker.users.carla.agent.upsertProfile(() => ({
|
|
|
|
displayName: 'Carla',
|
|
|
|
description: 'Test user 3',
|
|
|
|
}))
|
2023-06-28 03:55:46 +02:00
|
|
|
if (inviteRequired) {
|
|
|
|
await server.mocker.createInvite(server.mocker.users.alice.did)
|
|
|
|
}
|
2023-03-31 20:17:26 +02:00
|
|
|
}
|
|
|
|
if ('follows' in url.query) {
|
|
|
|
console.log('Generating mock follows')
|
|
|
|
await server.mocker.follow('alice', 'bob')
|
|
|
|
await server.mocker.follow('alice', 'carla')
|
|
|
|
await server.mocker.follow('bob', 'alice')
|
|
|
|
await server.mocker.follow('bob', 'carla')
|
|
|
|
await server.mocker.follow('carla', 'alice')
|
|
|
|
await server.mocker.follow('carla', 'bob')
|
|
|
|
}
|
|
|
|
if ('posts' in url.query) {
|
|
|
|
console.log('Generating mock posts')
|
|
|
|
for (let user in server.mocker.users) {
|
|
|
|
await server.mocker.users[user].agent.post({text: 'Post'})
|
|
|
|
}
|
|
|
|
}
|
2023-08-15 18:59:49 +02:00
|
|
|
if ('feeds' in url.query) {
|
|
|
|
console.log('Generating mock feed')
|
2023-09-21 04:47:56 +02:00
|
|
|
await server.mocker.createFeed('alice', 'alice-favs', [])
|
2023-08-15 18:59:49 +02:00
|
|
|
}
|
2023-03-31 20:17:26 +02:00
|
|
|
if ('thread' in url.query) {
|
|
|
|
console.log('Generating mock posts')
|
|
|
|
const res = await server.mocker.users.bob.agent.post({
|
|
|
|
text: 'Thread root',
|
|
|
|
})
|
|
|
|
await server.mocker.users.carla.agent.post({
|
|
|
|
text: 'Thread reply',
|
|
|
|
reply: {
|
|
|
|
parent: {cid: res.cid, uri: res.uri},
|
|
|
|
root: {cid: res.cid, uri: res.uri},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
2023-09-21 04:47:56 +02:00
|
|
|
if ('mergefeed' in url.query) {
|
|
|
|
console.log('Generating mock users')
|
|
|
|
await server.mocker.createUser('alice')
|
|
|
|
await server.mocker.createUser('bob')
|
|
|
|
await server.mocker.createUser('carla')
|
|
|
|
await server.mocker.createUser('dan')
|
|
|
|
await server.mocker.users.alice.agent.upsertProfile(() => ({
|
|
|
|
displayName: 'Alice',
|
|
|
|
description: 'Test user 1',
|
|
|
|
}))
|
|
|
|
await server.mocker.users.bob.agent.upsertProfile(() => ({
|
|
|
|
displayName: 'Bob',
|
|
|
|
description: 'Test user 2',
|
|
|
|
}))
|
|
|
|
await server.mocker.users.carla.agent.upsertProfile(() => ({
|
|
|
|
displayName: 'Carla',
|
|
|
|
description: 'Test user 3',
|
|
|
|
}))
|
|
|
|
await server.mocker.users.dan.agent.upsertProfile(() => ({
|
|
|
|
displayName: 'Dan',
|
|
|
|
description: 'Test user 4',
|
|
|
|
}))
|
|
|
|
console.log('Generating mock follows')
|
|
|
|
await server.mocker.follow('alice', 'bob')
|
|
|
|
await server.mocker.follow('alice', 'carla')
|
|
|
|
console.log('Generating mock posts')
|
|
|
|
let posts: Record<string, any[]> = {
|
|
|
|
alice: [],
|
|
|
|
bob: [],
|
|
|
|
carla: [],
|
|
|
|
dan: [],
|
|
|
|
}
|
|
|
|
for (let i = 0; i < 10; i++) {
|
|
|
|
for (let user in server.mocker.users) {
|
|
|
|
if (user === 'alice') continue
|
|
|
|
posts[user].push(
|
|
|
|
await server.mocker.createPost(user, `Post ${i}`),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (let i = 0; i < 10; i++) {
|
|
|
|
for (let user in server.mocker.users) {
|
|
|
|
if (user === 'alice') continue
|
|
|
|
if (i % 5 === 0) {
|
|
|
|
await server.mocker.createReply(user, 'Self reply', {
|
|
|
|
cid: posts[user][i].cid,
|
|
|
|
uri: posts[user][i].uri,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if (i % 5 === 1) {
|
|
|
|
await server.mocker.createReply(user, 'Reply to bob', {
|
|
|
|
cid: posts.bob[i].cid,
|
|
|
|
uri: posts.bob[i].uri,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
if (i % 5 === 2) {
|
|
|
|
await server.mocker.createReply(user, 'Reply to dan', {
|
|
|
|
cid: posts.dan[i].cid,
|
|
|
|
uri: posts.dan[i].uri,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
await server.mocker.users[user].agent.post({text: `Post ${i}`})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log('Generating mock feeds')
|
|
|
|
await server.mocker.createFeed(
|
|
|
|
'alice',
|
|
|
|
'alice-favs',
|
|
|
|
posts.dan.map(p => p.uri),
|
|
|
|
)
|
|
|
|
await server.mocker.createFeed(
|
|
|
|
'alice',
|
|
|
|
'alice-favs2',
|
|
|
|
posts.dan.map(p => p.uri),
|
|
|
|
)
|
|
|
|
}
|
2023-04-27 19:38:23 +02:00
|
|
|
if ('labels' in url.query) {
|
|
|
|
console.log('Generating naughty users with labels')
|
|
|
|
|
|
|
|
const anchorPost = await server.mocker.createPost(
|
|
|
|
'alice',
|
|
|
|
'Anchor post',
|
|
|
|
)
|
|
|
|
|
|
|
|
for (const user of [
|
2023-08-04 07:08:30 +02:00
|
|
|
'dmca-account',
|
|
|
|
'dmca-profile',
|
|
|
|
'dmca-posts',
|
2023-04-27 19:38:23 +02:00
|
|
|
'porn-account',
|
|
|
|
'porn-profile',
|
|
|
|
'porn-posts',
|
|
|
|
'nudity-account',
|
|
|
|
'nudity-profile',
|
|
|
|
'nudity-posts',
|
2023-08-04 07:08:30 +02:00
|
|
|
'scam-account',
|
|
|
|
'scam-profile',
|
|
|
|
'scam-posts',
|
2023-05-04 07:24:14 +02:00
|
|
|
'unknown-account',
|
|
|
|
'unknown-profile',
|
|
|
|
'unknown-posts',
|
2023-08-04 07:08:30 +02:00
|
|
|
'hide-account',
|
|
|
|
'hide-profile',
|
|
|
|
'hide-posts',
|
|
|
|
'no-promote-account',
|
|
|
|
'no-promote-profile',
|
|
|
|
'no-promote-posts',
|
|
|
|
'warn-account',
|
|
|
|
'warn-profile',
|
|
|
|
'warn-posts',
|
2023-04-27 19:38:23 +02:00
|
|
|
'muted-account',
|
2023-05-11 23:08:21 +02:00
|
|
|
'muted-by-list-account',
|
2023-08-04 07:08:30 +02:00
|
|
|
'blocking-account',
|
|
|
|
'blockedby-account',
|
|
|
|
'mutual-block-account',
|
2023-04-27 19:38:23 +02:00
|
|
|
]) {
|
|
|
|
await server.mocker.createUser(user)
|
|
|
|
await server.mocker.follow('alice', user)
|
|
|
|
await server.mocker.follow(user, 'alice')
|
|
|
|
await server.mocker.createPost(user, `Unlabeled post from ${user}`)
|
|
|
|
await server.mocker.createReply(
|
|
|
|
user,
|
|
|
|
`Unlabeled reply from ${user}`,
|
|
|
|
anchorPost,
|
|
|
|
)
|
|
|
|
await server.mocker.like(user, anchorPost)
|
|
|
|
}
|
|
|
|
|
2023-08-04 07:08:30 +02:00
|
|
|
await server.mocker.labelAccount('dmca-violation', 'dmca-account')
|
|
|
|
await server.mocker.labelProfile('dmca-violation', 'dmca-profile')
|
2023-04-27 19:38:23 +02:00
|
|
|
await server.mocker.labelPost(
|
2023-08-04 07:08:30 +02:00
|
|
|
'dmca-violation',
|
|
|
|
await server.mocker.createPost('dmca-posts', 'dmca post'),
|
2023-04-27 19:38:23 +02:00
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
2023-08-04 07:08:30 +02:00
|
|
|
'dmca-violation',
|
2023-04-27 19:38:23 +02:00
|
|
|
await server.mocker.createQuotePost(
|
2023-08-04 07:08:30 +02:00
|
|
|
'dmca-posts',
|
|
|
|
'dmca quote post',
|
2023-04-27 19:38:23 +02:00
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
2023-08-04 07:08:30 +02:00
|
|
|
'dmca-violation',
|
2023-04-27 19:38:23 +02:00
|
|
|
await server.mocker.createReply(
|
2023-08-04 07:08:30 +02:00
|
|
|
'dmca-posts',
|
|
|
|
'dmca reply',
|
2023-04-27 19:38:23 +02:00
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
await server.mocker.labelAccount('porn', 'porn-account')
|
|
|
|
await server.mocker.labelProfile('porn', 'porn-profile')
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'porn',
|
2023-08-09 00:54:36 +02:00
|
|
|
await server.mocker.createImagePost('porn-posts', 'porn post'),
|
2023-04-27 19:38:23 +02:00
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'porn',
|
|
|
|
await server.mocker.createQuotePost(
|
|
|
|
'porn-posts',
|
|
|
|
'porn quote post',
|
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'porn',
|
|
|
|
await server.mocker.createReply(
|
|
|
|
'porn-posts',
|
|
|
|
'porn reply',
|
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
await server.mocker.labelAccount('nudity', 'nudity-account')
|
|
|
|
await server.mocker.labelProfile('nudity', 'nudity-profile')
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'nudity',
|
2023-08-09 00:54:36 +02:00
|
|
|
await server.mocker.createImagePost('nudity-posts', 'nudity post'),
|
2023-04-27 19:38:23 +02:00
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'nudity',
|
|
|
|
await server.mocker.createQuotePost(
|
|
|
|
'nudity-posts',
|
|
|
|
'nudity quote post',
|
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'nudity',
|
|
|
|
await server.mocker.createReply(
|
|
|
|
'nudity-posts',
|
|
|
|
'nudity reply',
|
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2023-08-04 07:08:30 +02:00
|
|
|
await server.mocker.labelAccount('scam', 'scam-account')
|
|
|
|
await server.mocker.labelProfile('scam', 'scam-profile')
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'scam',
|
|
|
|
await server.mocker.createPost('scam-posts', 'scam post'),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'scam',
|
|
|
|
await server.mocker.createQuotePost(
|
|
|
|
'scam-posts',
|
|
|
|
'scam quote post',
|
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'scam',
|
|
|
|
await server.mocker.createReply(
|
|
|
|
'scam-posts',
|
|
|
|
'scam reply',
|
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2023-05-04 07:24:14 +02:00
|
|
|
await server.mocker.labelAccount(
|
|
|
|
'not-a-real-label',
|
|
|
|
'unknown-account',
|
|
|
|
)
|
|
|
|
await server.mocker.labelProfile(
|
|
|
|
'not-a-real-label',
|
|
|
|
'unknown-profile',
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'not-a-real-label',
|
|
|
|
await server.mocker.createPost('unknown-posts', 'unknown post'),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'not-a-real-label',
|
|
|
|
await server.mocker.createQuotePost(
|
|
|
|
'unknown-posts',
|
|
|
|
'unknown quote post',
|
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'not-a-real-label',
|
|
|
|
await server.mocker.createReply(
|
|
|
|
'unknown-posts',
|
|
|
|
'unknown reply',
|
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2023-08-04 07:08:30 +02:00
|
|
|
await server.mocker.labelAccount('!hide', 'hide-account')
|
|
|
|
await server.mocker.labelProfile('!hide', 'hide-profile')
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'!hide',
|
|
|
|
await server.mocker.createPost('hide-posts', 'hide post'),
|
|
|
|
)
|
2023-05-04 07:55:33 +02:00
|
|
|
await server.mocker.labelPost(
|
2023-08-04 07:08:30 +02:00
|
|
|
'!hide',
|
|
|
|
await server.mocker.createQuotePost(
|
|
|
|
'hide-posts',
|
|
|
|
'hide quote post',
|
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'!hide',
|
|
|
|
await server.mocker.createReply(
|
|
|
|
'hide-posts',
|
|
|
|
'hide reply',
|
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
await server.mocker.labelAccount('!no-promote', 'no-promote-account')
|
|
|
|
await server.mocker.labelProfile('!no-promote', 'no-promote-profile')
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'!no-promote',
|
2023-05-04 07:55:33 +02:00
|
|
|
await server.mocker.createPost(
|
2023-08-04 07:08:30 +02:00
|
|
|
'no-promote-posts',
|
|
|
|
'no-promote post',
|
2023-05-04 07:55:33 +02:00
|
|
|
),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
2023-08-04 07:08:30 +02:00
|
|
|
'!no-promote',
|
2023-05-04 07:55:33 +02:00
|
|
|
await server.mocker.createQuotePost(
|
2023-08-04 07:08:30 +02:00
|
|
|
'no-promote-posts',
|
|
|
|
'no-promote quote post',
|
2023-05-04 07:55:33 +02:00
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
2023-08-04 07:08:30 +02:00
|
|
|
'!no-promote',
|
2023-05-04 07:55:33 +02:00
|
|
|
await server.mocker.createReply(
|
2023-08-04 07:08:30 +02:00
|
|
|
'no-promote-posts',
|
|
|
|
'no-promote reply',
|
2023-05-04 07:55:33 +02:00
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2023-08-04 07:08:30 +02:00
|
|
|
await server.mocker.labelAccount('!warn', 'warn-account')
|
|
|
|
await server.mocker.labelProfile('!warn', 'warn-profile')
|
2023-05-04 07:55:33 +02:00
|
|
|
await server.mocker.labelPost(
|
|
|
|
'!warn',
|
2023-08-04 07:08:30 +02:00
|
|
|
await server.mocker.createPost('warn-posts', 'warn post'),
|
2023-05-04 07:55:33 +02:00
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'!warn',
|
|
|
|
await server.mocker.createQuotePost(
|
2023-08-04 07:08:30 +02:00
|
|
|
'warn-posts',
|
|
|
|
'warn quote post',
|
2023-05-04 07:55:33 +02:00
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
await server.mocker.labelPost(
|
|
|
|
'!warn',
|
|
|
|
await server.mocker.createReply(
|
2023-08-04 07:08:30 +02:00
|
|
|
'warn-posts',
|
|
|
|
'warn reply',
|
2023-05-04 07:55:33 +02:00
|
|
|
anchorPost,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
2023-04-27 19:38:23 +02:00
|
|
|
await server.mocker.users.alice.agent.mute('muted-account.test')
|
|
|
|
await server.mocker.createPost('muted-account', 'muted post')
|
|
|
|
await server.mocker.createQuotePost(
|
|
|
|
'muted-account',
|
2023-05-11 23:08:21 +02:00
|
|
|
'muted quote post',
|
2023-04-27 19:38:23 +02:00
|
|
|
anchorPost,
|
|
|
|
)
|
|
|
|
await server.mocker.createReply(
|
|
|
|
'muted-account',
|
2023-05-11 23:08:21 +02:00
|
|
|
'muted reply',
|
|
|
|
anchorPost,
|
|
|
|
)
|
|
|
|
|
|
|
|
const list = await server.mocker.createMuteList(
|
|
|
|
'alice',
|
|
|
|
'Muted Users',
|
|
|
|
)
|
|
|
|
await server.mocker.addToMuteList(
|
|
|
|
'alice',
|
|
|
|
list,
|
|
|
|
server.mocker.users['muted-by-list-account'].did,
|
|
|
|
)
|
|
|
|
await server.mocker.createPost('muted-by-list-account', 'muted post')
|
|
|
|
await server.mocker.createQuotePost(
|
|
|
|
'muted-by-list-account',
|
|
|
|
'account quote post',
|
|
|
|
anchorPost,
|
|
|
|
)
|
|
|
|
await server.mocker.createReply(
|
|
|
|
'muted-by-list-account',
|
2023-04-27 19:38:23 +02:00
|
|
|
'account reply',
|
|
|
|
anchorPost,
|
|
|
|
)
|
2023-08-04 07:08:30 +02:00
|
|
|
|
|
|
|
await server.mocker.createPost('blocking-account', 'blocking post')
|
|
|
|
await server.mocker.createQuotePost(
|
|
|
|
'blocking-account',
|
|
|
|
'blocking quote post',
|
|
|
|
anchorPost,
|
|
|
|
)
|
|
|
|
await server.mocker.createReply(
|
|
|
|
'blocking-account',
|
|
|
|
'blocking reply',
|
|
|
|
anchorPost,
|
|
|
|
)
|
|
|
|
await server.mocker.users.alice.agent.app.bsky.graph.block.create(
|
|
|
|
{
|
|
|
|
repo: server.mocker.users.alice.did,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
subject: server.mocker.users['blocking-account'].did,
|
|
|
|
createdAt: new Date().toISOString(),
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
await server.mocker.createPost('blockedby-account', 'blockedby post')
|
|
|
|
await server.mocker.createQuotePost(
|
|
|
|
'blockedby-account',
|
|
|
|
'blockedby quote post',
|
|
|
|
anchorPost,
|
|
|
|
)
|
|
|
|
await server.mocker.createReply(
|
|
|
|
'blockedby-account',
|
|
|
|
'blockedby reply',
|
|
|
|
anchorPost,
|
|
|
|
)
|
|
|
|
await server.mocker.users[
|
|
|
|
'blockedby-account'
|
|
|
|
].agent.app.bsky.graph.block.create(
|
|
|
|
{
|
|
|
|
repo: server.mocker.users['blockedby-account'].did,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
subject: server.mocker.users.alice.did,
|
|
|
|
createdAt: new Date().toISOString(),
|
|
|
|
},
|
|
|
|
)
|
|
|
|
|
|
|
|
await server.mocker.createPost(
|
|
|
|
'mutual-block-account',
|
|
|
|
'mutual-block post',
|
|
|
|
)
|
|
|
|
await server.mocker.createQuotePost(
|
|
|
|
'mutual-block-account',
|
|
|
|
'mutual-block quote post',
|
|
|
|
anchorPost,
|
|
|
|
)
|
|
|
|
await server.mocker.createReply(
|
|
|
|
'mutual-block-account',
|
|
|
|
'mutual-block reply',
|
|
|
|
anchorPost,
|
|
|
|
)
|
|
|
|
await server.mocker.users.alice.agent.app.bsky.graph.block.create(
|
|
|
|
{
|
|
|
|
repo: server.mocker.users.alice.did,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
subject: server.mocker.users['mutual-block-account'].did,
|
|
|
|
createdAt: new Date().toISOString(),
|
|
|
|
},
|
|
|
|
)
|
|
|
|
await server.mocker.users[
|
|
|
|
'mutual-block-account'
|
|
|
|
].agent.app.bsky.graph.block.create(
|
|
|
|
{
|
|
|
|
repo: server.mocker.users['mutual-block-account'].did,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
subject: server.mocker.users.alice.did,
|
|
|
|
createdAt: new Date().toISOString(),
|
|
|
|
},
|
|
|
|
)
|
2023-10-11 00:46:27 +02:00
|
|
|
|
|
|
|
// flush caches
|
|
|
|
await server.mocker.testNet.processAll()
|
2023-04-27 19:38:23 +02:00
|
|
|
}
|
2023-03-31 20:17:26 +02:00
|
|
|
}
|
|
|
|
console.log('Ready')
|
|
|
|
return res.writeHead(200).end(server.pdsUrl)
|
|
|
|
} catch (e) {
|
|
|
|
console.error('Error!', e)
|
|
|
|
return res.writeHead(500).end()
|
|
|
|
}
|
|
|
|
}).listen(1986)
|
|
|
|
console.log('Mock server manager listening on 1986')
|
|
|
|
}
|
|
|
|
main()
|