| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171 |
- import { baseApi } from "./baseApi";
- import { FullActionConfigType, StorageType } from "./types";
- /**
- * Generic api call format
- * @param {string} token - Bearer token.
- * @param {Object} params - Body params.
- * @param {Object} pathParams - Path params.
- * @param {(err: Object, res: Object) => void} callback - Callback function.
- */
- const checkAuth = baseApi("GET", "/api/users/current");
- const connectECRRegistry = baseApi<
- {
- name: string;
- aws_integration_id: string;
- },
- { id: number }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.id}/registries`;
- });
- const connectGCRRegistry = baseApi<
- {
- name: string;
- gcp_integration_id: string;
- url: string;
- },
- { id: number }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.id}/registries`;
- });
- const createAWSIntegration = baseApi<
- {
- aws_region: string;
- aws_cluster_id?: string;
- aws_access_key_id: string;
- aws_secret_access_key: string;
- },
- { id: number }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.id}/integrations/aws`;
- });
- const overwriteAWSIntegration = baseApi<
- {
- aws_integration_id: number;
- aws_access_key_id: string;
- aws_secret_access_key: string;
- cluster_id: number;
- },
- {
- project_id: number;
- }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/integrations/aws/overwrite`;
- });
- const createDOCR = baseApi<
- {
- do_integration_id: number;
- docr_name: string;
- docr_subscription_tier: string;
- },
- {
- project_id: number;
- }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/provision/docr`;
- });
- const createDOKS = baseApi<
- {
- do_integration_id: number;
- doks_name: string;
- do_region: string;
- },
- {
- project_id: number;
- }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/provision/doks`;
- });
- const createEmailVerification = baseApi<{}, {}>("POST", (pathParams) => {
- return `/api/email/verify/initiate`;
- });
- const createGCPIntegration = baseApi<
- {
- gcp_region: string;
- gcp_key_data: string;
- gcp_project_id: string;
- },
- {
- project_id: number;
- }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/integrations/gcp`;
- });
- const createGCR = baseApi<
- {
- gcp_integration_id: number;
- },
- {
- project_id: number;
- }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/provision/gcr`;
- });
- const createGKE = baseApi<
- {
- gcp_integration_id: number;
- gke_name: string;
- },
- {
- project_id: number;
- }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/provision/gke`;
- });
- const createInvite = baseApi<
- {
- email: string;
- kind: string;
- },
- {
- id: number;
- }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.id}/invites`;
- });
- const createPasswordReset = baseApi<
- {
- email: string;
- },
- {}
- >("POST", (pathParams) => {
- return `/api/password/reset/initiate`;
- });
- const createPasswordResetVerify = baseApi<
- {
- email: string;
- token: string;
- token_id: number;
- },
- {}
- >("POST", (pathParams) => {
- return `/api/password/reset/verify`;
- });
- const createPasswordResetFinalize = baseApi<
- {
- email: string;
- token: string;
- token_id: number;
- new_password: string;
- },
- {}
- >("POST", (pathParams) => {
- return `/api/password/reset/finalize`;
- });
- const createProject = baseApi<{ name: string }, {}>("POST", (pathParams) => {
- return `/api/projects`;
- });
- const createSubdomain = baseApi<
- {},
- {
- id: number;
- release_name: string;
- namespace: string;
- cluster_id: number;
- }
- >("POST", (pathParams) => {
- let { cluster_id, id, namespace, release_name } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/subdomain`;
- });
- const deleteCluster = baseApi<
- {},
- {
- project_id: number;
- cluster_id: number;
- }
- >("DELETE", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
- });
- const deleteInvite = baseApi<{}, { id: number; invId: number }>(
- "DELETE",
- (pathParams) => {
- return `/api/projects/${pathParams.id}/invites/${pathParams.invId}`;
- }
- );
- const deletePod = baseApi<
- {},
- { name: string; namespace: string; id: number; cluster_id: number }
- >("DELETE", (pathParams) => {
- let { id, name, cluster_id, namespace } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}`;
- });
- const getPodEvents = baseApi<
- {},
- { name: string; namespace: string; id: number; cluster_id: number }
- >("GET", (pathParams) => {
- let { id, name, cluster_id, namespace } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}/events`;
- });
- const deleteProject = baseApi<{}, { id: number }>("DELETE", (pathParams) => {
- return `/api/projects/${pathParams.id}`;
- });
- const deleteRegistryIntegration = baseApi<
- {},
- {
- project_id: number;
- registry_id: number;
- }
- >("DELETE", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}`;
- });
- const deleteSlackIntegration = baseApi<
- {},
- {
- project_id: number;
- slack_integration_id: number;
- }
- >("DELETE", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/slack_integrations/${pathParams.slack_integration_id}`;
- });
- const updateNotificationConfig = baseApi<
- {
- payload: any;
- },
- {
- project_id: number;
- cluster_id: number;
- namespace: string;
- name: string;
- }
- >("POST", (pathParams) => {
- let { project_id, cluster_id, namespace, name } = pathParams;
- return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/notifications`;
- });
- const getNotificationConfig = baseApi<
- {},
- {
- project_id: number;
- cluster_id: number;
- namespace: string;
- name: string;
- }
- >("GET", (pathParams) => {
- let { project_id, cluster_id, namespace, name } = pathParams;
- return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/notifications`;
- });
- const getGHAWorkflowTemplate = baseApi<
- {
- release_name: string;
- github_action_config: FullActionConfigType;
- },
- {
- cluster_id: number;
- project_id: number;
- namespace: string;
- }
- >("POST", (pathParams) => {
- const { cluster_id, project_id, namespace } = pathParams;
- return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/gha_template`;
- });
- const deployTemplate = baseApi<
- {
- template_name: string;
- template_version: string;
- image_url?: string;
- values?: any;
- name: string;
- github_action_config?: FullActionConfigType;
- },
- {
- id: number;
- cluster_id: number;
- namespace: string;
- repo_url?: string;
- }
- >("POST", (pathParams) => {
- let { cluster_id, id, namespace, repo_url } = pathParams;
- if (repo_url) {
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases?repo_url=${repo_url}`;
- }
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases`;
- });
- const deployAddon = baseApi<
- {
- template_name: string;
- template_version: string;
- values?: any;
- name: string;
- },
- {
- id: number;
- cluster_id: number;
- namespace: string;
- repo_url?: string;
- }
- >("POST", (pathParams) => {
- let { cluster_id, id, namespace, repo_url } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/addons?repo_url=${repo_url}`;
- });
- const detectBuildpack = baseApi<
- {},
- {
- project_id: number;
- git_repo_id: number;
- kind: string;
- owner: string;
- name: string;
- 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`;
- });
- const getBranchContents = baseApi<
- {
- dir: string;
- },
- {
- project_id: number;
- git_repo_id: number;
- kind: string;
- owner: string;
- name: string;
- 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`;
- });
- const getProcfileContents = baseApi<
- {
- path: string;
- },
- {
- project_id: number;
- git_repo_id: number;
- kind: string;
- owner: string;
- name: string;
- 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`;
- });
- const getBranches = baseApi<
- {},
- {
- project_id: number;
- git_repo_id: number;
- kind: string;
- owner: string;
- name: string;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name}/branches`;
- });
- const getChart = baseApi<
- {},
- {
- id: number;
- cluster_id: number;
- namespace: string;
- name: string;
- revision: number;
- }
- >("GET", (pathParams) => {
- let { id, cluster_id, namespace, name, revision } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}`;
- });
- const getCharts = baseApi<
- {
- limit: number;
- skip: number;
- byDate: boolean;
- statusFilter: string[];
- },
- {
- id: number;
- cluster_id: number;
- namespace: string;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/releases`;
- });
- const getChartComponents = baseApi<
- {},
- {
- id: number;
- cluster_id: number;
- namespace: string;
- name: string;
- revision: number;
- }
- >("GET", (pathParams) => {
- let { id, cluster_id, namespace, name, revision } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}/components`;
- });
- const getChartControllers = baseApi<
- {},
- {
- id: number;
- cluster_id: number;
- namespace: string;
- name: string;
- revision: number;
- }
- >("GET", (pathParams) => {
- let { id, cluster_id, namespace, name, revision } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}/controllers`;
- });
- const getClusterIntegrations = baseApi("GET", "/api/integrations/cluster");
- const getClusters = baseApi<{}, { id: number }>("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters`;
- });
- const getCluster = baseApi<
- {},
- {
- project_id: number;
- cluster_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
- });
- const getClusterNodes = baseApi<
- {},
- {
- project_id: number;
- cluster_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}/nodes`;
- });
- const getClusterNode = baseApi<
- {},
- {
- project_id: number;
- cluster_id: number;
- nodeName: string;
- }
- >(
- "GET",
- (pathParams) =>
- `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}/nodes/${pathParams.nodeName}`
- );
- const getGitRepoList = baseApi<
- {},
- {
- project_id: number;
- git_repo_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos`;
- });
- const getGitRepos = baseApi<
- {},
- {
- project_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/gitrepos`;
- });
- const getImageRepos = baseApi<
- {},
- {
- project_id: number;
- registry_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories`;
- });
- const getImageTags = baseApi<
- {},
- {
- project_id: number;
- registry_id: number;
- repo_name: string;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories/${pathParams.repo_name}`;
- });
- const getInfra = baseApi<
- {},
- {
- project_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/infra`;
- });
- const getIngress = baseApi<
- {},
- { namespace: string; cluster_id: number; name: string; id: number }
- >("GET", (pathParams) => {
- let { id, name, cluster_id, namespace } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/ingresses/${name}`;
- });
- const getInvites = baseApi<{}, { id: number }>("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/invites`;
- });
- const getJobs = baseApi<
- {},
- { namespace: string; cluster_id: number; release_name: string; id: number }
- >("GET", (pathParams) => {
- let { id, release_name, cluster_id, namespace } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/jobs`;
- });
- const getJobStatus = baseApi<
- {},
- { namespace: string; cluster_id: number; release_name: string; id: number }
- >("GET", (pathParams) => {
- let { id, release_name, cluster_id, namespace } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/jobs/status`;
- });
- const getJobPods = baseApi<
- {},
- { name: string; namespace: string; id: number; cluster_id: number }
- >("GET", (pathParams) => {
- let { id, name, cluster_id, namespace } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}/pods`;
- });
- const getMatchingPods = baseApi<
- {
- namespace: string;
- selectors: string[];
- },
- { id: number; cluster_id: number }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/pods`;
- });
- const getMetrics = baseApi<
- {
- metric: string;
- shouldsum: boolean;
- pods?: string[];
- kind?: string; // the controller kind
- name?: string;
- percentile?: number;
- namespace: string;
- startrange: number;
- endrange: number;
- resolution: string;
- },
- {
- id: number;
- cluster_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/metrics`;
- });
- const getNamespaces = baseApi<
- {},
- {
- id: number;
- cluster_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces`;
- });
- const getNGINXIngresses = baseApi<
- {},
- {
- id: number;
- cluster_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/prometheus/ingresses`;
- });
- const getOAuthIds = baseApi<
- {},
- {
- project_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/integrations/oauth`;
- });
- const getProjectClusters = baseApi<{}, { id: number }>("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters`;
- });
- const getProjectRegistries = baseApi<{}, { id: number }>(
- "GET",
- (pathParams) => {
- return `/api/projects/${pathParams.id}/registries`;
- }
- );
- const getProjectRepos = baseApi<{}, { id: number }>("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/repos`;
- });
- const getProjects = baseApi("GET", "/api/projects");
- const getPrometheusIsInstalled = baseApi<
- {},
- {
- id: number;
- cluster_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/prometheus/detect`;
- });
- const getRegistryIntegrations = baseApi("GET", "/api/integrations/registry");
- const getReleaseToken = baseApi<
- {},
- { name: string; id: number; namespace: string; cluster_id: number }
- >("GET", (pathParams) => {
- let { id, cluster_id, namespace, name } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/webhook`;
- });
- const getReleaseSteps = baseApi<
- {},
- { name: string; id: number; namespace: string; cluster_id: number }
- >("GET", (pathParams) => {
- let { id, cluster_id, namespace, name } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/steps`;
- });
- const destroyInfra = baseApi<
- {
- name: string;
- },
- {
- project_id: number;
- infra_id: number;
- }
- >("DELETE", (pathParams) => {
- return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}`;
- });
- const getRepoIntegrations = baseApi("GET", "/api/integrations/repo");
- const getRepos = baseApi<{}, { id: number }>("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/repos`;
- });
- const getSlackIntegrations = baseApi<{}, { id: number }>(
- "GET",
- (pathParams) => {
- return `/api/projects/${pathParams.id}/slack_integrations`;
- }
- );
- const getRevisions = baseApi<
- {},
- { id: number; cluster_id: number; namespace: string; name: string }
- >("GET", (pathParams) => {
- let { id, cluster_id, namespace, name } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/history`;
- });
- const getTemplateInfo = baseApi<
- {
- repo_url?: string;
- },
- { name: string; version: string }
- >("GET", (pathParams) => {
- return `/api/templates/${pathParams.name}/${pathParams.version}`;
- });
- const getTemplateUpgradeNotes = baseApi<
- {
- repo_url?: string;
- prev_version: string;
- },
- { name: string; version: string }
- >("GET", (pathParams) => {
- return `/api/templates/${pathParams.name}/${pathParams.version}/upgrade_notes`;
- });
- const getTemplates = baseApi<
- {
- repo_url?: string;
- },
- {}
- >("GET", "/api/templates");
- const getMetadata = baseApi<{}, {}>("GET", () => {
- return `/api/metadata`;
- });
- const postWelcome = baseApi<{
- email: string;
- isCompany: boolean;
- company: string;
- role: string;
- }>("POST", () => {
- return `/api/welcome`;
- });
- const linkGithubProject = baseApi<
- {},
- {
- project_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/oauth/projects/${pathParams.project_id}/github`;
- });
- const getGithubAccounts = baseApi<{}, {}>("GET", () => {
- return `/api/integrations/github-app/accounts`;
- });
- const logInUser = baseApi<{
- email: string;
- password: string;
- }>("POST", "/api/login");
- const logOutUser = baseApi("POST", "/api/logout");
- const provisionECR = baseApi<
- {
- ecr_name: string;
- aws_integration_id: string;
- },
- { id: number }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.id}/provision/ecr`;
- });
- const provisionEKS = baseApi<
- {
- eks_name: string;
- aws_integration_id: string;
- machine_type: string;
- },
- { id: number }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.id}/provision/eks`;
- });
- const registerUser = baseApi<{
- email: string;
- password: string;
- }>("POST", "/api/users");
- const rollbackChart = baseApi<
- {
- revision: number;
- },
- {
- id: number;
- name: string;
- namespace: string;
- cluster_id: number;
- }
- >("POST", (pathParams) => {
- let { id, name, cluster_id, namespace } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0/rollback`;
- });
- const uninstallTemplate = baseApi<
- {},
- {
- id: number;
- name: string;
- cluster_id: number;
- namespace: string;
- }
- >("DELETE", (pathParams) => {
- let { id, name, cluster_id, namespace } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0`;
- });
- const updateUser = baseApi<
- {
- rawKubeConfig?: string;
- allowedContexts?: string[];
- },
- { id: number }
- >("PUT", (pathParams) => {
- return `/api/users/${pathParams.id}`;
- });
- const upgradeChartValues = baseApi<
- {
- values: string;
- version?: string;
- },
- {
- id: number;
- name: string;
- namespace: string;
- cluster_id: number;
- }
- >("POST", (pathParams) => {
- let { id, name, cluster_id, namespace } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0/upgrade`;
- });
- const listConfigMaps = baseApi<
- {},
- {
- id: number;
- namespace: string;
- cluster_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/list`;
- });
- const getConfigMap = baseApi<
- {
- name: string;
- },
- {
- id: number;
- namespace: string;
- cluster_id: number;
- }
- >("GET", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap`;
- });
- const createConfigMap = baseApi<
- {
- name: string;
- variables: Record<string, string>;
- secret_variables?: Record<string, string>;
- },
- {
- id: number;
- cluster_id: number;
- namespace: string;
- }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/create`;
- });
- const updateConfigMap = baseApi<
- {
- name: string;
- variables: Record<string, string>;
- secret_variables?: Record<string, string>;
- },
- {
- id: number;
- cluster_id: number;
- namespace: string;
- }
- >("POST", (pathParams) => {
- let { id, cluster_id } = pathParams;
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/update`;
- });
- const renameConfigMap = baseApi<
- {
- name: string;
- new_name: string;
- },
- {
- id: number;
- cluster_id: number;
- namespace: string;
- }
- >("POST", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/rename`;
- });
- const deleteConfigMap = baseApi<
- {
- name: string;
- },
- {
- id: number;
- namespace: string;
- cluster_id: number;
- }
- >("DELETE", (pathParams) => {
- return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/delete`;
- });
- const createNamespace = baseApi<
- {
- name: string;
- },
- { id: number; cluster_id: number }
- >("POST", (pathParams) => {
- let { id, cluster_id } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/create`;
- });
- const deleteNamespace = baseApi<
- {
- name: string;
- },
- {
- id: number;
- cluster_id: number;
- }
- >("DELETE", (pathParams) => {
- let { id, cluster_id } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/delete`;
- });
- const deleteJob = baseApi<
- {},
- { name: string; namespace: string; id: number; cluster_id: number }
- >("DELETE", (pathParams) => {
- let { id, name, cluster_id, namespace } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}`;
- });
- const stopJob = baseApi<
- {},
- { name: string; namespace: string; id: number; cluster_id: number }
- >("POST", (pathParams) => {
- let { id, name, namespace, cluster_id } = pathParams;
- return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}/stop`;
- });
- const getAvailableRoles = baseApi<{}, { project_id: number }>(
- "GET",
- ({ project_id }) => `/api/projects/${project_id}/roles`
- );
- const updateInvite = baseApi<
- { kind: string },
- { project_id: number; invite_id: number }
- >(
- "POST",
- ({ project_id, invite_id }) =>
- `/api/projects/${project_id}/invites/${invite_id}`
- );
- const getCollaborators = baseApi<{}, { project_id: number }>(
- "GET",
- ({ project_id }) => `/api/projects/${project_id}/collaborators`
- );
- const updateCollaborator = baseApi<
- {
- kind: string;
- user_id: number;
- },
- { project_id: number }
- >("POST", ({ project_id }) => `/api/projects/${project_id}/roles`);
- const removeCollaborator = baseApi<{ user_id: number }, { project_id: number }>(
- "DELETE",
- ({ project_id }) => `/api/projects/${project_id}/roles`
- );
- const getPolicyDocument = baseApi<{}, { project_id: number }>(
- "GET",
- ({ project_id }) => `/api/projects/${project_id}/policy`
- );
- const createWebhookToken = baseApi<
- {},
- {
- project_id: number;
- chart_name: string;
- namespace: string;
- cluster_id: number;
- }
- >(
- "POST",
- ({ project_id, chart_name, namespace, cluster_id }) =>
- `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${chart_name}/0/webhook`
- );
- const getUsage = baseApi<{}, { project_id: number }>(
- "GET",
- ({ project_id }) => `/api/projects/${project_id}/usage`
- );
- // Used for billing purposes
- const getCustomerToken = baseApi<{}, { project_id: number }>(
- "GET",
- ({ project_id }) => `/api/projects/${project_id}/billing/token`
- );
- const getHasBilling = baseApi<{}, { project_id: number }>(
- "GET",
- ({ project_id }) => `/api/projects/${project_id}/billing`
- );
- // Bundle export to allow default api import (api.<method> is more readable)
- export default {
- checkAuth,
- connectECRRegistry,
- connectGCRRegistry,
- createAWSIntegration,
- overwriteAWSIntegration,
- createDOCR,
- createDOKS,
- createEmailVerification,
- createGCPIntegration,
- createGCR,
- createGKE,
- createInvite,
- createNamespace,
- createPasswordReset,
- createPasswordResetVerify,
- createPasswordResetFinalize,
- createProject,
- createConfigMap,
- deleteCluster,
- deleteConfigMap,
- deleteInvite,
- deleteNamespace,
- deletePod,
- deleteProject,
- deleteRegistryIntegration,
- deleteSlackIntegration,
- updateNotificationConfig,
- getNotificationConfig,
- createSubdomain,
- deployTemplate,
- deployAddon,
- destroyInfra,
- detectBuildpack,
- getBranchContents,
- getBranches,
- getMetadata,
- postWelcome,
- getChart,
- getCharts,
- getChartComponents,
- getChartControllers,
- getClusterIntegrations,
- getClusters,
- getCluster,
- getClusterNodes,
- getClusterNode,
- getConfigMap,
- getGHAWorkflowTemplate,
- getGitRepoList,
- getGitRepos,
- getImageRepos,
- getImageTags,
- getInfra,
- getIngress,
- getInvites,
- getJobs,
- getJobStatus,
- getJobPods,
- getMatchingPods,
- getMetrics,
- getNamespaces,
- getNGINXIngresses,
- getOAuthIds,
- getPodEvents,
- getProcfileContents,
- getProjectClusters,
- getProjectRegistries,
- getProjectRepos,
- getProjects,
- getPrometheusIsInstalled,
- getRegistryIntegrations,
- getReleaseToken,
- getReleaseSteps,
- getRepoIntegrations,
- getSlackIntegrations,
- getRepos,
- getRevisions,
- getTemplateInfo,
- getTemplateUpgradeNotes,
- getTemplates,
- linkGithubProject,
- getGithubAccounts,
- listConfigMaps,
- logInUser,
- logOutUser,
- provisionECR,
- provisionEKS,
- registerUser,
- rollbackChart,
- uninstallTemplate,
- updateUser,
- renameConfigMap,
- updateConfigMap,
- upgradeChartValues,
- deleteJob,
- stopJob,
- updateInvite,
- getAvailableRoles,
- getCollaborators,
- updateCollaborator,
- removeCollaborator,
- getPolicyDocument,
- createWebhookToken,
- getUsage,
- getCustomerToken,
- getHasBilling,
- };
|