Skip to content

Commit

Permalink
feat(integrations):integration template for teamtailor (NangoHQ#1748)
Browse files Browse the repository at this point in the history
## Describe your changes

- Added integration template for syncing teamtailor candidates.

## Test
The documentation update was reviewed using `npm run docs`, and
verification was performed on localhost.
  • Loading branch information
hassan254-prog authored Mar 1, 2024
1 parent 97a70bb commit 48dc142
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs-v2/integrations/integration-templates/teamtailor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: 'Teamtailor API Integration Template'
sidebarTitle: 'Teamtailor'
---

## Get started with the Teamtailor template

<Card title="How to use integration templates"
href="/understand/concepts/templates"
icon="book-open">
Learn how to use integration templates in Nango
</Card>

<Card title="Get the Teamtailor template"
href="https://github.com/NangoHQ/nango/tree/master/integration-templates/teamtailor"
icon="github">
Get the latest version of the Teamtailor integration template from GitHub
</Card>

## Need help with the template?
Please reach out in the [Slack community](https://nango.dev/slack), we are very active there and happy to help!
1 change: 1 addition & 0 deletions docs-v2/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@
"integrations/integration-templates/pipedrive",
"integrations/integration-templates/salesforce",
"integrations/integration-templates/slack",
"integrations/integration-templates/teamtailor",
"integrations/integration-templates/workable",
"integrations/integration-templates/zendesk",
"integrations/integration-templates/zoho-crm"
Expand Down
89 changes: 89 additions & 0 deletions integration-templates/teamtailor/nango.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
integrations:
teamtailor:
syncs:
teamtailor-candidates:
runs: every 6 hours
description: |
Fetches a list of all candidates from your teamtailor account.
Details: full sync, doesn't track deletes, metadata is not required.
output: TeamtailorCandidate
sync_type: full
endpoint: /teamtailor-candidates/candidates
scopes:
- Admin
models:
TeamtailorCandidate:
id: string
type: string
links:
self: string
attributes:
connected: boolean
consent_future_jobs_at: date
created_at: date
updated_at: date
email: string
facebook_id: string
facebook_profile: string
first_name: string
internal: boolean
last_name: string
linkedin_profile: string
linkedin_uid: string
linkedin_url: string
original_resume: string
phone: string
picture: string
pitch: string
referring_site: string
referring_url: string
referred: boolean
resume: string
sourced: boolean
tags: array
unsubscribed: boolean
relationships:
activities:
links:
self: string
related: string
department:
links:
self: string
related: string
role:
links:
self: string
related: string
regions:
links:
self: string
related: string
job_applications:
links:
self: string
related: string
questions:
links:
self: string
related: string
answers:
links:
self: string
related: string
locations:
links:
self: string
related: string
uploads:
links:
self: string
related: string
custom_field_values:
links:
self: string
related: string
partner_results:
links:
self: string
related: string
38 changes: 38 additions & 0 deletions integration-templates/teamtailor/teamtailor-candidates.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import type { NangoSync, TeamtailorCandidate } from './models';

export default async function fetchData(nango: NangoSync): Promise<void> {
let totalRecords = 0;

try {
const endpoint = '/v1/candidates';
const config = {
paginate: {
type: 'link',
link_path_in_response_body: 'links.next',
limit_name_in_request: 'page[size]',
response_path: 'data',
limit: 100
}
};
for await (const candidate of nango.paginate({ ...config, endpoint })) {
const mappedCandidate: TeamtailorCandidate[] = candidate.map(mapCandidate) || [];

const batchSize: number = mappedCandidate.length;
totalRecords += batchSize;
await nango.log(`Saving batch of ${batchSize} candidate(s) (total candidate(s): ${totalRecords})`);
await nango.batchSave(mappedCandidate, 'TeamtailorCandidate');
}
} catch (error: any) {
throw new Error(`Error in fetchData: ${error.message}`);
}
}

function mapCandidate(candidate: any): TeamtailorCandidate {
return {
id: candidate.id,
type: candidate.type,
links: candidate.links,
attributes: candidate.attributes,
relationships: candidate.relationships
};
}
88 changes: 88 additions & 0 deletions packages/shared/flows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,94 @@ integrations:
mobilePhone: string
licenseType: string
language: string
teamtailor:
syncs:
teamtailor-candidates:
runs: every 6 hours
description: |
Fetches a list of all candidates from your teamtailor account.
Details: full sync, doesn't track deletes, metadata is not required.
output: TeamtailorCandidate
sync_type: full
endpoint: /teamtailor-candidates/candidates
scopes:
- Admin
models:
TeamtailorCandidate:
id: string
type: string
links:
self: string
attributes:
connected: boolean
consent_future_jobs_at: date
created_at: date
updated_at: date
email: string
facebook_id: string
facebook_profile: string
first_name: string
internal: boolean
last_name: string
linkedin_profile: string
linkedin_uid: string
linkedin_url: string
original_resume: string
phone: string
picture: string
pitch: string
referring_site: string
referring_url: string
referred: boolean
resume: string
sourced: boolean
tags: array
unsubscribed: boolean
relationships:
activities:
links:
self: string
related: string
department:
links:
self: string
related: string
role:
links:
self: string
related: string
regions:
links:
self: string
related: string
job_applications:
links:
self: string
related: string
questions:
links:
self: string
related: string
answers:
links:
self: string
related: string
locations:
links:
self: string
related: string
uploads:
links:
self: string
related: string
custom_field_values:
links:
self: string
related: string
partner_results:
links:
self: string
related: string
workable:
syncs:
workable-candidates:
Expand Down

0 comments on commit 48dc142

Please sign in to comment.