Skip to content

Commit a0afb5d

Browse files
authored
feat(pipedrive): added sort order to endpoints that support it, upgraded turborepo (#3237)
* feat(pipedrive): added sort order to endpoints that support it * upgraded turborepo * fix
1 parent cdacb79 commit a0afb5d

File tree

7 files changed

+32
-10
lines changed

7 files changed

+32
-10
lines changed

apps/docs/content/docs/en/tools/pipedrive.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ Retrieve files from Pipedrive with optional filters
151151

152152
| Parameter | Type | Required | Description |
153153
| --------- | ---- | -------- | ----------- |
154+
| `sort` | string | No | Sort files by field \(supported: "id", "update_time"\) |
154155
| `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 100\) |
155156
| `start` | string | No | Pagination start offset \(0-based index of the first item to return\) |
156157
| `downloadFiles` | boolean | No | Download file contents into file outputs |

apps/sim/app/api/tools/pipedrive/get-files/route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ interface PipedriveApiResponse {
3333

3434
const PipedriveGetFilesSchema = z.object({
3535
accessToken: z.string().min(1, 'Access token is required'),
36+
sort: z.enum(['id', 'update_time']).optional().nullable(),
3637
limit: z.string().optional().nullable(),
3738
start: z.string().optional().nullable(),
3839
downloadFiles: z.boolean().optional().default(false),
@@ -58,11 +59,12 @@ export async function POST(request: NextRequest) {
5859
const body = await request.json()
5960
const validatedData = PipedriveGetFilesSchema.parse(body)
6061

61-
const { accessToken, limit, start, downloadFiles } = validatedData
62+
const { accessToken, sort, limit, start, downloadFiles } = validatedData
6263

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

67+
if (sort) queryParams.append('sort', sort)
6668
if (limit) queryParams.append('limit', limit)
6769
if (start) queryParams.append('start', start)
6870

apps/sim/blocks/blocks/pipedrive.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,17 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
215215
placeholder: 'New deal title ',
216216
condition: { field: 'operation', value: ['update_deal'] },
217217
},
218+
{
219+
id: 'sort',
220+
title: 'Sort By',
221+
type: 'dropdown',
222+
options: [
223+
{ label: 'ID', id: 'id' },
224+
{ label: 'Update Time', id: 'update_time' },
225+
],
226+
value: () => 'id',
227+
condition: { field: 'operation', value: ['get_files'] },
228+
},
218229
{
219230
id: 'limit',
220231
title: 'Limit',

apps/sim/tools/pipedrive/get_files.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ export const pipedriveGetFilesTool: ToolConfig<PipedriveGetFilesParams, Pipedriv
1616
visibility: 'hidden',
1717
description: 'The access token for the Pipedrive API',
1818
},
19+
sort: {
20+
type: 'string',
21+
required: false,
22+
visibility: 'user-or-llm',
23+
description: 'Sort files by field (supported: "id", "update_time")',
24+
},
1925
limit: {
2026
type: 'string',
2127
required: false,
@@ -44,6 +50,7 @@ export const pipedriveGetFilesTool: ToolConfig<PipedriveGetFilesParams, Pipedriv
4450
}),
4551
body: (params) => ({
4652
accessToken: params.accessToken,
53+
sort: params.sort,
4754
limit: params.limit,
4855
start: params.start,
4956
downloadFiles: params.downloadFiles,

apps/sim/tools/pipedrive/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ export interface PipedriveUpdateDealResponse extends ToolResponse {
443443
// GET Files
444444
export interface PipedriveGetFilesParams {
445445
accessToken: string
446+
sort?: string
446447
limit?: string
447448
start?: string
448449
downloadFiles?: boolean

bun.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"glob": "13.0.0",
4343
"husky": "9.1.7",
4444
"lint-staged": "16.0.0",
45-
"turbo": "2.8.3"
45+
"turbo": "2.8.9"
4646
},
4747
"lint-staged": {
4848
"*.{js,jsx,ts,tsx,json,css,scss}": [

0 commit comments

Comments
 (0)