Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/mit-27/Panora into connecto…
Browse files Browse the repository at this point in the history
…r/affinityCRM
  • Loading branch information
mit-27 committed Jun 19, 2024
2 parents b52333d + d1c271f commit c96bb48
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ export class ServiceRegistry {
this.serviceMap = new Map<string, IManagementConnectionService>();
}

registerService(
serviceKey: string,
service: IManagementConnectionService,
) {
registerService(serviceKey: string, service: IManagementConnectionService) {
this.serviceMap.set(serviceKey, service);
}

Expand Down
5 changes: 4 additions & 1 deletion packages/api/src/@core/events/events.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export class EventsController {
this.logger.setContext(EventsController.name);
}

@ApiOperation({ operationId: 'getPanoraCoreEvents', summary: 'Retrieve Events' })
@ApiOperation({
operationId: 'getPanoraCoreEvents',
summary: 'Retrieve Events',
})
@ApiResponse({ status: 200 })
@UsePipes(
new ValidationPipe({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ export class MWHandlerController {
async handleThirdPartyWebhook(
@Body() data: any,
@Headers() headers: any,
@Param('endpoint_uuid') uuid: string, // Changed 'uuid' to 'endpoint_uuid'
@Param('endpoint_uuid') uuid: string, // Changed 'uuid' to 'endpoint_uuid'
) {
this.loggerService.log(
'Realtime Webhook Received with Payload ---- ' + JSON.stringify(data),
);
await this.queue.add({ uuid, data, headers });
}

}
2 changes: 1 addition & 1 deletion packages/api/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import { PrismaModule } from '@@core/prisma/prisma.module';
context: 'HTTP',
env: process.env.ENV,
distribution: process.env.DISTRIBUTION,
commit_id: process.env.GIT_COMMIT_ID,
commit_id: process.env.GIT_COMMIT_ID,
}),
transport:
process.env.AXIOM_AGENT_STATUS === 'ENABLED'
Expand Down
25 changes: 13 additions & 12 deletions packages/shared/src/authUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,21 @@ const handleOAuth2Url = async (input: HandleOAuth2Url) => {

let BASE_URL: string;
// construct the baseAuthUrl based on the fact that client may use custom subdomain
if(needsSubdomain(providerName, vertical)){
if(typeof baseUrl == "string"){

if( needsSubdomain(providerName, vertical) ) {
if(typeof baseUrl === 'string') {
BASE_URL = baseUrl;
}else{
BASE_URL = (baseUrl as DynamicAuthorization)(data.SUBDOMAIN);
} else {
BASE_URL = (baseUrl as DynamicAuthorization)(data.SUBDOMAIN as string);
}
}else if (needsEndUserSubdomain(providerName, vertical)){
if(typeof baseUrl == "string"){
} else if (needsEndUserSubdomain(providerName, vertical)) {
if(typeof baseUrl === 'string') {
BASE_URL = baseUrl;
}else{
BASE_URL = (baseUrl as DynamicAuthorization)("END_USER_SUBDOMAIN"); // TODO: get the END-USER domain from the hook (data coming from webapp client)
} else {
BASE_URL = (baseUrl as DynamicAuthorization)('END_USER_SUBDOMAIN'); // TODO: get the END-USER domain from the hook (data coming from webapp client)
// TODO: add the end user subdomain as query param on the redirect uri ?
}
}else{
} else {
BASE_URL = baseUrl as StringAuthorization;
}

Expand All @@ -120,9 +121,9 @@ const handleOAuth2Url = async (input: HandleOAuth2Url) => {
let params = `response_type=code&client_id=${encodeURIComponent(clientId)}&redirect_uri=${encodedRedirectUrl}&state=${state}`;

if (scopes) {
if(providerName == "slack"){
if(providerName === 'slack') {
params += `&scope=&user_scope=${encodeURIComponent(scopes)}`;
}else{
} else {
params += `&scope=${encodeURIComponent(scopes)}`;
}
}
Expand Down Expand Up @@ -164,7 +165,7 @@ const handleOAuth2Url = async (input: HandleOAuth2Url) => {
}

const finalAuthUrl = `${BASE_URL}?${params}`;
console.log('Final Authentication : ', finalAuthUrl);
// console.log('Final Authentication : ', finalAuthUrl);
return finalAuthUrl;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/connectors/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ export const CONNECTORS_METADATA: ProvidersConfig = {
'workday': {
urls: {
docsUrl: 'https://apidocs.workdayspend.com/services/legacy/v3.html#tag/support',
apiUrl: "https://api.us.workdayspend.com/services" // todo other locations
apiUrl: 'https://api.us.workdayspend.com/services' // todo other locations
},
logoPath: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSZTX2h9yFQ0u4ziDqvfQ224wW4N1s5JvJ5nA&s',
description: 'Sync & Create contacts, deals, companies, notes, engagements, stages, tasks and users',
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/envConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function needsSubdomain(provider: string, vertical: string): boolean {

// Extract the provider's config
const providerConfig = CONNECTORS_METADATA[vertical][provider];
if(providerConfig.options && providerConfig.options.company_subdomain){
if(providerConfig.options && providerConfig.options.company_subdomain) {
return providerConfig.options.company_subdomain;
}
return false;
Expand All @@ -112,7 +112,7 @@ export function needsEndUserSubdomain(provider: string, vertical: string): boole

// Extract the provider's config
const providerConfig = CONNECTORS_METADATA[vertical][provider];
if(providerConfig.options && providerConfig.options.end_user_domain){
if(providerConfig.options && providerConfig.options.end_user_domain) {
return providerConfig.options.end_user_domain;
}
return false;
Expand Down

0 comments on commit c96bb48

Please sign in to comment.