Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/docs/content/docs/en/tools/pipedrive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ Retrieve files from Pipedrive with optional filters

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `sort` | string | No | Sort files by field \(supported: "id", "update_time"\) |
| `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 100\) |
| `start` | string | No | Pagination start offset \(0-based index of the first item to return\) |
| `downloadFiles` | boolean | No | Download file contents into file outputs |
Expand Down
4 changes: 3 additions & 1 deletion apps/sim/app/api/tools/pipedrive/get-files/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ interface PipedriveApiResponse {

const PipedriveGetFilesSchema = z.object({
accessToken: z.string().min(1, 'Access token is required'),
sort: z.string().optional().nullable(),
Comment thread
waleedlatif1 marked this conversation as resolved.
Outdated
limit: z.string().optional().nullable(),
start: z.string().optional().nullable(),
downloadFiles: z.boolean().optional().default(false),
Expand All @@ -58,11 +59,12 @@ export async function POST(request: NextRequest) {
const body = await request.json()
const validatedData = PipedriveGetFilesSchema.parse(body)

const { accessToken, limit, start, downloadFiles } = validatedData
const { accessToken, sort, limit, start, downloadFiles } = validatedData

const baseUrl = 'https://api.pipedrive.com/v1/files'
const queryParams = new URLSearchParams()

if (sort) queryParams.append('sort', sort)
Comment thread
waleedlatif1 marked this conversation as resolved.
if (limit) queryParams.append('limit', limit)
if (start) queryParams.append('start', start)

Expand Down
11 changes: 11 additions & 0 deletions apps/sim/blocks/blocks/pipedrive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
placeholder: 'New deal title ',
condition: { field: 'operation', value: ['update_deal'] },
},
{
id: 'sort',
title: 'Sort By',
type: 'dropdown',
options: [
{ label: 'ID', id: 'id' },
{ label: 'Update Time', id: 'update_time' },
],
value: () => 'id',
condition: { field: 'operation', value: ['get_files'] },
},
{
id: 'limit',
title: 'Limit',
Expand Down
7 changes: 7 additions & 0 deletions apps/sim/tools/pipedrive/get_files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ export const pipedriveGetFilesTool: ToolConfig<PipedriveGetFilesParams, Pipedriv
visibility: 'hidden',
description: 'The access token for the Pipedrive API',
},
sort: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Sort files by field (supported: "id", "update_time")',
},
limit: {
type: 'string',
required: false,
Expand Down Expand Up @@ -44,6 +50,7 @@ export const pipedriveGetFilesTool: ToolConfig<PipedriveGetFilesParams, Pipedriv
}),
body: (params) => ({
accessToken: params.accessToken,
sort: params.sort,
limit: params.limit,
start: params.start,
downloadFiles: params.downloadFiles,
Expand Down
1 change: 1 addition & 0 deletions apps/sim/tools/pipedrive/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ export interface PipedriveUpdateDealResponse extends ToolResponse {
// GET Files
export interface PipedriveGetFilesParams {
accessToken: string
sort?: string
limit?: string
start?: string
downloadFiles?: boolean
Expand Down
16 changes: 8 additions & 8 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"glob": "13.0.0",
"husky": "9.1.7",
"lint-staged": "16.0.0",
"turbo": "2.8.3"
"turbo": "2.8.9"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,css,scss}": [
Expand Down