MCPcopy Index your code
hub / github.com/simstudioai/sim / buildBody

Function buildBody

apps/sim/lib/webhooks/polling/hubspot.ts:645–666  ·  view source on GitHub ↗
(cursor?: string)

Source from the content-addressed store, hash-verified

643 // Group B is dropped on the first poll after seeding so we don't emit boundary
644 // records the seed point already skipped past.
645 const buildBody = (cursor?: string) => {
646 const groupA: FilterClause[] = [
647 { propertyName: filterProperty, operator: 'GT', value: String(watermarkMs) },
648 ...userFilters,
649 ]
650 const groups = [{ filters: groupA }]
651 if (lastSeenObjectId) {
652 const groupB: FilterClause[] = [
653 { propertyName: filterProperty, operator: 'EQ', value: String(watermarkMs) },
654 { propertyName: 'hs_object_id', operator: 'GT', value: String(lastSeenObjectId) },
655 ...userFilters,
656 ]
657 groups.push({ filters: groupB })
658 }
659 return {
660 filterGroups: groups,
661 sorts: [{ propertyName: filterProperty, direction: 'ASCENDING' }],
662 properties,
663 limit: HUBSPOT_PAGE_LIMIT,
664 ...(cursor ? { after: cursor } : {}),
665 }
666 }
667
668 do {
669 const response = await fetch(url, {

Callers 1

fetchHubSpotChangesFunction · 0.70

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected