🚀 support for firefox

This commit is contained in:
kawamataryo
2023-08-25 23:26:36 +09:00
parent 0e4c201394
commit 36f590f1a6
12 changed files with 206 additions and 10 deletions

View File

@@ -0,0 +1,13 @@
import type { PlasmoMessaging } from "@plasmohq/messaging"
import { BskyClient } from "~lib/bskyClient";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const { session, subjectDid } = req.body
const client = BskyClient.createAgentFromSession(session)
res.send({
result: await client.block(subjectDid)
})
}
export default handler

View File

@@ -0,0 +1,13 @@
import type { PlasmoMessaging } from "@plasmohq/messaging"
import { BskyClient } from "~lib/bskyClient";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const { session, subjectDid } = req.body
const client = BskyClient.createAgentFromSession(session)
res.send({
result: await client.follow(subjectDid)
})
}
export default handler

View File

@@ -0,0 +1,17 @@
import type { PlasmoMessaging } from "@plasmohq/messaging"
import { BskyClient } from "../../lib/bskyClient";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const { identifier, password } = req.body
const agent = await BskyClient.createAgent({
identifier,
password,
})
res.send({
session: agent.session,
})
}
export default handler

View File

@@ -0,0 +1,16 @@
import type { PlasmoMessaging } from "@plasmohq/messaging"
import { BskyClient } from "~lib/bskyClient";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const { session, term, limit } = req.body
const client = BskyClient.createAgentFromSession(session)
res.send({
actors: await client.searchUser({
term,
limit,
})
})
}
export default handler

View File

@@ -0,0 +1,13 @@
import type { PlasmoMessaging } from "@plasmohq/messaging"
import { BskyClient } from "~lib/bskyClient";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const { session, blockUri } = req.body
const client = BskyClient.createAgentFromSession(session)
res.send({
result: await client.unblock(blockUri)
})
}
export default handler

View File

@@ -0,0 +1,13 @@
import type { PlasmoMessaging } from "@plasmohq/messaging"
import { BskyClient } from "~lib/bskyClient";
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
const { session, followUri } = req.body
const client = BskyClient.createAgentFromSession(session)
res.send({
result: await client.unfollow(followUri)
})
}
export default handler