mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 01:05:40 +00:00
Merge remote-tracking branch 'origin/main' into feat/add-cloudflare-app-connection-and-sync
This commit is contained in:
@@ -23,6 +23,7 @@ export enum AppConnection {
|
||||
TeamCity = "teamcity",
|
||||
OCI = "oci",
|
||||
OnePass = "1password",
|
||||
Heroku = "heroku",
|
||||
Render = "render",
|
||||
Flyio = "flyio",
|
||||
Cloudflare = "cloudflare"
|
||||
|
||||
@@ -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 { THerokuApp } from "./types";
|
||||
|
||||
const herokuConnectionKeys = {
|
||||
all: [...appConnectionKeys.all, "heroku"] as const,
|
||||
listApps: (connectionId: string) => [...herokuConnectionKeys.all, "apps", connectionId] as const
|
||||
};
|
||||
|
||||
export const useHerokuConnectionListApps = (
|
||||
connectionId: string,
|
||||
options?: Omit<
|
||||
UseQueryOptions<
|
||||
THerokuApp[],
|
||||
unknown,
|
||||
THerokuApp[],
|
||||
ReturnType<typeof herokuConnectionKeys.listApps>
|
||||
>,
|
||||
"queryKey" | "queryFn"
|
||||
>
|
||||
) => {
|
||||
return useQuery({
|
||||
queryKey: herokuConnectionKeys.listApps(connectionId),
|
||||
queryFn: async () => {
|
||||
const { data } = await apiRequest.get<THerokuApp[]>(
|
||||
`/api/v1/app-connections/heroku/${connectionId}/apps`
|
||||
);
|
||||
|
||||
return data;
|
||||
},
|
||||
...options
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
export type THerokuApp = {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
@@ -106,6 +106,11 @@ export type TOCIConnectionOption = TAppConnectionOptionBase & {
|
||||
app: AppConnection.OCI;
|
||||
};
|
||||
|
||||
export type THerokuConnectionOption = TAppConnectionOptionBase & {
|
||||
app: AppConnection.Heroku;
|
||||
oauthClientId?: string;
|
||||
};
|
||||
|
||||
export type TOnePassConnectionOption = TAppConnectionOptionBase & {
|
||||
app: AppConnection.OnePass;
|
||||
};
|
||||
@@ -145,6 +150,7 @@ export type TAppConnectionOption =
|
||||
| TTeamCityConnectionOption
|
||||
| TOCIConnectionOption
|
||||
| TOnePassConnectionOption
|
||||
| THerokuConnectionOption
|
||||
| TRenderConnectionOption
|
||||
| TFlyioConnectionOption
|
||||
| TCloudflareConnectionOption;
|
||||
@@ -174,6 +180,7 @@ export type TAppConnectionOptionMap = {
|
||||
[AppConnection.TeamCity]: TTeamCityConnectionOption;
|
||||
[AppConnection.OCI]: TOCIConnectionOption;
|
||||
[AppConnection.OnePass]: TOnePassConnectionOption;
|
||||
[AppConnection.Heroku]: THerokuConnectionOption;
|
||||
[AppConnection.Render]: TRenderConnectionOption;
|
||||
[AppConnection.Flyio]: TFlyioConnectionOption;
|
||||
[AppConnection.Cloudflare]: TCloudflareConnectionOption;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { AppConnection } from "@app/hooks/api/appConnections/enums";
|
||||
import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";
|
||||
|
||||
export enum HerokuConnectionMethod {
|
||||
AuthToken = "auth-token",
|
||||
OAuth = "oauth"
|
||||
}
|
||||
|
||||
export type THerokuConnection = TRootAppConnection & { app: AppConnection.Heroku } & (
|
||||
| {
|
||||
method: HerokuConnectionMethod.AuthToken;
|
||||
credentials: {
|
||||
authToken: string;
|
||||
};
|
||||
}
|
||||
| {
|
||||
method: HerokuConnectionMethod.OAuth;
|
||||
credentials: {
|
||||
code: string;
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -15,6 +15,7 @@ import { TGcpConnection } from "./gcp-connection";
|
||||
import { TGitHubConnection } from "./github-connection";
|
||||
import { TGitHubRadarConnection } from "./github-radar-connection";
|
||||
import { THCVaultConnection } from "./hc-vault-connection";
|
||||
import { THerokuConnection } from "./heroku-connection";
|
||||
import { THumanitecConnection } from "./humanitec-connection";
|
||||
import { TLdapConnection } from "./ldap-connection";
|
||||
import { TMsSqlConnection } from "./mssql-connection";
|
||||
@@ -42,6 +43,7 @@ export * from "./gcp-connection";
|
||||
export * from "./github-connection";
|
||||
export * from "./github-radar-connection";
|
||||
export * from "./hc-vault-connection";
|
||||
export * from "./heroku-connection";
|
||||
export * from "./humanitec-connection";
|
||||
export * from "./ldap-connection";
|
||||
export * from "./mssql-connection";
|
||||
@@ -81,6 +83,7 @@ export type TAppConnection =
|
||||
| TTeamCityConnection
|
||||
| TOCIConnection
|
||||
| TOnePassConnection
|
||||
| THerokuConnection
|
||||
| TRenderConnection
|
||||
| TFlyioConnection
|
||||
| TCloudflareConnection;
|
||||
@@ -135,6 +138,7 @@ export type TAppConnectionMap = {
|
||||
[AppConnection.TeamCity]: TTeamCityConnection;
|
||||
[AppConnection.OCI]: TOCIConnection;
|
||||
[AppConnection.OnePass]: TOnePassConnection;
|
||||
[AppConnection.Heroku]: THerokuConnection;
|
||||
[AppConnection.Render]: TRenderConnection;
|
||||
[AppConnection.Flyio]: TFlyioConnection;
|
||||
[AppConnection.Cloudflare]: TCloudflareConnection;
|
||||
|
||||
Reference in New Issue
Block a user