diff --git a/packages/backend/src/apps/twilio/assets/favicon.svg b/packages/backend/src/apps/twilio/assets/favicon.svg deleted file mode 100644 index 3d3a8971..00000000 --- a/packages/backend/src/apps/twilio/assets/favicon.svg +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/packages/backend/src/apps/twilio/authentication.ts b/packages/backend/src/apps/twilio/authentication.ts deleted file mode 100644 index a2b1d8ca..00000000 --- a/packages/backend/src/apps/twilio/authentication.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { - IAuthentication, - IApp, - IJSONObject, -} from '@automatisch/types'; -import TwilioApi from 'twilio'; - -export default class Authentication implements IAuthentication { - appData: IApp; - connectionData: IJSONObject; - client: TwilioApi.Twilio; - - constructor(appData: IApp, connectionData: IJSONObject) { - this.client = TwilioApi( - connectionData.accountSid as string, - connectionData.authToken as string - ); - - this.connectionData = connectionData; - this.appData = appData; - } - - async verifyCredentials() { - await this.verify(); - - return { - screenName: this.connectionData.accountSid, - }; - } - - async verify() { - try { - await this.client.keys.list({ limit: 1 }); - return true; - } catch (error) { - // Test credentials throw HTTP 403 and thus, we need to have an exception. - return error?.status === 403; - } - } - - async isStillVerified() { - return this.verify(); - } -} diff --git a/packages/backend/src/apps/twilio/index.ts b/packages/backend/src/apps/twilio/index.ts deleted file mode 100644 index f25658d5..00000000 --- a/packages/backend/src/apps/twilio/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import Authentication from './authentication'; -import { - IService, - IAuthentication, - IApp, - IJSONObject, -} from '@automatisch/types'; - -export default class Twilio implements IService { - authenticationClient: IAuthentication; - - constructor(appData: IApp, connectionData: IJSONObject) { - this.authenticationClient = new Authentication(appData, connectionData); - } -} diff --git a/packages/backend/src/apps/twilio/info.json b/packages/backend/src/apps/twilio/info.json deleted file mode 100644 index ac68b688..00000000 --- a/packages/backend/src/apps/twilio/info.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "name": "Twilio", - "key": "twilio", - "iconUrl": "{BASE_URL}/apps/twilio/assets/favicon.svg", - "docUrl": "https://automatisch.io/docs/twilio", - "primaryColor": "f22f46", - "supportsConnections": true, - "fields": [ - { - "key": "accountSid", - "label": "Account SID", - "type": "string", - "required": true, - "readOnly": false, - "value": null, - "placeholder": null, - "description": "Log into your Twilio account and find \"API Credentials\" on this page https://www.twilio.com/user/account/settings", - "docUrl": "https://automatisch.io/docs/twilio#host", - "clickToCopy": false - }, - { - "key": "authToken", - "label": "Auth Token", - "type": "string", - "required": true, - "readOnly": false, - "value": null, - "placeholder": null, - "description": "Found directly below your Account SID.", - "docUrl": "https://automatisch.io/docs/twilio#username", - "clickToCopy": false - } - ], - "authenticationSteps": [ - { - "step": 1, - "type": "mutation", - "name": "createConnection", - "arguments": [ - { - "name": "key", - "value": "{key}" - }, - { - "name": "formattedData", - "value": null, - "properties": [ - { - "name": "accountSid", - "value": "{fields.accountSid}" - }, - { - "name": "authToken", - "value": "{fields.authToken}" - } - ] - } - ] - }, - { - "step": 2, - "type": "mutation", - "name": "verifyConnection", - "arguments": [ - { - "name": "id", - "value": "{createConnection.id}" - } - ] - } - ], - "reconnectionSteps": [ - { - "step": 1, - "type": "mutation", - "name": "resetConnection", - "arguments": [ - { - "name": "id", - "value": "{connection.id}" - } - ] - }, - { - "step": 2, - "type": "mutation", - "name": "updateConnection", - "arguments": [ - { - "name": "id", - "value": "{connection.id}" - }, - { - "name": "formattedData", - "value": null, - "properties": [ - { - "name": "accountSid", - "value": "{fields.accountSid}" - }, - { - "name": "authToken", - "value": "{fields.authToken}" - } - ] - } - ] - }, - { - "step": 3, - "type": "mutation", - "name": "verifyConnection", - "arguments": [ - { - "name": "id", - "value": "{connection.id}" - } - ] - } - ] -}