chore: remove unused twilio app
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
aria-label="Twilio" role="img"
|
||||
viewBox="0 0 512 512"><rect
|
||||
width="512" height="512"
|
||||
rx="15%"
|
||||
fill="#fff"/><g fill="#f22f46"><circle cx="256" cy="256" r="256"/><circle cx="256" cy="256" fill="#fff" r="188"/><circle cx="193" cy="193" r="53" id="c"/><use xlink:href="#c" x="126"/><use xlink:href="#c" y="126"/><use xlink:href="#c" x="126" y="126"/></g></svg>
|
Before Width: | Height: | Size: 438 B |
@@ -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();
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
}
|
@@ -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}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user