Skip to content

Commit

Permalink
✨ Added updates
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Apr 12, 2024
1 parent 133af09 commit ea880ee
Show file tree
Hide file tree
Showing 36 changed files with 614 additions and 328 deletions.
7 changes: 0 additions & 7 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ services:
JIRA_SERVICE_MGMT_TICKETING_CLIENT_SECRET: ${JIRA_SERVICE_MGMT_TICKETING_CLIENT_SECRET}
LINEAR_TICKETING_CLIENT_ID: ${LINEAR_TICKETING_CLIENT_ID}
LINEAR_TICKETING_CLIENT_SECRET: ${LINEAR_TICKETING_CLIENT_SECRET}
AFFINITY_CRM_CLIENT_ID: ${AFFINITY_CRM_CLIENT_ID}
AFFINITY_CRM_CLIENT_SECRET: ${AFFINITY_CRM_CLIENT_SECRET}
ACCELO_CRM_CLIENT_ID: ${ACCELO_CRM_CLIENT_ID}
ACCELO_CRM_CLIENT_SECRET: ${ACCELO_CRM_CLIENT_SECRET}
ACCELO_CRM_SUBDOMAIN: ${ACCELO_CRM_SUBDOMAIN}
Expand All @@ -77,13 +75,8 @@ services:
CLOSE_CRM_CLIENT_SECRET: ${CLOSE_CRM_CLIENT_SECRET}
COPPER_CRM_CLIENT_ID: ${COPPER_CRM_CLIENT_ID}
COPPER_CRM_CLIENT_SECRET: ${COPPER_CRM_CLIENT_SECRET}
INSIGHTLY_CRM_CLIENT_ID: ${INSIGHTLY_CRM_CLIENT_ID}
INSIGHTLY_CRM_CLIENT_SECRET: ${INSIGHTLY_CRM_CLIENT_SECRET}
KEAP_CRM_CLIENT_ID: ${KEAP_CRM_CLIENT_ID}
KEAP_CRM_CLIENT_SECRET: ${KEAP_CRM_CLIENT_SECRET}
SUGARCRM_CRM_CLIENT_ID: ${SUGARCRM_CRM_CLIENT_ID}
SUGARCRM_CRM_CLIENT_SECRET: ${SUGARCRM_CRM_CLIENT_SECRET}
SUGARCRM_CRM_SUBDOMAIN: ${SUGARCRM_CRM_SUBDOMAIN}
TEAMLEADER_CRM_CLIENT_ID: ${TEAMLEADER_CRM_CLIENT_ID}
TEAMLEADER_CRM_CLIENT_SECRET: ${TEAMLEADER_CRM_CLIENT_SECRET}
TEAMWORK_CRM_CLIENT_ID: ${TEAMWORK_CRM_CLIENT_ID}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ export class FreeagentConnectionService
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['accounting']['freshagent'].apiUrl,
account_url:
providersConfig['accounting']['freshagent'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand All @@ -110,7 +111,8 @@ export class FreeagentConnectionService
provider_slug: 'freeagent',
vertical: 'accounting',
token_type: 'oauth',
account_url: providersConfig['accounting']['freshagent'].apiUrl,
account_url:
providersConfig['accounting']['freshagent'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class FreshbooksConnectionService
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['accounting']['freshbooks'].apiUrl,
account_url: providersConfig['accounting']['freshbooks'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand All @@ -109,7 +109,7 @@ export class FreshbooksConnectionService
provider_slug: 'freshbooks',
vertical: 'accounting',
token_type: 'oauth',
account_url: providersConfig['accounting']['freshbooks'].apiUrl,
account_url: providersConfig['accounting']['freshbooks'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class MoneybirdConnectionService
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['accounting']['moneybird'].apiUrl,
account_url: providersConfig['accounting']['moneybird'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand All @@ -110,7 +110,7 @@ export class MoneybirdConnectionService
provider_slug: 'moneybird',
vertical: 'accounting',
token_type: 'oauth',
account_url: providersConfig['accounting']['moneybird'].apiUrl,
account_url: providersConfig['accounting']['moneybird'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class PennylaneConnectionService
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['accounting']['pennylane'].apiUrl,
account_url: providersConfig['accounting']['pennylane'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand All @@ -108,7 +108,7 @@ export class PennylaneConnectionService
provider_slug: 'pennylane',
vertical: 'accounting',
token_type: 'oauth',
account_url: providersConfig['accounting']['pennylane'].apiUrl,
account_url: providersConfig['accounting']['pennylane'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class QuickbooksConnectionService
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['accounting']['quickbooks'].apiUrl,
account_url: providersConfig['accounting']['quickbooks'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand All @@ -110,7 +110,7 @@ export class QuickbooksConnectionService
provider_slug: 'quickbooks',
vertical: 'accounting',
token_type: 'oauth',
account_url: providersConfig['accounting']['quickbooks'].apiUrl,
account_url: providersConfig['accounting']['quickbooks'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class SageConnectionService implements IAccountingConnectionService {
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['accounting']['sage'].apiUrl,
account_url: providersConfig['accounting']['sage'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand All @@ -109,7 +109,7 @@ export class SageConnectionService implements IAccountingConnectionService {
provider_slug: 'sage',
vertical: 'accounting',
token_type: 'oauth',
account_url: providersConfig['accounting']['sage'].apiUrl,
account_url: providersConfig['accounting']['sage'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class WaveFinancialConnectionService
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['accounting']['wave_financial'].apiUrl,
account_url: providersConfig['accounting']['wave_financial'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand All @@ -115,7 +115,7 @@ export class WaveFinancialConnectionService
provider_slug: 'wave_financial',
vertical: 'accounting',
token_type: 'oauth',
account_url: providersConfig['accounting']['wave_financial'].apiUrl,
account_url: providersConfig['accounting']['wave_financial'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class AcceloConnectionService implements ICrmConnectionService {
const connection_token = uuidv4();
//get the right BASE URL API
const BASE_API_URL =
CREDENTIALS.SUBDOMAIN + providersConfig['crm']['accelo'].apiUrl;
CREDENTIALS.SUBDOMAIN + providersConfig['crm']['accelo'].urls.apiUrl;

if (isNotUnique) {
// Update existing connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class AttioConnectionService implements ICrmConnectionService {
provider_slug: 'attio',
vertical: 'crm',
token_type: 'oauth',
account_url: providersConfig['crm']['attio'].apiUrl,
account_url: providersConfig['crm']['attio'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
status: 'valid',
created_at: new Date(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class CapsuleConnectionService implements ICrmConnectionService {
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['crm']['capsule'].apiUrl,
account_url: providersConfig['crm']['capsule'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand All @@ -110,7 +110,7 @@ export class CapsuleConnectionService implements ICrmConnectionService {
provider_slug: 'capsule',
vertical: 'crm',
token_type: 'oauth',
account_url: providersConfig['crm']['capsule'].apiUrl,
account_url: providersConfig['crm']['capsule'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class CloseConnectionService implements ICrmConnectionService {
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['crm']['close'].apiUrl,
account_url: providersConfig['crm']['close'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand All @@ -114,7 +114,7 @@ export class CloseConnectionService implements ICrmConnectionService {
provider_slug: 'close',
vertical: 'crm',
token_type: 'oauth',
account_url: providersConfig['crm']['close'].apiUrl,
account_url: providersConfig['crm']['close'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class CopperConnectionService implements ICrmConnectionService {
provider_slug: 'copper',
vertical: 'crm',
token_type: 'oauth',
account_url: providersConfig['crm']['copper'].apiUrl,
account_url: providersConfig['crm']['copper'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
status: 'valid',
created_at: new Date(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class HubspotConnectionService implements ICrmConnectionService {
provider_slug: 'hubspot',
vertical: 'crm',
token_type: 'oauth',
account_url: providersConfig['crm']['hubspot'].apiUrl,
account_url: providersConfig['crm']['hubspot'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class KeapConnectionService implements ICrmConnectionService {
provider_slug: 'keap',
vertical: 'crm',
token_type: 'oauth',
account_url: providersConfig['crm']['keap'].apiUrl,
account_url: providersConfig['crm']['keap'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class PipedriveConnectionService implements ICrmConnectionService {
provider_slug: 'pipedrive',
vertical: 'crm',
token_type: 'oauth',
account_url: providersConfig['crm']['pipedrive'].apiUrl,
account_url: providersConfig['crm']['pipedrive'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class TeamleaderConnectionService implements ICrmConnectionService {
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['crm']['teamleader'].apiUrl,
account_url: providersConfig['crm']['teamleader'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class TeamworkConnectionService implements ICrmConnectionService {
const connection_token = uuidv4();
//get the right BASE URL API
const BASE_API_URL =
CREDENTIALS.SUBDOMAIN + providersConfig['crm']['teamwork'].apiUrl;
CREDENTIALS.SUBDOMAIN + providersConfig['crm']['teamwork'].urls.apiUrl;

if (isNotUnique) {
db_res = await this.prisma.connections.update({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class ZendeskConnectionService implements ICrmConnectionService {
provider_slug: 'zendesk',
vertical: 'crm',
token_type: 'oauth',
account_url: providersConfig['crm']['zendesk'].apiUrl,
account_url: providersConfig['crm']['zendesk'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: data.refresh_token
? this.cryptoService.encrypt(data.refresh_token)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class ZohoConnectionService implements ICrmConnectionService {
),
status: 'valid',
created_at: new Date(),
account_url: apiDomain + providersConfig['crm']['zoho'].apiUrl,
account_url: apiDomain + providersConfig['crm']['zoho'].urls.apiUrl,
},
});
} else {
Expand All @@ -160,7 +160,7 @@ export class ZohoConnectionService implements ICrmConnectionService {
linked_users: {
connect: { id_linked_user: linkedUserId },
},
account_url: apiDomain + providersConfig['crm']['zoho'].apiUrl,
account_url: apiDomain + providersConfig['crm']['zoho'].urls.apiUrl,
},
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class AhaConnectionService implements ITicketingConnectionService {
const connection_token = uuidv4();
//get the right BASE URL API
const BASE_API_URL =
CREDENTIALS.SUBDOMAIN + providersConfig['ticketing']['aha'].apiUrl;
CREDENTIALS.SUBDOMAIN + providersConfig['ticketing']['aha'].urls.apiUrl;

if (isNotUnique) {
db_res = await this.prisma.connections.update({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class AsanaConnectionService implements ITicketingConnectionService {
data: {
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
account_url: providersConfig['ticketing']['asana'].apiUrl,
account_url: providersConfig['ticketing']['asana'].urls.apiUrl,
expiration_timestamp: new Date(
new Date().getTime() + Number(data.expires_in) * 1000,
),
Expand All @@ -112,7 +112,7 @@ export class AsanaConnectionService implements ITicketingConnectionService {
provider_slug: 'asana',
vertical: 'ticketing',
token_type: 'oauth',
account_url: providersConfig['ticketing']['asana'].apiUrl,
account_url: providersConfig['ticketing']['asana'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class ClickupConnectionService implements ITicketingConnectionService {
provider_slug: 'clickup',
vertical: 'ticketing',
token_type: 'oauth',
account_url: providersConfig['ticketing']['clickup'].apiUrl,
account_url: providersConfig['ticketing']['clickup'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: '',
expiration_timestamp: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class FrontConnectionService implements ITicketingConnectionService {
provider_slug: 'front',
vertical: 'ticketing',
token_type: 'oauth',
account_url: providersConfig['ticketing']['front'].apiUrl,
account_url: providersConfig['ticketing']['front'].urls.apiUrl,
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
expiration_timestamp: new Date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class GithubConnectionService implements ITicketingConnectionService {
connection_token: connection_token,
provider_slug: 'github',
vertical: 'ticketing',
account_url: providersConfig['ticketing']['github'].apiUrl,
account_url: providersConfig['ticketing']['github'].urls.apiUrl,
token_type: 'oauth',
access_token: this.cryptoService.encrypt(data.access_token),
refresh_token: this.cryptoService.encrypt(data.refresh_token),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class GitlabConnectionService implements ITicketingConnectionService {
let db_res;
const connection_token = uuidv4();
const BASE_API_URL =
CREDENTIALS.SUBDOMAIN + providersConfig['ticketing']['gitlab'].apiUrl;
CREDENTIALS.SUBDOMAIN + providersConfig['ticketing']['gitlab'].urls.apiUrl;

if (isNotUnique) {
db_res = await this.prisma.connections.update({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class GorgiasConnectionService implements ITicketingConnectionService {

//get the right BASE URL API
const BASE_API_URL =
CREDENTIALS.SUBDOMAIN + providersConfig['ticketing']['gorgias'].apiUrl;
CREDENTIALS.SUBDOMAIN + providersConfig['ticketing']['gorgias'].urls.apiUrl;

if (isNotUnique) {
db_res = await this.prisma.connections.update({
Expand Down
Loading

0 comments on commit ea880ee

Please sign in to comment.