ReviewOS

also looking at this

stacks/postline

Sync Bluesky engagement metrics into analytics

#12
Merged glennmichael123 wants to merge feat/metrics-sync into main
10 files +200 -4
app/Actions/Postline/MetricsSyncAction.tsadded+22-0
Changes to app/Actions/Postline/MetricsSyncAction.ts
@@ -0,0 +1,22 @@
1import { Action } from '@stacksjs/actions'
2import { response } from '@stacksjs/router'
3import { bluesky } from '../../Services/Social/BlueskyService'
4
5export default new Action({
6 name: 'Postline Metrics Sync',
7 description: 'Refresh engagement metrics for published posts on demand.',
8 method: 'POST',
9
10 async handle() {
11 try {
12 const data = await bluesky.syncMetrics()
13 return response.json({ ok: true, data })
14 }
15 catch (error) {
16 return response.json({
17 ok: false,
18 error: error instanceof Error ? error.message : String(error),
19 }, { status: 422 })
20 }
21 },
22})