Skip to content
Merged
14 changes: 6 additions & 8 deletions apps/docs/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7985,18 +7985,16 @@ export function LeadMagicIcon(props: SVGProps<SVGSVGElement>) {
)
}

/** Dropcontact brand icon: teal disc with the white open-"d" contact mark. */
/** Dropcontact brand icon: the teal swirl mark from the official wordmark. */
export function DropcontactIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg {...props} viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
<circle cx='12' cy='12' r='12' fill='#0ABA9F' />
<svg {...props} viewBox='0 0 50 50' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M13.87 7.9A5 5 0 1 0 13.87 16.1'
stroke='#FFFFFF'
strokeWidth='2.4'
strokeLinecap='round'
fillRule='evenodd'
clipRule='evenodd'
d='M29.57 16.22a10.84 10.84 0 0 0-4.698-1.064c-6.01 0-10.88 4.872-10.88 10.88s4.872 10.88 10.88 10.88c4.09 0 7.655-2.258 9.513-5.596l-2.623-1.457a7.88 7.88 0 0 1-6.89 4.053c-4.353 0-7.88-3.528-7.88-7.88s3.528-7.88 7.88-7.88a7.85 7.85 0 0 1 3.403.77l1.295-2.707zm5.21-14.235v25.762h-3.11V.9C29.546.313 27.3 0 25 0 11.193 0 0 11.193 0 25s11.193 25 25 25 25-11.193 25-25c0-10.337-6.274-19.21-15.222-23.016z'
fill='currentColor'
/>
<path d='M15.1 6.2V17.8' stroke='#FFFFFF' strokeWidth='2.4' strokeLinecap='round' />
</svg>
)
}
Expand Down
33 changes: 31 additions & 2 deletions apps/docs/content/docs/en/integrations/algolia.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ Search an Algolia index
| `page` | number | No | Page number to retrieve \(default: 0\) |
| `filters` | string | No | Filter string \(e.g., "category:electronics AND price &lt; 100"\) |
| `attributesToRetrieve` | string | No | Comma-separated list of attributes to retrieve |
| `facets` | string | No | Comma-separated list of facet attribute names to retrieve counts for \(use "*" for all\) |
| `getRankingInfo` | boolean | No | Whether to include detailed ranking information in each hit |
| `aroundLatLng` | string | No | Coordinates for geo-search \(e.g., "40.71,-74.01"\) |
| `aroundRadius` | string | No | Maximum radius in meters for geo-search, or "all" for unlimited |
| `insideBoundingBox` | json | No | Bounding box coordinates as \[\[lat1, lng1, lat2, lng2\]\] for geo-search |
| `insidePolygon` | json | No | Polygon coordinates as \[\[lat1, lng1, lat2, lng2, lat3, lng3, ...\]\] for geo-search |

#### Output

Expand Down Expand Up @@ -200,6 +206,10 @@ Browse and iterate over all records in an Algolia index using cursor pagination
| `attributesToRetrieve` | string | No | Comma-separated list of attributes to retrieve |
| `hitsPerPage` | number | No | Number of hits per page \(default: 1000, max: 1000\) |
| `cursor` | string | No | Cursor from a previous browse response for pagination |
| `aroundLatLng` | string | No | Coordinates for geo-search \(e.g., "40.71,-74.01"\) |
| `aroundRadius` | string | No | Maximum radius in meters for geo-search, or "all" for unlimited |
| `insideBoundingBox` | json | No | Bounding box coordinates as \[\[lat1, lng1, lat2, lng2\]\] for geo-search |
| `insidePolygon` | json | No | Polygon coordinates as \[\[lat1, lng1, lat2, lng2, lat3, lng3, ...\]\] for geo-search |

#### Output

Expand All @@ -225,7 +235,7 @@ Perform batch add, update, partial update, or delete operations on records in an
| `applicationId` | string | Yes | Algolia Application ID |
| `apiKey` | string | Yes | Algolia Admin API Key |
| `indexName` | string | Yes | Name of the Algolia index |
| `requests` | json | Yes | Array of batch operations. Each item has "action" \(addObject, updateObject, partialUpdateObject, partialUpdateObjectNoCreate, deleteObject\) and "body" \(the record data, must include objectID for update/delete\) |
| `requests` | json | Yes | Array of batch operations. Each item has "action" \(addObject, updateObject, partialUpdateObject, partialUpdateObjectNoCreate, deleteObject, delete, clear\) and "body" \(the record data, must include objectID for update/delete; omit body for delete/clear\) |

#### Output

Expand Down Expand Up @@ -390,7 +400,7 @@ Delete all records matching a filter from an Algolia index
| `numericFilters` | json | No | Array of numeric filters \(e.g., \["price &gt; 100"\]\) |
| `tagFilters` | json | No | Array of tag filters using the _tags attribute \(e.g., \["published"\]\) |
| `aroundLatLng` | string | No | Coordinates for geo-search filter \(e.g., "40.71,-74.01"\) |
| `aroundRadius` | number | No | Maximum radius in meters for geo-search, or "all" for unlimited |
| `aroundRadius` | string | No | Maximum radius in meters for geo-search, or "all" for unlimited |
| `insideBoundingBox` | json | No | Bounding box coordinates as \[\[lat1, lng1, lat2, lng2\]\] for geo-search filter |
| `insidePolygon` | json | No | Polygon coordinates as \[\[lat1, lng1, lat2, lng2, lat3, lng3, ...\]\] for geo-search filter |

Expand All @@ -401,4 +411,23 @@ Delete all records matching a filter from an Algolia index
| `taskID` | number | Algolia task ID for tracking the delete-by-filter operation |
| `updatedAt` | string | Timestamp when the operation was performed |

### `algolia_get_task_status`

Check whether an Algolia indexing task has finished publishing

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `applicationId` | string | Yes | Algolia Application ID |
| `apiKey` | string | Yes | Algolia API Key |
| `indexName` | string | Yes | Name of the Algolia index the task ran against |
| `taskID` | number | Yes | The taskID returned by a previous write operation |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `status` | string | Task status: "published" once the operation has been applied, "notPublished" while still pending |


2 changes: 1 addition & 1 deletion apps/docs/content/docs/en/integrations/dropcontact.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"

<BlockInfoCard
type="dropcontact"
color="#0066FF"
color="#0ABA9F"
/>

{/* MANUAL-CONTENT-START:intro */}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/en/integrations/grafana.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"

<BlockInfoCard
type="grafana"
color="#F46800"
color="#FFFFFF"
/>

{/* MANUAL-CONTENT-START:intro */}
Expand Down
128 changes: 88 additions & 40 deletions apps/sim/blocks/blocks/algolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const AlgoliaBlock: BlockConfig = {
{ label: 'Copy/Move Index', id: 'copy_move_index' },
{ label: 'Clear Records', id: 'clear_records' },
{ label: 'Delete By Filter', id: 'delete_by_filter' },
{ label: 'Get Task Status', id: 'get_task_status' },
],
value: () => 'search',
},
Expand All @@ -63,15 +64,15 @@ export const AlgoliaBlock: BlockConfig = {
title: 'Hits Per Page',
type: 'short-input',
placeholder: '20',
condition: { field: 'operation', value: ['search', 'browse_records'] },
condition: { field: 'operation', value: ['search', 'browse_records', 'list_indices'] },
mode: 'advanced',
},
{
id: 'page',
title: 'Page',
type: 'short-input',
placeholder: '0',
condition: { field: 'operation', value: 'search' },
condition: { field: 'operation', value: ['search', 'list_indices'] },
mode: 'advanced',
},
{
Expand Down Expand Up @@ -108,6 +109,26 @@ Return ONLY the filter string, no quotes or explanation.`,
condition: { field: 'operation', value: ['search', 'get_record', 'browse_records'] },
mode: 'advanced',
},
{
id: 'facets',
title: 'Facets',
type: 'short-input',
placeholder: 'category,brand (or * for all)',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
{
id: 'getRankingInfo',
title: 'Include Ranking Info',
type: 'dropdown',
options: [
{ label: 'No', id: 'false' },
{ label: 'Yes', id: 'true' },
],
value: () => 'false',
condition: { field: 'operation', value: 'search' },
mode: 'advanced',
},
// Browse cursor
{
id: 'cursor',
Expand Down Expand Up @@ -389,31 +410,31 @@ Return ONLY the filter string, no quotes or explanation.`,
title: 'Around Lat/Lng',
type: 'short-input',
placeholder: '40.71,-74.01',
condition: { field: 'operation', value: 'delete_by_filter' },
condition: { field: 'operation', value: ['delete_by_filter', 'search', 'browse_records'] },
mode: 'advanced',
},
{
id: 'aroundRadius',
title: 'Around Radius (m)',
type: 'short-input',
placeholder: '1000 or "all"',
condition: { field: 'operation', value: 'delete_by_filter' },
condition: { field: 'operation', value: ['delete_by_filter', 'search', 'browse_records'] },
mode: 'advanced',
},
{
id: 'insideBoundingBox',
title: 'Inside Bounding Box',
type: 'short-input',
placeholder: '[[47.3165,0.757,47.3424,0.8012]]',
condition: { field: 'operation', value: 'delete_by_filter' },
condition: { field: 'operation', value: ['delete_by_filter', 'search', 'browse_records'] },
mode: 'advanced',
},
{
id: 'insidePolygon',
title: 'Inside Polygon',
type: 'short-input',
placeholder: '[[47.3165,0.757,47.3424,0.8012,47.33,0.78]]',
condition: { field: 'operation', value: 'delete_by_filter' },
condition: { field: 'operation', value: ['delete_by_filter', 'search', 'browse_records'] },
mode: 'advanced',
},
// Get records (batch) field
Expand Down Expand Up @@ -447,22 +468,14 @@ Return ONLY the JSON array.`,
generationType: 'json-object',
},
},
// List indices pagination
// Get task status field
{
id: 'listPage',
title: 'Page',
id: 'taskID',
title: 'Task ID',
type: 'short-input',
placeholder: '0',
condition: { field: 'operation', value: 'list_indices' },
mode: 'advanced',
},
{
id: 'listHitsPerPage',
title: 'Indices Per Page',
type: 'short-input',
placeholder: '100',
condition: { field: 'operation', value: 'list_indices' },
mode: 'advanced',
placeholder: '12345',
condition: { field: 'operation', value: 'get_task_status' },
required: { field: 'operation', value: 'get_task_status' },
},
// Object ID - for add (optional), get, partial update, delete
{
Expand Down Expand Up @@ -515,32 +528,48 @@ Return ONLY the JSON array.`,
'algolia_copy_move_index',
'algolia_clear_records',
'algolia_delete_by_filter',
'algolia_get_task_status',
],
config: {
tool: (params: Record<string, unknown>) => {
const op = params.operation as string
if (op === 'partial_update_record') {
params.createIfNotExists = params.createIfNotExists !== 'false'
tool: (params: Record<string, unknown>) => `algolia_${params.operation}`,
params: (params: Record<string, unknown>) => {
const { operation, ...rest } = params
const result: Record<string, unknown> = {}

for (const [key, value] of Object.entries(rest)) {
if (value === undefined || value === null || value === '') continue
result[key] = value
}
if (op === 'update_settings' && params.forwardToReplicas === 'true') {
params.forwardToReplicas = true
} else if (op === 'update_settings') {
params.forwardToReplicas = false

const toBool = (value: unknown, defaultValue: boolean) => {
if (typeof value === 'boolean') return value
if (typeof value === 'string') return value === 'true'
return defaultValue
}

if (operation === 'partial_update_record') {
result.createIfNotExists = toBool(result.createIfNotExists, true)
}
if (op === 'copy_move_index') {
params.operation = params.copyMoveOperation
if (operation === 'update_settings') {
result.forwardToReplicas = toBool(result.forwardToReplicas, false)
}
if (op === 'delete_by_filter') {
params.filters = params.deleteFilters
if (operation === 'search' && result.getRankingInfo !== undefined) {
result.getRankingInfo = toBool(result.getRankingInfo, false)
}
if (op === 'get_records') {
params.requests = params.getRecordsRequests
if (operation === 'copy_move_index') {
result.operation = result.copyMoveOperation
result.copyMoveOperation = undefined
}
if (op === 'list_indices') {
if (params.listPage !== undefined) params.page = params.listPage
if (params.listHitsPerPage !== undefined) params.hitsPerPage = params.listHitsPerPage
if (operation === 'delete_by_filter') {
result.filters = result.deleteFilters
result.deleteFilters = undefined
}
return `algolia_${op}`
if (operation === 'get_records') {
result.requests = result.getRecordsRequests
result.getRecordsRequests = undefined
}

return result
Comment thread
waleedlatif1 marked this conversation as resolved.
},
},
},
Expand All @@ -553,6 +582,8 @@ Return ONLY the JSON array.`,
page: { type: 'string', description: 'Page number' },
filters: { type: 'string', description: 'Algolia filter string' },
attributesToRetrieve: { type: 'string', description: 'Attributes to retrieve' },
facets: { type: 'string', description: 'Comma-separated facet attribute names to count' },
getRankingInfo: { type: 'string', description: 'Include detailed ranking info in each hit' },
cursor: { type: 'string', description: 'Browse cursor for pagination' },
record: { type: 'json', description: 'Record data to add' },
attributes: { type: 'json', description: 'Attributes to partially update' },
Expand All @@ -579,8 +610,7 @@ Return ONLY the JSON array.`,
type: 'json',
description: 'Array of objects with objectID to retrieve multiple records',
},
listPage: { type: 'string', description: 'Page number for list indices pagination' },
listHitsPerPage: { type: 'string', description: 'Indices per page for list indices' },
taskID: { type: 'string', description: 'Task ID returned by a previous write operation' },
applicationId: { type: 'string', description: 'Algolia Application ID' },
apiKey: { type: 'string', description: 'Algolia API Key' },
},
Expand Down Expand Up @@ -644,6 +674,10 @@ Return ONLY the JSON array.`,
type: 'number',
description: 'Maximum number of hits accessible via pagination (default 1000)',
},
status: {
type: 'string',
description: 'Task status: "published" once applied, "notPublished" while still pending',
},
},
}

Expand Down Expand Up @@ -739,5 +773,19 @@ export const AlgoliaBlockMeta = {
content:
'# Audit Search Relevance\n\nCheck that important queries return good results from an Algolia index.\n\n## Steps\n1. Run each query in the provided test set against the index.\n2. Record the top results, total hit count, and whether the expected record appears.\n3. Flag queries that return zero hits, too many hits, or miss the expected record.\n\n## Output\nA table of queries with result counts and pass/fail, plus suggestions for synonyms or ranking tweaks where relevance is weak.',
},
{
name: 'tune-index-ranking',
description:
'Read an Algolia index configuration, propose ranking and searchable-attribute changes, and apply the update.',
content:
'# Tune Index Ranking\n\nAdjust how an Algolia index ranks results without touching the underlying data.\n\n## Steps\n1. Fetch the current index settings (searchable attributes, custom ranking, ranking criteria).\n2. Compare them against the desired outcome (e.g., surface newer or more popular items first).\n3. Propose specific changes to customRanking, searchableAttributes order, or attributesForFaceting.\n4. Apply the approved settings update to the index.\n\n## Output\nA before/after summary of the settings changed and why, plus confirmation the update succeeded.',
},
{
name: 'snapshot-index-before-change',
description:
'Copy an Algolia index to a timestamped backup before applying a risky settings or data change.',
content:
'# Snapshot Index Before Change\n\nProtect against a bad settings or batch update by copying the index first.\n\n## Steps\n1. Copy the source index to a new destination index named with a date or version suffix.\n2. Confirm the copy completed by checking the resulting task status.\n3. Apply the intended change (settings update, batch operation, or delete-by-filter) to the original index.\n4. If the change causes problems, the snapshot index can be copied back or used for comparison.\n\n## Output\nThe name of the backup index created and confirmation the source change was applied afterward.',
},
],
} as const satisfies BlockMeta
3 changes: 2 additions & 1 deletion apps/sim/blocks/blocks/dropcontact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export const DropcontactBlock: BlockConfig<DropcontactResponse> = {
'Use Dropcontact to verify and enrich B2B contacts. Submit a contact with their name, company, website, or LinkedIn URL and receive a verified professional email, phone number, company firmographics, and LinkedIn profile. Enrichment is async: Dropcontact processes the request, then Sim polls until the result is ready. Credits are only charged when a verified email is returned.',
docsLink: 'https://docs.sim.ai/tools/dropcontact',
category: 'tools',
bgColor: '#0066FF',
bgColor: '#0ABA9F',
Comment thread
waleedlatif1 marked this conversation as resolved.
iconColor: '#0ABA9F',
icon: DropcontactIcon,
authMode: AuthMode.ApiKey,
integrationType: IntegrationType.Sales,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/blocks/blocks/grafana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const GrafanaBlock: BlockConfig<GrafanaResponse> = {
docsLink: 'https://docs.sim.ai/integrations/grafana',
category: 'tools',
integrationType: IntegrationType.Observability,
bgColor: '#F46800',
bgColor: '#FFFFFF',
icon: GrafanaIcon,
subBlocks: [
{
Expand Down
14 changes: 6 additions & 8 deletions apps/sim/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7985,18 +7985,16 @@ export function LeadMagicIcon(props: SVGProps<SVGSVGElement>) {
)
}

/** Dropcontact brand icon: teal disc with the white open-"d" contact mark. */
/** Dropcontact brand icon: the teal swirl mark from the official wordmark. */
export function DropcontactIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg {...props} viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
<circle cx='12' cy='12' r='12' fill='#0ABA9F' />
<svg {...props} viewBox='0 0 50 50' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M13.87 7.9A5 5 0 1 0 13.87 16.1'
stroke='#FFFFFF'
strokeWidth='2.4'
strokeLinecap='round'
fillRule='evenodd'
clipRule='evenodd'
d='M29.57 16.22a10.84 10.84 0 0 0-4.698-1.064c-6.01 0-10.88 4.872-10.88 10.88s4.872 10.88 10.88 10.88c4.09 0 7.655-2.258 9.513-5.596l-2.623-1.457a7.88 7.88 0 0 1-6.89 4.053c-4.353 0-7.88-3.528-7.88-7.88s3.528-7.88 7.88-7.88a7.85 7.85 0 0 1 3.403.77l1.295-2.707zm5.21-14.235v25.762h-3.11V.9C29.546.313 27.3 0 25 0 11.193 0 0 11.193 0 25s11.193 25 25 25 25-11.193 25-25c0-10.337-6.274-19.21-15.222-23.016z'
fill='currentColor'
/>
<path d='M15.1 6.2V17.8' stroke='#FFFFFF' strokeWidth='2.4' strokeLinecap='round' />
</svg>
)
}
Expand Down
Loading
Loading