Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(box): file sync #235

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

dannylwe
Copy link
Contributor

@dannylwe dannylwe commented Feb 26, 2025

Describe your changes

  • Note: Adding "0" as the folder id in the metadata (folders) will recursively get all files from all box folders when using the files sync.

Challenges

  • the --save-responses flag does not work with responseType: 'stream' when generating tests
  • using the -m flag when generating tests does not work correctly. The metadata needs to be set on the connection

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 doc

Copy link

linear bot commented Feb 26, 2025

@dannylwe dannylwe marked this pull request as ready for review February 26, 2025 17:54
@dannylwe dannylwe requested review from khaliqgant and a team February 26, 2025 17:55
name: metadata.name,
modified_at: metadata.modified_at,
download_url: metadata.shared_link?.download_url,
field_id: metadata.id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the field_id used for / why is this included?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is to help the user understand that that the field_id in the api docs is the same as the id field

let batch: BoxDocument[] = [];
const batchSize = 100;

const response = await nango.get<ListFolderItemsResponse>(proxy);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't actually paginate over the results, should use nango.paginate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants