Skip to content

Latest commit

 

History

History
194 lines (161 loc) · 7.6 KB

usage.md

File metadata and controls

194 lines (161 loc) · 7.6 KB

Usage Guide

This document describes the usage and structure of the CRM Integrator project. It provides an overview of the project folders and files, and explains how to use and manage the various functions included in the project.

Table of Contents

  1. Project Structure
  2. Functions Overview
  3. Folder Overview
  4. Disabling Unnecessary Functions
  5. Additional Resources

Project Structure

.  
├── .firebase/  
├── functions/  
│   ├── lib/  
│   │   ├── callback24Sync/  
│   │   ├── facebookSync/  
│   │   ├── gamilSync/  
│   │   ├── pipedrive/  
│   │   ├── utils/  
│   │   ├── index.js  
│   │   ├── init.js  
│   │   ├── interfaces.js  
│   ├── src/  
│   │   ├── callback24Sync/  
│   │   │   ├── getCallInfo.ts  
│   │   │   ├── getHistory.ts  
│   │   │   ├── handleCallback24Data.ts  
│   │   │   ├── callback24Sync.ts  
│   │   ├── facebookSync/  
│   │   │   ├── getFacebookLeads.ts  
│   │   │   ├── handleFacebookLeads.ts  
│   │   │   ├── reformatFacebookLeads.ts  
│   │   │   ├── facebookSync.ts  
│   │   ├── gamilSync/  
│   │   │   ├── authorize.ts  
│   │   │   ├── extractGmailFields.ts  
│   │   │   ├── getGmailHistoryGmailApi.ts  
│   │   │   ├── getGmailHistoryImap.ts  
│   │   │   ├── handleGmailDataGmailApi.ts  
│   │   │   ├── handleGmailDataImap.ts  
│   │   │   ├── gmailSync.ts  
│   │   ├── pipedrive/  
│   │   │   ├── createLeads.ts  
│   │   │   ├── createPerson.ts  
│   │   ├── utils/  
│   │   │   ├── dateFuncs.ts  
│   │   │   ├── delay.ts  
│   │   │   ├── getSecret.ts  
│   │   │   ├── handleSyncError.ts  
│   │   │   ├── saveLeadInfo.ts  
│   │   │   ├── sendMails.ts  
│   │   │   ├── filterSavedLeads.ts  
│   │   ├── index.ts  
│   │   ├── init.ts  
│   │   ├── interfaces.ts
│   ├── .eslintrc.js  
│   ├── package.json  
│   ├── tsconfig.json  
│   ├── tsconfig.dev.json  
├── public/  
│   ├── index.html  
│   ├── privacy-policy.html  
│   ├── terms-of-service.html  
├── .firebaserc  
├── .gitignore  
├── firebase.json  
└── README.md  

Functions Overview

Callback24 Sync

  • Path: functions/src/callback24Sync/callback24Sync.ts
  • Description: Synchronizes leads from Callback24 and creates records in Pipedrive.
  • Usage:
  import { scheduleCallback24Sync } from "./callback24Sync/callback24Sync";

Facebook Sync

  • Path: functions/src/facebookSync/facebookSync.ts
  • Description: Synchronizes leads from Facebook and creates records in Pipedrive.
  • Usage:
  import { scheduleFacebookSync } from "./facebookSync/facebookSync";

Gmail Sync

  • Path: functions/src/gamilSync/gmailSync.ts
  • Description: Synchronizes leads from Gmail and creates records in Pipedrive.
  • Usage:
  import { scheduleGmailSync } from "./gamilSync/gmailSync";

Folder Overview

callback24Sync

  • Description: Contains all the files related to synchronizing leads from Callback24 and creating records in Pipedrive.
  • Files:
    • getCallInfo.ts: Retrieves call information from Callback24.
    • getHistory.ts: Fetches call history from Callback24.
    • handleCallback24Data.ts: Processes and handles data from Callback24.
    • callback24Sync.ts: Main file for synchronizing data from Callback24.

facebookSync

  • Description: Contains all the files related to synchronizing leads from Facebook and creating records in Pipedrive.
  • Files:
    • getFacebookLeads.ts: Retrieves leads from Facebook.
    • handleFacebookLeads.ts: Processes and handles Facebook leads.
    • reformatFacebookLeads.ts: Reformats Facebook leads data.
    • facebookSync.ts: Main file for synchronizing data from Facebook.

gamilSync

  • Description: Contains all the files related to synchronizing leads from Gmail and creating records in Pipedrive.
  • Files:
    • authorize.ts: Handles Gmail authorization.
    • extractGmailFields.ts: Extracts fields from Gmail messages.
    • getGmailHistoryGmailApi.ts: Fetches Gmail history using Gmail API.
    • getGmailHistoryImap.ts: Fetches Gmail history using IMAP.
    • handleGmailDataGmailApi.ts: Processes Gmail data using Gmail API.
    • handleGmailDataImap.ts: Processes Gmail data using IMAP.
    • gmailSync.ts: Main file for synchronizing data from Gmail.

pipedrive

  • Description: Contains all the files related to creating leads and persons in Pipedrive.
  • Files:
    • createLeads.ts: Creates leads in Pipedrive.
    • createPerson.ts: Creates persons in Pipedrive.

utils

  • Description: Contains utility functions used across the project.
  • Files:
    • dateFuncs.ts: Contains date utility functions.
    • delay.ts: Implements delay functionality.
    • getSecret.ts: Retrieves secrets from Google Secret Manager.
    • handleSyncError.ts: Handles synchronization errors.
    • saveLeadInfo.ts: Saves processed lead information.
    • sendMails.ts: Sends error and fixed emails.
    • filterSavedLeads.ts: Filters saved leads.

Other Files

  • index.ts: Main entry point for function exports.
  • init.ts: Initializes Firebase admin.
  • interfaces.ts: Defines TypeScript interfaces.

Disabling Unnecessary Functions

If any function is not needed, you can disable it by removing its import and usage from the index.ts file. After making the changes, you can deploy the updated functions using the following command:

firebase deploy --only functions

Alternatively, you can delete the function using Firebase CLI with the following command:

firebase functions:delete <functionName>

Additional Resources