Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Attio CRM integration #320

Merged
merged 6 commits into from
Mar 20, 2024
Merged

Add Attio CRM integration #320

merged 6 commits into from
Mar 20, 2024

Conversation

mit-27
Copy link
Contributor

@mit-27 mit-27 commented Mar 16, 2024

Pending Tasks

  • Add image for Attio CRM
  • Add Company object to CRM
  • Check Mapping of attributes to unified Data and vice versa
  • Test Connection Creation
  • Test Sync Contacts
  • Test Add Contact
  • Discover a method to substitute the client_id value within the providersConfig constant located in packages/shared/src/utils.ts file. (Failure to provide a valid client_id will result in improper functioning of the connection flow.)

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added support for Attio CRM, including OAuth authentication, contact synchronization, and configuration settings.
  • Enhancements
    • Improved logging for better debugging and monitoring.
  • Refactor
    • Updated environment configurations and internal service registration for enhanced modularity and maintainability.
  • Documentation
    • Expanded the enum and type definitions to include Attio-specific configurations and data structures.

Copy link

changeset-bot bot commented Mar 16, 2024

⚠️ No Changeset found

Latest commit: 9459865

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Mar 16, 2024

Walkthrough

This update integrates Attio into the CRM Unified API, focusing on OAuth callbacks, database interactions, and contact syncing. It introduces the AttioConnectionService and AttioService for managing connections and contacts, respectively. Enhanced logging and configuration updates support the integration, ensuring smooth operation and debugging capabilities. This comprehensive addition aims to expand the CRM's functionality and compatibility with Attio.

Changes

File Path Change Summary
.env.example, packages/api/src/@core/environment/environment.service.ts, packages/shared/src/utils.ts, packages/shared/src/enum.ts Added Attio configurations and updated environment handling for new and existing CRM integrations.
packages/api/src/@core/connections/..., packages/api/src/crm/contact/... Implemented Attio connection and contact services, including OAuth flow, contact syncing, and data mapping. Added logging for enhanced debugging.
packages/api/src/@core/connections/crm/types/index.ts, packages/api/src/crm/contact/services/attio/types.ts Introduced new types and interfaces for Attio OAuth responses and contact data structures.
packages/shared/src/authUrl.ts Updated logic for constructing authentication URLs, including logging for debugging.

Assessment against linked issues

Objective Addressed Explanation
Add Attio to CRM Unified API (#316)

Poem

In the code where the rabbits hop,
A new CRM joins the crop.
Attio's the name, syncing's the game,
With OAuth flows, we aim to tame.
🐰🎉 Now let's code, without any stop,
In this digital field, we gallantly hop!

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 9

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0f12bff and 14b5f4f.
Files ignored due to path filters (3)
  • docker-compose.dev.yml is excluded by: !**/*.yml
  • docker-compose.source.yml is excluded by: !**/*.yml
  • docker-compose.yml is excluded by: !**/*.yml
Files selected for processing (17)
  • .env.example (2 hunks)
  • packages/api/src/@core/connections/connections.controller.ts (1 hunks)
  • packages/api/src/@core/connections/crm/crm.connection.module.ts (2 hunks)
  • packages/api/src/@core/connections/crm/services/attio/attio.service.ts (1 hunks)
  • packages/api/src/@core/connections/crm/services/crm.connection.service.ts (2 hunks)
  • packages/api/src/@core/connections/crm/types/index.ts (1 hunks)
  • packages/api/src/@core/environment/environment.service.ts (2 hunks)
  • packages/api/src/@core/utils/types/index.ts (4 hunks)
  • packages/api/src/crm/@utils/@types/index.ts (1 hunks)
  • packages/api/src/crm/contact/contact.module.ts (2 hunks)
  • packages/api/src/crm/contact/services/attio/index.ts (1 hunks)
  • packages/api/src/crm/contact/services/attio/mappers.ts (1 hunks)
  • packages/api/src/crm/contact/services/attio/types.ts (1 hunks)
  • packages/api/src/crm/contact/types/mappingsTypes.ts (2 hunks)
  • packages/shared/src/authUrl.ts (2 hunks)
  • packages/shared/src/enum.ts (2 hunks)
  • packages/shared/src/utils.ts (4 hunks)
Check Runs (1)
Build and Test (18.x) failure (17)
  • packages/api/src/@core/connections/crm/services/attio/attio.service.ts: 110-110: 'opts' is defined but never used
  • packages/api/src/@core/connections/crm/services/crm.connection.service.ts: 109-109: 'data' is assigned a value but never used
Additional comments: 20
packages/shared/src/enum.ts (1)
  • 18-18: The addition of ATTIO to the CrmProviders enum is correctly implemented and follows the existing naming conventions.
packages/api/src/@core/connections/crm/types/index.ts (1)
  • 25-28: The AttioOAuthResponse interface is correctly defined and aligns with the structure and naming conventions of existing OAuth response interfaces in the file.
packages/api/src/crm/contact/contact.module.ts (1)
  • 37-37: The addition of AttioService to the ContactModule providers is correctly implemented, ensuring that the service is available for dependency injection within the module.
packages/api/src/@core/connections/crm/crm.connection.module.ts (1)
  • 30-30: The addition of AttioConnectionService to the CrmConnectionModule providers is correctly implemented, ensuring that the service is available for dependency injection within the module.
packages/api/src/crm/contact/types/mappingsTypes.ts (1)
  • 36-39: The addition of AttioContactMapper and its integration into contactUnificationMapping is correctly implemented, ensuring compatibility between the system and Attio CRM for contact data conversion.
.env.example (2)
  • 45-47: The addition of Attio configuration settings (ATTIO_CLIENT_ID and ATTIO_CLIENT_SECRET) is correctly implemented, ensuring the system can authenticate with Attio's OAuth service.
  • 61-62: The update to NEXT_PUBLIC_FRONTEND_DOMAIN and the addition of NEXT_PUBLIC_ML_FRONTED_DOMAIN are correctly implemented, aligning with the system's configuration requirements.
packages/shared/src/authUrl.ts (2)
  • 15-16: Consider refining the use of console logs for debugging purposes. While helpful during development, it's best to replace them with a more sophisticated logging mechanism for production to avoid exposing sensitive information.
  • 38-51: The modifications to the logic for constructing finalAuth URLs based on providerName are correctly implemented, supporting the integration with Attio and potentially other providers.
packages/api/src/@core/environment/environment.service.ts (1)
  • 50-55: The addition of the getAttioAuth() method is correctly implemented, allowing the system to retrieve Attio's OAuth credentials from environment variables in a manner consistent with other providers.
packages/api/src/crm/contact/services/attio/types.ts (1)
  • 1-127: The interfaces defined for Attio's contact data structure are well-structured and adhere to TypeScript best practices. However, consider documenting each interface and its properties to improve code readability and maintainability, especially for complex structures like these.
packages/api/src/@core/utils/types/index.ts (4)
  • 34-34: Adding attio to the domains object with its API base URL is a good practice for centralizing configuration settings. Ensure that the URL is correct and accessible.
  • 47-47: Including attio in the customPropertiesUrls object with a specific documentation URL is helpful for developers. Verify that this URL points to the correct documentation section for Attio's standard objects and people.
  • 72-72: Adding attio to the CrmProviders enum is necessary for handling different CRM providers consistently. This change looks good.
  • 91-91: Including attio in the CRM_PROVIDERS array is essential for iterating over supported CRM providers. This addition is correctly implemented.
packages/api/src/crm/contact/services/attio/mappers.ts (1)
  • 13-131: The AttioContactMapper class provides a clear and structured approach to mapping between unified contact models and Attio-specific models. However, consider adding comments to explain the mapping logic, especially for complex transformations, to improve maintainability and understandability of the code.
packages/api/src/crm/@utils/@types/index.ts (1)
  • 112-112: Exporting Attio service types is a good practice for modular code organization and reuse. This change facilitates the integration of Attio-specific types across the application.
packages/shared/src/utils.ts (3)
  • 133-133: The getDescription function correctly retrieves the description of a provider based on its name. However, consider adding error handling or logging for cases where the provider name does not exist in the configuration. This will improve the debuggability and robustness of the function.

Consider adding error logging for unmatched provider names to aid in debugging.

  • 149-149: The providersArray function is well-implemented for converting the providers' configuration into an array format. To enhance the function's usability, consider including the description field in the returned objects if it's deemed useful for the consuming code. This would provide a more comprehensive overview of each provider directly from the array.

Consider including the description field in the objects returned by providersArray if it aligns with the function's usage context.

  • 20-34: Minor formatting changes in the providersConfig object and the utility functions improve readability and maintainability. These changes are generally positive, enhancing the clarity of the code.

The formatting changes and updates to the providersConfig object are well-executed, contributing to the code's overall readability and maintainability.

Comment on lines 20 to 34
// Add client id in their respective crm
'hubspot': {
clientId: 'ba591170-a7c7-4fca-8086-1bd178c6b14d',
clientId: 'Add hubspot requested client id',
scopes: 'crm.objects.contacts.read crm.objects.contacts.write crm.schemas.deals.read crm.schemas.deals.write crm.objects.deals.read crm.objects.deals.write crm.objects.companies.read crm.objects.companies.write crm.objects.owners.read settings.users.read settings.users.write settings.users.teams.read settings.users.teams.write',
authBaseUrl: 'https://app-eu1.hubspot.com/oauth/authorize',
logoPath: "https://assets-global.website-files.com/6421a177cdeeaf3c6791b745/64d61202dd99e63d40d446f6_hubspot%20logo.png",
description: "Sync & Create contacts, deals, companies, notes, engagements, stages, tasks and users"
},
'attio': {
clientId: '<Add Attio requested client id>',
scopes: 'record_permission:read',
authBaseUrl: 'https://app.attio.com/authorize',
logoPath: "https://assets-global.website-files.com/6421a177cdeeaf3c6791b745/64d61202dd99e63d40d446f6_hubspot%20logo.png",
description: "Sync & Create contacts, deals, companies, notes, engagements, stages, tasks and users"
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of the clientId placeholder for Attio and Hubspot in the providersConfig object is a crucial step for integrating these CRMs. However, there are a few points to consider:

  • For Attio's clientId, it's mentioned as <Add Attio requested client id>. Ensure that this placeholder is replaced with the actual clientId obtained from Attio during deployment or through an environment variable to avoid hardcoding sensitive information.
  • The logoPath for Attio is currently using Hubspot's logo URL. This should be updated to reflect Attio's actual logo to avoid confusion and ensure accurate representation in the UI.
- logoPath: "https://assets-global.website-files.com/6421a177cdeeaf3c6791b745/64d61202dd99e63d40d446f6_hubspot%20logo.png",
+ logoPath: "<Add Attio logo URL>",

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
// Add client id in their respective crm
'hubspot': {
clientId: 'ba591170-a7c7-4fca-8086-1bd178c6b14d',
clientId: 'Add hubspot requested client id',
scopes: 'crm.objects.contacts.read crm.objects.contacts.write crm.schemas.deals.read crm.schemas.deals.write crm.objects.deals.read crm.objects.deals.write crm.objects.companies.read crm.objects.companies.write crm.objects.owners.read settings.users.read settings.users.write settings.users.teams.read settings.users.teams.write',
authBaseUrl: 'https://app-eu1.hubspot.com/oauth/authorize',
logoPath: "https://assets-global.website-files.com/6421a177cdeeaf3c6791b745/64d61202dd99e63d40d446f6_hubspot%20logo.png",
description: "Sync & Create contacts, deals, companies, notes, engagements, stages, tasks and users"
},
'attio': {
clientId: '<Add Attio requested client id>',
scopes: 'record_permission:read',
authBaseUrl: 'https://app.attio.com/authorize',
logoPath: "https://assets-global.website-files.com/6421a177cdeeaf3c6791b745/64d61202dd99e63d40d446f6_hubspot%20logo.png",
description: "Sync & Create contacts, deals, companies, notes, engagements, stages, tasks and users"
},
// Add client id in their respective crm
'hubspot': {
clientId: 'Add hubspot requested client id',
scopes: 'crm.objects.contacts.read crm.objects.contacts.write crm.schemas.deals.read crm.schemas.deals.write crm.objects.deals.read crm.objects.deals.write crm.objects.companies.read crm.objects.companies.write crm.objects.owners.read settings.users.read settings.users.write settings.users.teams.read settings.users.teams.write',
authBaseUrl: 'https://app-eu1.hubspot.com/oauth/authorize',
logoPath: "https://assets-global.website-files.com/6421a177cdeeaf3c6791b745/64d61202dd99e63d40d446f6_hubspot%20logo.png",
description: "Sync & Create contacts, deals, companies, notes, engagements, stages, tasks and users"
},
'attio': {
clientId: '<Add Attio requested client id>',
scopes: 'record_permission:read',
authBaseUrl: 'https://app.attio.com/authorize',
logoPath: "<Add Attio logo URL>",
description: "Sync & Create contacts, deals, companies, notes, engagements, stages, tasks and users"
},

Comment on lines 48 to 49
console.log("In connection controller - Mit")
this.logger.log("in connection controller - Mit")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using both console.log and this.logger.log for logging the same message is redundant. It's recommended to stick with this.logger.log for consistency and to leverage the logging framework's capabilities, such as log levels and formatting.

- console.log("In connection controller - Mit")
- this.logger.log("in connection controller - Mit")
+ this.logger.log("In connection controller - Mit")

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
console.log("In connection controller - Mit")
this.logger.log("in connection controller - Mit")
this.logger.log("In connection controller - Mit")

Comment on lines 44 to 45
this.logger.log("callback called")
console.log("callback called")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the previous file, using both console.log and this.logger.log for logging the same message is redundant. Prefer using this.logger.log for consistency across the application.

- this.logger.log("callback called")
- console.log("callback called")
+ this.logger.log("Callback called")

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
this.logger.log("callback called")
console.log("callback called")
this.logger.log("Callback called")

Comment on lines 41 to 55
zohoLocation?: string,
) {
try {
this.logger.log("callback called")
console.log("callback called")
if (!code) {
throw new NotFoundError(`no ${providerName} code found, found ${code}`);
}

const serviceName = providerName.toLowerCase();
this.logger.log("callback in connection service - Mit")

const service = this.serviceRegistry.getService(serviceName);

if (!service) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [51-64]

The console.log statement here seems to be used for debugging purposes. It's recommended to remove it or replace it with this.logger.log if you intend to keep it for logging purposes in production.

- console.log("In callback2")

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [109-109]

The variable data is assigned a value but never used. If the intention was to log or process this data, ensure that it's being utilized appropriately. Otherwise, consider removing this assignment to clean up the code.

Comment on lines +83 to +84
console.log("Before Axios")
console.log(this.cryptoService.decrypt(connection.access_token))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debugging statements using console.log should be replaced with this.logger.log for consistency and to leverage the logging framework's capabilities. Additionally, consider removing or commenting out these logs before merging into production code.

- console.log("Before Axios")
- console.log(this.cryptoService.decrypt(connection.access_token))

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
console.log("Before Axios")
console.log(this.cryptoService.decrypt(connection.access_token))


);

console.log("After Axios")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with the previous comment, replace console.log with this.logger.log for logging purposes, or remove this debugging statement before merging.

- console.log("After Axios")

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
console.log("After Axios")


async handleCallback(opts: CallbackParams) {
try {
console.log("Linked User iD : <MMMMKIIT")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The console.log statement here appears to be a debugging statement. It's recommended to remove it or replace it with this.logger.log if you intend to keep it for logging purposes in production.

- console.log("Linked User iD : <MMMMKIIT")

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
console.log("Linked User iD : <MMMMKIIT")

} catch (error) {
handleServiceError(error, this.logger, 'attio', Action.oauthCallback);

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The opts parameter in the handleTokenRefresh method is defined but never used. Since Attio does not require token refreshes as noted in the comment, you can remove the opts parameter to avoid confusion and align with the method's purpose.

- async handleTokenRefresh(opts: RefreshParams) {
+ async handleTokenRefresh() {

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
}
async handleTokenRefresh() {

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 14b5f4f and 66b6a3b.
Files selected for processing (1)
  • packages/api/src/@core/connections/crm/services/crm.connection.service.ts (2 hunks)
Check Runs (1)
Build and Test (18.x) failure (17)
  • packages/api/src/@core/connections/crm/services/crm.connection.service.ts: 107-107: 'data' is assigned a value but never used
Additional comments: 1
packages/api/src/@core/connections/crm/services/crm.connection.service.ts (1)
  • 49-49: Adding a logging statement here is good for tracking the callback flow, but consider using a more descriptive message that includes dynamic data such as providerName or projectId for better debugging and monitoring.

@@ -57,6 +59,7 @@
code: code,
location: zohoLocation || null,
};
console.log("In callback2")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using console.log for logging is not recommended in production code as it lacks the flexibility and control provided by more sophisticated logging frameworks like the one already used in this service (this.logger). Consider replacing console.log with this.logger.log for consistency and better log management.

- console.log("In callback2")
+ this.logger.log("In callback2")

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
console.log("In callback2")
this.logger.log("In callback2")

Comment on lines 46 to 53
}

const serviceName = providerName.toLowerCase();
this.logger.log("callback in connection service - Mit")

const service = this.serviceRegistry.getService(serviceName);

if (!service) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [107-107]

The variable data is assigned a value but never used within the handleCRMTokensRefresh method. If the intention was to log or process this data, ensure that it is utilized appropriately. Otherwise, consider removing the assignment to avoid confusion and potential memory overhead.

Copy link

vercel bot commented Mar 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
panora-client-ts ❌ Failed (Inspect) Mar 19, 2024 4:24am

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 66b6a3b and 08e7a0a.
Files ignored due to path filters (1)
  • apps/client-ts/public/providers/crm/attio.png is excluded by: !**/*.png
Files selected for processing (4)
  • .npmrc (1 hunks)
  • packages/api/src/@core/connections/crm/services/crm.connection.service.ts (1 hunks)
  • packages/shared/src/providers.ts (1 hunks)
  • packages/shared/src/utils.ts (4 hunks)
Files skipped from review due to trivial changes (1)
  • .npmrc
Files skipped from review as they are similar to previous changes (2)
  • packages/api/src/@core/connections/crm/services/crm.connection.service.ts
  • packages/shared/src/utils.ts

@@ -7,6 +7,7 @@ export const CRM_PROVIDERS = [
'zendesk',
'hubspot',
'pipedrive',
'attio',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

The usage of CRM_PROVIDERS in packages/api/src/crm/contact/sync/sync.service.ts suggests dynamic handling of CRM providers, potentially allowing for the automatic inclusion of new entries like 'attio'. However, the impact of not explicitly handling 'attio' depends on the filter criteria used. Further investigation into these criteria would be necessary for a definitive assessment.

Analysis chain

The addition of 'attio' to the CRM_PROVIDERS list aligns with the PR objectives and is consistent with the existing structure. Ensure that all system components using CRM_PROVIDERS can handle the new entry without issues.


Given the findings, it's crucial to further investigate how CRM_PROVIDERS is utilized within the listed files to understand the implications of not including 'attio'. Let's examine the usage of CRM_PROVIDERS in one of the files to assess the potential impact.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that all occurrences of CRM_PROVIDERS in the codebase properly handle the new 'attio' entry.
rg 'CRM_PROVIDERS' --files-with-matches | xargs rg 'attio' --files-without-match

Length of output: 467



Script:

#!/bin/bash
# Examine how CRM_PROVIDERS is used in one of the affected files.
rg 'CRM_PROVIDERS' packages/api/src/crm/contact/sync/sync.service.ts

Length of output: 183

@mit-27
Copy link
Contributor Author

mit-27 commented Mar 19, 2024

Hello @rflihxyz, This pull request exclusively contains contacts from Attio CRM. Would you like me to also implement it for the Company object?

@naelob
Copy link
Contributor

naelob commented Mar 20, 2024

Hello @rflihxyz, This pull request exclusively contains contacts from Attio CRM. Would you like me to also implement it for the Company object?

Im checking the validity of the code on my side, i'll let you know within 1 hour !

@naelob
Copy link
Contributor

naelob commented Mar 20, 2024

@mit-27 Could you in the meantime, spot all missing things you had to check by yourself when building this integration ?

Thanky ou very much !

@mit-27
Copy link
Contributor Author

mit-27 commented Mar 20, 2024

Hello @rflihxyz, This pull request exclusively contains contacts from Attio CRM. Would you like me to also implement it for the Company object?

Im checking the validity of the code on my side, i'll let you know within 1 hour !
I think there are issues with addContact method. Could you also double check the dataModel which I mentioned in types.ts file. I am not sure whether it works for both AttioContactInput and AttioContactOutput. Thanks :)

@mit-27
Copy link
Contributor Author

mit-27 commented Mar 20, 2024

@mit-27 Could you in the meantime, spot all missing things you had to check by yourself when building this integration ?

Thanky ou very much !

Sure ;)

@naelob
Copy link
Contributor

naelob commented Mar 20, 2024

@mit-27 Could you in the meantime, spot all missing things you had to check by yourself when building this integration ?
Thanky ou very much !

Sure ;)

btw could you share with me the .env vars for ATTIO ? You can send that over slack in private (send me your address mail so i can invite you on slack)

@mit-27
Copy link
Contributor Author

mit-27 commented Mar 20, 2024

@mit-27 Could you in the meantime, spot all missing things you had to check by yourself when building this integration ?
Thanky ou very much !

Sure ;)

btw could you share with me the .env vars for ATTIO ? You can send that over slack in private (send me your address mail so i can invite you on slack)

It is [email protected]

@naelob naelob merged commit 8637c30 into panoratech:main Mar 20, 2024
7 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Add Attio to CRM Unified API
2 participants