diff --git a/apps/docs/content/docs/en/tools/incidentio.mdx b/apps/docs/content/docs/en/tools/incidentio.mdx index 595eda032..3476d3535 100644 --- a/apps/docs/content/docs/en/tools/incidentio.mdx +++ b/apps/docs/content/docs/en/tools/incidentio.mdx @@ -234,7 +234,6 @@ List actions from incident.io. Optionally filter by incident ID. | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | incident.io API Key | | `incident_id` | string | No | Filter actions by incident ID \(e.g., "01FCNDV6P870EA6S7TK1DSYDG0"\) | -| `page_size` | number | No | Number of actions to return per page \(e.g., 10, 25, 50\) | #### Output @@ -309,7 +308,6 @@ List follow-ups from incident.io. Optionally filter by incident ID. | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | incident.io API Key | | `incident_id` | string | No | Filter follow-ups by incident ID \(e.g., "01FCNDV6P870EA6S7TK1DSYDG0"\) | -| `page_size` | number | No | Number of follow-ups to return per page \(e.g., 10, 25, 50\) | #### Output @@ -396,6 +394,7 @@ List all users in your Incident.io workspace. Returns user details including id, | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | Incident.io API Key | | `page_size` | number | No | Number of results to return per page \(e.g., 10, 25, 50\). Default: 25 | +| `after` | string | No | Pagination cursor to fetch the next page of results | #### Output @@ -406,6 +405,10 @@ List all users in your Incident.io workspace. Returns user details including id, | ↳ `name` | string | Full name of the user | | ↳ `email` | string | Email address of the user | | ↳ `role` | string | Role of the user in the workspace | +| `pagination_meta` | object | Pagination metadata | +| ↳ `after` | string | Cursor for next page | +| ↳ `page_size` | number | Number of items per page | +| ↳ `total_record_count` | number | Total number of records | ### `incidentio_users_show` @@ -644,7 +647,6 @@ List all escalation policies in incident.io | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `apiKey` | string | Yes | incident.io API Key | -| `page_size` | number | No | Number of results per page \(e.g., 10, 25, 50\). Default: 25 | #### Output diff --git a/apps/docs/content/docs/en/tools/pipedrive.mdx b/apps/docs/content/docs/en/tools/pipedrive.mdx index 28b8f723b..f25abe6e9 100644 --- a/apps/docs/content/docs/en/tools/pipedrive.mdx +++ b/apps/docs/content/docs/en/tools/pipedrive.mdx @@ -49,6 +49,7 @@ Retrieve all deals from Pipedrive with optional filters | `pipeline_id` | string | No | If supplied, only deals in the specified pipeline are returned \(e.g., "1"\) | | `updated_since` | string | No | If set, only deals updated after this time are returned. Format: 2025-01-01T10:20:00Z | | `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 500\) | +| `cursor` | string | No | For pagination, the marker representing the first item on the next page | #### Output @@ -74,6 +75,8 @@ Retrieve all deals from Pipedrive with optional filters | `metadata` | object | Pagination metadata for the response | | ↳ `total_items` | number | Total number of items | | ↳ `has_more` | boolean | Whether more items are available | +| ↳ `next_cursor` | string | Cursor for fetching the next page \(v2 endpoints\) | +| ↳ `next_start` | number | Offset for fetching the next page \(v1 endpoints\) | | `success` | boolean | Operation success status | ### `pipedrive_get_deal` @@ -148,10 +151,8 @@ Retrieve files from Pipedrive with optional filters | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | -| `deal_id` | string | No | Filter files by deal ID \(e.g., "123"\) | -| `person_id` | string | No | Filter files by person ID \(e.g., "456"\) | -| `org_id` | string | No | Filter files by organization ID \(e.g., "789"\) | -| `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 500\) | +| `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 | #### Output @@ -171,6 +172,8 @@ Retrieve files from Pipedrive with optional filters | ↳ `url` | string | File download URL | | `downloadedFiles` | file[] | Downloaded files from Pipedrive | | `total_items` | number | Total number of files returned | +| `has_more` | boolean | Whether more files are available | +| `next_start` | number | Offset for fetching the next page | | `success` | boolean | Operation success status | ### `pipedrive_get_mail_messages` @@ -183,6 +186,7 @@ Retrieve mail threads from Pipedrive mailbox | --------- | ---- | -------- | ----------- | | `folder` | string | No | Filter by folder: inbox, drafts, sent, archive \(default: inbox\) | | `limit` | string | No | Number of results to return \(e.g., "25", default: 50\) | +| `start` | string | No | Pagination start offset \(0-based index of the first item to return\) | #### Output @@ -190,6 +194,8 @@ Retrieve mail threads from Pipedrive mailbox | --------- | ---- | ----------- | | `messages` | array | Array of mail thread objects from Pipedrive mailbox | | `total_items` | number | Total number of mail threads returned | +| `has_more` | boolean | Whether more messages are available | +| `next_start` | number | Offset for fetching the next page | | `success` | boolean | Operation success status | ### `pipedrive_get_mail_thread` @@ -221,7 +227,7 @@ Retrieve all pipelines from Pipedrive | `sort_by` | string | No | Field to sort by: id, update_time, add_time \(default: id\) | | `sort_direction` | string | No | Sorting direction: asc, desc \(default: asc\) | | `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 500\) | -| `cursor` | string | No | For pagination, the marker representing the first item on the next page | +| `start` | string | No | Pagination start offset \(0-based index of the first item to return\) | #### Output @@ -237,6 +243,8 @@ Retrieve all pipelines from Pipedrive | ↳ `add_time` | string | When the pipeline was created | | ↳ `update_time` | string | When the pipeline was last updated | | `total_items` | number | Total number of pipelines returned | +| `has_more` | boolean | Whether more pipelines are available | +| `next_start` | number | Offset for fetching the next page | | `success` | boolean | Operation success status | ### `pipedrive_get_pipeline_deals` @@ -249,8 +257,8 @@ Retrieve all deals in a specific pipeline | --------- | ---- | -------- | ----------- | | `pipeline_id` | string | Yes | The ID of the pipeline \(e.g., "1"\) | | `stage_id` | string | No | Filter by specific stage within the pipeline \(e.g., "2"\) | -| `status` | string | No | Filter by deal status: open, won, lost | | `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 500\) | +| `start` | string | No | Pagination start offset \(0-based index of the first item to return\) | #### Output @@ -271,6 +279,7 @@ Retrieve all projects or a specific project from Pipedrive | `project_id` | string | No | Optional: ID of a specific project to retrieve \(e.g., "123"\) | | `status` | string | No | Filter by project status: open, completed, deleted \(only for listing all\) | | `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 500, only for listing all\) | +| `cursor` | string | No | For pagination, the marker representing the first item on the next page | #### Output @@ -279,6 +288,8 @@ Retrieve all projects or a specific project from Pipedrive | `projects` | array | Array of project objects \(when listing all\) | | `project` | object | Single project object \(when project_id is provided\) | | `total_items` | number | Total number of projects returned | +| `has_more` | boolean | Whether more projects are available | +| `next_cursor` | string | Cursor for fetching the next page | | `success` | boolean | Operation success status | ### `pipedrive_create_project` @@ -309,12 +320,11 @@ Retrieve activities (tasks) from Pipedrive with optional filters | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | -| `deal_id` | string | No | Filter activities by deal ID \(e.g., "123"\) | -| `person_id` | string | No | Filter activities by person ID \(e.g., "456"\) | -| `org_id` | string | No | Filter activities by organization ID \(e.g., "789"\) | +| `user_id` | string | No | Filter activities by user ID \(e.g., "123"\) | | `type` | string | No | Filter by activity type \(call, meeting, task, deadline, email, lunch\) | | `done` | string | No | Filter by completion status: 0 for not done, 1 for done | | `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 500\) | +| `start` | string | No | Pagination start offset \(0-based index of the first item to return\) | #### Output @@ -335,6 +345,8 @@ Retrieve activities (tasks) from Pipedrive with optional filters | ↳ `add_time` | string | When the activity was created | | ↳ `update_time` | string | When the activity was last updated | | `total_items` | number | Total number of activities returned | +| `has_more` | boolean | Whether more activities are available | +| `next_start` | number | Offset for fetching the next page | | `success` | boolean | Operation success status | ### `pipedrive_create_activity` @@ -399,6 +411,7 @@ Retrieve all leads or a specific lead from Pipedrive | `person_id` | string | No | Filter by person ID \(e.g., "456"\) | | `organization_id` | string | No | Filter by organization ID \(e.g., "789"\) | | `limit` | string | No | Number of results to return \(e.g., "50", default: 100, max: 500\) | +| `start` | string | No | Pagination start offset \(0-based index of the first item to return\) | #### Output @@ -433,6 +446,8 @@ Retrieve all leads or a specific lead from Pipedrive | ↳ `add_time` | string | When the lead was created \(ISO 8601\) | | ↳ `update_time` | string | When the lead was last updated \(ISO 8601\) | | `total_items` | number | Total number of leads returned | +| `has_more` | boolean | Whether more leads are available | +| `next_start` | number | Offset for fetching the next page | | `success` | boolean | Operation success status | ### `pipedrive_create_lead` diff --git a/apps/docs/content/docs/en/tools/supabase.mdx b/apps/docs/content/docs/en/tools/supabase.mdx index 089def746..a076f4e5e 100644 --- a/apps/docs/content/docs/en/tools/supabase.mdx +++ b/apps/docs/content/docs/en/tools/supabase.mdx @@ -57,6 +57,7 @@ Query data from a Supabase table | `filter` | string | No | PostgREST filter \(e.g., "id=eq.123"\) | | `orderBy` | string | No | Column to order by \(add DESC for descending\) | | `limit` | number | No | Maximum number of rows to return | +| `offset` | number | No | Number of rows to skip \(for pagination\) | | `apiKey` | string | Yes | Your Supabase service role secret key | #### Output @@ -211,6 +212,7 @@ Perform full-text search on a Supabase table | `searchType` | string | No | Search type: plain, phrase, or websearch \(default: websearch\) | | `language` | string | No | Language for text search configuration \(default: english\) | | `limit` | number | No | Maximum number of rows to return | +| `offset` | number | No | Number of rows to skip \(for pagination\) | | `apiKey` | string | Yes | Your Supabase service role secret key | #### Output diff --git a/apps/docs/content/docs/en/tools/typeform.mdx b/apps/docs/content/docs/en/tools/typeform.mdx index dc364b260..b8a7e97e5 100644 --- a/apps/docs/content/docs/en/tools/typeform.mdx +++ b/apps/docs/content/docs/en/tools/typeform.mdx @@ -43,6 +43,8 @@ Retrieve form responses from Typeform | `formId` | string | Yes | Typeform form ID \(e.g., "abc123XYZ"\) | | `apiKey` | string | Yes | Typeform Personal Access Token | | `pageSize` | number | No | Number of responses to retrieve \(e.g., 10, 25, 50\) | +| `before` | string | No | Cursor token for fetching the next page of older responses | +| `after` | string | No | Cursor token for fetching the next page of newer responses | | `since` | string | No | Retrieve responses submitted after this date \(e.g., "2024-01-01T00:00:00Z"\) | | `until` | string | No | Retrieve responses submitted before this date \(e.g., "2024-12-31T23:59:59Z"\) | | `completed` | string | No | Filter by completion status \(e.g., "true", "false", "all"\) | diff --git a/apps/docs/content/docs/en/tools/zendesk.mdx b/apps/docs/content/docs/en/tools/zendesk.mdx index d01a0660a..06b11c19b 100644 --- a/apps/docs/content/docs/en/tools/zendesk.mdx +++ b/apps/docs/content/docs/en/tools/zendesk.mdx @@ -67,10 +67,9 @@ Retrieve a list of tickets from Zendesk with optional filtering | `type` | string | No | Filter by type: "problem", "incident", "question", or "task" | | `assigneeId` | string | No | Filter by assignee user ID as a numeric string \(e.g., "12345"\) | | `organizationId` | string | No | Filter by organization ID as a numeric string \(e.g., "67890"\) | -| `sortBy` | string | No | Sort field: "created_at", "updated_at", "priority", or "status" | -| `sortOrder` | string | No | Sort order: "asc" or "desc" | +| `sort` | string | No | Sort field for ticket listing \(only applies without filters\): "updated_at", "id", or "status". Prefix with "-" for descending \(e.g., "-updated_at"\) | | `perPage` | string | No | Results per page as a number string \(default: "100", max: "100"\) | -| `page` | string | No | Page number as a string \(e.g., "1", "2"\) | +| `pageAfter` | string | No | Cursor from a previous response to fetch the next page of results | #### Output @@ -129,10 +128,10 @@ Retrieve a list of tickets from Zendesk with optional filtering | ↳ `from_messaging_channel` | boolean | Whether the ticket originated from a messaging channel | | ↳ `ticket_form_id` | number | Ticket form ID | | ↳ `generated_timestamp` | number | Unix timestamp of the ticket generation | -| `paging` | object | Pagination information | +| `paging` | object | Cursor-based pagination information | +| ↳ `after_cursor` | string | Cursor for fetching the next page of results | +| ↳ `has_more` | boolean | Whether more results are available | | ↳ `next_page` | string | URL for next page of results | -| ↳ `previous_page` | string | URL for previous page of results | -| ↳ `count` | number | Total count of items | | `metadata` | object | Response metadata | | ↳ `total_returned` | number | Number of items returned in this response | | ↳ `has_more` | boolean | Whether more items are available | @@ -515,7 +514,7 @@ Retrieve a list of users from Zendesk with optional filtering | `role` | string | No | Filter by role: "end-user", "agent", or "admin" | | `permissionSet` | string | No | Filter by permission set ID as a numeric string \(e.g., "12345"\) | | `perPage` | string | No | Results per page as a number string \(default: "100", max: "100"\) | -| `page` | string | No | Page number as a string \(e.g., "1", "2"\) | +| `pageAfter` | string | No | Cursor from a previous response to fetch the next page of results | #### Output @@ -563,10 +562,10 @@ Retrieve a list of users from Zendesk with optional filtering | ↳ `shared` | boolean | Whether the user is shared from a different Zendesk | | ↳ `shared_agent` | boolean | Whether the agent is shared from a different Zendesk | | ↳ `remote_photo_url` | string | URL to a remote photo | -| `paging` | object | Pagination information | +| `paging` | object | Cursor-based pagination information | +| ↳ `after_cursor` | string | Cursor for fetching the next page of results | +| ↳ `has_more` | boolean | Whether more results are available | | ↳ `next_page` | string | URL for next page of results | -| ↳ `previous_page` | string | URL for previous page of results | -| ↳ `count` | number | Total count of items | | `metadata` | object | Response metadata | | ↳ `total_returned` | number | Number of items returned in this response | | ↳ `has_more` | boolean | Whether more items are available | @@ -706,7 +705,7 @@ Search for users in Zendesk using a query string | `query` | string | No | Search query string \(e.g., user name or email\) | | `externalId` | string | No | External ID to search by \(your system identifier\) | | `perPage` | string | No | Results per page as a number string \(default: "100", max: "100"\) | -| `page` | string | No | Page number as a string \(e.g., "1", "2"\) | +| `page` | string | No | Page number for pagination \(1-based\) | #### Output @@ -754,10 +753,10 @@ Search for users in Zendesk using a query string | ↳ `shared` | boolean | Whether the user is shared from a different Zendesk | | ↳ `shared_agent` | boolean | Whether the agent is shared from a different Zendesk | | ↳ `remote_photo_url` | string | URL to a remote photo | -| `paging` | object | Pagination information | +| `paging` | object | Cursor-based pagination information | +| ↳ `after_cursor` | string | Cursor for fetching the next page of results | +| ↳ `has_more` | boolean | Whether more results are available | | ↳ `next_page` | string | URL for next page of results | -| ↳ `previous_page` | string | URL for previous page of results | -| ↳ `count` | number | Total count of items | | `metadata` | object | Response metadata | | ↳ `total_returned` | number | Number of items returned in this response | | ↳ `has_more` | boolean | Whether more items are available | @@ -999,7 +998,7 @@ Retrieve a list of organizations from Zendesk | `apiToken` | string | Yes | Zendesk API token | | `subdomain` | string | Yes | Your Zendesk subdomain \(e.g., "mycompany" for mycompany.zendesk.com\) | | `perPage` | string | No | Results per page as a number string \(default: "100", max: "100"\) | -| `page` | string | No | Page number as a string \(e.g., "1", "2"\) | +| `pageAfter` | string | No | Cursor from a previous response to fetch the next page of results | #### Output @@ -1020,10 +1019,10 @@ Retrieve a list of organizations from Zendesk | ↳ `created_at` | string | When the organization was created \(ISO 8601 format\) | | ↳ `updated_at` | string | When the organization was last updated \(ISO 8601 format\) | | ↳ `external_id` | string | External ID for linking to external records | -| `paging` | object | Pagination information | +| `paging` | object | Cursor-based pagination information | +| ↳ `after_cursor` | string | Cursor for fetching the next page of results | +| ↳ `has_more` | boolean | Whether more results are available | | ↳ `next_page` | string | URL for next page of results | -| ↳ `previous_page` | string | URL for previous page of results | -| ↳ `count` | number | Total count of items | | `metadata` | object | Response metadata | | ↳ `total_returned` | number | Number of items returned in this response | | ↳ `has_more` | boolean | Whether more items are available | @@ -1075,7 +1074,7 @@ Autocomplete organizations in Zendesk by name prefix (for name matching/autocomp | `subdomain` | string | Yes | Your Zendesk subdomain | | `name` | string | Yes | Organization name prefix to search for \(e.g., "Acme"\) | | `perPage` | string | No | Results per page as a number string \(default: "100", max: "100"\) | -| `page` | string | No | Page number as a string \(e.g., "1", "2"\) | +| `page` | string | No | Page number for pagination \(1-based\) | #### Output @@ -1096,10 +1095,10 @@ Autocomplete organizations in Zendesk by name prefix (for name matching/autocomp | ↳ `created_at` | string | When the organization was created \(ISO 8601 format\) | | ↳ `updated_at` | string | When the organization was last updated \(ISO 8601 format\) | | ↳ `external_id` | string | External ID for linking to external records | -| `paging` | object | Pagination information | +| `paging` | object | Cursor-based pagination information | +| ↳ `after_cursor` | string | Cursor for fetching the next page of results | +| ↳ `has_more` | boolean | Whether more results are available | | ↳ `next_page` | string | URL for next page of results | -| ↳ `previous_page` | string | URL for previous page of results | -| ↳ `count` | number | Total count of items | | `metadata` | object | Response metadata | | ↳ `total_returned` | number | Number of items returned in this response | | ↳ `has_more` | boolean | Whether more items are available | @@ -1249,19 +1248,18 @@ Unified search across tickets, users, and organizations in Zendesk | `apiToken` | string | Yes | Zendesk API token | | `subdomain` | string | Yes | Your Zendesk subdomain | | `query` | string | Yes | Search query string using Zendesk search syntax \(e.g., "type:ticket status:open"\) | -| `sortBy` | string | No | Sort field: "relevance", "created_at", "updated_at", "priority", "status", or "ticket_type" | -| `sortOrder` | string | No | Sort order: "asc" or "desc" | +| `filterType` | string | Yes | Resource type to search for: "ticket", "user", "organization", or "group" | | `perPage` | string | No | Results per page as a number string \(default: "100", max: "100"\) | -| `page` | string | No | Page number as a string \(e.g., "1", "2"\) | +| `pageAfter` | string | No | Cursor from a previous response to fetch the next page of results | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `paging` | object | Pagination information | +| `paging` | object | Cursor-based pagination information | +| ↳ `after_cursor` | string | Cursor for fetching the next page of results | +| ↳ `has_more` | boolean | Whether more results are available | | ↳ `next_page` | string | URL for next page of results | -| ↳ `previous_page` | string | URL for previous page of results | -| ↳ `count` | number | Total count of items | | `metadata` | object | Response metadata | | ↳ `total_returned` | number | Number of items returned in this response | | ↳ `has_more` | boolean | Whether more items are available | diff --git a/apps/sim/app/api/tools/pipedrive/get-files/route.ts b/apps/sim/app/api/tools/pipedrive/get-files/route.ts index 93111c94b..aab219d94 100644 --- a/apps/sim/app/api/tools/pipedrive/get-files/route.ts +++ b/apps/sim/app/api/tools/pipedrive/get-files/route.ts @@ -22,15 +22,19 @@ interface PipedriveFile { interface PipedriveApiResponse { success: boolean data?: PipedriveFile[] + additional_data?: { + pagination?: { + more_items_in_collection: boolean + next_start: number + } + } error?: string } const PipedriveGetFilesSchema = z.object({ accessToken: z.string().min(1, 'Access token is required'), - deal_id: z.string().optional().nullable(), - person_id: z.string().optional().nullable(), - org_id: z.string().optional().nullable(), limit: z.string().optional().nullable(), + start: z.string().optional().nullable(), downloadFiles: z.boolean().optional().default(false), }) @@ -54,20 +58,18 @@ export async function POST(request: NextRequest) { const body = await request.json() const validatedData = PipedriveGetFilesSchema.parse(body) - const { accessToken, deal_id, person_id, org_id, limit, downloadFiles } = validatedData + const { accessToken, limit, start, downloadFiles } = validatedData const baseUrl = 'https://api.pipedrive.com/v1/files' const queryParams = new URLSearchParams() - if (deal_id) queryParams.append('deal_id', deal_id) - if (person_id) queryParams.append('person_id', person_id) - if (org_id) queryParams.append('org_id', org_id) if (limit) queryParams.append('limit', limit) + if (start) queryParams.append('start', start) const queryString = queryParams.toString() const apiUrl = queryString ? `${baseUrl}?${queryString}` : baseUrl - logger.info(`[${requestId}] Fetching files from Pipedrive`, { deal_id, person_id, org_id }) + logger.info(`[${requestId}] Fetching files from Pipedrive`) const urlValidation = await validateUrlWithDNS(apiUrl, 'apiUrl') if (!urlValidation.isValid) { @@ -93,6 +95,8 @@ export async function POST(request: NextRequest) { } const files = data.data || [] + const hasMore = data.additional_data?.pagination?.more_items_in_collection || false + const nextStart = data.additional_data?.pagination?.next_start ?? null const downloadedFiles: Array<{ name: string mimeType: string @@ -149,6 +153,8 @@ export async function POST(request: NextRequest) { files, downloadedFiles: downloadedFiles.length > 0 ? downloadedFiles : undefined, total_items: files.length, + has_more: hasMore, + next_start: nextStart, success: true, }, }) diff --git a/apps/sim/blocks/blocks/incidentio.ts b/apps/sim/blocks/blocks/incidentio.ts index 31f743258..0959e3176 100644 --- a/apps/sim/blocks/blocks/incidentio.ts +++ b/apps/sim/blocks/blocks/incidentio.ts @@ -92,12 +92,9 @@ export const IncidentioBlock: BlockConfig = { field: 'operation', value: [ 'incidentio_incidents_list', - 'incidentio_actions_list', - 'incidentio_follow_ups_list', 'incidentio_users_list', 'incidentio_workflows_list', 'incidentio_schedules_list', - 'incidentio_escalations_list', 'incidentio_incident_updates_list', 'incidentio_schedule_entries_list', ], @@ -113,6 +110,7 @@ export const IncidentioBlock: BlockConfig = { field: 'operation', value: [ 'incidentio_incidents_list', + 'incidentio_users_list', 'incidentio_workflows_list', 'incidentio_schedules_list', 'incidentio_incident_updates_list', diff --git a/apps/sim/blocks/blocks/pipedrive.ts b/apps/sim/blocks/blocks/pipedrive.ts index 22d81d782..614986089 100644 --- a/apps/sim/blocks/blocks/pipedrive.ts +++ b/apps/sim/blocks/blocks/pipedrive.ts @@ -215,32 +215,11 @@ 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: 'deal_id', - title: 'Deal ID', - type: 'short-input', - placeholder: 'Filter by deal ID ', - condition: { field: 'operation', value: ['get_files'] }, - }, - { - id: 'person_id', - title: 'Person ID', - type: 'short-input', - placeholder: 'Filter by person ID ', - condition: { field: 'operation', value: ['get_files'] }, - }, - { - id: 'org_id', - title: 'Organization ID', - type: 'short-input', - placeholder: 'Filter by organization ID ', - condition: { field: 'operation', value: ['get_files'] }, - }, { id: 'limit', title: 'Limit', type: 'short-input', - placeholder: 'Number of results (default 100, max 500)', + placeholder: 'Number of results (default 100, max 100)', condition: { field: 'operation', value: ['get_files'] }, }, { @@ -305,8 +284,28 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n id: 'cursor', title: 'Cursor', type: 'short-input', - placeholder: 'Pagination cursor (optional)', - condition: { field: 'operation', value: ['get_pipelines'] }, + placeholder: 'Pagination cursor from previous response', + condition: { + field: 'operation', + value: ['get_all_deals', 'get_projects'], + }, + }, + { + id: 'start', + title: 'Start (Offset)', + type: 'short-input', + placeholder: 'Pagination offset (e.g., 0, 100, 200)', + condition: { + field: 'operation', + value: [ + 'get_activities', + 'get_leads', + 'get_files', + 'get_pipeline_deals', + 'get_mail_messages', + 'get_pipelines', + ], + }, }, { id: 'pipeline_id', @@ -323,19 +322,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n placeholder: 'Filter by stage ID ', condition: { field: 'operation', value: ['get_pipeline_deals'] }, }, - { - id: 'status', - title: 'Status', - type: 'dropdown', - options: [ - { label: 'All', id: '' }, - { label: 'Open', id: 'open' }, - { label: 'Won', id: 'won' }, - { label: 'Lost', id: 'lost' }, - ], - value: () => '', - condition: { field: 'operation', value: ['get_pipeline_deals'] }, - }, { id: 'limit', title: 'Limit', @@ -426,22 +412,29 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n id: 'deal_id', title: 'Deal ID', type: 'short-input', - placeholder: 'Filter by deal ID ', - condition: { field: 'operation', value: ['get_activities', 'create_activity'] }, + placeholder: 'Associated deal ID ', + condition: { field: 'operation', value: ['create_activity'] }, }, { id: 'person_id', title: 'Person ID', type: 'short-input', - placeholder: 'Filter by person ID ', - condition: { field: 'operation', value: ['get_activities', 'create_activity'] }, + placeholder: 'Associated person ID ', + condition: { field: 'operation', value: ['create_activity'] }, }, { id: 'org_id', title: 'Organization ID', type: 'short-input', - placeholder: 'Filter by organization ID ', - condition: { field: 'operation', value: ['get_activities', 'create_activity'] }, + placeholder: 'Associated organization ID ', + condition: { field: 'operation', value: ['create_activity'] }, + }, + { + id: 'user_id', + title: 'User ID', + type: 'short-input', + placeholder: 'Filter by user ID', + condition: { field: 'operation', value: ['get_activities'] }, }, { id: 'type', @@ -781,7 +774,8 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n thread_id: { type: 'string', description: 'Mail thread ID' }, sort_by: { type: 'string', description: 'Field to sort by' }, sort_direction: { type: 'string', description: 'Sorting direction' }, - cursor: { type: 'string', description: 'Pagination cursor' }, + cursor: { type: 'string', description: 'Pagination cursor (v2 endpoints)' }, + start: { type: 'string', description: 'Pagination start offset (v1 endpoints)' }, project_id: { type: 'string', description: 'Project ID' }, description: { type: 'string', description: 'Description' }, start_date: { type: 'string', description: 'Start date' }, @@ -793,12 +787,15 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n due_time: { type: 'string', description: 'Due time' }, duration: { type: 'string', description: 'Duration' }, done: { type: 'string', description: 'Completion status' }, + user_id: { type: 'string', description: 'User ID' }, note: { type: 'string', description: 'Notes' }, lead_id: { type: 'string', description: 'Lead ID' }, archived: { type: 'string', description: 'Archived status' }, value_amount: { type: 'string', description: 'Value amount' }, value_currency: { type: 'string', description: 'Value currency' }, is_archived: { type: 'string', description: 'Archive status' }, + organization_id: { type: 'string', description: 'Organization ID' }, + owner_id: { type: 'string', description: 'Owner user ID' }, }, outputs: { deals: { type: 'json', description: 'Array of deal objects' }, diff --git a/apps/sim/blocks/blocks/supabase.ts b/apps/sim/blocks/blocks/supabase.ts index 602111ffa..84ec3c0e3 100644 --- a/apps/sim/blocks/blocks/supabase.ts +++ b/apps/sim/blocks/blocks/supabase.ts @@ -445,6 +445,13 @@ Return ONLY the order by expression - no explanations, no extra text.`, placeholder: '100', condition: { field: 'operation', value: 'query' }, }, + { + id: 'offset', + title: 'Offset', + type: 'short-input', + placeholder: '0', + condition: { field: 'operation', value: 'query' }, + }, // Vector search operation fields { id: 'functionName', @@ -543,6 +550,13 @@ Return ONLY the order by expression - no explanations, no extra text.`, placeholder: '100', condition: { field: 'operation', value: 'text_search' }, }, + { + id: 'offset', + title: 'Offset', + type: 'short-input', + placeholder: '0', + condition: { field: 'operation', value: 'text_search' }, + }, // Count operation fields { id: 'filter', diff --git a/apps/sim/blocks/blocks/typeform.ts b/apps/sim/blocks/blocks/typeform.ts index 43536e463..f0c0a58de 100644 --- a/apps/sim/blocks/blocks/typeform.ts +++ b/apps/sim/blocks/blocks/typeform.ts @@ -66,6 +66,20 @@ export const TypeformBlock: BlockConfig = { placeholder: 'Number of responses per page (default: 25)', condition: { field: 'operation', value: 'typeform_responses' }, }, + { + id: 'before', + title: 'Before (Cursor)', + type: 'short-input', + placeholder: 'Cursor token from previous response for pagination', + condition: { field: 'operation', value: 'typeform_responses' }, + }, + { + id: 'after', + title: 'After (Cursor)', + type: 'short-input', + placeholder: 'Cursor token from previous response for newer results', + condition: { field: 'operation', value: 'typeform_responses' }, + }, { id: 'since', title: 'Since', @@ -380,6 +394,8 @@ Do not include any explanations, markdown formatting, or other text outside the apiKey: { type: 'string', description: 'Personal access token' }, // Response operation params pageSize: { type: 'number', description: 'Responses per page' }, + before: { type: 'string', description: 'Cursor token for fetching the next page' }, + after: { type: 'string', description: 'Cursor token for fetching newer results' }, since: { type: 'string', description: 'Start date filter' }, until: { type: 'string', description: 'End date filter' }, completed: { type: 'string', description: 'Completion status filter' }, diff --git a/apps/sim/blocks/blocks/zendesk.ts b/apps/sim/blocks/blocks/zendesk.ts index 687f87819..fa7735c52 100644 --- a/apps/sim/blocks/blocks/zendesk.ts +++ b/apps/sim/blocks/blocks/zendesk.ts @@ -444,33 +444,36 @@ Return ONLY the search query - no explanations.`, }, }, { - id: 'sortBy', - title: 'Sort By', + id: 'filterType', + title: 'Resource Type', type: 'dropdown', options: [ - { label: 'Relevance', id: 'relevance' }, - { label: 'Created At', id: 'created_at' }, - { label: 'Updated At', id: 'updated_at' }, - { label: 'Priority', id: 'priority' }, - { label: 'Status', id: 'status' }, - { label: 'Ticket Type', id: 'ticket_type' }, + { label: 'Ticket', id: 'ticket' }, + { label: 'User', id: 'user' }, + { label: 'Organization', id: 'organization' }, + { label: 'Group', id: 'group' }, ], + required: true, condition: { field: 'operation', value: ['search'], }, }, { - id: 'sortOrder', - title: 'Sort Order', + id: 'sort', + title: 'Sort', type: 'dropdown', options: [ - { label: 'Ascending', id: 'asc' }, - { label: 'Descending', id: 'desc' }, + { label: 'Updated At (Asc)', id: 'updated_at' }, + { label: 'Updated At (Desc)', id: '-updated_at' }, + { label: 'ID (Asc)', id: 'id' }, + { label: 'ID (Desc)', id: '-id' }, + { label: 'Status (Asc)', id: 'status' }, + { label: 'Status (Desc)', id: '-status' }, ], condition: { field: 'operation', - value: ['search'], + value: ['get_tickets'], }, }, // Pagination fields @@ -492,20 +495,25 @@ Return ONLY the search query - no explanations.`, }, }, { - id: 'page', - title: 'Page', + id: 'pageAfter', + title: 'Page After (Cursor)', type: 'short-input', - placeholder: 'Page number', + placeholder: 'Cursor from previous response (after_cursor)', + description: 'Cursor value from a previous response to fetch the next page of results', condition: { field: 'operation', - value: [ - 'get_tickets', - 'get_users', - 'get_organizations', - 'search_users', - 'autocomplete_organizations', - 'search', - ], + value: ['get_tickets', 'get_users', 'get_organizations', 'search'], + }, + }, + { + id: 'page', + title: 'Page Number', + type: 'short-input', + placeholder: 'Page number (default: 1)', + description: 'Page number for offset-based pagination', + condition: { + field: 'operation', + value: ['search_users', 'autocomplete_organizations'], }, }, ], @@ -624,6 +632,7 @@ Return ONLY the search query - no explanations.`, email: { type: 'string', description: 'Zendesk email address' }, apiToken: { type: 'string', description: 'Zendesk API token' }, subdomain: { type: 'string', description: 'Zendesk subdomain' }, + sort: { type: 'string', description: 'Sort field for ticket listing' }, }, outputs: { // Ticket operations - list @@ -665,8 +674,11 @@ Return ONLY the search query - no explanations.`, type: 'boolean', description: 'Deletion confirmation (delete_ticket, delete_user, delete_organization)', }, - // Pagination (shared across list operations) - paging: { type: 'json', description: 'Pagination information for list operations' }, + // Cursor-based pagination (shared across list operations) + paging: { + type: 'json', + description: 'Cursor-based pagination information (after_cursor, has_more)', + }, // Metadata (shared across all operations) metadata: { type: 'json', description: 'Operation metadata including operation type' }, }, diff --git a/apps/sim/tools/incidentio/actions_list.ts b/apps/sim/tools/incidentio/actions_list.ts index ddfaa41f4..35e2fe02c 100644 --- a/apps/sim/tools/incidentio/actions_list.ts +++ b/apps/sim/tools/incidentio/actions_list.ts @@ -26,12 +26,6 @@ export const actionsListTool: ToolConfig< visibility: 'user-or-llm', description: 'Filter actions by incident ID (e.g., "01FCNDV6P870EA6S7TK1DSYDG0")', }, - page_size: { - type: 'number', - required: false, - visibility: 'user-or-llm', - description: 'Number of actions to return per page (e.g., 10, 25, 50)', - }, }, request: { @@ -42,10 +36,6 @@ export const actionsListTool: ToolConfig< url.searchParams.append('incident_id', params.incident_id) } - if (params.page_size) { - url.searchParams.append('page_size', params.page_size.toString()) - } - return url.toString() }, method: 'GET', diff --git a/apps/sim/tools/incidentio/escalations_list.ts b/apps/sim/tools/incidentio/escalations_list.ts index d09ad9528..5d5f76f7b 100644 --- a/apps/sim/tools/incidentio/escalations_list.ts +++ b/apps/sim/tools/incidentio/escalations_list.ts @@ -20,22 +20,10 @@ export const escalationsListTool: ToolConfig< visibility: 'user-only', description: 'incident.io API Key', }, - page_size: { - type: 'number', - required: false, - visibility: 'user-or-llm', - description: 'Number of results per page (e.g., 10, 25, 50). Default: 25', - }, }, request: { - url: (params) => { - const url = new URL('https://api.incident.io/v2/escalations') - if (params.page_size) { - url.searchParams.append('page_size', params.page_size.toString()) - } - return url.toString() - }, + url: () => 'https://api.incident.io/v2/escalations', method: 'GET', headers: (params) => ({ 'Content-Type': 'application/json', diff --git a/apps/sim/tools/incidentio/follow_ups_list.ts b/apps/sim/tools/incidentio/follow_ups_list.ts index be6a55669..603547b43 100644 --- a/apps/sim/tools/incidentio/follow_ups_list.ts +++ b/apps/sim/tools/incidentio/follow_ups_list.ts @@ -26,12 +26,6 @@ export const followUpsListTool: ToolConfig< visibility: 'user-or-llm', description: 'Filter follow-ups by incident ID (e.g., "01FCNDV6P870EA6S7TK1DSYDG0")', }, - page_size: { - type: 'number', - required: false, - visibility: 'user-or-llm', - description: 'Number of follow-ups to return per page (e.g., 10, 25, 50)', - }, }, request: { @@ -42,10 +36,6 @@ export const followUpsListTool: ToolConfig< url.searchParams.append('incident_id', params.incident_id) } - if (params.page_size) { - url.searchParams.append('page_size', params.page_size.toString()) - } - return url.toString() }, method: 'GET', diff --git a/apps/sim/tools/incidentio/types.ts b/apps/sim/tools/incidentio/types.ts index b342de3a1..356803adc 100644 --- a/apps/sim/tools/incidentio/types.ts +++ b/apps/sim/tools/incidentio/types.ts @@ -396,7 +396,6 @@ export interface IncidentioIncidentsUpdateResponse extends ToolResponse { // Action types export interface IncidentioActionsListParams extends IncidentioBaseParams { incident_id?: string - page_size?: number } export interface IncidentioAction { @@ -446,7 +445,6 @@ export interface IncidentioActionsShowResponse extends ToolResponse { // Follow-up types export interface IncidentioFollowUpsListParams extends IncidentioBaseParams { incident_id?: string - page_size?: number } export interface IncidentioFollowUp { @@ -664,6 +662,7 @@ export interface CustomFieldsDeleteResponse extends ToolResponse { // Users list tool types export interface IncidentioUsersListParams extends IncidentioBaseParams { page_size?: number + after?: string } export interface IncidentioUser { @@ -676,6 +675,11 @@ export interface IncidentioUser { export interface IncidentioUsersListResponse extends ToolResponse { output: { users: IncidentioUser[] + pagination_meta?: { + after: string + page_size: number + total_record_count?: number + } } } @@ -786,9 +790,7 @@ export type IncidentioResponse = | IncidentioEscalationPathsDeleteResponse // Escalations types -export interface IncidentioEscalationsListParams extends IncidentioBaseParams { - page_size?: number -} +export interface IncidentioEscalationsListParams extends IncidentioBaseParams {} export interface IncidentioEscalation { id: string diff --git a/apps/sim/tools/incidentio/users_list.ts b/apps/sim/tools/incidentio/users_list.ts index 226e5bd2d..cbf982911 100644 --- a/apps/sim/tools/incidentio/users_list.ts +++ b/apps/sim/tools/incidentio/users_list.ts @@ -1,6 +1,7 @@ -import type { - IncidentioUsersListParams, - IncidentioUsersListResponse, +import { + INCIDENTIO_PAGINATION_OUTPUT_PROPERTIES, + type IncidentioUsersListParams, + type IncidentioUsersListResponse, } from '@/tools/incidentio/types' import type { ToolConfig } from '@/tools/types' @@ -24,15 +25,27 @@ export const usersListTool: ToolConfig { - const baseUrl = 'https://api.incident.io/v2/users' + const url = new URL('https://api.incident.io/v2/users') + if (params.page_size) { - return `${baseUrl}?page_size=${params.page_size}` + url.searchParams.append('page_size', params.page_size.toString()) } - return baseUrl + + if (params.after) { + url.searchParams.append('after', params.after) + } + + return url.toString() }, method: 'GET', headers: (params) => ({ @@ -53,6 +66,13 @@ export const usersListTool: ToolConfig ({ accessToken: params.accessToken, - deal_id: params.deal_id, - person_id: params.person_id, - org_id: params.org_id, limit: params.limit, + start: params.start, downloadFiles: params.downloadFiles, }), }, @@ -79,6 +65,16 @@ export const pipedriveGetFilesTool: ToolConfig // Common Pipedrive types @@ -355,6 +365,7 @@ export interface PipedriveGetAllDealsParams { pipeline_id?: string updated_since?: string limit?: string + cursor?: string } export interface PipedriveGetAllDealsOutput { @@ -362,6 +373,7 @@ export interface PipedriveGetAllDealsOutput { metadata: { total_items: number has_more: boolean + next_cursor?: string } success: boolean } @@ -431,10 +443,8 @@ export interface PipedriveUpdateDealResponse extends ToolResponse { // GET Files export interface PipedriveGetFilesParams { accessToken: string - deal_id?: string - person_id?: string - org_id?: string limit?: string + start?: string downloadFiles?: boolean } @@ -442,6 +452,8 @@ export interface PipedriveGetFilesOutput { files: PipedriveFile[] downloadedFiles?: ToolFileData[] total_items: number + has_more?: boolean + next_start?: number success: boolean } @@ -453,11 +465,14 @@ export interface PipedriveGetMailMessagesParams { accessToken: string folder?: string limit?: string + start?: string } export interface PipedriveGetMailMessagesOutput { messages: PipedriveMailMessage[] total_items: number + has_more?: boolean + next_start?: number success: boolean } @@ -490,12 +505,14 @@ export interface PipedriveGetPipelinesParams { sort_by?: string sort_direction?: string limit?: string - cursor?: string + start?: string } export interface PipedriveGetPipelinesOutput { pipelines: PipedrivePipeline[] total_items: number + has_more?: boolean + next_start?: number success: boolean } @@ -508,8 +525,8 @@ export interface PipedriveGetPipelineDealsParams { accessToken: string pipeline_id: string stage_id?: string - status?: string limit?: string + start?: string } export interface PipedriveGetPipelineDealsOutput { @@ -517,6 +534,8 @@ export interface PipedriveGetPipelineDealsOutput { metadata: { pipeline_id: string total_items: number + has_more?: boolean + next_start?: number } success: boolean } @@ -531,12 +550,15 @@ export interface PipedriveGetProjectsParams { project_id?: string status?: string limit?: string + cursor?: string } export interface PipedriveGetProjectsOutput { projects?: PipedriveProject[] project?: PipedriveProject total_items?: number + has_more?: boolean + next_cursor?: string success: boolean } @@ -565,17 +587,18 @@ export interface PipedriveCreateProjectResponse extends ToolResponse { // GET All Activities export interface PipedriveGetActivitiesParams { accessToken: string - deal_id?: string - person_id?: string - org_id?: string + user_id?: string type?: string done?: string limit?: string + start?: string } export interface PipedriveGetActivitiesOutput { activities: PipedriveActivity[] total_items: number + has_more?: boolean + next_start?: number success: boolean } @@ -636,12 +659,15 @@ export interface PipedriveGetLeadsParams { person_id?: string organization_id?: string limit?: string + start?: string } export interface PipedriveGetLeadsOutput { leads?: PipedriveLead[] lead?: PipedriveLead total_items?: number + has_more?: boolean + next_start?: number success: boolean } diff --git a/apps/sim/tools/supabase/query.ts b/apps/sim/tools/supabase/query.ts index c72ba7252..95653bacc 100644 --- a/apps/sim/tools/supabase/query.ts +++ b/apps/sim/tools/supabase/query.ts @@ -51,6 +51,12 @@ export const queryTool: ToolConfig = visibility: 'user-or-llm', description: 'Maximum number of rows to return', }, + offset: { + type: 'number', + required: false, + visibility: 'user-or-llm', + description: 'Number of rows to skip (for pagination)', + }, apiKey: { type: 'string', required: true, @@ -91,10 +97,15 @@ export const queryTool: ToolConfig = } // Add limit if provided - if (params.limit) { + if (params.limit !== undefined && params.limit !== null) { url += `&limit=${Number(params.limit)}` } + // Add offset if provided + if (params.offset !== undefined && params.offset !== null) { + url += `&offset=${Number(params.offset)}` + } + return url }, method: 'GET', diff --git a/apps/sim/tools/supabase/text_search.ts b/apps/sim/tools/supabase/text_search.ts index add29afe6..d644c8989 100644 --- a/apps/sim/tools/supabase/text_search.ts +++ b/apps/sim/tools/supabase/text_search.ts @@ -57,6 +57,12 @@ export const textSearchTool: ToolConfig = { - plain: 'fts', + plain: 'plfts', phrase: 'phfts', websearch: 'wfts', } @@ -86,10 +92,15 @@ export const textSearchTool: ToolConfig { const queryParams = new URLSearchParams() queryParams.append('name', params.name) - if (params.page) queryParams.append('page', params.page) if (params.perPage) queryParams.append('per_page', params.perPage) + if (params.page) queryParams.append('page', params.page) const query = queryParams.toString() const url = buildZendeskUrl(params.subdomain, '/organizations/autocomplete') @@ -112,19 +111,22 @@ export const zendeskAutocompleteOrganizationsTool: ToolConfig< const data = await response.json() const organizations = data.organizations || [] + const hasMore = data.next_page !== null && data.next_page !== undefined return { success: true, output: { organizations, + // /organizations/autocomplete uses offset pagination (page/per_page), not cursor pagination. + // after_cursor is always null; use next_page URL or page param for subsequent pages. paging: { + after_cursor: null, + has_more: hasMore, next_page: data.next_page ?? null, - previous_page: data.previous_page ?? null, - count: data.count || organizations.length, }, metadata: { total_returned: organizations.length, - has_more: !!data.next_page, + has_more: hasMore, }, success: true, }, diff --git a/apps/sim/tools/zendesk/get_organizations.ts b/apps/sim/tools/zendesk/get_organizations.ts index 728f0b4b1..e5e6bbf84 100644 --- a/apps/sim/tools/zendesk/get_organizations.ts +++ b/apps/sim/tools/zendesk/get_organizations.ts @@ -1,6 +1,8 @@ import type { ToolConfig } from '@/tools/types' import { + appendCursorPaginationParams, buildZendeskUrl, + extractCursorPagingInfo, handleZendeskError, METADATA_OUTPUT, ORGANIZATIONS_ARRAY_OUTPUT, @@ -12,7 +14,7 @@ export interface ZendeskGetOrganizationsParams { apiToken: string subdomain: string perPage?: string - page?: string + pageAfter?: string } export interface ZendeskGetOrganizationsResponse { @@ -20,9 +22,8 @@ export interface ZendeskGetOrganizationsResponse { output: { organizations: any[] paging?: { - next_page?: string | null - previous_page?: string | null - count: number + after_cursor: string | null + has_more: boolean } metadata: { total_returned: number @@ -66,19 +67,18 @@ export const zendeskGetOrganizationsTool: ToolConfig< visibility: 'user-or-llm', description: 'Results per page as a number string (default: "100", max: "100")', }, - page: { + pageAfter: { type: 'string', required: false, visibility: 'user-or-llm', - description: 'Page number as a string (e.g., "1", "2")', + description: 'Cursor from a previous response to fetch the next page of results', }, }, request: { url: (params) => { const queryParams = new URLSearchParams() - if (params.page) queryParams.append('page', params.page) - if (params.perPage) queryParams.append('per_page', params.perPage) + appendCursorPaginationParams(queryParams, params) const query = queryParams.toString() const url = buildZendeskUrl(params.subdomain, '/organizations') @@ -103,19 +103,16 @@ export const zendeskGetOrganizationsTool: ToolConfig< const data = await response.json() const organizations = data.organizations || [] + const paging = extractCursorPagingInfo(data) return { success: true, output: { organizations, - paging: { - next_page: data.next_page ?? null, - previous_page: data.previous_page ?? null, - count: data.count || organizations.length, - }, + paging, metadata: { total_returned: organizations.length, - has_more: !!data.next_page, + has_more: paging.has_more, }, success: true, }, diff --git a/apps/sim/tools/zendesk/get_tickets.ts b/apps/sim/tools/zendesk/get_tickets.ts index fde19c325..ffda867b0 100644 --- a/apps/sim/tools/zendesk/get_tickets.ts +++ b/apps/sim/tools/zendesk/get_tickets.ts @@ -1,6 +1,8 @@ import type { ToolConfig } from '@/tools/types' import { + appendCursorPaginationParams, buildZendeskUrl, + extractCursorPagingInfo, handleZendeskError, METADATA_OUTPUT, PAGING_OUTPUT, @@ -16,10 +18,9 @@ export interface ZendeskGetTicketsParams { type?: string assigneeId?: string organizationId?: string - sortBy?: string - sortOrder?: string + sort?: string perPage?: string - page?: string + pageAfter?: string } export interface ZendeskGetTicketsResponse { @@ -27,9 +28,8 @@ export interface ZendeskGetTicketsResponse { output: { tickets: any[] paging?: { - next_page?: string | null - previous_page?: string | null - count: number + after_cursor: string | null + has_more: boolean } metadata: { total_returned: number @@ -95,17 +95,12 @@ export const zendeskGetTicketsTool: ToolConfig { const queryParams = new URLSearchParams() queryParams.append('query', params.query) - if (params.sortBy) queryParams.append('sort_by', params.sortBy) - if (params.sortOrder) queryParams.append('sort_order', params.sortOrder) - if (params.page) queryParams.append('page', params.page) - if (params.perPage) queryParams.append('per_page', params.perPage) + queryParams.append('filter[type]', params.filterType) + appendCursorPaginationParams(queryParams, params) const query = queryParams.toString() - const url = buildZendeskUrl(params.subdomain, '/search') + const url = buildZendeskUrl(params.subdomain, '/search/export') return `${url}?${query}` }, method: 'GET', @@ -125,19 +116,16 @@ export const zendeskSearchTool: ToolConfig): ZendeskPagingInfo { + const meta = (data.meta as Record) || {} + const links = (data.links as Record) || {} + return { + after_cursor: (meta.after_cursor as string) ?? null, + has_more: Boolean(meta.has_more), + next_page: (links.next as string) ?? null, + } +} + /** * Output definition for the "via" object in ticket responses. * Contains information about how the ticket was created. @@ -377,13 +403,13 @@ export const ORGANIZATION_OUTPUT_PROPERTIES = { * Pagination output properties for list endpoints */ export const PAGING_OUTPUT_PROPERTIES = { - next_page: { type: 'string', description: 'URL for next page of results', optional: true }, - previous_page: { + after_cursor: { type: 'string', - description: 'URL for previous page of results', + description: 'Cursor for fetching the next page of results', optional: true, }, - count: { type: 'number', description: 'Total count of items' }, + has_more: { type: 'boolean', description: 'Whether more results are available' }, + next_page: { type: 'string', description: 'URL for next page of results', optional: true }, } as const satisfies Record /** @@ -391,7 +417,7 @@ export const PAGING_OUTPUT_PROPERTIES = { */ export const PAGING_OUTPUT: OutputProperty = { type: 'object', - description: 'Pagination information', + description: 'Cursor-based pagination information', properties: PAGING_OUTPUT_PROPERTIES, }