mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 05:19:49 +00:00
Checkly group level sync support
This commit is contained in:
@@ -10,5 +10,6 @@ export {
|
||||
useGetIntegrationAuthTeamCityBuildConfigs,
|
||||
useGetIntegrationAuthTeams,
|
||||
useGetIntegrationAuthVercelBranches,
|
||||
useSaveIntegrationAccessToken
|
||||
useSaveIntegrationAccessToken,
|
||||
useGetIntegrationAuthGroups
|
||||
} from "./queries";
|
||||
|
||||
@@ -12,7 +12,8 @@ import {
|
||||
Org,
|
||||
Project,
|
||||
Service,
|
||||
Team,
|
||||
Team,
|
||||
Group,
|
||||
TeamCityBuildConfig} from "./types";
|
||||
|
||||
const integrationAuthKeys = {
|
||||
@@ -22,6 +23,8 @@ const integrationAuthKeys = {
|
||||
[{ integrationAuthId, teamId, workspaceSlug }, "integrationAuthApps"] as const,
|
||||
getIntegrationAuthTeams: (integrationAuthId: string) =>
|
||||
[{ integrationAuthId }, "integrationAuthTeams"] as const,
|
||||
getIntegrationAuthGroups: (integrationAuthId: string) =>
|
||||
[{ integrationAuthId }, "integrationAuthGroups"] as const,
|
||||
getIntegrationAuthVercelBranches: ({
|
||||
integrationAuthId,
|
||||
appId
|
||||
@@ -125,6 +128,12 @@ const fetchIntegrationAuthTeams = async (integrationAuthId: string) => {
|
||||
return data.teams;
|
||||
};
|
||||
|
||||
const fetchIntegrationAuthGroups = async (integrationAuthId: string) => {
|
||||
const { data } = await apiRequest.get<{ groups: Group[] }>(
|
||||
`/api/v1/integration-auth/${integrationAuthId}/groups`
|
||||
);
|
||||
return data.groups;
|
||||
};
|
||||
|
||||
const fetchIntegrationAuthVercelBranches = async ({
|
||||
integrationAuthId,
|
||||
@@ -413,6 +422,14 @@ export const useGetIntegrationAuthVercelBranches = ({
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetIntegrationAuthGroups = (integrationAuthId: string) => {
|
||||
return useQuery({
|
||||
queryKey: integrationAuthKeys.getIntegrationAuthGroups(integrationAuthId),
|
||||
queryFn: () => fetchIntegrationAuthGroups(integrationAuthId),
|
||||
enabled: true
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetIntegrationAuthQoveryOrgs = (integrationAuthId: string) => {
|
||||
return useQuery({
|
||||
queryKey: integrationAuthKeys.getIntegrationAuthQoveryOrgs(integrationAuthId),
|
||||
|
||||
@@ -26,6 +26,11 @@ export type Environment = {
|
||||
environmentId: string;
|
||||
};
|
||||
|
||||
export type Group = {
|
||||
name: string;
|
||||
groupId: string;
|
||||
};
|
||||
|
||||
export type Container = {
|
||||
name: string;
|
||||
containerId: string;
|
||||
|
||||
Reference in New Issue
Block a user