mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-18 02:11:59 -05:00
feat(pagination): update pagination for remaining integrations that support it (#3233)
* feat(pagination): update pagination for remaining integrations that support it * fixed remaining * ack comments
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"\) |
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -92,12 +92,9 @@ export const IncidentioBlock: BlockConfig<IncidentioResponse> = {
|
||||
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<IncidentioResponse> = {
|
||||
field: 'operation',
|
||||
value: [
|
||||
'incidentio_incidents_list',
|
||||
'incidentio_users_list',
|
||||
'incidentio_workflows_list',
|
||||
'incidentio_schedules_list',
|
||||
'incidentio_incident_updates_list',
|
||||
|
||||
@@ -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' },
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -66,6 +66,20 @@ export const TypeformBlock: BlockConfig<TypeformResponse> = {
|
||||
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' },
|
||||
|
||||
@@ -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' },
|
||||
},
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<IncidentioUsersListParams, IncidentioUser
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of results to return per page (e.g., 10, 25, 50). Default: 25',
|
||||
},
|
||||
after: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Pagination cursor to fetch the next page of results',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
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<IncidentioUsersListParams, IncidentioUser
|
||||
email: user.email,
|
||||
role: user.role,
|
||||
})),
|
||||
pagination_meta: data.pagination_meta
|
||||
? {
|
||||
after: data.pagination_meta.after,
|
||||
page_size: data.pagination_meta.page_size,
|
||||
total_record_count: data.pagination_meta.total_record_count,
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -71,5 +91,11 @@ export const usersListTool: ToolConfig<IncidentioUsersListParams, IncidentioUser
|
||||
},
|
||||
},
|
||||
},
|
||||
pagination_meta: {
|
||||
type: 'object',
|
||||
description: 'Pagination metadata',
|
||||
optional: true,
|
||||
properties: INCIDENTIO_PAGINATION_OUTPUT_PROPERTIES,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -24,23 +24,11 @@ export const pipedriveGetActivitiesTool: ToolConfig<
|
||||
visibility: 'hidden',
|
||||
description: 'The access token for the Pipedrive API',
|
||||
},
|
||||
deal_id: {
|
||||
user_id: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter activities by deal ID (e.g., "123")',
|
||||
},
|
||||
person_id: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter activities by person ID (e.g., "456")',
|
||||
},
|
||||
org_id: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter activities by organization ID (e.g., "789")',
|
||||
description: 'Filter activities by user ID (e.g., "123")',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
@@ -60,6 +48,12 @@ export const pipedriveGetActivitiesTool: ToolConfig<
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of results to return (e.g., "50", default: 100, max: 500)',
|
||||
},
|
||||
start: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Pagination start offset (0-based index of the first item to return)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
@@ -67,12 +61,11 @@ export const pipedriveGetActivitiesTool: ToolConfig<
|
||||
const baseUrl = 'https://api.pipedrive.com/v1/activities'
|
||||
const queryParams = new URLSearchParams()
|
||||
|
||||
if (params.deal_id) queryParams.append('deal_id', params.deal_id)
|
||||
if (params.person_id) queryParams.append('person_id', params.person_id)
|
||||
if (params.org_id) queryParams.append('org_id', params.org_id)
|
||||
if (params.user_id) queryParams.append('user_id', params.user_id)
|
||||
if (params.type) queryParams.append('type', params.type)
|
||||
if (params.done) queryParams.append('done', params.done)
|
||||
if (params.limit) queryParams.append('limit', params.limit)
|
||||
if (params.start) queryParams.append('start', params.start)
|
||||
|
||||
const queryString = queryParams.toString()
|
||||
return queryString ? `${baseUrl}?${queryString}` : baseUrl
|
||||
@@ -99,12 +92,16 @@ export const pipedriveGetActivitiesTool: ToolConfig<
|
||||
}
|
||||
|
||||
const activities = data.data || []
|
||||
const hasMore = data.additional_data?.pagination?.more_items_in_collection || false
|
||||
const nextStart = data.additional_data?.pagination?.next_start ?? null
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
activities,
|
||||
total_items: activities.length,
|
||||
has_more: hasMore,
|
||||
next_start: nextStart,
|
||||
success: true,
|
||||
},
|
||||
}
|
||||
@@ -120,6 +117,16 @@ export const pipedriveGetActivitiesTool: ToolConfig<
|
||||
},
|
||||
},
|
||||
total_items: { type: 'number', description: 'Total number of activities returned' },
|
||||
has_more: {
|
||||
type: 'boolean',
|
||||
description: 'Whether more activities are available',
|
||||
optional: true,
|
||||
},
|
||||
next_start: {
|
||||
type: 'number',
|
||||
description: 'Offset for fetching the next page',
|
||||
optional: true,
|
||||
},
|
||||
success: { type: 'boolean', description: 'Operation success status' },
|
||||
},
|
||||
}
|
||||
|
||||
@@ -67,6 +67,12 @@ export const pipedriveGetAllDealsTool: ToolConfig<
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of results to return (e.g., "50", default: 100, max: 500)',
|
||||
},
|
||||
cursor: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'For pagination, the marker representing the first item on the next page',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
@@ -81,6 +87,7 @@ export const pipedriveGetAllDealsTool: ToolConfig<
|
||||
if (params.pipeline_id) queryParams.append('pipeline_id', params.pipeline_id)
|
||||
if (params.updated_since) queryParams.append('updated_since', params.updated_since)
|
||||
if (params.limit) queryParams.append('limit', params.limit)
|
||||
if (params.cursor) queryParams.append('cursor', params.cursor)
|
||||
|
||||
const queryString = queryParams.toString()
|
||||
return queryString ? `${baseUrl}?${queryString}` : baseUrl
|
||||
@@ -107,7 +114,8 @@ export const pipedriveGetAllDealsTool: ToolConfig<
|
||||
}
|
||||
|
||||
const deals = data.data || []
|
||||
const hasMore = data.additional_data?.pagination?.more_items_in_collection || false
|
||||
const nextCursor = data.additional_data?.next_cursor ?? null
|
||||
const hasMore = nextCursor !== null
|
||||
|
||||
return {
|
||||
success: true,
|
||||
@@ -116,6 +124,7 @@ export const pipedriveGetAllDealsTool: ToolConfig<
|
||||
metadata: {
|
||||
total_items: deals.length,
|
||||
has_more: hasMore,
|
||||
next_cursor: nextCursor,
|
||||
},
|
||||
success: true,
|
||||
},
|
||||
|
||||
@@ -16,29 +16,17 @@ export const pipedriveGetFilesTool: ToolConfig<PipedriveGetFilesParams, Pipedriv
|
||||
visibility: 'hidden',
|
||||
description: 'The access token for the Pipedrive API',
|
||||
},
|
||||
deal_id: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter files by deal ID (e.g., "123")',
|
||||
},
|
||||
person_id: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter files by person ID (e.g., "456")',
|
||||
},
|
||||
org_id: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter files by organization ID (e.g., "789")',
|
||||
},
|
||||
limit: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of results to return (e.g., "50", default: 100, max: 500)',
|
||||
description: 'Number of results to return (e.g., "50", default: 100, max: 100)',
|
||||
},
|
||||
start: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Pagination start offset (0-based index of the first item to return)',
|
||||
},
|
||||
downloadFiles: {
|
||||
type: 'boolean',
|
||||
@@ -56,10 +44,8 @@ export const pipedriveGetFilesTool: ToolConfig<PipedriveGetFilesParams, Pipedriv
|
||||
}),
|
||||
body: (params) => ({
|
||||
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<PipedriveGetFilesParams, Pipedriv
|
||||
optional: true,
|
||||
},
|
||||
total_items: { type: 'number', description: 'Total number of files returned' },
|
||||
has_more: {
|
||||
type: 'boolean',
|
||||
description: 'Whether more files are available',
|
||||
optional: true,
|
||||
},
|
||||
next_start: {
|
||||
type: 'number',
|
||||
description: 'Offset for fetching the next page',
|
||||
optional: true,
|
||||
},
|
||||
success: { type: 'boolean', description: 'Operation success status' },
|
||||
},
|
||||
}
|
||||
|
||||
@@ -60,6 +60,12 @@ export const pipedriveGetLeadsTool: ToolConfig<PipedriveGetLeadsParams, Pipedriv
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of results to return (e.g., "50", default: 100, max: 500)',
|
||||
},
|
||||
start: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Pagination start offset (0-based index of the first item to return)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
@@ -81,6 +87,7 @@ export const pipedriveGetLeadsTool: ToolConfig<PipedriveGetLeadsParams, Pipedriv
|
||||
if (params.person_id) queryParams.append('person_id', params.person_id)
|
||||
if (params.organization_id) queryParams.append('organization_id', params.organization_id)
|
||||
if (params.limit) queryParams.append('limit', params.limit)
|
||||
if (params.start) queryParams.append('start', params.start)
|
||||
|
||||
const queryString = queryParams.toString()
|
||||
return queryString ? `${baseUrl}?${queryString}` : baseUrl
|
||||
@@ -119,12 +126,19 @@ export const pipedriveGetLeadsTool: ToolConfig<PipedriveGetLeadsParams, Pipedriv
|
||||
|
||||
// Otherwise, return list of leads
|
||||
const leads = data.data || []
|
||||
// Leads endpoint puts pagination fields directly on additional_data (no .pagination wrapper)
|
||||
const hasMore = data.additional_data?.more_items_in_collection || false
|
||||
const currentStart = data.additional_data?.start ?? 0
|
||||
const currentLimit = data.additional_data?.limit ?? leads.length
|
||||
const nextStart = hasMore ? currentStart + currentLimit : null
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
leads,
|
||||
total_items: leads.length,
|
||||
has_more: hasMore,
|
||||
next_start: nextStart,
|
||||
success: true,
|
||||
},
|
||||
}
|
||||
@@ -151,6 +165,16 @@ export const pipedriveGetLeadsTool: ToolConfig<PipedriveGetLeadsParams, Pipedriv
|
||||
description: 'Total number of leads returned',
|
||||
optional: true,
|
||||
},
|
||||
has_more: {
|
||||
type: 'boolean',
|
||||
description: 'Whether more leads are available',
|
||||
optional: true,
|
||||
},
|
||||
next_start: {
|
||||
type: 'number',
|
||||
description: 'Offset for fetching the next page',
|
||||
optional: true,
|
||||
},
|
||||
success: { type: 'boolean', description: 'Operation success status' },
|
||||
},
|
||||
}
|
||||
|
||||
@@ -40,6 +40,12 @@ export const pipedriveGetMailMessagesTool: ToolConfig<
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of results to return (e.g., "25", default: 50)',
|
||||
},
|
||||
start: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Pagination start offset (0-based index of the first item to return)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
@@ -49,6 +55,7 @@ export const pipedriveGetMailMessagesTool: ToolConfig<
|
||||
|
||||
if (params.folder) queryParams.append('folder', params.folder)
|
||||
if (params.limit) queryParams.append('limit', params.limit)
|
||||
if (params.start) queryParams.append('start', params.start)
|
||||
|
||||
const queryString = queryParams.toString()
|
||||
return queryString ? `${baseUrl}?${queryString}` : baseUrl
|
||||
@@ -75,12 +82,16 @@ export const pipedriveGetMailMessagesTool: ToolConfig<
|
||||
}
|
||||
|
||||
const threads = data.data || []
|
||||
const hasMore = data.additional_data?.pagination?.more_items_in_collection || false
|
||||
const nextStart = data.additional_data?.pagination?.next_start ?? null
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
messages: threads,
|
||||
total_items: threads.length,
|
||||
has_more: hasMore,
|
||||
next_start: nextStart,
|
||||
success: true,
|
||||
},
|
||||
}
|
||||
@@ -89,6 +100,16 @@ export const pipedriveGetMailMessagesTool: ToolConfig<
|
||||
outputs: {
|
||||
messages: { type: 'array', description: 'Array of mail thread objects from Pipedrive mailbox' },
|
||||
total_items: { type: 'number', description: 'Total number of mail threads returned' },
|
||||
has_more: {
|
||||
type: 'boolean',
|
||||
description: 'Whether more messages are available',
|
||||
optional: true,
|
||||
},
|
||||
next_start: {
|
||||
type: 'number',
|
||||
description: 'Offset for fetching the next page',
|
||||
optional: true,
|
||||
},
|
||||
success: { type: 'boolean', description: 'Operation success status' },
|
||||
},
|
||||
}
|
||||
|
||||
@@ -35,18 +35,18 @@ export const pipedriveGetPipelineDealsTool: ToolConfig<
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter by specific stage within the pipeline (e.g., "2")',
|
||||
},
|
||||
status: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter by deal status: open, won, lost',
|
||||
},
|
||||
limit: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of results to return (e.g., "50", default: 100, max: 500)',
|
||||
},
|
||||
start: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Pagination start offset (0-based index of the first item to return)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
@@ -55,8 +55,8 @@ export const pipedriveGetPipelineDealsTool: ToolConfig<
|
||||
const queryParams = new URLSearchParams()
|
||||
|
||||
if (params.stage_id) queryParams.append('stage_id', params.stage_id)
|
||||
if (params.status) queryParams.append('status', params.status)
|
||||
if (params.limit) queryParams.append('limit', params.limit)
|
||||
if (params.start) queryParams.append('start', params.start)
|
||||
|
||||
const queryString = queryParams.toString()
|
||||
return queryString ? `${baseUrl}?${queryString}` : baseUrl
|
||||
@@ -83,6 +83,8 @@ export const pipedriveGetPipelineDealsTool: ToolConfig<
|
||||
}
|
||||
|
||||
const deals = data.data || []
|
||||
const hasMore = data.additional_data?.pagination?.more_items_in_collection || false
|
||||
const nextStart = data.additional_data?.pagination?.next_start ?? null
|
||||
|
||||
return {
|
||||
success: true,
|
||||
@@ -91,6 +93,8 @@ export const pipedriveGetPipelineDealsTool: ToolConfig<
|
||||
metadata: {
|
||||
pipeline_id: params?.pipeline_id || '',
|
||||
total_items: deals.length,
|
||||
has_more: hasMore,
|
||||
next_start: nextStart,
|
||||
},
|
||||
success: true,
|
||||
},
|
||||
|
||||
@@ -42,11 +42,11 @@ export const pipedriveGetPipelinesTool: ToolConfig<
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of results to return (e.g., "50", default: 100, max: 500)',
|
||||
},
|
||||
cursor: {
|
||||
start: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'For pagination, the marker representing the first item on the next page',
|
||||
description: 'Pagination start offset (0-based index of the first item to return)',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -58,7 +58,7 @@ export const pipedriveGetPipelinesTool: ToolConfig<
|
||||
if (params.sort_by) queryParams.append('sort_by', params.sort_by)
|
||||
if (params.sort_direction) queryParams.append('sort_direction', params.sort_direction)
|
||||
if (params.limit) queryParams.append('limit', params.limit)
|
||||
if (params.cursor) queryParams.append('cursor', params.cursor)
|
||||
if (params.start) queryParams.append('start', params.start)
|
||||
|
||||
const queryString = queryParams.toString()
|
||||
return queryString ? `${baseUrl}?${queryString}` : baseUrl
|
||||
@@ -85,12 +85,16 @@ export const pipedriveGetPipelinesTool: ToolConfig<
|
||||
}
|
||||
|
||||
const pipelines = data.data || []
|
||||
const hasMore = data.additional_data?.pagination?.more_items_in_collection || false
|
||||
const nextStart = data.additional_data?.pagination?.next_start ?? null
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
pipelines,
|
||||
total_items: pipelines.length,
|
||||
has_more: hasMore,
|
||||
next_start: nextStart,
|
||||
success: true,
|
||||
},
|
||||
}
|
||||
@@ -106,6 +110,16 @@ export const pipedriveGetPipelinesTool: ToolConfig<
|
||||
},
|
||||
},
|
||||
total_items: { type: 'number', description: 'Total number of pipelines returned' },
|
||||
has_more: {
|
||||
type: 'boolean',
|
||||
description: 'Whether more pipelines are available',
|
||||
optional: true,
|
||||
},
|
||||
next_start: {
|
||||
type: 'number',
|
||||
description: 'Offset for fetching the next page',
|
||||
optional: true,
|
||||
},
|
||||
success: { type: 'boolean', description: 'Operation success status' },
|
||||
},
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ export const pipedriveGetProjectsTool: ToolConfig<
|
||||
description:
|
||||
'Number of results to return (e.g., "50", default: 100, max: 500, only for listing all)',
|
||||
},
|
||||
cursor: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'For pagination, the marker representing the first item on the next page',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
@@ -57,6 +63,7 @@ export const pipedriveGetProjectsTool: ToolConfig<
|
||||
|
||||
if (params.status) queryParams.append('status', params.status)
|
||||
if (params.limit) queryParams.append('limit', params.limit)
|
||||
if (params.cursor) queryParams.append('cursor', params.cursor)
|
||||
|
||||
const queryString = queryParams.toString()
|
||||
return queryString ? `${baseUrl}?${queryString}` : baseUrl
|
||||
@@ -95,12 +102,16 @@ export const pipedriveGetProjectsTool: ToolConfig<
|
||||
|
||||
// Otherwise, return list of projects
|
||||
const projects = data.data || []
|
||||
const nextCursor = data.additional_data?.next_cursor ?? null
|
||||
const hasMore = nextCursor !== null
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
projects,
|
||||
total_items: projects.length,
|
||||
has_more: hasMore,
|
||||
next_cursor: nextCursor,
|
||||
success: true,
|
||||
},
|
||||
}
|
||||
@@ -122,6 +133,16 @@ export const pipedriveGetProjectsTool: ToolConfig<
|
||||
description: 'Total number of projects returned',
|
||||
optional: true,
|
||||
},
|
||||
has_more: {
|
||||
type: 'boolean',
|
||||
description: 'Whether more projects are available',
|
||||
optional: true,
|
||||
},
|
||||
next_cursor: {
|
||||
type: 'string',
|
||||
description: 'Cursor for fetching the next page',
|
||||
optional: true,
|
||||
},
|
||||
success: { type: 'boolean', description: 'Operation success status' },
|
||||
},
|
||||
}
|
||||
|
||||
@@ -239,6 +239,16 @@ export const PIPEDRIVE_MAIL_MESSAGE_OUTPUT: OutputProperty = {
|
||||
export const PIPEDRIVE_METADATA_OUTPUT_PROPERTIES = {
|
||||
total_items: { type: 'number', description: 'Total number of items' },
|
||||
has_more: { type: 'boolean', description: 'Whether more items are available', optional: true },
|
||||
next_cursor: {
|
||||
type: 'string',
|
||||
description: 'Cursor for fetching the next page (v2 endpoints)',
|
||||
optional: true,
|
||||
},
|
||||
next_start: {
|
||||
type: 'number',
|
||||
description: 'Offset for fetching the next page (v1 endpoints)',
|
||||
optional: true,
|
||||
},
|
||||
} as const satisfies Record<string, OutputProperty>
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,12 @@ export const queryTool: ToolConfig<SupabaseQueryParams, SupabaseQueryResponse> =
|
||||
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<SupabaseQueryParams, SupabaseQueryResponse> =
|
||||
}
|
||||
|
||||
// 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',
|
||||
|
||||
@@ -57,6 +57,12 @@ export const textSearchTool: ToolConfig<SupabaseTextSearchParams, SupabaseTextSe
|
||||
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,
|
||||
@@ -75,7 +81,7 @@ export const textSearchTool: ToolConfig<SupabaseTextSearchParams, SupabaseTextSe
|
||||
|
||||
// Map search types to PostgREST operators
|
||||
const operatorMap: Record<string, string> = {
|
||||
plain: 'fts',
|
||||
plain: 'plfts',
|
||||
phrase: 'phfts',
|
||||
websearch: 'wfts',
|
||||
}
|
||||
@@ -86,10 +92,15 @@ export const textSearchTool: ToolConfig<SupabaseTextSearchParams, SupabaseTextSe
|
||||
url += `&${params.column}=${operator}(${language}).${encodeURIComponent(params.query)}`
|
||||
|
||||
// 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',
|
||||
|
||||
@@ -315,6 +315,7 @@ export interface SupabaseQueryParams {
|
||||
filter?: string
|
||||
orderBy?: string
|
||||
limit?: number
|
||||
offset?: number
|
||||
}
|
||||
|
||||
export interface SupabaseInsertParams {
|
||||
@@ -413,6 +414,7 @@ export interface SupabaseTextSearchParams {
|
||||
searchType?: string
|
||||
language?: string
|
||||
limit?: number
|
||||
offset?: number
|
||||
}
|
||||
|
||||
export interface SupabaseTextSearchResponse extends SupabaseBaseResponse {}
|
||||
|
||||
@@ -26,6 +26,18 @@ export const responsesTool: ToolConfig<TypeformResponsesParams, TypeformResponse
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of responses to retrieve (e.g., 10, 25, 50)',
|
||||
},
|
||||
before: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Cursor token for fetching the next page of older responses',
|
||||
},
|
||||
after: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Cursor token for fetching the next page of newer responses',
|
||||
},
|
||||
since: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
@@ -56,6 +68,14 @@ export const responsesTool: ToolConfig<TypeformResponsesParams, TypeformResponse
|
||||
queryParams.push(`page_size=${Number(params.pageSize)}`)
|
||||
}
|
||||
|
||||
if (params.before) {
|
||||
queryParams.push(`before=${encodeURIComponent(params.before)}`)
|
||||
}
|
||||
|
||||
if (params.after) {
|
||||
queryParams.push(`after=${encodeURIComponent(params.after)}`)
|
||||
}
|
||||
|
||||
if (params.since) {
|
||||
queryParams.push(`since=${encodeURIComponent(params.since)}`)
|
||||
}
|
||||
|
||||
@@ -62,6 +62,8 @@ export interface TypeformResponsesParams {
|
||||
formId: string
|
||||
apiKey: string
|
||||
pageSize?: number
|
||||
before?: string
|
||||
after?: string
|
||||
since?: string
|
||||
until?: string
|
||||
completed?: string
|
||||
|
||||
@@ -21,9 +21,8 @@ export interface ZendeskAutocompleteOrganizationsResponse {
|
||||
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
|
||||
@@ -78,7 +77,7 @@ export const zendeskAutocompleteOrganizationsTool: ToolConfig<
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page number as a string (e.g., "1", "2")',
|
||||
description: 'Page number for pagination (1-based)',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -86,8 +85,8 @@ export const zendeskAutocompleteOrganizationsTool: ToolConfig<
|
||||
url: (params) => {
|
||||
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,
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
@@ -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<ZendeskGetTicketsParams, ZendeskG
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter by organization ID as a numeric string (e.g., "67890")',
|
||||
},
|
||||
sortBy: {
|
||||
sort: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Sort field: "created_at", "updated_at", "priority", or "status"',
|
||||
},
|
||||
sortOrder: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Sort order: "asc" or "desc"',
|
||||
description:
|
||||
'Sort field for ticket listing (only applies without filters): "updated_at", "id", or "status". Prefix with "-" for descending (e.g., "-updated_at")',
|
||||
},
|
||||
perPage: {
|
||||
type: 'string',
|
||||
@@ -113,11 +108,11 @@ export const zendeskGetTicketsTool: ToolConfig<ZendeskGetTicketsParams, ZendeskG
|
||||
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',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -142,20 +137,16 @@ export const zendeskGetTicketsTool: ToolConfig<ZendeskGetTicketsParams, ZendeskG
|
||||
|
||||
const queryParams = new URLSearchParams()
|
||||
queryParams.append('query', searchTerms.join(' '))
|
||||
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]', 'ticket')
|
||||
appendCursorPaginationParams(queryParams, params)
|
||||
|
||||
return `${buildZendeskUrl(params.subdomain, '/search')}?${queryParams.toString()}`
|
||||
return `${buildZendeskUrl(params.subdomain, '/search/export')}?${queryParams.toString()}`
|
||||
}
|
||||
|
||||
// No filters - use the simple /tickets endpoint
|
||||
// No filters - use the simple /tickets endpoint with cursor-based pagination
|
||||
const queryParams = new URLSearchParams()
|
||||
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)
|
||||
if (params.sort) queryParams.append('sort', params.sort)
|
||||
appendCursorPaginationParams(queryParams, params)
|
||||
|
||||
const query = queryParams.toString()
|
||||
const url = buildZendeskUrl(params.subdomain, '/tickets')
|
||||
@@ -182,19 +173,16 @@ export const zendeskGetTicketsTool: ToolConfig<ZendeskGetTicketsParams, ZendeskG
|
||||
const data = await response.json()
|
||||
// Handle both /tickets response (data.tickets) and /search response (data.results)
|
||||
const tickets = data.tickets || data.results || []
|
||||
const paging = extractCursorPagingInfo(data)
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
tickets,
|
||||
paging: {
|
||||
next_page: data.next_page ?? null,
|
||||
previous_page: data.previous_page ?? null,
|
||||
count: data.count || tickets.length,
|
||||
},
|
||||
paging,
|
||||
metadata: {
|
||||
total_returned: tickets.length,
|
||||
has_more: !!data.next_page,
|
||||
has_more: paging.has_more,
|
||||
},
|
||||
success: true,
|
||||
},
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
import {
|
||||
appendCursorPaginationParams,
|
||||
buildZendeskUrl,
|
||||
extractCursorPagingInfo,
|
||||
handleZendeskError,
|
||||
METADATA_OUTPUT,
|
||||
PAGING_OUTPUT,
|
||||
@@ -14,7 +16,7 @@ export interface ZendeskGetUsersParams {
|
||||
role?: string
|
||||
permissionSet?: string
|
||||
perPage?: string
|
||||
page?: string
|
||||
pageAfter?: string
|
||||
}
|
||||
|
||||
export interface ZendeskGetUsersResponse {
|
||||
@@ -22,9 +24,8 @@ export interface ZendeskGetUsersResponse {
|
||||
output: {
|
||||
users: any[]
|
||||
paging?: {
|
||||
next_page?: string | null
|
||||
previous_page?: string | null
|
||||
count: number
|
||||
after_cursor: string | null
|
||||
has_more: boolean
|
||||
}
|
||||
metadata: {
|
||||
total_returned: number
|
||||
@@ -77,11 +78,11 @@ export const zendeskGetUsersTool: ToolConfig<ZendeskGetUsersParams, ZendeskGetUs
|
||||
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',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -90,8 +91,7 @@ export const zendeskGetUsersTool: ToolConfig<ZendeskGetUsersParams, ZendeskGetUs
|
||||
const queryParams = new URLSearchParams()
|
||||
if (params.role) queryParams.append('role', params.role)
|
||||
if (params.permissionSet) queryParams.append('permission_set', params.permissionSet)
|
||||
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, '/users')
|
||||
@@ -116,19 +116,16 @@ export const zendeskGetUsersTool: ToolConfig<ZendeskGetUsersParams, ZendeskGetUs
|
||||
|
||||
const data = await response.json()
|
||||
const users = data.users || []
|
||||
const paging = extractCursorPagingInfo(data)
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
users,
|
||||
paging: {
|
||||
next_page: data.next_page ?? null,
|
||||
previous_page: data.previous_page ?? null,
|
||||
count: data.count || users.length,
|
||||
},
|
||||
paging,
|
||||
metadata: {
|
||||
total_returned: users.length,
|
||||
has_more: !!data.next_page,
|
||||
has_more: paging.has_more,
|
||||
},
|
||||
success: true,
|
||||
},
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
import {
|
||||
appendCursorPaginationParams,
|
||||
buildZendeskUrl,
|
||||
extractCursorPagingInfo,
|
||||
handleZendeskError,
|
||||
METADATA_OUTPUT,
|
||||
PAGING_OUTPUT,
|
||||
@@ -11,10 +13,9 @@ export interface ZendeskSearchParams {
|
||||
apiToken: string
|
||||
subdomain: string
|
||||
query: string
|
||||
sortBy?: string
|
||||
sortOrder?: string
|
||||
filterType: string
|
||||
perPage?: string
|
||||
page?: string
|
||||
pageAfter?: string
|
||||
}
|
||||
|
||||
export interface ZendeskSearchResponse {
|
||||
@@ -22,9 +23,8 @@ export interface ZendeskSearchResponse {
|
||||
output: {
|
||||
results: any[]
|
||||
paging?: {
|
||||
next_page?: string | null
|
||||
previous_page?: string | null
|
||||
count: number
|
||||
after_cursor: string | null
|
||||
has_more: boolean
|
||||
}
|
||||
metadata: {
|
||||
total_returned: number
|
||||
@@ -66,18 +66,11 @@ export const zendeskSearchTool: ToolConfig<ZendeskSearchParams, ZendeskSearchRes
|
||||
description:
|
||||
'Search query string using Zendesk search syntax (e.g., "type:ticket status:open")',
|
||||
},
|
||||
sortBy: {
|
||||
filterType: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Sort field: "relevance", "created_at", "updated_at", "priority", "status", or "ticket_type"',
|
||||
},
|
||||
sortOrder: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Sort order: "asc" or "desc"',
|
||||
description: 'Resource type to search for: "ticket", "user", "organization", or "group"',
|
||||
},
|
||||
perPage: {
|
||||
type: 'string',
|
||||
@@ -85,11 +78,11 @@ export const zendeskSearchTool: ToolConfig<ZendeskSearchParams, ZendeskSearchRes
|
||||
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',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -97,13 +90,11 @@ export const zendeskSearchTool: ToolConfig<ZendeskSearchParams, ZendeskSearchRes
|
||||
url: (params) => {
|
||||
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<ZendeskSearchParams, ZendeskSearchRes
|
||||
|
||||
const data = await response.json()
|
||||
const results = data.results || []
|
||||
const paging = extractCursorPagingInfo(data)
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
results,
|
||||
paging: {
|
||||
next_page: data.next_page ?? null,
|
||||
previous_page: data.previous_page ?? null,
|
||||
count: data.count || results.length,
|
||||
},
|
||||
paging,
|
||||
metadata: {
|
||||
total_returned: results.length,
|
||||
has_more: !!data.next_page,
|
||||
has_more: paging.has_more,
|
||||
},
|
||||
success: true,
|
||||
},
|
||||
|
||||
@@ -22,9 +22,8 @@ export interface ZendeskSearchUsersResponse {
|
||||
output: {
|
||||
users: any[]
|
||||
paging?: {
|
||||
next_page?: string | null
|
||||
previous_page?: string | null
|
||||
count: number
|
||||
after_cursor: string | null
|
||||
has_more: boolean
|
||||
}
|
||||
metadata: {
|
||||
total_returned: number
|
||||
@@ -84,7 +83,7 @@ export const zendeskSearchUsersTool: ToolConfig<
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Page number as a string (e.g., "1", "2")',
|
||||
description: 'Page number for pagination (1-based)',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -93,8 +92,8 @@ export const zendeskSearchUsersTool: ToolConfig<
|
||||
const queryParams = new URLSearchParams()
|
||||
if (params.query) queryParams.append('query', params.query)
|
||||
if (params.externalId) queryParams.append('external_id', params.externalId)
|
||||
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, '/users/search')
|
||||
@@ -119,19 +118,22 @@ export const zendeskSearchUsersTool: ToolConfig<
|
||||
|
||||
const data = await response.json()
|
||||
const users = data.users || []
|
||||
const hasMore = data.next_page !== null && data.next_page !== undefined
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
users,
|
||||
// /users/search 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 || users.length,
|
||||
},
|
||||
metadata: {
|
||||
total_returned: users.length,
|
||||
has_more: !!data.next_page,
|
||||
has_more: hasMore,
|
||||
},
|
||||
success: true,
|
||||
},
|
||||
|
||||
@@ -11,14 +11,14 @@ export interface ZendeskBaseParams {
|
||||
}
|
||||
|
||||
export interface ZendeskPaginationParams {
|
||||
page?: string
|
||||
perPage?: string
|
||||
pageAfter?: string
|
||||
}
|
||||
|
||||
export interface ZendeskPagingInfo {
|
||||
after_cursor: string | null
|
||||
has_more: boolean
|
||||
next_page?: string | null
|
||||
previous_page?: string | null
|
||||
count: number
|
||||
}
|
||||
|
||||
export interface ZendeskListMetadata {
|
||||
@@ -50,6 +50,32 @@ export function handleZendeskError(data: any, status: number, operation: string)
|
||||
throw new Error(`Zendesk ${operation} failed: ${errorMessage}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends cursor-based pagination query params.
|
||||
* Zendesk uses bracket notation: `page[size]` and `page[after]`.
|
||||
*/
|
||||
export function appendCursorPaginationParams(
|
||||
queryParams: URLSearchParams,
|
||||
params: ZendeskPaginationParams
|
||||
): void {
|
||||
if (params.perPage) queryParams.append('page[size]', params.perPage)
|
||||
if (params.pageAfter) queryParams.append('page[after]', params.pageAfter)
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts cursor-based pagination info from Zendesk API response.
|
||||
* Zendesk cursor-based responses include `meta.after_cursor`, `meta.has_more`, and `links.next`.
|
||||
*/
|
||||
export function extractCursorPagingInfo(data: Record<string, unknown>): ZendeskPagingInfo {
|
||||
const meta = (data.meta as Record<string, unknown>) || {}
|
||||
const links = (data.links as Record<string, unknown>) || {}
|
||||
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<string, OutputProperty>
|
||||
|
||||
/**
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user