Skip to content

Commit 9f2e761

Browse files
committed
fix(integrations): keep quoted Zendesk search text, require org names on create, validate Intercom snooze timestamps, and tighten Pipedrive outputs
1 parent ea23d26 commit 9f2e761

11 files changed

Lines changed: 74 additions & 16 deletions

File tree

‎apps/docs/content/docs/integrations/pipedrive.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ Retrieve all pipelines from Pipedrive
282282
| `total_items` | number | Total number of pipelines returned |
283283
| `has_more` | boolean | Whether more pipelines are available |
284284
| `next_start` | number | Always null: API v2 pages with next_cursor instead of an offset |
285-
| `next_cursor` | string | Cursor for fetching the next page |
285+
| `next_cursor` | string | Cursor for fetching the next page; null on the last page |
286286
| `success` | boolean | Operation success status |
287287

288288
</ReferenceDetails>
@@ -535,7 +535,7 @@ Create a new lead in Pipedrive
535535
| `value_amount` | string | No | Potential value amount \(e.g., "10000"\) |
536536
| `value_currency` | string | No | Currency code \(e.g., "USD", "EUR", "GBP"\) |
537537
| `expected_close_date` | string | No | Expected close date in YYYY-MM-DD format \(e.g., "2025-04-15"\) |
538-
| `visible_to` | string | No | Visibility group: 1 \(owner only / owner & followers\), 3 \(owner's visibility group / entire company\), 5 \(owner's group and sub-groups\), 7 \(entire company\); 5 and 7 are Premium/Ultimate only |
538+
| `visible_to` | string | No | Visibility group; meanings depend on the Pipedrive plan. Light, Growth, and Professional: 1 = owner & followers, 3 = entire company. Premium and Ultimate: 1 = owner only, 3 = owner's visibility group, 5 = owner's visibility group and sub-groups, 7 = entire company |
539539

540540
#### Output
541541

‎apps/sim/blocks/blocks/intercom.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ const EVENT_ACTOR_FIELD = ['event_email', 'event_user_id', 'event_contact_id'] a
1717
/** What an outbound message shows: its subject when set, otherwise its body. */
1818
const MESSAGE_PREVIEW_FIELD = ['subject', 'body'] as const
1919

20+
/** Intercom requires `snoozed_until` as a whole Unix timestamp in seconds. */
21+
function toSnoozeTimestamp(value: unknown): number {
22+
const timestamp = Number(value)
23+
if (!Number.isInteger(timestamp)) {
24+
throw new Error('Snooze until must be a whole Unix timestamp in seconds')
25+
}
26+
return timestamp
27+
}
28+
2029
export const IntercomBlock: BlockConfig = {
2130
type: 'intercom',
2231
name: 'Intercom (Legacy)',
@@ -1412,7 +1421,7 @@ Return ONLY the numeric timestamp.`,
14121421
}
14131422

14141423
if (operation === 'snooze_conversation' && snoozed_until) {
1415-
cleanParams.snoozed_until = Number(snoozed_until)
1424+
cleanParams.snoozed_until = toSnoozeTimestamp(snoozed_until)
14161425
}
14171426

14181427
if (operation === 'close_conversation' && close_body) {
@@ -1701,7 +1710,7 @@ export const IntercomV2Block: BlockConfig = {
17011710
}
17021711

17031712
if (operation === 'snooze_conversation' && snoozed_until) {
1704-
cleanParams.snoozed_until = Number(snoozed_until)
1713+
cleanParams.snoozed_until = toSnoozeTimestamp(snoozed_until)
17051714
}
17061715

17071716
if (operation === 'close_conversation' && close_body) {

‎apps/sim/blocks/blocks/pipedrive.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
448448
{ label: 'Open', id: 'open' },
449449
{ label: 'Completed', id: 'completed' },
450450
{ label: 'Canceled', id: 'canceled' },
451+
{ label: 'Deleted', id: 'deleted' },
451452
],
452453
value: () => '',
453454
condition: { field: 'operation', value: ['get_projects'] },

‎apps/sim/blocks/blocks/zendesk.ts‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ Return ONLY the JSON array - no explanations.`,
556556
placeholder: 'Organization name',
557557
required: {
558558
field: 'operation',
559-
value: ['autocomplete_organizations'],
559+
value: ['autocomplete_organizations', 'create_organization'],
560560
},
561561
condition: {
562562
field: 'operation',
@@ -917,22 +917,23 @@ Return ONLY the search query - no explanations.`,
917917
},
918918
job_id: { type: 'string', description: 'Background job ID for bulk and merge operations' },
919919
ticket_id: {
920-
type: 'number',
921-
description: 'Ticket ID (get_ticket, create_ticket, update_ticket; string for delete_ticket)',
920+
type: 'any',
921+
description:
922+
'Ticket ID: a number from get, create, and update ticket; a string from delete ticket',
922923
},
923924
target_ticket_id: {
924925
type: 'string',
925926
description: 'Ticket the source tickets were merged into (merge_tickets)',
926927
},
927928
user_id: {
928-
type: 'number',
929+
type: 'any',
929930
description:
930-
'User ID (get_user, get_current_user, create_user, update_user; string for delete_user)',
931+
'User ID: a number from get, current, create, and update user; a string from delete user',
931932
},
932933
organization_id: {
933-
type: 'number',
934+
type: 'any',
934935
description:
935-
'Organization ID (get_organization, create_organization, update_organization; string for delete_organization)',
936+
'Organization ID: a number from get, create, and update organization; a string from delete organization',
936937
},
937938
// Delete operations
938939
deleted: {

‎apps/sim/tools/generated/tool-metadata.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/generated/tool-outputs.ts‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎apps/sim/tools/pipedrive/create_lead.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const pipedriveCreateLeadTool: ToolConfig<
8383
required: false,
8484
visibility: 'user-or-llm',
8585
description:
86-
"Visibility group: 1 (owner only / owner & followers), 3 (owner's visibility group / entire company), 5 (owner's group and sub-groups), 7 (entire company); 5 and 7 are Premium/Ultimate only",
86+
"Visibility group; meanings depend on the Pipedrive plan. Light, Growth, and Professional: 1 = owner & followers, 3 = entire company. Premium and Ultimate: 1 = owner only, 3 = owner's visibility group, 5 = owner's visibility group and sub-groups, 7 = entire company",
8787
},
8888
},
8989

‎apps/sim/tools/pipedrive/get_pipelines.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,13 @@ export const pipedriveGetPipelinesTool: ToolConfig<
129129
type: 'number',
130130
description: 'Always null: API v2 pages with next_cursor instead of an offset',
131131
optional: true,
132+
nullable: true,
132133
},
133134
next_cursor: {
134135
type: 'string',
135-
description: 'Cursor for fetching the next page',
136+
description: 'Cursor for fetching the next page; null on the last page',
136137
optional: true,
138+
nullable: true,
137139
},
138140
success: { type: 'boolean', description: 'Operation success status' },
139141
},

‎apps/sim/tools/pipedrive/types.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ interface PipedriveFile {
259259
id: number
260260
name: string
261261
file_name: string
262+
file_type: string
262263
file_size: number
263264
add_time: string
264265
update_time: string
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { zendeskSearchTool } from '@/tools/zendesk/search'
3+
4+
const sentQuery = (query: string) => {
5+
const build = zendeskSearchTool.request.url
6+
if (typeof build !== 'function') throw new Error('Zendesk search URL is built per request')
7+
const url = build({
8+
subdomain: 'acme',
9+
email: 'agent@example.com',
10+
apiToken: 'token',
11+
query,
12+
filterType: 'ticket',
13+
})
14+
return new URL(url).searchParams.get('query')
15+
}
16+
17+
describe('Zendesk search export query', () => {
18+
it('drops a standalone type filter, which the export endpoint rejects', () => {
19+
expect(sentQuery('type:ticket status:open')).toBe('status:open')
20+
})
21+
22+
it('keeps type: text inside a quoted phrase', () => {
23+
expect(sentQuery('subject:"unexpected type:widget" status:open')).toBe(
24+
'subject:"unexpected type:widget" status:open'
25+
)
26+
})
27+
28+
it('keeps the ticket_type keyword', () => {
29+
expect(sentQuery('ticket_type:incident')).toBe('ticket_type:incident')
30+
})
31+
})

0 commit comments

Comments
 (0)