Skip to content

Commit 0d959f4

Browse files
committed
fix(credentials): review round 1 — site_not_found modal message, revert pipeline-deals pagination change
- Client-credential connect modal maps site_not_found (bad Salesforce My Domain host) to host-specific guidance instead of the generic fallback - Reverts the pipeline-deals v1→v2 migration: it swapped the saved-workflow pagination contract (start/next_start → cursor/next_cursor), silently breaking deployed workflows; the v2 move needs a dedicated PR with a subblock migration. authStyle typing and helper usage are kept
1 parent 79fa0fa commit 0d959f4

4 files changed

Lines changed: 24 additions & 12 deletions

File tree

apps/sim/app/workspace/[workspaceId]/integrations/components/connect-service-account-modal/client-credential-account-modal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ function messageForClientCredentialError(
3939
switch (err.code) {
4040
case 'invalid_credentials':
4141
return `We couldn't authenticate with those credentials. Check that the ${fieldLabels} all belong to the same ${descriptor.serviceLabel} app and that the app is authorized.`
42+
case 'site_not_found':
43+
return `We couldn't find a ${descriptor.serviceLabel} account at that host. Check the spelling of the host field and try again.`
4244
case 'provider_unavailable':
4345
return `We couldn't reach ${descriptor.serviceLabel} to verify these credentials. Try again in a moment.`
4446
case 'duplicate_display_name':

apps/sim/blocks/blocks/pipedrive.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
319319
placeholder: 'Pagination cursor from previous response',
320320
condition: {
321321
field: 'operation',
322-
value: ['get_all_deals', 'get_pipeline_deals', 'get_projects'],
322+
value: ['get_all_deals', 'get_projects'],
323323
},
324324
},
325325
{
@@ -329,7 +329,14 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
329329
placeholder: 'Pagination offset (e.g., 0, 100, 200)',
330330
condition: {
331331
field: 'operation',
332-
value: ['get_activities', 'get_leads', 'get_files', 'get_mail_messages', 'get_pipelines'],
332+
value: [
333+
'get_activities',
334+
'get_leads',
335+
'get_files',
336+
'get_pipeline_deals',
337+
'get_mail_messages',
338+
'get_pipelines',
339+
],
333340
},
334341
},
335342
{

apps/sim/tools/pipedrive/get_pipeline_deals.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,25 @@ export const pipedriveGetPipelineDealsTool: ToolConfig<
4949
visibility: 'user-or-llm',
5050
description: 'Number of results to return (e.g., "50", default: 100, max: 500)',
5151
},
52-
cursor: {
52+
start: {
5353
type: 'string',
5454
required: false,
5555
visibility: 'user-or-llm',
56-
description: 'For pagination, the marker representing the first item on the next page',
56+
description: 'Pagination start offset (0-based index of the first item to return)',
5757
},
5858
},
5959

6060
request: {
6161
url: (params) => {
62-
const queryParams = new URLSearchParams({ pipeline_id: params.pipeline_id })
62+
const baseUrl = `https://api.pipedrive.com/v1/pipelines/${params.pipeline_id}/deals`
63+
const queryParams = new URLSearchParams()
6364

6465
if (params.stage_id) queryParams.append('stage_id', params.stage_id)
6566
if (params.limit) queryParams.append('limit', params.limit)
66-
if (params.cursor) queryParams.append('cursor', params.cursor)
67+
if (params.start) queryParams.append('start', params.start)
6768

68-
return `https://api.pipedrive.com/api/v2/deals?${queryParams.toString()}`
69+
const queryString = queryParams.toString()
70+
return queryString ? `${baseUrl}?${queryString}` : baseUrl
6971
},
7072
method: 'GET',
7173
headers: (params) => getPipedriveAuthHeaders(params),
@@ -80,7 +82,8 @@ export const pipedriveGetPipelineDealsTool: ToolConfig<
8082
}
8183

8284
const deals = data.data || []
83-
const nextCursor = data.additional_data?.next_cursor ?? null
85+
const hasMore = data.additional_data?.pagination?.more_items_in_collection || false
86+
const nextStart = data.additional_data?.pagination?.next_start ?? null
8487

8588
return {
8689
success: true,
@@ -89,8 +92,8 @@ export const pipedriveGetPipelineDealsTool: ToolConfig<
8992
metadata: {
9093
pipeline_id: params?.pipeline_id || '',
9194
total_items: deals.length,
92-
has_more: nextCursor !== null,
93-
next_cursor: nextCursor,
95+
has_more: hasMore,
96+
next_start: nextStart,
9497
},
9598
success: true,
9699
},

apps/sim/tools/pipedrive/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ export interface PipedriveGetPipelineDealsParams extends PipedriveBaseParams {
529529
pipeline_id: string
530530
stage_id?: string
531531
limit?: string
532-
cursor?: string
532+
start?: string
533533
}
534534

535535
interface PipedriveGetPipelineDealsOutput {
@@ -538,7 +538,7 @@ interface PipedriveGetPipelineDealsOutput {
538538
pipeline_id: string
539539
total_items: number
540540
has_more?: boolean
541-
next_cursor?: string | null
541+
next_start?: number
542542
}
543543
success: boolean
544544
}

0 commit comments

Comments
 (0)