CrmService
Stentor API Reference / stentor-models/src / CrmService
Interface: CrmService
Defined in: packages/stentor-models/src/Services/CrmService.ts:204
Methodsβ
send()β
send(
externalLead,extras?):Promise<CrmResponse>
Defined in: packages/stentor-models/src/Services/CrmService.ts:215
Send information about a lead to the CRM.
This can be used to either create a lead or append data to an existing lead.
The existing lead can be determined by the refId on the ExternalLead information or by attempting to match data such as email or phone number.
Parametersβ
externalLeadβ
Lead information
extras?β
Record<string, unknown>
Optional additional metadata to pass to the CRM
Returnsβ
Promise<CrmResponse>
update()?β
optionalupdate(externalLead,extras?):Promise<CrmResponse>
Defined in: packages/stentor-models/src/Services/CrmService.ts:229
Updates a lead if the user provides more information after the lead has been sent.
It leverages the refId on the externalLead, which is originally provided in the CrmResponse to properly
Parametersβ
externalLeadβ
extras?β
Record<string, unknown>
Returnsβ
Promise<CrmResponse>
Deprecatedβ
Use send with a refId on the externalLead and call send() again. This will update.
getAvailability()β
getAvailability(
range,options?):Promise<CrmServiceAvailability>
Defined in: packages/stentor-models/src/Services/CrmService.ts:239
Returns availability for scheduling an appointment with the business.
Parametersβ
rangeβ
options?β
Returnsβ
Promise<CrmServiceAvailability>
getJobType()?β
optionalgetJobType(message,externalLead?,options?):Promise<CrmServiceJobType>
Defined in: packages/stentor-models/src/Services/CrmService.ts:255
Returns the job type (id) for the free text job description (AI call usually)
Parametersβ
messageβ
string
externalLead?β
options?β
CrmServiceAvailabilitySettings
Availability settings in scope for this request (e.g. a widget's forceAvailabilityClass or jobTypeClasses), needed to resolve the job type's class.
Deliberately typed as the settings-only CrmServiceAvailabilitySettings rather than
CrmServiceAvailabilityOptions: this method determines the job type, so the jobType member of
the Options type would be meaningless (and misleading) here.
Returnsβ
Promise<CrmServiceJobType>
listJobTypes()?β
optionallistJobTypes():Promise<CrmServiceJobType[]>
Defined in: packages/stentor-models/src/Services/CrmService.ts:263
Lists the tenant's job types from the FSM. Backs a Studio picker.
Returnsβ
Promise<CrmServiceJobType[]>
suggestJobTypeClasses()?β
optionalsuggestJobTypeClasses(availabilityClasses?):Promise<JobTypeAvailabilityClass[]>
Defined in: packages/stentor-models/src/Services/CrmService.ts:269
Returns a suggested job-type -> class map. Does not persist anything.
Parametersβ
availabilityClasses?β
Returnsβ
Promise<JobTypeAvailabilityClass[]>