ReviewOS

also looking at this

stacks/postline

feat: crosspost to LinkedIn and Instagram

#1
Merged chris wants to merge feat/crosspost-linkedin-instagram into main
31 files +2335 -87
app/Actions/Postline/ProvidersStatusAction.tsadded+29-0
Changes to app/Actions/Postline/ProvidersStatusAction.ts
@@ -0,0 +1,29 @@
1import { Action } from '@stacksjs/actions'
2import { response } from '@stacksjs/router'
3import { bluesky } from '../../Services/Social/BlueskyService'
4import { instagram } from '../../Services/Social/InstagramService'
5import { linkedin } from '../../Services/Social/LinkedInService'
6
7export default new Action({
8 name: 'Postline Providers Status',
9 description: 'Return the connection state for every crosspost provider.',
10 method: 'GET',
11
12 async handle() {
13 try {
14 const providers = await Promise.all([
15 bluesky.status(),
16 linkedin.status(),
17 instagram.status(),
18 ])
19
20 return response.json({ ok: true, data: { providers } })
21 }
22 catch (error) {
23 return response.json({
24 ok: false,
25 error: error instanceof Error ? error.message : String(error),
26 }, { status: 500 })
27 }
28 },
29})