also looking at this
feat: crosspost to LinkedIn and Instagram
#1
31 files
+2335
-87
| @@ -0,0 +1,29 @@ | ||
| 1 | import { Action } from '@stacksjs/actions' | |
| 2 | import { response } from '@stacksjs/router' | |
| 3 | import { bluesky } from '../../Services/Social/BlueskyService' | |
| 4 | import { instagram } from '../../Services/Social/InstagramService' | |
| 5 | import { linkedin } from '../../Services/Social/LinkedInService' | |
| 6 | ||
| 7 | export 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 | }) | |