General improvements to Humanitec integration

This commit is contained in:
carlosmonastyrski
2025-03-13 09:41:12 -03:00
parent 568aadef75
commit b0b55344ce
27 changed files with 340 additions and 166 deletions
@@ -12,4 +12,17 @@ export type THumanitecApp = {
export type THumanitecConnectionApp = {
id: string;
name: string;
envs: THumanitecConnectionEnvironment[];
};
export type THumanitecConnectionEnvironment = {
id: string;
name: string;
};
export type THumanitecConnectionOrganization = {
id: string;
name: string;
apps: THumanitecConnectionApp[];
};
@@ -44,7 +44,8 @@ export type TAppConnectionOption =
| TGcpConnectionOption
| TAzureAppConfigurationConnectionOption
| TAzureKeyVaultConnectionOption
| TDatabricksConnectionOption;
| TDatabricksConnectionOption
| THumanitecConnectionOption;
export type TAppConnectionOptionMap = {
[AppConnection.AWS]: TAwsConnectionOption;
@@ -2,12 +2,12 @@ import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";
export enum HumanitecConnectionMethod {
AccessKey = "access-key"
API_TOKEN = "api-token"
}
export type THumanitecConnection = TRootAppConnection & { app: AppConnection.Humanitec } & {
method: HumanitecConnectionMethod.AccessKey;
method: HumanitecConnectionMethod.API_TOKEN;
credentials: {
accessKeyId: string;
apiToken: string;
};
};
@@ -4,13 +4,26 @@ import { TRootSecretSync } from "@app/hooks/api/secretSyncs/types/root-sync";
export type THumanitecSync = TRootSecretSync & {
destination: SecretSync.Humanitec;
destinationConfig: {
org: string;
app: string;
};
destinationConfig:
| {
scope: HumanitecSyncScope.Application;
org: string;
app: string;
}
| {
scope: HumanitecSyncScope.Environment;
org: string;
app: string;
env: string;
};
connection: {
app: AppConnection.Humanitec;
name: string;
id: string;
};
};
export enum HumanitecSyncScope {
Application = "application",
Environment = "environment"
}