feat: Checkly app connection and secrets sync (#4078)

* feat: checkly app connection
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Sid
2025-07-16 00:07:42 +05:30
committed by GitHub
co-authored by greptile-apps[bot]
parent 023079be16
commit 7ef077228e
91 changed files with 1448 additions and 36 deletions
@@ -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 "@app/hooks/api/appConnections";
import { TChecklyAccount } from "./types";
const checklyConnectionKeys = {
all: [...appConnectionKeys.all, "checkly"] as const,
listAccounts: (connectionId: string) =>
[...checklyConnectionKeys.all, "workspace-scopes", connectionId] as const
};
export const useChecklyConnectionListAccounts = (
connectionId: string,
options?: Omit<
UseQueryOptions<
TChecklyAccount[],
unknown,
TChecklyAccount[],
ReturnType<typeof checklyConnectionKeys.listAccounts>
>,
"queryKey" | "queryFn"
>
) => {
return useQuery({
queryKey: checklyConnectionKeys.listAccounts(connectionId),
queryFn: async () => {
const { data } = await apiRequest.get<{ accounts: TChecklyAccount[] }>(
`/api/v1/app-connections/checkly/${connectionId}/accounts`
);
return data.accounts;
},
...options
});
};
@@ -0,0 +1,5 @@
export type TChecklyAccount = {
id: string;
name: string;
runtimeId: string;
};
@@ -30,5 +30,6 @@ export enum AppConnection {
Cloudflare = "cloudflare",
Bitbucket = "bitbucket",
Zabbix = "zabbix",
Railway = "railway"
Railway = "railway",
Checkly = "checkly"
}
@@ -144,6 +144,10 @@ export type TRailwayConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Railway;
};
export type TChecklyConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.Checkly;
};
export type TAppConnectionOption =
| TAwsConnectionOption
| TGitHubConnectionOption
@@ -174,7 +178,8 @@ export type TAppConnectionOption =
| TCloudflareConnectionOption
| TBitbucketConnectionOption
| TZabbixConnectionOption
| TRailwayConnectionOption;
| TRailwayConnectionOption
| TChecklyConnectionOption;
export type TAppConnectionOptionMap = {
[AppConnection.AWS]: TAwsConnectionOption;
@@ -209,4 +214,5 @@ export type TAppConnectionOptionMap = {
[AppConnection.Bitbucket]: TBitbucketConnectionOption;
[AppConnection.Zabbix]: TZabbixConnectionOption;
[AppConnection.Railway]: TRailwayConnectionOption;
[AppConnection.Checkly]: TChecklyConnectionOption;
};
@@ -0,0 +1,14 @@
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";
export enum ChecklyConnectionMethod {
ApiKey = "api-key"
}
export type TChecklyConnection = TRootAppConnection & {
app: AppConnection.Checkly;
method: ChecklyConnectionMethod.ApiKey;
credentials: {
apiKey: string;
};
};
@@ -9,6 +9,7 @@ import { TAzureDevOpsConnection } from "./azure-devops-connection";
import { TAzureKeyVaultConnection } from "./azure-key-vault-connection";
import { TBitbucketConnection } from "./bitbucket-connection";
import { TCamundaConnection } from "./camunda-connection";
import { TChecklyConnection } from "./checkly-connection";
import { TCloudflareConnection } from "./cloudflare-connection";
import { TDatabricksConnection } from "./databricks-connection";
import { TFlyioConnection } from "./flyio-connection";
@@ -97,7 +98,8 @@ export type TAppConnection =
| TCloudflareConnection
| TBitbucketConnection
| TZabbixConnection
| TRailwayConnection;
| TRailwayConnection
| TChecklyConnection;
export type TAvailableAppConnection = Pick<TAppConnection, "name" | "id">;
@@ -157,4 +159,5 @@ export type TAppConnectionMap = {
[AppConnection.Bitbucket]: TBitbucketConnection;
[AppConnection.Zabbix]: TZabbixConnection;
[AppConnection.Railway]: TRailwayConnection;
[AppConnection.Checkly]: TChecklyConnection;
};
+2 -1
View File
@@ -24,7 +24,8 @@ export enum SecretSync {
CloudflareWorkers = "cloudflare-workers",
Zabbix = "zabbix",
Railway = "railway"
Railway = "railway",
Checkly = "checkly"
}
export enum SecretSyncStatus {
@@ -0,0 +1,17 @@
/* eslint-disable @typescript-eslint/no-empty-object-type */
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 TChecklySync = TRootSecretSync & {
destination: SecretSync.Checkly;
destinationConfig: {
accountId: string;
accountName: string;
};
connection: {
app: AppConnection.Checkly;
name: string;
id: string;
};
};
@@ -9,6 +9,7 @@ import { TAzureAppConfigurationSync } from "./azure-app-configuration-sync";
import { TAzureDevOpsSync } from "./azure-devops-sync";
import { TAzureKeyVaultSync } from "./azure-key-vault-sync";
import { TCamundaSync } from "./camunda-sync";
import { TChecklySync } from "./checkly-sync";
import { TCloudflarePagesSync } from "./cloudflare-pages-sync";
import { TCloudflareWorkersSync } from "./cloudflare-workers-sync";
import { TDatabricksSync } from "./databricks-sync";
@@ -59,7 +60,8 @@ export type TSecretSync =
| TCloudflarePagesSync
| TCloudflareWorkersSync
| TZabbixSync
| TRailwaySync;
| TRailwaySync
| TChecklySync;
export type TListSecretSyncs = { secretSyncs: TSecretSync[] };