Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move main connectors to node + create new connectors container #2020

Closed
18 tasks done
RomaricMourgues opened this issue Mar 21, 2022 · 0 comments
Closed
18 tasks done
Assignees

Comments

@RomaricMourgues
Copy link
Contributor

RomaricMourgues commented Mar 21, 2022

Issue : #2020

Create connectors app architecture

  • Create a new express project suitable for applications

Jitsi

Two ways to create a Jitsi meeting: click on the camera button, type "/jitsi Meeting name"
When it's done, a thread (or a response) is created with a button to the meeting.

Giphy

Two ways to create a Gif: click on the giphy icon in the apps menu of the input, type "/giphy gif name"

  • Configure Gihpy app and listen to command/button events
  • Generate an ephemeral message (add this to the message object: "ephemeral": {"recipient":"user_id", "recipient_context_id": "context_id"};)
  • This ephemeral message will contain an iframe with a search bar and when click on a gif, it will be sent to the channel (or as a reply of a thread)
  • Push to https://github.com/linagora/Twake-Plugins-Giphy

Webhooks

See Discord webhooks for inspiration:

  1. An ephemeral message to choose an icon and a title and an option to send alerts to the thread or to the channel (check box)
  2. Click on "Get webhook url"
  3. Show guide about how to use this webhook url
    The webhooks urls will look like this:
    my/webhook/plugins/hook?company_id=...&workspace_id=...&channel_id=...&thread_id=...&title=...&icon=...
    It must be called like this:
POST [url]
{
  "icon": "some url" //Optional, will override the default icon
  "title": "some title" //Optional, will override the default title
  "content": Object or string twacode compatible
}

If the Posted content isn't formated like this, then we send all the body in the message

Handle incoming object:

  1. If we have an object sent as JSON, with a "content" key being an object
    -> use "content" as twacode
  2. If we have an object sent as JSON, with a "content" key being an string
    -> use "content" as twacode bloc of type "compile"
  3. If we get a single string
    -> use it as twacode bloc of type "compile"
  4. If we get an object with only one key with value being a string
    -> use it as twacode bloc of type "compile"
  5. Else
    -> JSON.stringify all the body with a prettify option, and put this string in a mcode twacode block

n8n

RomaricMourgues added a commit that referenced this issue Apr 11, 2022
…ner (#2021)

* Little fixs to create an applications and send message as an application

* Implement hooks from Twake to app

* Fix app company access

* Add checks when sending hooks

* Try to fix missing thread in notifyApp

* Add thread in notify apps

* Make sure object is null when thread isn't defined

* Make sure object is null when thread isn't defined

* Bootstraping plugins server

* Add install command

* Fix build

* Fix tests

* Fix for integations

Co-authored-by: Romaric Mourgues <rmourgues@linagora.com>

* update package-lock

* Frontend button fix

Co-authored-by: tissarni <tissarni>
Co-authored-by: Romaric Mourgues <rmourgues@linagora.com>
RomaricMourgues added a commit that referenced this issue Apr 11, 2022
…ner (#2021)

* Little fixs to create an applications and send message as an application

* Implement hooks from Twake to app

* Fix app company access

* Add checks when sending hooks

* Try to fix missing thread in notifyApp

* Add thread in notify apps

* Make sure object is null when thread isn't defined

* Make sure object is null when thread isn't defined

* Bootstraping plugins server

* Add install command

* Fix build

* Fix tests

* Fix for integations

Co-authored-by: Romaric Mourgues <rmourgues@linagora.com>

* update package-lock

* Frontend button fix

Co-authored-by: tissarni <tissarni>
Co-authored-by: Romaric Mourgues <rmourgues@linagora.com>
RomaricMourgues added a commit that referenced this issue Apr 11, 2022
…ner (#2021)

* Little fixs to create an applications and send message as an application

* Implement hooks from Twake to app

* Fix app company access

* Add checks when sending hooks

* Try to fix missing thread in notifyApp

* Add thread in notify apps

* Make sure object is null when thread isn't defined

* Make sure object is null when thread isn't defined

* Bootstraping plugins server

* Add install command

* Fix build

* Fix tests

* Fix for integations

Co-authored-by: Romaric Mourgues <rmourgues@linagora.com>

* update package-lock

* Frontend button fix

Co-authored-by: tissarni <tissarni>
Co-authored-by: Romaric Mourgues <rmourgues@linagora.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants