From 67e67bd7d902d2776f565ff584d584b552789e88 Mon Sep 17 00:00:00 2001 From: Hassan_Wari <85742599+hassan254-prog@users.noreply.github.com> Date: Fri, 9 Aug 2024 18:11:57 +0300 Subject: [PATCH] feat(integration): add support for podium (#2601) ## Describe your changes - Add support for podium ## Issue ticket number and link [EXT-119](https://linear.app/nango/issue/EXT-119/add-support-for-podium-api) --- docs-v2/integrations/all/podium.mdx | 32 +++++++++++++++++++ docs-v2/integrations/communication.mdx | 1 + docs-v2/integrations/marketing.mdx | 1 + docs-v2/mint.json | 1 + .../shared/lib/services/connection.service.ts | 2 ++ packages/shared/providers.yaml | 24 ++++++++++++++ packages/types/lib/integration/template.ts | 1 + .../public/images/template-logos/podium.svg | 1 + scripts/validation/providers/schema.json | 3 ++ 9 files changed, 66 insertions(+) create mode 100644 docs-v2/integrations/all/podium.mdx create mode 100644 packages/webapp/public/images/template-logos/podium.svg diff --git a/docs-v2/integrations/all/podium.mdx b/docs-v2/integrations/all/podium.mdx new file mode 100644 index 0000000000..2d1731e022 --- /dev/null +++ b/docs-v2/integrations/all/podium.mdx @@ -0,0 +1,32 @@ +--- +title: Podium +sidebarTitle: Podium +--- + +API configuration: [`podium`](https://nango.dev/providers.yaml) + +## Features + +| Features | Status | +| - | - | +| [Auth (OAuth)](/integrate/guides/authorize-an-api) | ✅ | +| [Sync data](/integrate/guides/sync-data-from-an-api) | ✅ | +| [Perform workflows](/integrate/guides/perform-workflows-with-an-api) | ✅ | +| [Proxy requests](/integrate/guides/proxy-requests-to-an-api) | ✅ | +| [Receive webhooks](/integrate/guides/receive-webhooks-from-an-api) | 🚫 (time to contribute: <48h) | + +We can implement missing features in <48h, just ask for it in the [community](https://nango.dev/slack). + +## Getting started + +- [How to Register an Application](https://docs.podium.com/docs/oauth#create-your-app) +- [OAuth related docs](https://docs.podium.com/docs/oauth) +- [List of OAuth Scopes](https://docs.podium.com/docs/oauth-scopes) +- [Podium API docs](https://docs.podium.com/reference) + +Need help getting started? Get help in the [community](https://nango.dev/slack). + +## API gotchas +- When creating a new connection in Nango, you will also have to provide your `apiVersion` for compatibility. For more details, please check [Podium API versioning](https://docs.podium.com/docs/api-version) +- Podium enforces a rate limit of 300 requests per minute on most of its routes, with some exceptions. +Add Getting Started links and Gotchas by [editing this page](https://github.com/nangohq/nango/tree/master/docs-v2/integrations/all/podium.mdx) \ No newline at end of file diff --git a/docs-v2/integrations/communication.mdx b/docs-v2/integrations/communication.mdx index e5c8c687ec..a3938554d7 100644 --- a/docs-v2/integrations/communication.mdx +++ b/docs-v2/integrations/communication.mdx @@ -23,6 +23,7 @@ sidebarTitle: Communication + diff --git a/docs-v2/integrations/marketing.mdx b/docs-v2/integrations/marketing.mdx index 2b4663f923..e56897c0ad 100644 --- a/docs-v2/integrations/marketing.mdx +++ b/docs-v2/integrations/marketing.mdx @@ -26,6 +26,7 @@ sidebarTitle: Marketing + diff --git a/docs-v2/mint.json b/docs-v2/mint.json index cc3bcf10d1..2d25094a65 100644 --- a/docs-v2/mint.json +++ b/docs-v2/mint.json @@ -454,6 +454,7 @@ "integrations/all/pipedrive", "integrations/all/pivotaltracker", "integrations/all/productboard", + "integrations/all/podium", "integrations/all/posthog", "integrations/all/qualtrics", "integrations/all/quickbooks", diff --git a/packages/shared/lib/services/connection.service.ts b/packages/shared/lib/services/connection.service.ts index 1290419d46..7d7d83f265 100644 --- a/packages/shared/lib/services/connection.service.ts +++ b/packages/shared/lib/services/connection.service.ts @@ -868,6 +868,8 @@ class ConnectionService { expiresAt = parseTokenExpirationDate(rawCreds['expires_at']); } else if (rawCreds['expires_in']) { expiresAt = new Date(Date.now() + Number.parseInt(rawCreds['expires_in'], 10) * 1000); + } else if (template?.expires_in_ms) { + expiresAt = new Date(Date.now() + template.expires_in_ms); } const oauth2Creds: OAuth2Credentials = { diff --git a/packages/shared/providers.yaml b/packages/shared/providers.yaml index 11152327e5..6e4916953c 100644 --- a/packages/shared/providers.yaml +++ b/packages/shared/providers.yaml @@ -2200,6 +2200,30 @@ pivotaltracker: method: GET endpoint: /accounts docs: https://docs.nango.dev/integrations/all/pivotaltracker +podium: + categories: + - communication + - marketing + auth_mode: OAUTH2 + authorization_url: https://api.podium.com/oauth/authorize + token_url: https://api.podium.com/oauth/token + scope_separator: ' ' + body_format: json + authorization_params: + response_type: code + token_params: + grant_type: authorization_code + refresh_params: + grant_type: refresh_token + expires_in_ms: 36000000 + proxy: + headers: + Podium-Version: ${connectionConfig.apiVersion} + Content-Type: application/json + base_url: https://api.podium.com + retry: + after: 'x-ratelimit-reset' + docs: https://docs.nango.dev/integrations/all/podium posthog: categories: - dev-tools diff --git a/packages/types/lib/integration/template.ts b/packages/types/lib/integration/template.ts index 4b38a361fc..bd0687cec9 100644 --- a/packages/types/lib/integration/template.ts +++ b/packages/types/lib/integration/template.ts @@ -68,6 +68,7 @@ export interface TemplateOAuth2 extends Template { refresh_url?: string; expires_in_unit?: 'milliseconds'; + expires_in_ms?: number; //in ms token_request_auth_method?: 'basic' | 'custom'; } diff --git a/packages/webapp/public/images/template-logos/podium.svg b/packages/webapp/public/images/template-logos/podium.svg new file mode 100644 index 0000000000..6516cc9639 --- /dev/null +++ b/packages/webapp/public/images/template-logos/podium.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/scripts/validation/providers/schema.json b/scripts/validation/providers/schema.json index 0077ca398a..9b0e5cd4d6 100644 --- a/scripts/validation/providers/schema.json +++ b/scripts/validation/providers/schema.json @@ -262,6 +262,9 @@ "type": "string", "enum": ["milliseconds"] }, + "expires_in_ms": { + "type": "number" + }, "token_response_metadata": { "type": "array", "items": {