Skip to content

Commit

Permalink
fix(pagination): rename and update action param (#161)
Browse files Browse the repository at this point in the history
## Describe your changes
As pointed out in
https://github.com/NangoHQ/integration-templates/pull/160/files#r1888871550
## Issue ticket number and link

## Checklist before requesting a review (skip if just adding/editing
APIs & templates)

-   [ ] I added tests, otherwise the reason is:
-   [ ] External API requests have `retries`
-   [ ] Pagination is used where appropriate
- [ ] The built in `nango.paginate` call is used instead of a `while
(true)` loop
- [ ] Third party requests are NOT parallelized (this can cause issues
with rate limits)
- [ ] If a sync requires metadata the `nango.yaml` has `auto_start:
false`
-   [ ] If the sync is a `full` sync then `track_deletes: true` is set
- [ ] I followed the best practices and guidelines from the [Writing
Integration
Scripts](/NangoHQ/integration-templates/blob/main/WRITING_INTEGRATION_SCRIPTS.md)
doc
  • Loading branch information
khaliqgant authored Dec 18, 2024
1 parent dbcc525 commit cfeeae6
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 12 deletions.
5 changes: 3 additions & 2 deletions flows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3497,16 +3497,17 @@ integrations:
is_escalated: boolean
front:
syncs:
list-conversations:
conversations:
runs: every day
description: List the conversations in the company in reverse chronological order.
output: Conversation
endpoint:
method: GET
path: /conversations
group: Conversations
track_deletes: true
sync_type: full
version: 1.0.1
version: 1.0.2
actions:
conversation:
description: >-
Expand Down
1 change: 1 addition & 0 deletions integrations/front/actions/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default async function runAction(nango: NangoAction, input: SingleConvers
paginate: {
type: 'link',
response_path: '_results',
limit_name_in_request: 'limit',
link_path_in_response_body: 'next',
limit: 100
}
Expand Down
5 changes: 3 additions & 2 deletions integrations/front/nango.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
integrations:
front:
syncs:
list-conversations:
conversations:
runs: every day
description: List the conversations in the company in reverse chronological order.
output: Conversation
endpoint:
method: GET
path: /conversations
group: Conversations
track_deletes: true
sync_type: full
version: 1.0.1
version: 1.0.2
actions:
conversation:
description: List the messages in a conversation in reverse chronological order (newest first).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!-- BEGIN GENERATED CONTENT -->
# List Conversations
# Conversations

## General Information

- **Description:** List the conversations in the company in reverse chronological order.
- **Version:** 1.0.1
- **Version:** 1.0.2
- **Group:** Others
- **Scopes:** _None_
- **Endpoint Type:** Sync
- **Code:** [github.com](https://github.com/NangoHQ/integration-templates/tree/main/integrations/front/syncs/list-conversations.ts)
- **Code:** [github.com](https://github.com/NangoHQ/integration-templates/tree/main/integrations/front/syncs/conversations.ts)


## Endpoint Reference
Expand Down Expand Up @@ -74,8 +74,8 @@ _No request body_

## Changelog

- [Script History](https://github.com/NangoHQ/integration-templates/commits/main/integrations/front/syncs/list-conversations.ts)
- [Documentation History](https://github.com/NangoHQ/integration-templates/commits/main/integrations/front/syncs/list-conversations.md)
- [Script History](https://github.com/NangoHQ/integration-templates/commits/main/integrations/front/syncs/conversations.ts)
- [Documentation History](https://github.com/NangoHQ/integration-templates/commits/main/integrations/front/syncs/conversations.md)

<!-- END GENERATED CONTENT -->

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { vi, expect, it, describe } from 'vitest';

import fetchData from '../syncs/list-conversations.js';
import fetchData from '../syncs/conversations.js';

describe('front list-conversations tests', () => {
describe('front conversations tests', () => {
const nangoMock = new global.vitest.NangoSyncMock({
dirname: __dirname,
name: 'list-conversations',
name: 'conversations',
Model: 'Conversation'
});

Expand Down

0 comments on commit cfeeae6

Please sign in to comment.