Skip to content

Commit

Permalink
Use new package types
Browse files Browse the repository at this point in the history
  • Loading branch information
joeauyeung committed Dec 27, 2024
1 parent 2a9f57d commit 852ceec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/app-store/salesforce/lib/CrmService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { TokenResponse } from "@jsforce/jsforce-node";
import type { TokenResponse, Connection, QueryResult, Field } from "@jsforce/jsforce-node";
import jsforce from "@jsforce/jsforce-node";
import { RRule } from "rrule";
import { z } from "zod";
Expand Down Expand Up @@ -64,7 +64,7 @@ const salesforceTokenSchema = z.object({

export default class SalesforceCRMService implements CRM {
private integrationName = "";
private conn!: Promise<jsforce.Connection>;
private conn!: Promise<Connection>;
private log: typeof logger;
private calWarnings: string[] = [];
private appOptions: any;
Expand Down Expand Up @@ -463,7 +463,7 @@ export default class SalesforceCRMService implements CRM {
);

// Filter out any undefined results and ensure records exist
const validOwnersQuery = ownersQuery.filter((query): query is jsforce.QueryResult<ContactRecord> => {
const validOwnersQuery = ownersQuery.filter((query): query is QueryResult<ContactRecord> => {
const firstRecord = query?.records?.[0];
if (!firstRecord) return false;

Expand Down Expand Up @@ -838,7 +838,7 @@ export default class SalesforceCRMService implements CRM {
const conn = await this.conn;

const fieldSet = new Set(fieldsToTest);
const foundFields: jsforce.Field[] = [];
const foundFields: Field[] = [];

try {
const salesforceEntity = await conn.describe(sobject);
Expand Down Expand Up @@ -979,7 +979,7 @@ export default class SalesforceCRMService implements CRM {
organizerEmail,
calEventResponses,
}: {
existingFields: jsforce.Field[];
existingFields: Field[];
personRecord: Record<string, any>;
onBookingWriteToRecordFields: Record<string, any>;
startTime: string;
Expand Down Expand Up @@ -1136,7 +1136,7 @@ export default class SalesforceCRMService implements CRM {

private async fetchPersonRecord(
contactId: string,
existingFields: jsforce.Field[],
existingFields: Field[],
personRecordType: SalesforceRecordEnum
): Promise<Record<string, any> | null> {
const conn = await this.conn;
Expand Down

0 comments on commit 852ceec

Please sign in to comment.