@fusebit-int/gong-connector
Version:
Gong Connector
42 lines • 2.06 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
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 Engine_1 = __importDefault(require("./Engine"));
const TOKEN_URL = 'https://app.gong.io/oauth2/generate-token';
const AUTHORIZATION_URL = 'https://app.gong.io/oauth2/authorize';
const REVOCATION_URL = 'https://app.gong.io/oauth2/revoke-token-not-supported';
const SERVICE_NAME = 'Gong';
const PROXY_KEY = 'gong';
// 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.OAuthEngine = Engine_1.default;
this.router.get('/api/configure', async (ctx) => {
// Adjust the configuration elements here
ctx.body.uischema.elements.find((element) => element.label == 'OAuth2 Configuration').label =
'Gong 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