Merge remote-tracking branch 'origin/main' into feat/add-render-app-connection-and-secret-sync

This commit is contained in:
Sheen Capadngan
2025-06-19 03:14:23 +08:00
281 changed files with 6700 additions and 1520 deletions
@@ -23,5 +23,6 @@ export enum AppConnection {
TeamCity = "teamcity",
OCI = "oci",
OnePass = "1password",
Render = "render"
Render = "render",
Flyio = "flyio"
}
@@ -0,0 +1,2 @@
export * from "./queries";
export * from "./types";
@@ -0,0 +1,36 @@
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
import { appConnectionKeys } from "../queries";
import { TFlyioApp } from "./types";
const flyioConnectionKeys = {
all: [...appConnectionKeys.all, "flyio"] as const,
listApps: (connectionId: string) => [...flyioConnectionKeys.all, "apps", connectionId] as const
};
export const useFlyioConnectionListApps = (
connectionId: string,
options?: Omit<
UseQueryOptions<
TFlyioApp[],
unknown,
TFlyioApp[],
ReturnType<typeof flyioConnectionKeys.listApps>
>,
"queryKey" | "queryFn"
>
) => {
return useQuery({
queryKey: flyioConnectionKeys.listApps(connectionId),
queryFn: async () => {
const { data } = await apiRequest.get<TFlyioApp[]>(
`/api/v1/app-connections/flyio/${connectionId}/apps`
);
return data;
},
...options
});
};
@@ -0,0 +1,4 @@
export type TFlyioApp = {
id: string;
name: string;
};
@@ -114,6 +114,10 @@ export type TRenderConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Render;
};
export type TFlyioConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Flyio;
};
export type TAppConnectionOption =
| TAwsConnectionOption
| TGitHubConnectionOption
@@ -137,7 +141,8 @@ export type TAppConnectionOption =
| TTeamCityConnectionOption
| TOCIConnectionOption
| TOnePassConnectionOption
| TRenderConnectionOption;
| TRenderConnectionOption
| TFlyioConnectionOption;
export type TAppConnectionOptionMap = {
[AppConnection.AWS]: TAwsConnectionOption;
@@ -165,4 +170,5 @@ export type TAppConnectionOptionMap = {
[AppConnection.OCI]: TOCIConnectionOption;
[AppConnection.OnePass]: TOnePassConnectionOption;
[AppConnection.Render]: TRenderConnectionOption;
[AppConnection.Flyio]: TFlyioConnectionOption;
};
@@ -0,0 +1,13 @@
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";
export enum FlyioConnectionMethod {
AccessToken = "access-token"
}
export type TFlyioConnection = TRootAppConnection & { app: AppConnection.Flyio } & {
method: FlyioConnectionMethod.AccessToken;
credentials: {
accessToken: string;
};
};
@@ -9,6 +9,7 @@ import { TAzureDevOpsConnection } from "./azure-devops-connection";
import { TAzureKeyVaultConnection } from "./azure-key-vault-connection";
import { TCamundaConnection } from "./camunda-connection";
import { TDatabricksConnection } from "./databricks-connection";
import { TFlyioConnection } from "./flyio-connection";
import { TGcpConnection } from "./gcp-connection";
import { TGitHubConnection } from "./github-connection";
import { TGitHubRadarConnection } from "./github-radar-connection";
@@ -35,6 +36,7 @@ export * from "./azure-devops-connection";
export * from "./azure-key-vault-connection";
export * from "./camunda-connection";
export * from "./databricks-connection";
export * from "./flyio-connection";
export * from "./gcp-connection";
export * from "./github-connection";
export * from "./github-radar-connection";
@@ -77,7 +79,8 @@ export type TAppConnection =
| TTeamCityConnection
| TOCIConnection
| TOnePassConnection
| TRenderConnection;
| TRenderConnection
| TFlyioConnection;
export type TAvailableAppConnection = Pick<TAppConnection, "name" | "id">;
@@ -130,4 +133,5 @@ export type TAppConnectionMap = {
[AppConnection.OCI]: TOCIConnection;
[AppConnection.OnePass]: TOnePassConnection;
[AppConnection.Render]: TRenderConnection;
[AppConnection.Flyio]: TFlyioConnection;
};
@@ -242,6 +242,7 @@ interface CreateIdentityEvent {
metadata: {
identityId: string;
name: string;
hasDeleteProtection: boolean;
};
}
@@ -250,6 +251,7 @@ interface UpdateIdentityEvent {
metadata: {
identityId: string;
name?: string;
hasDeleteProtection?: boolean;
};
}
@@ -85,12 +85,13 @@ export const useCreateIdentity = () => {
export const useUpdateIdentity = () => {
const queryClient = useQueryClient();
return useMutation<Identity, object, UpdateIdentityDTO>({
mutationFn: async ({ identityId, name, role, metadata }) => {
mutationFn: async ({ identityId, name, role, hasDeleteProtection, metadata }) => {
const {
data: { identity }
} = await apiRequest.patch(`/api/v1/identities/${identityId}`, {
name,
role,
hasDeleteProtection,
metadata
});
@@ -14,6 +14,7 @@ export type IdentityTrustedIp = {
export type Identity = {
id: string;
name: string;
hasDeleteProtection: boolean;
authMethods: IdentityAuthMethod[];
createdAt: string;
updatedAt: string;
@@ -83,6 +84,7 @@ export type CreateIdentityDTO = {
name: string;
organizationId: string;
role?: string;
hasDeleteProtection: boolean;
metadata?: { key: string; value: string }[];
};
@@ -90,6 +92,7 @@ export type UpdateIdentityDTO = {
identityId: string;
name?: string;
role?: string;
hasDeleteProtection?: boolean;
organizationId: string;
metadata?: { key: string; value: string }[];
};
@@ -32,6 +32,7 @@ export type TSecretApprovalSecChange = {
version: number;
secretKey: string;
secretValue?: string;
secretValueHidden?: boolean;
secretComment?: string;
isRotatedSecret?: boolean;
tags?: string[];
+2 -1
View File
@@ -16,7 +16,8 @@ export enum SecretSync {
TeamCity = "teamcity",
OCIVault = "oci-vault",
OnePass = "1password",
Render = "render"
Render = "render",
Flyio = "flyio"
}
export enum SecretSyncStatus {
@@ -0,0 +1,15 @@
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { SecretSync } from "@app/hooks/api/secretSyncs";
import { TRootSecretSync } from "@app/hooks/api/secretSyncs/types/root-sync";
export type TFlyioSync = TRootSecretSync & {
destination: SecretSync.Flyio;
destinationConfig: {
appId: string;
};
connection: {
app: AppConnection.Flyio;
name: string;
id: string;
};
};
@@ -10,6 +10,7 @@ import { TAzureDevOpsSync } from "./azure-devops-sync";
import { TAzureKeyVaultSync } from "./azure-key-vault-sync";
import { TCamundaSync } from "./camunda-sync";
import { TDatabricksSync } from "./databricks-sync";
import { TFlyioSync } from "./flyio-sync";
import { TGcpSync } from "./gcp-sync";
import { TGitHubSync } from "./github-sync";
import { THCVaultSync } from "./hc-vault-sync";
@@ -45,7 +46,8 @@ export type TSecretSync =
| TTeamCitySync
| TOCIVaultSync
| TOnePassSync
| TRenderSync;
| TRenderSync
| TFlyioSync;
export type TListSecretSyncs = { secretSyncs: TSecretSync[] };