mirror of
https://github.com/snachodog/tok-to-insta-follower-bridge.git
synced 2025-09-13 15:33:33 -06:00
🚀 support for firefox
This commit is contained in:
13
src/background/messages/block.ts
Normal file
13
src/background/messages/block.ts
Normal 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
|
13
src/background/messages/follow.ts
Normal file
13
src/background/messages/follow.ts
Normal 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
|
17
src/background/messages/login.ts
Normal file
17
src/background/messages/login.ts
Normal 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
|
16
src/background/messages/searchUser.ts
Normal file
16
src/background/messages/searchUser.ts
Normal 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
|
13
src/background/messages/unblock.ts
Normal file
13
src/background/messages/unblock.ts
Normal 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
|
13
src/background/messages/unfollow.ts
Normal file
13
src/background/messages/unfollow.ts
Normal 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
|
Reference in New Issue
Block a user