feat(microsoft-teams): better authentication flow and doc references

This commit is contained in:
Daniel Hougaard
2025-04-26 09:46:23 +04:00
parent 8987938642
commit 0323d152da
17 changed files with 477 additions and 103 deletions
@@ -23,7 +23,8 @@ export const workflowIntegrationKeys = {
{ id },
"microsoft-teams-workflow-integration-teams"
],
getSlackIntegrationChannels: (id?: string) => [{ id }, "slack-workflow-integration-channels"]
getSlackIntegrationChannels: (id?: string) => [{ id }, "slack-workflow-integration-channels"],
getMicrosoftTeamsClientId: () => ["microsoft-teams-client-id"]
};
export const fetchSlackInstallUrl = async ({
@@ -104,6 +105,14 @@ export const fetchMicrosoftTeamsIntegrationTeams = async (id?: string) => {
return data;
};
export const fetchMicrosoftTeamsClientId = async () => {
const { data } = await apiRequest.get<{ clientId: string }>(
"/api/v1/workflow-integrations/microsoft-teams/client-id"
);
return data;
};
export const useGetMicrosoftTeamsIntegrations = (orgId?: string) =>
useQuery({
queryKey: workflowIntegrationKeys.getMicrosoftTeamsIntegrations(orgId),
@@ -145,3 +154,10 @@ export const useGetWorkflowIntegrations = (id?: string) =>
queryFn: () => fetchWorkflowIntegrations(),
enabled: Boolean(id)
});
export const useGetMicrosoftTeamsClientId = () =>
useQuery({
queryKey: workflowIntegrationKeys.getMicrosoftTeamsClientId(),
queryFn: () => fetchMicrosoftTeamsClientId(),
enabled: true
});
@@ -59,10 +59,11 @@ export type TUpdateMicrosoftTeamsIntegrationDTO = {
};
export type TCreateMicrosoftTeamsIntegrationDTO = {
orgId: string;
tenantId: string;
slug: string;
description?: string;
redirectUri: string;
orgId: string;
};
export type TDeleteSlackIntegrationDTO = {