sendanor / project-sendanor.fi

Join us in shaping the future of sendanor.fi. Your contributions, feedback, and involvement are invaluable to our continuous improvement and success.
https://sendanor.fi
MIT License
0 stars 0 forks source link

Add support to post on Facebook to Sendanor Agent CLI #165

Closed thejhh closed 3 months ago

thejhh commented 3 months ago

Goal

Add support to post to Facebook into our Agent CLI. Use our Facebook client.

Complete sequence diagram

sequenceDiagram

    box Green Frontend
        participant Alice
        participant Browser
        participant CLI
    end

    box The Goal
        participant Library
    end

    box Backend
        participant GraphAPI
    end

    Alice->>CLI: Start login

    CLI->>Library: Get authentication URL with these permissions
    Library-->>CLI: Here's https://www.facebook.com/dialog/oauth

    CLI-->>Alice: Go to https://www.facebook.com/dialog/oauth

    Alice->>Browser: Opens up https://www.facebook.com/dialog/oauth
    Alice-->>Browser: Follows up on instructions to authenticate
    Browser-->>Alice: All ready, you can close the window

    Library-->>CLI: All set! Here's code.

    CLI->>Library: Here's my code, give me user access token

    Library->>GraphAPI: Here's my code, give me user access token
    GraphAPI-->>Library: Here's user access token

    Library-->>CLI: Here's user access token

    CLI->>Library: Here's user access token, give me list of pages with page access tokens

    Library->>GraphAPI: Here's my user access token, give me list of pages with accounts (pages) with access tokens
    GraphAPI-->>Library: Here's list of accounts (pages)
    Library-->>CLI: Here's list of accounts (pages) with access tokens

    CLI-->>Alice: Here's the page access token

    Alice->>CLI: Here's the page access token, post on my feed.

    CLI->>Library: Here's page access token, post on this feed
    Library->>GraphAPI: Here's page access token, post on this feed.
    GraphAPI-->>Library: Posted!
    Library-->>CLI: Posted!

    CLI-->>Alice: Post ready!

Subtasks