Merge remote-tracking branch 'origin/main' into feat/addHerokuSecretSync

This commit is contained in:
carlosmonastyrski
2025-06-19 08:47:03 -03:00
205 changed files with 5151 additions and 759 deletions
@@ -23,5 +23,7 @@ export enum AppConnection {
TeamCity = "teamcity",
OCI = "oci",
OnePass = "1password",
Heroku = "heroku"
Heroku = "heroku",
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;
};
@@ -0,0 +1,2 @@
export * from "./queries";
export * from "./types";
@@ -0,0 +1,37 @@
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
import { appConnectionKeys } from "../queries";
import { TRenderService } from "./types";
const renderConnectionKeys = {
all: [...appConnectionKeys.all, "render"] as const,
listServices: (connectionId: string) =>
[...renderConnectionKeys.all, "services", connectionId] as const
};
export const useRenderConnectionListServices = (
connectionId: string,
options?: Omit<
UseQueryOptions<
TRenderService[],
unknown,
TRenderService[],
ReturnType<typeof renderConnectionKeys.listServices>
>,
"queryKey" | "queryFn"
>
) => {
return useQuery({
queryKey: renderConnectionKeys.listServices(connectionId),
queryFn: async () => {
const { data } = await apiRequest.get<TRenderService[]>(
`/api/v1/app-connections/render/${connectionId}/services`
);
return data;
},
...options
});
};
@@ -0,0 +1,4 @@
export type TRenderService = {
id: string;
name: string;
};
@@ -115,6 +115,14 @@ export type TOnePassConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.OnePass;
};
export type TRenderConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Render;
};
export type TFlyioConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Flyio;
};
export type TAppConnectionOption =
| TAwsConnectionOption
| TGitHubConnectionOption
@@ -138,7 +146,9 @@ export type TAppConnectionOption =
| TTeamCityConnectionOption
| TOCIConnectionOption
| TOnePassConnectionOption
| THerokuConnectionOption;
| THerokuConnectionOption
| TRenderConnectionOption
| TFlyioConnectionOption;
export type TAppConnectionOptionMap = {
[AppConnection.AWS]: TAwsConnectionOption;
@@ -166,4 +176,6 @@ export type TAppConnectionOptionMap = {
[AppConnection.OCI]: TOCIConnectionOption;
[AppConnection.OnePass]: TOnePassConnectionOption;
[AppConnection.Heroku]: THerokuConnectionOption;
[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";
@@ -21,6 +22,7 @@ import { TMySqlConnection } from "./mysql-connection";
import { TOCIConnection } from "./oci-connection";
import { TOracleDBConnection } from "./oracledb-connection";
import { TPostgresConnection } from "./postgres-connection";
import { TRenderConnection } from "./render-connection";
import { TTeamCityConnection } from "./teamcity-connection";
import { TTerraformCloudConnection } from "./terraform-cloud-connection";
import { TVercelConnection } from "./vercel-connection";
@@ -35,6 +37,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";
@@ -47,6 +50,7 @@ export * from "./mysql-connection";
export * from "./oci-connection";
export * from "./oracledb-connection";
export * from "./postgres-connection";
export * from "./render-connection";
export * from "./teamcity-connection";
export * from "./terraform-cloud-connection";
export * from "./vercel-connection";
@@ -77,7 +81,9 @@ export type TAppConnection =
| TTeamCityConnection
| TOCIConnection
| TOnePassConnection
| THerokuConnection;
| THerokuConnection
| TRenderConnection
| TFlyioConnection;
export type TAvailableAppConnection = Pick<TAppConnection, "name" | "id">;
@@ -130,4 +136,6 @@ export type TAppConnectionMap = {
[AppConnection.OCI]: TOCIConnection;
[AppConnection.OnePass]: TOnePassConnection;
[AppConnection.Heroku]: THerokuConnection;
[AppConnection.Render]: TRenderConnection;
[AppConnection.Flyio]: TFlyioConnection;
};
@@ -0,0 +1,13 @@
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";
export enum RenderConnectionMethod {
ApiKey = "api-key"
}
export type TRenderConnection = TRootAppConnection & { app: AppConnection.Render } & {
method: RenderConnectionMethod.ApiKey;
credentials: {
apiKey: string;
};
};