feat(clickup): add clickup integration

This commit is contained in:
Rıdvan Akca
2024-02-13 16:43:47 +03:00
committed by Ali BARIN
parent 116bf59b68
commit 26fc63c52c
11 changed files with 214 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { URLSearchParams } from 'url';
export default async function generateAuthUrl($) {
const oauthRedirectUrlField = $.app.auth.fields.find(
(field) => field.key == 'oAuthRedirectUrl'
);
const redirectUri = oauthRedirectUrlField.value;
const state = Math.random().toString();
const searchParams = new URLSearchParams({
client_id: $.auth.data.clientId,
redirect_uri: redirectUri,
state,
});
const url = `https://app.clickup.com/api?${searchParams.toString()}`;
await $.auth.set({
url,
originalState: state,
});
}