|
|
@@ -11,7 +11,7 @@ import {
|
|
|
CreateStackBody,
|
|
|
SourceConfig,
|
|
|
} from "main/home/cluster-dashboard/stacks/types";
|
|
|
-import { Contract, EnumCloudProvider, GKEPreflightValues, PreflightCheckRequest } from "@porter-dev/api-contracts";
|
|
|
+import { Contract, PreflightCheckRequest } from "@porter-dev/api-contracts";
|
|
|
|
|
|
/**
|
|
|
* Generic api call format
|
|
|
@@ -75,12 +75,12 @@ const getGitlabIntegration = baseApi<{}, { project_id: number }>(
|
|
|
({ project_id }) => `/api/projects/${project_id}/integrations/gitlab`
|
|
|
);
|
|
|
|
|
|
-
|
|
|
-const preflightCheck = baseApi<PreflightCheckRequest,
|
|
|
- { id: number }
|
|
|
->("POST", (pathParams) => {
|
|
|
- return `/api/projects/${pathParams.id}/integrations/preflightcheck`;
|
|
|
-});
|
|
|
+const preflightCheck = baseApi<PreflightCheckRequest, { id: number }>(
|
|
|
+ "POST",
|
|
|
+ (pathParams) => {
|
|
|
+ return `/api/projects/${pathParams.id}/integrations/preflightcheck`;
|
|
|
+ }
|
|
|
+);
|
|
|
|
|
|
const preflightCheckAWSUsage = baseApi<
|
|
|
{
|
|
|
@@ -288,8 +288,9 @@ const getFeedEvents = baseApi<
|
|
|
}
|
|
|
>("GET", (pathParams) => {
|
|
|
let { project_id, cluster_id, stack_name, page } = pathParams;
|
|
|
- return `/api/projects/${project_id}/clusters/${cluster_id}/applications/${stack_name}/events?page=${page || 1
|
|
|
- }`;
|
|
|
+ return `/api/projects/${project_id}/clusters/${cluster_id}/applications/${stack_name}/events?page=${
|
|
|
+ page || 1
|
|
|
+ }`;
|
|
|
});
|
|
|
|
|
|
const createEnvironment = baseApi<
|
|
|
@@ -714,9 +715,11 @@ const detectBuildpack = baseApi<
|
|
|
branch: string;
|
|
|
}
|
|
|
>("GET", (pathParams) => {
|
|
|
- return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id
|
|
|
- }/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name
|
|
|
- }/${encodeURIComponent(pathParams.branch)}/buildpack/detect`;
|
|
|
+ return `/api/projects/${pathParams.project_id}/gitrepos/${
|
|
|
+ pathParams.git_repo_id
|
|
|
+ }/repos/${pathParams.kind}/${pathParams.owner}/${
|
|
|
+ pathParams.name
|
|
|
+ }/${encodeURIComponent(pathParams.branch)}/buildpack/detect`;
|
|
|
});
|
|
|
|
|
|
const detectGitlabBuildpack = baseApi<
|
|
|
@@ -747,9 +750,11 @@ const getBranchContents = baseApi<
|
|
|
branch: string;
|
|
|
}
|
|
|
>("GET", (pathParams) => {
|
|
|
- return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id
|
|
|
- }/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name
|
|
|
- }/${encodeURIComponent(pathParams.branch)}/contents`;
|
|
|
+ return `/api/projects/${pathParams.project_id}/gitrepos/${
|
|
|
+ pathParams.git_repo_id
|
|
|
+ }/repos/${pathParams.kind}/${pathParams.owner}/${
|
|
|
+ pathParams.name
|
|
|
+ }/${encodeURIComponent(pathParams.branch)}/contents`;
|
|
|
});
|
|
|
|
|
|
const getProcfileContents = baseApi<
|
|
|
@@ -765,9 +770,11 @@ const getProcfileContents = baseApi<
|
|
|
branch: string;
|
|
|
}
|
|
|
>("GET", (pathParams) => {
|
|
|
- return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id
|
|
|
- }/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name
|
|
|
- }/${encodeURIComponent(pathParams.branch)}/procfile`;
|
|
|
+ return `/api/projects/${pathParams.project_id}/gitrepos/${
|
|
|
+ pathParams.git_repo_id
|
|
|
+ }/repos/${pathParams.kind}/${pathParams.owner}/${
|
|
|
+ pathParams.name
|
|
|
+ }/${encodeURIComponent(pathParams.branch)}/procfile`;
|
|
|
});
|
|
|
|
|
|
const getPorterYamlContents = baseApi<
|
|
|
@@ -783,9 +790,11 @@ const getPorterYamlContents = baseApi<
|
|
|
branch: string;
|
|
|
}
|
|
|
>("GET", (pathParams) => {
|
|
|
- return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id
|
|
|
- }/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name
|
|
|
- }/${encodeURIComponent(pathParams.branch)}/porteryaml`;
|
|
|
+ return `/api/projects/${pathParams.project_id}/gitrepos/${
|
|
|
+ pathParams.git_repo_id
|
|
|
+ }/repos/${pathParams.kind}/${pathParams.owner}/${
|
|
|
+ pathParams.name
|
|
|
+ }/${encodeURIComponent(pathParams.branch)}/porteryaml`;
|
|
|
});
|
|
|
|
|
|
const parsePorterYaml = baseApi<
|
|
|
@@ -821,9 +830,11 @@ const getBranchHead = baseApi<
|
|
|
branch: string;
|
|
|
}
|
|
|
>("GET", (pathParams) => {
|
|
|
- return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id
|
|
|
- }/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name
|
|
|
- }/${encodeURIComponent(pathParams.branch)}/head`;
|
|
|
+ return `/api/projects/${pathParams.project_id}/gitrepos/${
|
|
|
+ pathParams.git_repo_id
|
|
|
+ }/repos/${pathParams.kind}/${pathParams.owner}/${
|
|
|
+ pathParams.name
|
|
|
+ }/${encodeURIComponent(pathParams.branch)}/head`;
|
|
|
});
|
|
|
|
|
|
const validatePorterApp = baseApi<
|
|
|
@@ -831,6 +842,10 @@ const validatePorterApp = baseApi<
|
|
|
b64_app_proto: string;
|
|
|
deployment_target_id: string;
|
|
|
commit_sha: string;
|
|
|
+ deletions: {
|
|
|
+ service_names: string[];
|
|
|
+ env_variable_names: string[];
|
|
|
+ };
|
|
|
},
|
|
|
{
|
|
|
project_id: number;
|
|
|
@@ -842,21 +857,21 @@ const validatePorterApp = baseApi<
|
|
|
|
|
|
const createApp = baseApi<
|
|
|
| {
|
|
|
- name: string;
|
|
|
- type: "github";
|
|
|
- git_repo_id: number;
|
|
|
- git_branch: string;
|
|
|
- git_repo_name: string;
|
|
|
- porter_yaml_path: string;
|
|
|
- }
|
|
|
+ name: string;
|
|
|
+ type: "github";
|
|
|
+ git_repo_id: number;
|
|
|
+ git_branch: string;
|
|
|
+ git_repo_name: string;
|
|
|
+ porter_yaml_path: string;
|
|
|
+ }
|
|
|
| {
|
|
|
- name: string;
|
|
|
- type: "docker-registry";
|
|
|
- image: {
|
|
|
- repository: string;
|
|
|
- tag: string;
|
|
|
- };
|
|
|
- },
|
|
|
+ name: string;
|
|
|
+ type: "docker-registry";
|
|
|
+ image: {
|
|
|
+ repository: string;
|
|
|
+ tag: string;
|
|
|
+ };
|
|
|
+ },
|
|
|
{
|
|
|
project_id: number;
|
|
|
cluster_id: number;
|
|
|
@@ -1767,9 +1782,11 @@ const getEnvGroup = baseApi<
|
|
|
version?: number;
|
|
|
}
|
|
|
>("GET", (pathParams) => {
|
|
|
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id
|
|
|
- }/namespaces/${pathParams.namespace}/envgroup?name=${pathParams.name}${pathParams.version ? "&version=" + pathParams.version : ""
|
|
|
- }`;
|
|
|
+ return `/api/projects/${pathParams.id}/clusters/${
|
|
|
+ pathParams.cluster_id
|
|
|
+ }/namespaces/${pathParams.namespace}/envgroup?name=${pathParams.name}${
|
|
|
+ pathParams.version ? "&version=" + pathParams.version : ""
|
|
|
+ }`;
|
|
|
});
|
|
|
|
|
|
const getConfigMap = baseApi<
|
|
|
@@ -2826,7 +2843,7 @@ const removeStackEnvGroup = baseApi<
|
|
|
`/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/remove_env_group/${env_group_name}`
|
|
|
);
|
|
|
|
|
|
-const getGithubStatus = baseApi<{}, {}>("GET", ({ }) => `/api/status/github`);
|
|
|
+const getGithubStatus = baseApi<{}, {}>("GET", ({}) => `/api/status/github`);
|
|
|
|
|
|
const createSecretAndOpenGitHubPullRequest = baseApi<
|
|
|
{
|