Skip to content

Commit

Permalink
fix: proxycurl return types bug
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Jul 22, 2024
1 parent 57c168d commit f700727
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/services/proxycurl-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1879,6 +1879,16 @@ export namespace proxycurl {
})
export type PersonProfile = z.infer<typeof PersonProfileSchema>

export type ResolvedPersonProfile = {
profile: PersonProfile
url?: string
name_similarity_score?: number
company_similarity_score?: number
title_similarity_score?: number
location_similarity_score?: number
last_updated?: string
}

export const PurpleAcquisitionSchema = z.object({
acquired: z.array(PurpleAcquiredCompanySchema).optional(),
acquired_by: PurpleAcquisitorSchema.optional()
Expand Down Expand Up @@ -2135,15 +2145,16 @@ export class ProxycurlClient extends AIFunctionsProvider {
})
async resolveLinkedInPerson(
opts: proxycurl.PersonLookupEndpointParamsQueryClass
): Promise<proxycurl.PersonProfile> {
): Promise<proxycurl.ResolvedPersonProfile> {
return this.ky
.get('api/linkedin/profile/resolve', {
searchParams: sanitizeSearchParams({
similarity_checks: 'include',
enrich_profile: 'enrich',
...opts
})
})
.json<proxycurl.PersonProfile>()
.json<proxycurl.ResolvedPersonProfile>()
}

@aiFunction({
Expand Down Expand Up @@ -2173,15 +2184,15 @@ export class ProxycurlClient extends AIFunctionsProvider {
})
async resolveLinkedInPersonAtCompanyByRole(
opts: proxycurl.RoleLookupEndpointParamsQueryClass
): Promise<proxycurl.PersonProfile> {
): Promise<proxycurl.ResolvedPersonProfile> {
return this.ky
.get('api/find/company/role/', {
searchParams: sanitizeSearchParams({
enrich_profile: 'enrich',
...opts
})
})
.json<proxycurl.PersonProfile>()
.json<proxycurl.ResolvedPersonProfile>()
}

@aiFunction({
Expand Down

0 comments on commit f700727

Please sign in to comment.