(blockId: string, objectType: string)
| 34 | } |
| 35 | |
| 36 | async function fetchHubSpotProperties(blockId: string, objectType: string) { |
| 37 | const credentialId = useSubBlockStore.getState().getValue(blockId, 'triggerCredentials') as |
| 38 | | string |
| 39 | | null |
| 40 | if (!credentialId) throw new Error('No HubSpot credential selected') |
| 41 | if (isCredentialSetValue(credentialId)) return [] |
| 42 | const data = await requestJson(hubspotPropertiesSelectorContract, { |
| 43 | query: { credentialId, objectType }, |
| 44 | }) |
| 45 | return data.properties.map((p) => ({ id: p.id, label: p.name })) |
| 46 | } |
| 47 | |
| 48 | export const hubspotPollingTrigger: TriggerConfig = { |
| 49 | id: 'hubspot_poller', |
no test coverage detected