Skip to content

Commit

Permalink
feat: migrate to new endpoints format (#108)
Browse files Browse the repository at this point in the history
## Describe your changes

- Migrate to new endpoints format
- Upgrade cli to `0.44.0`

```sh
#!/bin/bash

pushd() {
    command pushd "$@" >/dev/null
}

popd() {
    command popd "$@" >/dev/null
}

if [ -n "$npm_config_integration" ]; then
    integrations=("$npm_config_integration")
else
    cd integrations
    integrations=($(ls -d */ | sed 's/\///g'))
    cd ..
fi

export NANGO_CLI_UPGRADE_MODE=ignore

cd integrations

for d in "${integrations[@]}"; do
    integration=$(echo $d | sed 's/\///g')

    echo "Change endpoint format for $integration..."

    # Check if the integration directory exists (in case of single integration)
    if [ ! -d "$integration" ]; then
        echo "Integration directory $integration does not exist. Skipping..."
        continue
    fi

    pushd "$integration" || exit
    npx nango migrate-endpoints
    popd $1 || exit
done
``` 

## 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
bodinsamuel authored Nov 15, 2024
1 parent f3d8d3a commit b6e62a3
Show file tree
Hide file tree
Showing 78 changed files with 2,389 additions and 1,332 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Please review and follow the [writing integration scripts](/WRITING_INTEGRATION_
Upon making a PR review please ensure you have gone through the PR checklist.

## Script Helpers

* `npm run move:integrations` moves all the integrations into a `nango-integrations` directory. Accepts an optional `--integration=${INTEGRATION}` flag
* `npm run undo:move:integrations` undo the move of integrations into a `nango-integrations` directory
* `npm run lint-moved-integrations` lint all the integrations after moving them to the to the `nngo-integrations` directory
Expand Down
Loading

0 comments on commit b6e62a3

Please sign in to comment.