@fusebit-int/clickup-connector
Version:
ClickUp Connector
37 lines • 1.83 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceConnector = void 0;
const oauth_connector_1 = require("@fusebit-int/oauth-connector");
const Service_1 = require("./Service");
const TOKEN_URL = 'https://api.clickup.com/api/v2/oauth/token';
const AUTHORIZATION_URL = 'https://app.clickup.com/api';
const REVOCATION_URL = 'https://api.clickup.com/api/v2/oauth/revoke-not-supported';
const SERVICE_NAME = 'ClickUp';
const PROXY_KEY = 'clickup';
// Configuration section name used to add extra configuration elements via this.addConfigurationElement
const CONFIGURATION_SECTION = 'Fusebit Connector Configuration';
class ServiceConnector extends oauth_connector_1.OAuthConnector {
constructor() {
super();
this.router.get('/api/configure', async (ctx) => {
// Adjust the configuration elements here
ctx.body.uischema.elements.find((element) => element.label == 'OAuth2 Configuration').label =
'ClickUp Configuration';
// Adjust the data schema
ctx.body.schema.properties.scope.description = `Space separated scopes to request from your ${SERVICE_NAME} App`;
ctx.body.schema.properties.clientId.description = `The Client ID from your ${SERVICE_NAME} App`;
ctx.body.schema.properties.clientSecret.description = `The Client Secret from your ${SERVICE_NAME} App`;
});
}
createService() {
return new ServiceConnector.Service();
}
addUrlConfigurationAdjustment() {
return this.adjustUrlConfiguration(TOKEN_URL, AUTHORIZATION_URL, PROXY_KEY);
}
}
exports.ServiceConnector = ServiceConnector;
ServiceConnector.Service = Service_1.Service;
const connector = new ServiceConnector();
exports.default = connector;
//# sourceMappingURL=index.js.map