Skip to content

Commit

Permalink
[gh-#1032] Merge branch 'master' of github.com:NangoHQ/nango into gh-#…
Browse files Browse the repository at this point in the history
…1032-auto-complete-update
  • Loading branch information
khaliqgant committed Sep 29, 2023
2 parents 5ef1319 + c61b9e7 commit 1adc657
Show file tree
Hide file tree
Showing 119 changed files with 4,656 additions and 963 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/integration-flows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Nango Integration Flows Compile

on: [push, pull_request]

concurrency:
group: flows-compile--${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
flow-compilation:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install nango CLI
run: |
npm install -g nango
# TODO this shouldn't be needed
npm install @tsconfig/node18-strictest-esm --save-dev
- name: Compile with Nango
run: |
set -e
cd integration-templates
for dir in */; do
if [[ "$dir" != "." && "$dir" != "integration-templates/" ]]; then
cd "$dir"
mkdir -p nango-integrations
find . -maxdepth 1 ! -name '.' ! -name 'nango-integrations' -exec mv -t nango-integrations {} +
cd nango-integrations
output=$(nango compile 2>&1)
echo "$output"
if [[ "$output" == *"Error compiling"* ]]; then
echo "Error found in directory $dir"
exit 1
fi
cd ../../
fi
done
64 changes: 64 additions & 0 deletions .github/workflows/integration-template-upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Upload integration templates to S3

on:
push:
branches:
- master
pull_request:
branches:
- master
types:
- closed

concurrency:
group: templates-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
template-upload:
runs-on: ubuntu-latest
if: (github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install nango CLI
run: |
npm install -g nango
npm install @tsconfig/node18-strictest-esm --save-dev
- name: Get specific changed files
id: changed-files-specific
uses: tj-actions/changed-files@v39
with:
files: |
integration-templates/*
integration-templates/**/*
- name: Process and Upload changed directories to S3
if: steps.changed-files-specific.outputs.any_changed == 'true'
run: |
wd=$(pwd)
for file in ${{ steps.changed-files-specific.outputs.all_changed_files }}; do
dir=$(dirname $file)
mkdir -p /tmp/nango-temp/nango-integrations
cp -r $dir/* /tmp/nango-temp/nango-integrations/
cd /tmp/nango-temp/nango-integrations
nango compile
cp -r dist/ $wd/$dir/
cd -
rm -rf /tmp/nango-temp
aws s3 sync $dir s3://${{ secrets.AWS_BUCKET_NAME }}/$dir/
done
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}

3 changes: 3 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ rules:
document-start: disable
truthy:
check-keys: false

ignore: |
.github/workflows/*
1 change: 1 addition & 0 deletions docs-v2/integrations/accounting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Ask us on the [Slack community](https://nango.dev/slack) and we can help you qui
<Card title="Exact Online" href="integrations/all/exact-online" color="#68a063" />
<Card title="Freshbooks" href="/integrations/all/freshbooks" color="#68a063" />
<Card title="Netsuite" href="/integrations/all/netsuite" color="#68a063" />
<Card title="Pennylane" href="/integrations/all/pennylane" color="#68a063" />
<Card title="Quickbooks" href="/integrations/all/quickbooks" color="#68a063" />
<Card title="Sage" href="/integrations/all/sage" color="#68a063" />
<Card title="Wave Accounting" href="/integrations/all/wave-accounting" color="#68a063" />
Expand Down
30 changes: 30 additions & 0 deletions docs-v2/integrations/all/highlevel.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: HighLevel
sidebarTitle: HighLevel
---

API configuration: [`highlevel`](https://nango.dev/providers.yaml)



## Features

| Feature | Status |
| -------------------------------------------------------------------------------- | ------------------------------- |
| [Auth (OAuth)](/guides/oauth) ||
| [Syncs](/guides/sync) & [Actions](/guides/actions) ||
| [Nango Proxy](/guides/proxy) ||
| [Integration templates](/integration-templates/overview) | 🚫 (time to contribute: &lt;1h) |
| Auto-pagination | 🚫 (time to contribute: &lt;1h) |
| API-specific rate limits | 🚫 (time to contribute: &lt;1h) |

<Tip>We can implement missing features in &lt;48h, just ask for it in the [community](https://nango.dev/slack).</Tip>
## Getting started

- [API Documentation](https://highlevel.stoplight.io/docs/integrations/0443d7d1a4bd0-overview)

<Tip>Need help getting started? Get help in the [community](https://nango.dev/slack).</Tip>

## API gotchas

<Note>Add Getting Started links and Gotchas by [editing this page](https://github.com/nangohq/nango/tree/master/docs-v2/integrations/all/highlevel.mdx)</Note>
1 change: 1 addition & 0 deletions docs-v2/integrations/banking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@

<CardGroup cols={4}>
<Card title="Brex" href="/integrations/all/brex" color="#68a063" />
<Card title="Pennylane" href="/integrations/all/pennylane" color="#68a063" />
<Card title="Ramp" href="/integrations/all/ramp" color="#68a063" />
</CardGroup>
2 changes: 2 additions & 0 deletions docs-v2/integrations/communication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ sidebarTitle: Communication
</Tip>

<CardGroup cols={4}>
<Card title="Aircall" href="/integrations/all/aircall" color="#68a063" />
<Card title="Atlassian" href="/integrations/all/atlassian" color="#68a063" />
<Card title="Discord" href="/integrations/all/discord" color="#68a063" />
<Card title="Facebook" href="/integrations/all/facebook" color="#68a063" />
<Card title="Front" href="/integrations/all/front" color="#68a063" />
<Card title="Gmail" href="/integrations/all/google-mail" color="#68a063" />
<Card title="Microsoft Teams" href="/integrations/all/microsoft-teams" color="#68a063" />
<Card title="RingCentral" href="/integrations/all/ring-central" color="#68a063" />
<Card title="Slack" href="/integrations/all/slack" color="#68a063" />
</CardGroup>
1 change: 1 addition & 0 deletions docs-v2/integrations/invoicing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ sidebarTitle: Invoicing

<CardGroup cols={4}>
<Card title="Accelo" href="/integrations/all/accelo" color="#68a063" />
<Card title="Pennylane" href="/integrations/all/pennylane" color="#68a063" />
<Card title="Zoho Invoice" href="/integrations/all/zoho-invoice" color="#68a063" />
</CardGroup>
1 change: 1 addition & 0 deletions docs-v2/integrations/marketing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ sidebarTitle: Marketing

<CardGroup cols={4}>
<Card title="Facebook" href="/integrations/all/facebook" color="#68a063" />
<Card title="HighLevel" href="/integrations/all/highlevel" color="#68a063" />
<Card title="Hubspot" href="/integrations/all/hubspot" color="#68a063" />
<Card title="Instagram" href="/integrations/all/instagram" color="#68a063" />
<Card title="Intercom" href="/integrations/all/intercom" color="#68a063" />
Expand Down
2 changes: 2 additions & 0 deletions docs-v2/integrations/other.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ sidebarTitle: Other
<Card title="Amazon" href="/integrations/all/amazon" color="#68a063" />
<Card title="Atlassian" href="/integrations/all/atlassian" color="#68a063" />
<Card title="Exact Online" href="integrations/all/exact-online" color="#68a063" />
<Card title="Freshservice" href="integrations/all/freshservice" color="#68a063" />
<Card title="Google" href="/integrations/all/google" color="#68a063" />
<Card title="Gumroad" href="/integrations/all/gumroad" color="#68a063" />
<Card title="HealthGorilla" href="/integrations/all/healthgorilla" color="#68a063" />
Expand All @@ -20,6 +21,7 @@ sidebarTitle: Other
<Card title="Splitwise" href="/integrations/all/splitwise" color="#68a063" />
<Card title="Twinfield" href="/integrations/all/twinfield" color="#68a063" />
<Card title="Uber" href="/integrations/all/uber" color="#68a063" />
<Card title="ServiceM8" href="/integrations/all/servicem8" color="#68a063" />
<Card title="Yahoo" href="/integrations/all/yahoo" color="#68a063" />
<Card title="Yandex" href="/integrations/all/yandex" color="#68a063" />
<Card title="Zapier NLA" href="/integrations/all/zapier-nla" color="#68a063" />
Expand Down
1 change: 1 addition & 0 deletions docs-v2/integrations/payment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<CardGroup cols={4}>
<Card title="Braintree" href="/integrations/all/braintree" color="#68a063" />
<Card title="Gumroad" href="/integrations/all/gumroad" color="#68a063" />
<Card title="Pennylane" href="/integrations/all/pennylane" color="#68a063" />
<Card title="Splitwise" href="/integrations/all/splitwise" color="#68a063" />
<Card title="Squareup" href="/integrations/all/squareup" color="#68a063" />
<Card title="Stripe" href="/integrations/all/stripe" color="#68a063" />
Expand Down
2 changes: 2 additions & 0 deletions docs-v2/integrations/support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ sidebarTitle: Support
</Tip>

<CardGroup cols={4}>
<Card title="Aircall" href="/integrations/all/aircall" color="#68a063" />
<Card title="Front" href="/integrations/all/front" color="#68a063" />
<Card title="Github" href="/integrations/all/github" color="#68a063" />
<Card title="Gitlab" href="/integrations/all/gitlab" color="#68a063" />
<Card title="Intercom" href="/integrations/all/intercom" color="#68a063" />
<Card title="RingCentral" href="/integrations/all/ring-central" color="#68a063" />
<Card title="StackExchange" href="/integrations/all/stackexchange" color="#68a063" />
<Card title="Zendesk" href="/integrations/all/zendesk" color="#68a063" />
<Card title="Zoho Desk" href="/integrations/all/zoho-desk" color="#68a063" />
Expand Down
1 change: 1 addition & 0 deletions docs-v2/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
"integrations/all/gumroad",
"integrations/all/gusto",
"integrations/all/healthgorilla",
"integrations/all/highlevel",
"integrations/all/hubspot",
"integrations/all/instagram",
"integrations/all/intercom",
Expand Down
2 changes: 1 addition & 1 deletion integration-templates/asana/asana-tasks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AsanaTask, NangoSync } from './models';
import type { AsanaTask, NangoSync } from './models';

export default async function fetchData(nango: NangoSync) {
// Get the user's workspaces & projects
Expand Down
16 changes: 13 additions & 3 deletions integration-templates/evaluagent/evaluagent-groups.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import type { NangoSync, EvaluAgentGroup } from './models';

interface EvaluAgentGroupResponseCustom {
is_custom_reporting_group: boolean;
has_children: boolean;
}

interface EvaluAgentGroupResponse {
id: string;
attributes: EvaluAgentGroup & EvaluAgentGroupResponseCustom;
}

export default async function fetchData(nango: NangoSync) {
let payload = {
const payload = {
endpoint: '/v1/org/groups'
};

const response = await nango.get(payload);

let returnedData = response.data.data;
const returnedData = response.data.data;

const mappedGroups: EvaluAgentGroup[] = returnedData.map((group: EvaluAgentGroup) => ({
const mappedGroups: EvaluAgentGroup[] = returnedData.map((group: EvaluAgentGroupResponse) => ({
id: group.id,
name: group.attributes.name,
level: group.attributes.level,
Expand Down
11 changes: 8 additions & 3 deletions integration-templates/evaluagent/evaluagent-roles.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import type { NangoSync, EvaluAgentRole } from './models';

interface EvaluAgentRoleResponse {
id: string;
attributes: EvaluAgentRole;
}

export default async function fetchData(nango: NangoSync) {
let payload = {
const payload = {
endpoint: '/v1/org/roles'
};

const response = await nango.get(payload);

let returnedData = response.data.data;
const returnedData = response.data.data;

const mappedRoles: EvaluAgentRole[] = returnedData.map((role: EvaluAgentRole) => ({
const mappedRoles: EvaluAgentRole[] = returnedData.map((role: EvaluAgentRoleResponse) => ({
id: role.id,
title: role.attributes.title,
name: role.attributes.name
Expand Down
11 changes: 10 additions & 1 deletion integration-templates/evaluagent/evaluagent-users.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import type { NangoSync, EvaluAgentUser } from './models';

interface EvaluAgentUserResponseCustom {
third_party_id: string;
start_date: string;
}
interface EvaluAgentUserResponse {
id: string;
attributes: EvaluAgentUser & EvaluAgentUserResponseCustom;
}

export default async function fetchData(nango: NangoSync) {
let payload = {
endpoint: '/v1/org/users'
Expand All @@ -9,7 +18,7 @@ export default async function fetchData(nango: NangoSync) {

let returnedData = response.data.data;

const mappedUsers: EvaluAgentUser[] = returnedData.map((user: EvaluAgentUser) => ({
const mappedUsers: EvaluAgentUser[] = returnedData.map((user: EvaluAgentUserResponse) => ({
id: user.id,
forename: user.attributes.forename,
surname: user.attributes.surname,
Expand Down
2 changes: 1 addition & 1 deletion integration-templates/github/github-list-files-sync.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NangoSync, GithubRepoFile } from './models';
import type { NangoSync, GithubRepoFile } from './models';

enum PaginationType {
RepoFile,
Expand Down
4 changes: 2 additions & 2 deletions integration-templates/gmail/gmail-emails.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NangoSync, GmailEmail } from './models';
import type { NangoSync, GmailEmail } from './models';

export default async function fetchData(nango: NangoSync) {
const backfillPeriod = new Date(Date.now() - 24 * 60 * 60 * 1000); // 24 hours ago.
Expand All @@ -9,7 +9,7 @@ export default async function fetchData(nango: NangoSync) {
let nextPageToken: string | undefined = '';

do {
const response = await nango.proxy({
const response: any = await nango.proxy({
method: 'GET',
endpoint: '/gmail/v1/users/me/messages',
params: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface OrganizationUnitResponse {
organizationUnits: OrganizationUnit[];
}

export default async function fetchData(nango: NangoSync) {
export default async function fetchData(nango: NangoSync): Promise<void> {
const endpoint = '/admin/directory/v1/customer/my_customer/orgunits';
let pageToken: string | undefined;

Expand All @@ -43,7 +43,7 @@ export default async function fetchData(nango: NangoSync) {

if (!response) {
await nango.log('No response from the Google API');
return { OrganizationalUnit: [] };
return;
}

const { data } = response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GoogleWorkspaceUserToken, NangoSync } from './models';
import type { GoogleWorkspaceUserToken, NangoSync } from './models';

export default async function fetchData(nango: NangoSync) {
// Get the users in the org
Expand Down
6 changes: 2 additions & 4 deletions integration-templates/hubspot/hubspot-owner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ interface Params {
export default async function fetchData(nango: NangoSync) {
const MAX_PAGE = 100;

let page = 1;
let afterLink = null;

while (true) {
Expand All @@ -19,7 +18,7 @@ export default async function fetchData(nango: NangoSync) {
} as Params
};

if (!afterLink) {
if (afterLink) {
// If there is no afterLink, then we are on the first page.
payload.params['after'] = afterLink;
}
Expand All @@ -44,8 +43,7 @@ export default async function fetchData(nango: NangoSync) {
await nango.log(`Sent ${mappedOwners.length} owners`);
}

if (response.data.length == MAX_PAGE) {
page += 1;
if (response.data.paging?.next?.after) {
afterLink = response.data.paging.next.after;
} else {
break;
Expand Down
Loading

0 comments on commit 1adc657

Please # to comment.