api.tsx 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290
  1. import { PolicyDocType } from "./auth/types";
  2. import { PullRequest } from "main/home/cluster-dashboard/preview-environments/types";
  3. import { baseApi } from "./baseApi";
  4. import { BuildConfig, FullActionConfigType } from "./types";
  5. import {
  6. CreateStackBody,
  7. SourceConfig,
  8. } from "main/home/cluster-dashboard/stacks/types";
  9. /**
  10. * Generic api call format
  11. * @param {string} token - Bearer token.
  12. * @param {Object} params - Body params.
  13. * @param {Object} pathParams - Path params.
  14. * @param {(err: Object, res: Object) => void} callback - Callback function.
  15. */
  16. const checkAuth = baseApi("GET", "/api/users/current");
  17. const connectECRRegistry = baseApi<
  18. {
  19. name: string;
  20. aws_integration_id: string;
  21. },
  22. { id: number }
  23. >("POST", (pathParams) => {
  24. return `/api/projects/${pathParams.id}/registries`;
  25. });
  26. const connectGCRRegistry = baseApi<
  27. {
  28. name: string;
  29. gcp_integration_id: string;
  30. url: string;
  31. },
  32. { id: number }
  33. >("POST", (pathParams) => {
  34. return `/api/projects/${pathParams.id}/registries`;
  35. });
  36. const connectDORegistry = baseApi<
  37. {
  38. name: string;
  39. do_integration_id: string;
  40. url: string;
  41. },
  42. { project_id: number }
  43. >("POST", (pathParams) => {
  44. return `/api/projects/${pathParams.project_id}/registries`;
  45. });
  46. const getAWSIntegration = baseApi<{}, { project_id: number }>(
  47. "GET",
  48. ({ project_id }) => `/api/projects/${project_id}/integrations/aws`
  49. );
  50. const getGCPIntegration = baseApi<{}, { project_id: number }>(
  51. "GET",
  52. ({ project_id }) => `/api/projects/${project_id}/integrations/gcp`
  53. );
  54. const getAzureIntegration = baseApi<{}, { project_id: number }>(
  55. "GET",
  56. ({ project_id }) => `/api/projects/${project_id}/integrations/azure`
  57. );
  58. const getGitlabIntegration = baseApi<{}, { project_id: number }>(
  59. "GET",
  60. ({ project_id }) => `/api/projects/${project_id}/integrations/gitlab`
  61. );
  62. const createAWSIntegration = baseApi<
  63. {
  64. aws_region: string;
  65. aws_cluster_id?: string;
  66. aws_access_key_id: string;
  67. aws_secret_access_key: string;
  68. },
  69. { id: number }
  70. >("POST", (pathParams) => {
  71. return `/api/projects/${pathParams.id}/integrations/aws`;
  72. });
  73. const overwriteAWSIntegration = baseApi<
  74. {
  75. aws_integration_id: number;
  76. aws_access_key_id: string;
  77. aws_secret_access_key: string;
  78. cluster_id: number;
  79. },
  80. {
  81. project_id: number;
  82. }
  83. >("POST", (pathParams) => {
  84. return `/api/projects/${pathParams.project_id}/integrations/aws/overwrite`;
  85. });
  86. const updateClusterName = baseApi<
  87. {
  88. name: string;
  89. aws_cluster_id?: string;
  90. },
  91. {
  92. project_id: number;
  93. cluster_id: number;
  94. }
  95. >("POST", (pathParams) => {
  96. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
  97. });
  98. const createAzureIntegration = baseApi<
  99. {
  100. azure_client_id: string;
  101. azure_subscription_id: string;
  102. azure_tenant_id: string;
  103. service_principal_key: string;
  104. },
  105. { id: number }
  106. >("POST", (pathParams) => {
  107. return `/api/projects/${pathParams.id}/integrations/azure`;
  108. });
  109. const createGitlabIntegration = baseApi<
  110. {
  111. instance_url: string;
  112. client_id: string;
  113. client_secret: string;
  114. },
  115. { id: number }
  116. >("POST", (pathParams) => {
  117. return `/api/projects/${pathParams.id}/integrations/gitlab`;
  118. });
  119. const createEmailVerification = baseApi<{}, {}>("POST", (pathParams) => {
  120. return `/api/email/verify/initiate`;
  121. });
  122. const createEnvironment = baseApi<
  123. {
  124. name: string;
  125. mode: "auto" | "manual";
  126. },
  127. {
  128. project_id: number;
  129. cluster_id: number;
  130. git_installation_id: number;
  131. git_repo_owner: string;
  132. git_repo_name: string;
  133. }
  134. >("POST", (pathParams) => {
  135. let {
  136. project_id,
  137. cluster_id,
  138. git_installation_id,
  139. git_repo_owner,
  140. git_repo_name,
  141. } = pathParams;
  142. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${git_repo_owner}/${git_repo_name}/clusters/${cluster_id}/environment`;
  143. });
  144. const deleteEnvironment = baseApi<
  145. {
  146. name: string;
  147. },
  148. {
  149. project_id: number;
  150. cluster_id: number;
  151. git_installation_id: number;
  152. git_repo_owner: string;
  153. git_repo_name: string;
  154. }
  155. >("DELETE", (pathParams) => {
  156. let {
  157. project_id,
  158. cluster_id,
  159. git_installation_id,
  160. git_repo_owner,
  161. git_repo_name,
  162. } = pathParams;
  163. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${git_repo_owner}/${git_repo_name}/clusters/${cluster_id}/environment`;
  164. });
  165. const createPreviewEnvironmentDeployment = baseApi<
  166. PullRequest,
  167. { project_id: number; cluster_id: number }
  168. >(
  169. "POST",
  170. ({ project_id, cluster_id }) =>
  171. `/api/projects/${project_id}/clusters/${cluster_id}/deployments/pull_request`
  172. );
  173. const reenablePreviewEnvironmentDeployment = baseApi<
  174. {},
  175. {
  176. project_id: number;
  177. cluster_id: number;
  178. deployment_id: number;
  179. }
  180. >(
  181. "PATCH",
  182. ({ project_id, cluster_id, deployment_id }) =>
  183. `/api/projects/${project_id}/clusters/${cluster_id}/deployments/${deployment_id}/reenable`
  184. );
  185. const listEnvironments = baseApi<
  186. {},
  187. {
  188. project_id: number;
  189. cluster_id: number;
  190. }
  191. >("GET", (pathParams) => {
  192. let { project_id, cluster_id } = pathParams;
  193. return `/api/projects/${project_id}/clusters/${cluster_id}/environments`;
  194. });
  195. const getEnvironment = baseApi<
  196. {},
  197. {
  198. project_id: number;
  199. cluster_id: number;
  200. environment_id: number;
  201. }
  202. >("GET", (pathParams) => {
  203. let { project_id, cluster_id, environment_id } = pathParams;
  204. return `/api/projects/${project_id}/clusters/${cluster_id}/environments/${environment_id}`;
  205. });
  206. const toggleNewCommentForEnvironment = baseApi<
  207. {
  208. disable: boolean;
  209. },
  210. {
  211. project_id: number;
  212. cluster_id: number;
  213. environment_id: number;
  214. }
  215. >("PATCH", (pathParams) => {
  216. let { project_id, cluster_id, environment_id } = pathParams;
  217. return `/api/projects/${project_id}/clusters/${cluster_id}/environments/${environment_id}/toggle_new_comment`;
  218. });
  219. const createGCPIntegration = baseApi<
  220. {
  221. gcp_key_data: string;
  222. gcp_project_id: string;
  223. },
  224. {
  225. project_id: number;
  226. }
  227. >("POST", (pathParams) => {
  228. return `/api/projects/${pathParams.project_id}/integrations/gcp`;
  229. });
  230. const createInvite = baseApi<
  231. {
  232. email: string;
  233. kind: string;
  234. },
  235. {
  236. id: number;
  237. }
  238. >("POST", (pathParams) => {
  239. return `/api/projects/${pathParams.id}/invites`;
  240. });
  241. const createPasswordReset = baseApi<
  242. {
  243. email: string;
  244. },
  245. {}
  246. >("POST", (pathParams) => {
  247. return `/api/password/reset/initiate`;
  248. });
  249. const createPasswordResetVerify = baseApi<
  250. {
  251. email: string;
  252. token: string;
  253. token_id: number;
  254. },
  255. {}
  256. >("POST", (pathParams) => {
  257. return `/api/password/reset/verify`;
  258. });
  259. const createPasswordResetFinalize = baseApi<
  260. {
  261. email: string;
  262. token: string;
  263. token_id: number;
  264. new_password: string;
  265. },
  266. {}
  267. >("POST", (pathParams) => {
  268. return `/api/password/reset/finalize`;
  269. });
  270. const createProject = baseApi<{ name: string }, {}>("POST", (pathParams) => {
  271. return `/api/projects`;
  272. });
  273. const createSubdomain = baseApi<
  274. {},
  275. {
  276. id: number;
  277. release_name: string;
  278. namespace: string;
  279. cluster_id: number;
  280. }
  281. >("POST", (pathParams) => {
  282. let { cluster_id, id, namespace, release_name } = pathParams;
  283. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/subdomain`;
  284. });
  285. const deleteCluster = baseApi<
  286. {},
  287. {
  288. project_id: number;
  289. cluster_id: number;
  290. }
  291. >("DELETE", (pathParams) => {
  292. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
  293. });
  294. const deleteInvite = baseApi<{}, { id: number; invId: number }>(
  295. "DELETE",
  296. (pathParams) => {
  297. return `/api/projects/${pathParams.id}/invites/${pathParams.invId}`;
  298. }
  299. );
  300. const deletePod = baseApi<
  301. {},
  302. { name: string; namespace: string; id: number; cluster_id: number }
  303. >("DELETE", (pathParams) => {
  304. let { id, name, cluster_id, namespace } = pathParams;
  305. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}`;
  306. });
  307. const getPodEvents = baseApi<
  308. {},
  309. { name: string; namespace: string; id: number; cluster_id: number }
  310. >("GET", (pathParams) => {
  311. let { id, name, cluster_id, namespace } = pathParams;
  312. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}/events`;
  313. });
  314. const deleteProject = baseApi<{}, { id: number }>("DELETE", (pathParams) => {
  315. return `/api/projects/${pathParams.id}`;
  316. });
  317. const deleteRegistryIntegration = baseApi<
  318. {},
  319. {
  320. project_id: number;
  321. registry_id: number;
  322. }
  323. >("DELETE", (pathParams) => {
  324. return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}`;
  325. });
  326. const deleteSlackIntegration = baseApi<
  327. {},
  328. {
  329. project_id: number;
  330. slack_integration_id: number;
  331. }
  332. >("DELETE", (pathParams) => {
  333. return `/api/projects/${pathParams.project_id}/slack_integrations/${pathParams.slack_integration_id}`;
  334. });
  335. const updateNotificationConfig = baseApi<
  336. {
  337. payload: any;
  338. },
  339. {
  340. project_id: number;
  341. cluster_id: number;
  342. namespace: string;
  343. name: string;
  344. }
  345. >("POST", (pathParams) => {
  346. let { project_id, cluster_id, namespace, name } = pathParams;
  347. return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/notifications`;
  348. });
  349. const getPRDeploymentList = baseApi<
  350. {
  351. environment_id?: number;
  352. },
  353. {
  354. cluster_id: number;
  355. project_id: number;
  356. }
  357. >("GET", (pathParams) => {
  358. const { cluster_id, project_id } = pathParams;
  359. return `/api/projects/${project_id}/clusters/${cluster_id}/deployments`;
  360. });
  361. const getPRDeploymentByEnvironment = baseApi<
  362. {
  363. namespace: string;
  364. },
  365. {
  366. cluster_id: number;
  367. project_id: number;
  368. environment_id: number;
  369. }
  370. >("GET", (pathParams) => {
  371. const { cluster_id, project_id, environment_id } = pathParams;
  372. return `/api/projects/${project_id}/clusters/${cluster_id}/environments/${environment_id}/deployment`;
  373. });
  374. const getPRDeployment = baseApi<
  375. {
  376. namespace: string;
  377. },
  378. {
  379. cluster_id: number;
  380. project_id: number;
  381. git_installation_id: number;
  382. git_repo_owner: string;
  383. git_repo_name: string;
  384. }
  385. >("GET", (pathParams) => {
  386. const {
  387. cluster_id,
  388. project_id,
  389. git_installation_id,
  390. git_repo_owner,
  391. git_repo_name,
  392. } = pathParams;
  393. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${git_repo_owner}/${git_repo_name}/clusters/${cluster_id}/deployment`;
  394. });
  395. const deletePRDeployment = baseApi<
  396. {},
  397. {
  398. cluster_id: number;
  399. project_id: number;
  400. deployment_id: number;
  401. }
  402. >("DELETE", (pathParams) => {
  403. const { cluster_id, project_id, deployment_id } = pathParams;
  404. return `/api/projects/${project_id}/clusters/${cluster_id}/deployments/${deployment_id}`;
  405. });
  406. const getNotificationConfig = baseApi<
  407. {},
  408. {
  409. project_id: number;
  410. cluster_id: number;
  411. namespace: string;
  412. name: string;
  413. }
  414. >("GET", (pathParams) => {
  415. let { project_id, cluster_id, namespace, name } = pathParams;
  416. return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/notifications`;
  417. });
  418. const getGHAWorkflowTemplate = baseApi<
  419. {
  420. release_name: string;
  421. github_action_config: FullActionConfigType;
  422. },
  423. {
  424. cluster_id: number;
  425. project_id: number;
  426. namespace: string;
  427. }
  428. >("POST", (pathParams) => {
  429. const { cluster_id, project_id, namespace } = pathParams;
  430. return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/gha_template`;
  431. });
  432. const deployTemplate = baseApi<
  433. {
  434. template_name: string;
  435. template_version: string;
  436. image_url?: string;
  437. values?: any;
  438. name: string;
  439. git_action_config?: FullActionConfigType;
  440. build_config?: any;
  441. synced_env_groups?: string[];
  442. },
  443. {
  444. id: number;
  445. cluster_id: number;
  446. namespace: string;
  447. repo_url?: string;
  448. }
  449. >("POST", (pathParams) => {
  450. let { cluster_id, id, namespace, repo_url } = pathParams;
  451. if (repo_url) {
  452. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases?repo_url=${repo_url}`;
  453. }
  454. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases`;
  455. });
  456. const deployAddon = baseApi<
  457. {
  458. template_name: string;
  459. template_version: string;
  460. values?: any;
  461. name: string;
  462. },
  463. {
  464. id: number;
  465. cluster_id: number;
  466. namespace: string;
  467. repo_url?: string;
  468. }
  469. >("POST", (pathParams) => {
  470. let { cluster_id, id, namespace, repo_url } = pathParams;
  471. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/addons?repo_url=${repo_url}`;
  472. });
  473. const detectBuildpack = baseApi<
  474. {},
  475. {
  476. project_id: number;
  477. git_repo_id: number;
  478. kind: string;
  479. owner: string;
  480. name: string;
  481. branch: string;
  482. }
  483. >("GET", (pathParams) => {
  484. return `/api/projects/${pathParams.project_id}/gitrepos/${
  485. pathParams.git_repo_id
  486. }/repos/${pathParams.kind}/${pathParams.owner}/${
  487. pathParams.name
  488. }/${encodeURIComponent(pathParams.branch)}/buildpack/detect`;
  489. });
  490. const detectGitlabBuildpack = baseApi<
  491. { dir: string },
  492. {
  493. project_id: number;
  494. integration_id: number;
  495. repo_owner: string;
  496. repo_name: string;
  497. branch: string;
  498. }
  499. >(
  500. "GET",
  501. ({ project_id, integration_id, repo_name, repo_owner, branch }) =>
  502. `/api/projects/${project_id}/integrations/gitlab/${integration_id}/repos/${repo_owner}/${repo_name}/${branch}/buildpack/detect`
  503. );
  504. const getBranchContents = baseApi<
  505. {
  506. dir: string;
  507. },
  508. {
  509. project_id: number;
  510. git_repo_id: number;
  511. kind: string;
  512. owner: string;
  513. name: string;
  514. branch: string;
  515. }
  516. >("GET", (pathParams) => {
  517. return `/api/projects/${pathParams.project_id}/gitrepos/${
  518. pathParams.git_repo_id
  519. }/repos/${pathParams.kind}/${pathParams.owner}/${
  520. pathParams.name
  521. }/${encodeURIComponent(pathParams.branch)}/contents`;
  522. });
  523. const getProcfileContents = baseApi<
  524. {
  525. path: string;
  526. },
  527. {
  528. project_id: number;
  529. git_repo_id: number;
  530. kind: string;
  531. owner: string;
  532. name: string;
  533. branch: string;
  534. }
  535. >("GET", (pathParams) => {
  536. return `/api/projects/${pathParams.project_id}/gitrepos/${
  537. pathParams.git_repo_id
  538. }/repos/${pathParams.kind}/${pathParams.owner}/${
  539. pathParams.name
  540. }/${encodeURIComponent(pathParams.branch)}/procfile`;
  541. });
  542. const getGitlabProcfileContents = baseApi<
  543. {
  544. path: string;
  545. },
  546. {
  547. project_id: number;
  548. integration_id: number;
  549. owner: string;
  550. name: string;
  551. branch: string;
  552. }
  553. >(
  554. "GET",
  555. ({ project_id, integration_id, owner, name, branch }) =>
  556. `/api/projects/${project_id}/integrations/gitlab/${integration_id}/repos/${owner}/${name}/${encodeURIComponent(
  557. branch
  558. )}/procfile`
  559. );
  560. const getBranches = baseApi<
  561. {},
  562. {
  563. project_id: number;
  564. git_repo_id: number;
  565. kind: string;
  566. owner: string;
  567. name: string;
  568. }
  569. >("GET", (pathParams) => {
  570. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name}/branches`;
  571. });
  572. const getChart = baseApi<
  573. {},
  574. {
  575. id: number;
  576. cluster_id: number;
  577. namespace: string;
  578. name: string;
  579. revision: number;
  580. }
  581. >("GET", (pathParams) => {
  582. let { id, cluster_id, namespace, name, revision } = pathParams;
  583. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}`;
  584. });
  585. const getCharts = baseApi<
  586. {
  587. limit: number;
  588. skip: number;
  589. byDate: boolean;
  590. statusFilter: string[];
  591. },
  592. {
  593. id: number;
  594. cluster_id: number;
  595. namespace: string;
  596. }
  597. >("GET", (pathParams) => {
  598. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/releases`;
  599. });
  600. const getChartComponents = baseApi<
  601. {},
  602. {
  603. id: number;
  604. cluster_id: number;
  605. namespace: string;
  606. name: string;
  607. revision: number;
  608. }
  609. >("GET", (pathParams) => {
  610. let { id, cluster_id, namespace, name, revision } = pathParams;
  611. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}/components`;
  612. });
  613. const getChartControllers = baseApi<
  614. {},
  615. {
  616. id: number;
  617. cluster_id: number;
  618. namespace: string;
  619. name: string;
  620. revision: number;
  621. }
  622. >("GET", (pathParams) => {
  623. let { id, cluster_id, namespace, name, revision } = pathParams;
  624. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}/controllers`;
  625. });
  626. const getClusterIntegrations = baseApi("GET", "/api/integrations/cluster");
  627. const getClusters = baseApi<{}, { id: number }>("GET", (pathParams) => {
  628. return `/api/projects/${pathParams.id}/clusters`;
  629. });
  630. const getCluster = baseApi<
  631. {},
  632. {
  633. project_id: number;
  634. cluster_id: number;
  635. }
  636. >("GET", (pathParams) => {
  637. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
  638. });
  639. const getClusterNodes = baseApi<
  640. {},
  641. {
  642. project_id: number;
  643. cluster_id: number;
  644. }
  645. >("GET", (pathParams) => {
  646. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}/nodes`;
  647. });
  648. const getClusterNode = baseApi<
  649. {},
  650. {
  651. project_id: number;
  652. cluster_id: number;
  653. nodeName: string;
  654. }
  655. >(
  656. "GET",
  657. (pathParams) =>
  658. `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}/nodes/${pathParams.nodeName}`
  659. );
  660. const getGitRepoList = baseApi<
  661. {},
  662. {
  663. project_id: number;
  664. git_repo_id: number;
  665. }
  666. >("GET", (pathParams) => {
  667. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos`;
  668. });
  669. const getGitRepoPermission = baseApi<
  670. {},
  671. {
  672. project_id: number;
  673. git_repo_id: number;
  674. }
  675. >("GET", (pathParams) => {
  676. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/permissions`;
  677. });
  678. const getGitRepos = baseApi<
  679. {},
  680. {
  681. project_id: number;
  682. }
  683. >("GET", (pathParams) => {
  684. return `/api/projects/${pathParams.project_id}/gitrepos`;
  685. });
  686. const getImageRepos = baseApi<
  687. {},
  688. {
  689. project_id: number;
  690. registry_id: number;
  691. }
  692. >("GET", (pathParams) => {
  693. return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories`;
  694. });
  695. const getImageTags = baseApi<
  696. {},
  697. {
  698. project_id: number;
  699. registry_id: number;
  700. repo_name: string;
  701. }
  702. >("GET", (pathParams) => {
  703. return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories/${pathParams.repo_name}`;
  704. });
  705. const getInfra = baseApi<
  706. {
  707. version?: string;
  708. },
  709. {
  710. project_id: number;
  711. }
  712. >("GET", (pathParams) => {
  713. return `/api/projects/${pathParams.project_id}/infra`;
  714. });
  715. const listInfraTemplates = baseApi<
  716. {},
  717. {
  718. project_id: number;
  719. }
  720. >("GET", (pathParams) => {
  721. return `/api/projects/${pathParams.project_id}/infras/templates`;
  722. });
  723. const getInfraTemplate = baseApi<
  724. {},
  725. {
  726. project_id: number;
  727. name: string;
  728. version: string;
  729. }
  730. >("GET", (pathParams) => {
  731. let { project_id, name, version } = pathParams;
  732. return `/api/projects/${project_id}/infras/templates/${name}/${version}`;
  733. });
  734. const provisionInfra = baseApi<
  735. {
  736. kind: string;
  737. values: any;
  738. aws_integration_id?: number;
  739. gcp_integration_id?: number;
  740. do_integration_id?: number;
  741. azure_integration_id?: number;
  742. cluster_id?: number;
  743. },
  744. {
  745. project_id: number;
  746. }
  747. >("POST", ({ project_id }) => {
  748. return `/api/projects/${project_id}/infras`;
  749. });
  750. const updateInfra = baseApi<
  751. {
  752. values?: any;
  753. },
  754. {
  755. project_id: number;
  756. infra_id: number;
  757. }
  758. >("POST", (pathParams) => {
  759. let { project_id, infra_id } = pathParams;
  760. return `/api/projects/${project_id}/infras/${infra_id}/update`;
  761. });
  762. const retryCreateInfra = baseApi<
  763. {
  764. aws_integration_id?: number;
  765. gcp_integration_id?: number;
  766. do_integration_id?: number;
  767. values?: any;
  768. },
  769. {
  770. project_id: number;
  771. infra_id: number;
  772. }
  773. >("POST", (pathParams) => {
  774. let { project_id, infra_id } = pathParams;
  775. return `/api/projects/${project_id}/infras/${infra_id}/retry_create`;
  776. });
  777. const retryDeleteInfra = baseApi<
  778. {
  779. values?: any;
  780. },
  781. {
  782. project_id: number;
  783. infra_id: number;
  784. }
  785. >("POST", (pathParams) => {
  786. let { project_id, infra_id } = pathParams;
  787. return `/api/projects/${project_id}/infras/${infra_id}/retry_delete`;
  788. });
  789. const deleteInfra = baseApi<
  790. {},
  791. {
  792. project_id: number;
  793. infra_id: number;
  794. }
  795. >("DELETE", (pathParams) => {
  796. let { project_id, infra_id } = pathParams;
  797. return `/api/projects/${project_id}/infras/${infra_id}`;
  798. });
  799. const listOperations = baseApi<
  800. {},
  801. {
  802. project_id: number;
  803. infra_id: number;
  804. }
  805. >("GET", (pathParams) => {
  806. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/operations`;
  807. });
  808. const getOperation = baseApi<
  809. {},
  810. {
  811. project_id: number;
  812. infra_id: number;
  813. operation_id: string;
  814. }
  815. >("GET", (pathParams) => {
  816. let { project_id, infra_id, operation_id } = pathParams;
  817. return `/api/projects/${project_id}/infras/${infra_id}/operations/${operation_id}`;
  818. });
  819. const getOperationLogs = baseApi<
  820. {},
  821. {
  822. project_id: number;
  823. infra_id: number;
  824. operation_id: string;
  825. }
  826. >("GET", (pathParams) => {
  827. let { project_id, infra_id, operation_id } = pathParams;
  828. return `/api/projects/${project_id}/infras/${infra_id}/operations/${operation_id}/logs`;
  829. });
  830. const getInfraState = baseApi<
  831. {},
  832. {
  833. project_id: number;
  834. infra_id: number;
  835. }
  836. >("GET", (pathParams) => {
  837. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/state`;
  838. });
  839. const getInfraRawState = baseApi<
  840. {},
  841. {
  842. project_id: number;
  843. infra_id: number;
  844. }
  845. >("GET", (pathParams) => {
  846. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/raw_state`;
  847. });
  848. const getInfraByID = baseApi<
  849. {},
  850. {
  851. project_id: number;
  852. infra_id: number;
  853. }
  854. >("GET", (pathParams) => {
  855. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}`;
  856. });
  857. const getInfraDesired = baseApi<
  858. {},
  859. {
  860. project_id: number;
  861. infra_id: number;
  862. }
  863. >("GET", (pathParams) => {
  864. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/desired`;
  865. });
  866. const getInfraCurrent = baseApi<
  867. {},
  868. {
  869. project_id: number;
  870. infra_id: number;
  871. }
  872. >("GET", (pathParams) => {
  873. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/current`;
  874. });
  875. const getIngress = baseApi<
  876. {},
  877. { namespace: string; cluster_id: number; name: string; id: number }
  878. >("GET", (pathParams) => {
  879. let { id, name, cluster_id, namespace } = pathParams;
  880. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/ingresses/${name}`;
  881. });
  882. const getInvites = baseApi<{}, { id: number }>("GET", (pathParams) => {
  883. return `/api/projects/${pathParams.id}/invites`;
  884. });
  885. const getJobs = baseApi<
  886. {},
  887. { namespace: string; cluster_id: number; release_name: string; id: number }
  888. >("GET", (pathParams) => {
  889. let { id, release_name, cluster_id, namespace } = pathParams;
  890. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/jobs`;
  891. });
  892. const getJobStatus = baseApi<
  893. {},
  894. { namespace: string; cluster_id: number; release_name: string; id: number }
  895. >("GET", (pathParams) => {
  896. let { id, release_name, cluster_id, namespace } = pathParams;
  897. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/jobs/status`;
  898. });
  899. const getJobPods = baseApi<
  900. {},
  901. { name: string; namespace: string; id: number; cluster_id: number }
  902. >("GET", (pathParams) => {
  903. let { id, name, cluster_id, namespace } = pathParams;
  904. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}/pods`;
  905. });
  906. const getPodByName = baseApi<
  907. {},
  908. {
  909. project_id: number;
  910. cluster_id: number;
  911. namespace: string;
  912. name: string;
  913. }
  914. >(
  915. "GET",
  916. ({ project_id, cluster_id, namespace, name }) =>
  917. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}`
  918. );
  919. const getMatchingPods = baseApi<
  920. {
  921. namespace: string;
  922. selectors: string[];
  923. },
  924. { id: number; cluster_id: number }
  925. >("GET", (pathParams) => {
  926. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/pods`;
  927. });
  928. const getMetrics = baseApi<
  929. {
  930. metric: string;
  931. shouldsum: boolean;
  932. pods?: string[];
  933. kind?: string; // the controller kind
  934. name?: string;
  935. percentile?: number;
  936. namespace: string;
  937. startrange: number;
  938. endrange: number;
  939. resolution: string;
  940. },
  941. {
  942. id: number;
  943. cluster_id: number;
  944. }
  945. >("GET", (pathParams) => {
  946. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/metrics`;
  947. });
  948. const getNamespaces = baseApi<
  949. {},
  950. {
  951. id: number;
  952. cluster_id: number;
  953. }
  954. >("GET", (pathParams) => {
  955. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces`;
  956. });
  957. const getNGINXIngresses = baseApi<
  958. {},
  959. {
  960. id: number;
  961. cluster_id: number;
  962. }
  963. >("GET", (pathParams) => {
  964. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/prometheus/ingresses`;
  965. });
  966. const getOAuthIds = baseApi<
  967. {},
  968. {
  969. project_id: number;
  970. }
  971. >("GET", (pathParams) => {
  972. return `/api/projects/${pathParams.project_id}/integrations/oauth`;
  973. });
  974. const getProjectClusters = baseApi<{}, { id: number }>("GET", (pathParams) => {
  975. return `/api/projects/${pathParams.id}/clusters`;
  976. });
  977. const getProjectRegistries = baseApi<{}, { id: number }>(
  978. "GET",
  979. (pathParams) => {
  980. return `/api/projects/${pathParams.id}/registries`;
  981. }
  982. );
  983. const getProjectRepos = baseApi<{}, { id: number }>("GET", (pathParams) => {
  984. return `/api/projects/${pathParams.id}/repos`;
  985. });
  986. const getProjects = baseApi("GET", "/api/projects");
  987. const getPrometheusIsInstalled = baseApi<
  988. {},
  989. {
  990. id: number;
  991. cluster_id: number;
  992. }
  993. >("GET", (pathParams) => {
  994. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/prometheus/detect`;
  995. });
  996. const getRegistryIntegrations = baseApi("GET", "/api/integrations/registry");
  997. const getReleaseToken = baseApi<
  998. {},
  999. { name: string; id: number; namespace: string; cluster_id: number }
  1000. >("GET", (pathParams) => {
  1001. let { id, cluster_id, namespace, name } = pathParams;
  1002. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/webhook`;
  1003. });
  1004. const getReleaseSteps = baseApi<
  1005. {},
  1006. { name: string; id: number; namespace: string; cluster_id: number }
  1007. >("GET", (pathParams) => {
  1008. let { id, cluster_id, namespace, name } = pathParams;
  1009. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/steps`;
  1010. });
  1011. const destroyInfra = baseApi<
  1012. {},
  1013. {
  1014. project_id: number;
  1015. infra_id: number;
  1016. }
  1017. >("DELETE", (pathParams) => {
  1018. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}`;
  1019. });
  1020. const updateDatabaseStatus = baseApi<
  1021. {
  1022. status: string;
  1023. },
  1024. {
  1025. project_id: number;
  1026. infra_id: number;
  1027. }
  1028. >("POST", (pathParams) => {
  1029. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/database`;
  1030. });
  1031. const getRepoIntegrations = baseApi("GET", "/api/integrations/repo");
  1032. const getRepos = baseApi<{}, { id: number }>("GET", (pathParams) => {
  1033. return `/api/projects/${pathParams.id}/repos`;
  1034. });
  1035. const getSlackIntegrations = baseApi<{}, { id: number }>(
  1036. "GET",
  1037. (pathParams) => {
  1038. return `/api/projects/${pathParams.id}/slack_integrations`;
  1039. }
  1040. );
  1041. const getRevisions = baseApi<
  1042. {},
  1043. { id: number; cluster_id: number; namespace: string; name: string }
  1044. >("GET", (pathParams) => {
  1045. let { id, cluster_id, namespace, name } = pathParams;
  1046. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/history`;
  1047. });
  1048. const getTemplateInfo = baseApi<
  1049. {
  1050. repo_url?: string;
  1051. },
  1052. { name: string; version: string }
  1053. >("GET", (pathParams) => {
  1054. return `/api/templates/${pathParams.name}/${pathParams.version}`;
  1055. });
  1056. const getTemplateUpgradeNotes = baseApi<
  1057. {
  1058. repo_url?: string;
  1059. prev_version: string;
  1060. },
  1061. { name: string; version: string }
  1062. >("GET", (pathParams) => {
  1063. return `/api/templates/${pathParams.name}/${pathParams.version}/upgrade_notes`;
  1064. });
  1065. const getTemplates = baseApi<
  1066. {
  1067. repo_url?: string;
  1068. },
  1069. {}
  1070. >("GET", "/api/templates");
  1071. const getHelmRepos = baseApi<
  1072. {},
  1073. {
  1074. project_id: number;
  1075. }
  1076. >("GET", (pathParams) => {
  1077. return `/api/projects/${pathParams.project_id}/helmrepos`;
  1078. });
  1079. const getChartsFromHelmRepo = baseApi<
  1080. {},
  1081. {
  1082. project_id: number;
  1083. helm_repo_id: number;
  1084. }
  1085. >("GET", (pathParams) => {
  1086. return `/api/projects/${pathParams.project_id}/helmrepos/${pathParams.helm_repo_id}/charts`;
  1087. });
  1088. const getChartInfoFromHelmRepo = baseApi<
  1089. {},
  1090. { project_id: number; helm_repo_id: number; name: string; version: string }
  1091. >("GET", (pathParams) => {
  1092. return `/api/projects/${pathParams.project_id}/helmrepos/${pathParams.helm_repo_id}/charts/${pathParams.name}/${pathParams.version}`;
  1093. });
  1094. const getMetadata = baseApi<{}, {}>("GET", () => {
  1095. return `/api/metadata`;
  1096. });
  1097. const postWelcome = baseApi<{
  1098. email: string;
  1099. isCompany: boolean;
  1100. name: string;
  1101. company: string;
  1102. role: string;
  1103. }>("POST", () => {
  1104. return `/api/welcome`;
  1105. });
  1106. const linkGithubProject = baseApi<
  1107. {},
  1108. {
  1109. project_id: number;
  1110. }
  1111. >("GET", (pathParams) => {
  1112. return `/api/oauth/projects/${pathParams.project_id}/github`;
  1113. });
  1114. const getGithubAccounts = baseApi<{}, {}>("GET", () => {
  1115. return `/api/integrations/github-app/accounts`;
  1116. });
  1117. const logInUser = baseApi<{
  1118. email: string;
  1119. password: string;
  1120. }>("POST", "/api/login");
  1121. const logOutUser = baseApi("POST", "/api/logout");
  1122. const registerUser = baseApi<{
  1123. email: string;
  1124. password: string;
  1125. }>("POST", "/api/users");
  1126. const rollbackChart = baseApi<
  1127. {
  1128. revision: number;
  1129. },
  1130. {
  1131. id: number;
  1132. name: string;
  1133. namespace: string;
  1134. cluster_id: number;
  1135. }
  1136. >("POST", (pathParams) => {
  1137. let { id, name, cluster_id, namespace } = pathParams;
  1138. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0/rollback`;
  1139. });
  1140. const uninstallTemplate = baseApi<
  1141. {},
  1142. {
  1143. id: number;
  1144. name: string;
  1145. cluster_id: number;
  1146. namespace: string;
  1147. }
  1148. >("DELETE", (pathParams) => {
  1149. let { id, name, cluster_id, namespace } = pathParams;
  1150. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0`;
  1151. });
  1152. const updateUser = baseApi<
  1153. {
  1154. rawKubeConfig?: string;
  1155. allowedContexts?: string[];
  1156. },
  1157. { id: number }
  1158. >("PUT", (pathParams) => {
  1159. return `/api/users/${pathParams.id}`;
  1160. });
  1161. const upgradeChartValues = baseApi<
  1162. {
  1163. values: string;
  1164. version?: string;
  1165. },
  1166. {
  1167. id: number;
  1168. name: string;
  1169. namespace: string;
  1170. cluster_id: number;
  1171. }
  1172. >("POST", (pathParams) => {
  1173. let { id, name, cluster_id, namespace } = pathParams;
  1174. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0/upgrade`;
  1175. });
  1176. const listEnvGroups = baseApi<
  1177. {},
  1178. {
  1179. id: number;
  1180. namespace: string;
  1181. cluster_id: number;
  1182. }
  1183. >("GET", (pathParams) => {
  1184. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/envgroup/list`;
  1185. });
  1186. const listConfigMaps = baseApi<
  1187. {},
  1188. {
  1189. id: number;
  1190. namespace: string;
  1191. cluster_id: number;
  1192. }
  1193. >("GET", (pathParams) => {
  1194. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/list`;
  1195. });
  1196. const getEnvGroup = baseApi<
  1197. {},
  1198. {
  1199. id: number;
  1200. namespace: string;
  1201. cluster_id: number;
  1202. name: string;
  1203. version?: number;
  1204. }
  1205. >("GET", (pathParams) => {
  1206. return `/api/projects/${pathParams.id}/clusters/${
  1207. pathParams.cluster_id
  1208. }/namespaces/${pathParams.namespace}/envgroup?name=${pathParams.name}${
  1209. pathParams.version ? "&version=" + pathParams.version : ""
  1210. }`;
  1211. });
  1212. const getConfigMap = baseApi<
  1213. {
  1214. name: string;
  1215. },
  1216. {
  1217. id: number;
  1218. namespace: string;
  1219. cluster_id: number;
  1220. }
  1221. >("GET", (pathParams) => {
  1222. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap`;
  1223. });
  1224. const createEnvGroup = baseApi<
  1225. {
  1226. name: string;
  1227. variables: Record<string, string>;
  1228. secret_variables?: Record<string, string>;
  1229. },
  1230. {
  1231. id: number;
  1232. cluster_id: number;
  1233. namespace: string;
  1234. }
  1235. >("POST", (pathParams) => {
  1236. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/envgroup/create`;
  1237. });
  1238. const updateEnvGroup = baseApi<
  1239. {
  1240. name: string;
  1241. variables: { [key: string]: string };
  1242. secret_variables?: { [key: string]: string };
  1243. },
  1244. {
  1245. project_id: number;
  1246. cluster_id: number;
  1247. namespace: string;
  1248. }
  1249. >(
  1250. "POST",
  1251. ({ cluster_id, project_id, namespace }) =>
  1252. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/envgroup/create`
  1253. );
  1254. const createConfigMap = baseApi<
  1255. {
  1256. name: string;
  1257. variables: Record<string, string>;
  1258. secret_variables?: Record<string, string>;
  1259. },
  1260. {
  1261. id: number;
  1262. cluster_id: number;
  1263. namespace: string;
  1264. }
  1265. >("POST", (pathParams) => {
  1266. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/create`;
  1267. });
  1268. const updateConfigMap = baseApi<
  1269. {
  1270. name: string;
  1271. variables: Record<string, string>;
  1272. secret_variables?: Record<string, string>;
  1273. },
  1274. {
  1275. id: number;
  1276. cluster_id: number;
  1277. namespace: string;
  1278. }
  1279. >("POST", (pathParams) => {
  1280. let { id, cluster_id } = pathParams;
  1281. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/update`;
  1282. });
  1283. const renameConfigMap = baseApi<
  1284. {
  1285. name: string;
  1286. new_name: string;
  1287. },
  1288. {
  1289. id: number;
  1290. cluster_id: number;
  1291. namespace: string;
  1292. }
  1293. >("POST", (pathParams) => {
  1294. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/rename`;
  1295. });
  1296. const deleteEnvGroup = baseApi<
  1297. {
  1298. name: string;
  1299. },
  1300. {
  1301. id: number;
  1302. namespace: string;
  1303. cluster_id: number;
  1304. }
  1305. >("DELETE", (pathParams) => {
  1306. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/envgroup`;
  1307. });
  1308. const deleteConfigMap = baseApi<
  1309. {
  1310. name: string;
  1311. },
  1312. {
  1313. id: number;
  1314. namespace: string;
  1315. cluster_id: number;
  1316. }
  1317. >("DELETE", (pathParams) => {
  1318. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/delete`;
  1319. });
  1320. const createNamespace = baseApi<
  1321. {
  1322. name: string;
  1323. },
  1324. { id: number; cluster_id: number }
  1325. >("POST", (pathParams) => {
  1326. let { id, cluster_id } = pathParams;
  1327. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/create`;
  1328. });
  1329. const deleteNamespace = baseApi<
  1330. {},
  1331. {
  1332. id: number;
  1333. cluster_id: number;
  1334. namespace: string;
  1335. }
  1336. >("DELETE", (pathParams) => {
  1337. let { id, cluster_id, namespace } = pathParams;
  1338. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}`;
  1339. });
  1340. const deleteJob = baseApi<
  1341. {},
  1342. { name: string; namespace: string; id: number; cluster_id: number }
  1343. >("DELETE", (pathParams) => {
  1344. let { id, name, cluster_id, namespace } = pathParams;
  1345. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}`;
  1346. });
  1347. const stopJob = baseApi<
  1348. {},
  1349. { name: string; namespace: string; id: number; cluster_id: number }
  1350. >("POST", (pathParams) => {
  1351. let { id, name, namespace, cluster_id } = pathParams;
  1352. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}/stop`;
  1353. });
  1354. const listAPITokens = baseApi<{}, { project_id: number }>(
  1355. "GET",
  1356. ({ project_id }) => `/api/projects/${project_id}/api_token`
  1357. );
  1358. const getAPIToken = baseApi<{}, { project_id: number; token: string }>(
  1359. "GET",
  1360. ({ project_id, token }) => `/api/projects/${project_id}/api_token/${token}`
  1361. );
  1362. const revokeAPIToken = baseApi<{}, { project_id: number; token: string }>(
  1363. "POST",
  1364. ({ project_id, token }) =>
  1365. `/api/projects/${project_id}/api_token/${token}/revoke`
  1366. );
  1367. const createAPIToken = baseApi<
  1368. {
  1369. name: string;
  1370. policy_uid: string;
  1371. expires_at?: string;
  1372. },
  1373. { project_id: number }
  1374. >("POST", ({ project_id }) => `/api/projects/${project_id}/api_token`);
  1375. const createPolicy = baseApi<
  1376. {
  1377. name: string;
  1378. policy: PolicyDocType[];
  1379. },
  1380. { project_id: number }
  1381. >("POST", ({ project_id }) => `/api/projects/${project_id}/policy`);
  1382. const getAvailableRoles = baseApi<{}, { project_id: number }>(
  1383. "GET",
  1384. ({ project_id }) => `/api/projects/${project_id}/roles`
  1385. );
  1386. const updateInvite = baseApi<
  1387. { kind: string },
  1388. { project_id: number; invite_id: number }
  1389. >(
  1390. "POST",
  1391. ({ project_id, invite_id }) =>
  1392. `/api/projects/${project_id}/invites/${invite_id}`
  1393. );
  1394. const getCollaborators = baseApi<{}, { project_id: number }>(
  1395. "GET",
  1396. ({ project_id }) => `/api/projects/${project_id}/collaborators`
  1397. );
  1398. const updateCollaborator = baseApi<
  1399. {
  1400. kind: string;
  1401. user_id: number;
  1402. },
  1403. { project_id: number }
  1404. >("POST", ({ project_id }) => `/api/projects/${project_id}/roles`);
  1405. const removeCollaborator = baseApi<{ user_id: number }, { project_id: number }>(
  1406. "DELETE",
  1407. ({ project_id }) => `/api/projects/${project_id}/roles`
  1408. );
  1409. const getPolicyDocument = baseApi<{}, { project_id: number }>(
  1410. "GET",
  1411. ({ project_id }) => `/api/projects/${project_id}/policy`
  1412. );
  1413. const createWebhookToken = baseApi<
  1414. {},
  1415. {
  1416. project_id: number;
  1417. chart_name: string;
  1418. namespace: string;
  1419. cluster_id: number;
  1420. }
  1421. >(
  1422. "POST",
  1423. ({ project_id, chart_name, namespace, cluster_id }) =>
  1424. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${chart_name}/0/webhook`
  1425. );
  1426. const getUsage = baseApi<{}, { project_id: number }>(
  1427. "GET",
  1428. ({ project_id }) => `/api/projects/${project_id}/usage`
  1429. );
  1430. // Used for billing purposes
  1431. const getCustomerToken = baseApi<{}, { project_id: number }>(
  1432. "GET",
  1433. ({ project_id }) => `/api/projects/${project_id}/billing/token`
  1434. );
  1435. const getHasBilling = baseApi<{}, { project_id: number }>(
  1436. "GET",
  1437. ({ project_id }) => `/api/projects/${project_id}/billing`
  1438. );
  1439. const getOnboardingState = baseApi<{}, { project_id: number }>(
  1440. "GET",
  1441. ({ project_id }) => `/api/projects/${project_id}/onboarding`
  1442. );
  1443. const saveOnboardingState = baseApi<{}, { project_id: number }>(
  1444. "POST",
  1445. ({ project_id }) => `/api/projects/${project_id}/onboarding`
  1446. );
  1447. const getOnboardingInfra = baseApi<
  1448. {},
  1449. { project_id: number; registry_infra_id: number }
  1450. >(
  1451. "GET",
  1452. ({ project_id, registry_infra_id }) =>
  1453. `/api/projects/${project_id}/infras/${registry_infra_id}`
  1454. );
  1455. const getOnboardingRegistry = baseApi<
  1456. {},
  1457. { project_id: number; registry_connection_id: number }
  1458. >(
  1459. "GET",
  1460. ({ project_id, registry_connection_id }) =>
  1461. `/api/projects/${project_id}/registries/${registry_connection_id}`
  1462. );
  1463. const detectPorterAgent = baseApi<
  1464. {},
  1465. { project_id: number; cluster_id: number }
  1466. >(
  1467. "GET",
  1468. ({ project_id, cluster_id }) =>
  1469. `/api/projects/${project_id}/clusters/${cluster_id}/agent/detect`
  1470. );
  1471. const installPorterAgent = baseApi<
  1472. {},
  1473. { project_id: number; cluster_id: number }
  1474. >(
  1475. "POST",
  1476. ({ cluster_id, project_id }) =>
  1477. `/api/projects/${project_id}/clusters/${cluster_id}/agent/install`
  1478. );
  1479. const getKubeEvents = baseApi<
  1480. {
  1481. skip: number;
  1482. resource_type: string;
  1483. owner_type?: string;
  1484. owner_name?: string;
  1485. namespace?: string;
  1486. },
  1487. { project_id: number; cluster_id: number }
  1488. >("GET", ({ project_id, cluster_id }) => {
  1489. return `/api/projects/${project_id}/clusters/${cluster_id}/kube_events`;
  1490. });
  1491. const getKubeEvent = baseApi<
  1492. {},
  1493. { project_id: number; cluster_id: number; kube_event_id: number }
  1494. >(
  1495. "GET",
  1496. ({ project_id, cluster_id, kube_event_id }) =>
  1497. `/api/projects/${project_id}/clusters/${cluster_id}/kube_events/${kube_event_id}`
  1498. );
  1499. const getLogBuckets = baseApi<
  1500. {},
  1501. { project_id: number; cluster_id: number; kube_event_id: number }
  1502. >(
  1503. "GET",
  1504. ({ project_id, cluster_id, kube_event_id }) =>
  1505. `/api/projects/${project_id}/clusters/${cluster_id}/kube_events/${kube_event_id}/log_buckets`
  1506. );
  1507. const getLogBucketLogs = baseApi<
  1508. { timestamp: number },
  1509. { project_id: number; cluster_id: number; kube_event_id: number }
  1510. >(
  1511. "GET",
  1512. ({ project_id, cluster_id, kube_event_id }) =>
  1513. `/api/projects/${project_id}/clusters/${cluster_id}/kube_events/${kube_event_id}/logs`
  1514. );
  1515. const getCanCreateProject = baseApi<{}, {}>(
  1516. "GET",
  1517. () => "/api/can_create_project"
  1518. );
  1519. const addApplicationToEnvGroup = baseApi<
  1520. {
  1521. name: string; // Env Group name
  1522. app_name: string;
  1523. },
  1524. { project_id: number; cluster_id: number; namespace: string }
  1525. >(
  1526. "POST",
  1527. ({ cluster_id, namespace, project_id }) =>
  1528. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/envgroup/add_application`
  1529. );
  1530. const removeApplicationFromEnvGroup = baseApi<
  1531. {
  1532. name: string; // Env Group name
  1533. app_name: string;
  1534. },
  1535. { project_id: number; cluster_id: number; namespace: string }
  1536. >(
  1537. "POST",
  1538. ({ cluster_id, namespace, project_id }) =>
  1539. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/envgroup/remove_application`
  1540. );
  1541. const provisionDatabase = baseApi<
  1542. {
  1543. username: string;
  1544. password: string;
  1545. machine_type: string;
  1546. db_storage_encrypted: boolean;
  1547. db_name: string;
  1548. db_max_allocated_storage: string;
  1549. db_family: string;
  1550. db_engine_version: string;
  1551. db_allocated_storage: string;
  1552. },
  1553. { project_id: number; cluster_id: number; namespace: string }
  1554. >(
  1555. "POST",
  1556. ({ project_id, cluster_id, namespace }) =>
  1557. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/provision/rds`
  1558. );
  1559. const getDatabases = baseApi<
  1560. {},
  1561. {
  1562. project_id: number;
  1563. cluster_id: number;
  1564. }
  1565. >(
  1566. "GET",
  1567. ({ project_id, cluster_id }) =>
  1568. `/api/projects/${project_id}/clusters/${cluster_id}/databases`
  1569. );
  1570. const getPreviousLogsForContainer = baseApi<
  1571. {
  1572. container_name: string;
  1573. },
  1574. {
  1575. project_id: number;
  1576. cluster_id: number;
  1577. namespace: string;
  1578. pod_name: string;
  1579. }
  1580. >(
  1581. "GET",
  1582. ({ cluster_id, namespace, pod_name: name, project_id }) =>
  1583. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/pod/${name}/previous_logs`
  1584. );
  1585. const getIncidents = baseApi<
  1586. {},
  1587. {
  1588. project_id: number;
  1589. cluster_id: number;
  1590. }
  1591. >(
  1592. "GET",
  1593. ({ project_id, cluster_id }) =>
  1594. `/api/projects/${project_id}/clusters/${cluster_id}/incidents`
  1595. );
  1596. const getIncidentsByReleaseName = baseApi<
  1597. {
  1598. namespace: string;
  1599. release_name: string;
  1600. },
  1601. {
  1602. project_id: number;
  1603. cluster_id: number;
  1604. }
  1605. >(
  1606. "GET",
  1607. ({ project_id, cluster_id }) =>
  1608. `/api/projects/${project_id}/clusters/${cluster_id}/incidents`
  1609. );
  1610. const getIncidentById = baseApi<
  1611. {
  1612. incident_id: string;
  1613. },
  1614. {
  1615. project_id: number;
  1616. cluster_id: number;
  1617. }
  1618. >(
  1619. "GET",
  1620. ({ project_id, cluster_id }) =>
  1621. `/api/projects/${project_id}/clusters/${cluster_id}/incidents`
  1622. );
  1623. const getIncidentLogsByLogId = baseApi<
  1624. {
  1625. log_id: string;
  1626. },
  1627. {
  1628. project_id: number;
  1629. cluster_id: number;
  1630. }
  1631. >(
  1632. "GET",
  1633. ({ project_id, cluster_id }) =>
  1634. `/api/projects/${project_id}/clusters/${cluster_id}/incidents/logs`
  1635. );
  1636. const upgradePorterAgent = baseApi<
  1637. {},
  1638. { project_id: number; cluster_id: number }
  1639. >(
  1640. "POST",
  1641. ({ project_id, cluster_id }) =>
  1642. `/api/projects/${project_id}/clusters/${cluster_id}/agent/upgrade`
  1643. );
  1644. const updateBuildConfig = baseApi<
  1645. BuildConfig,
  1646. {
  1647. project_id: number;
  1648. cluster_id: number;
  1649. namespace: string;
  1650. release_name: string;
  1651. }
  1652. >(
  1653. "POST",
  1654. ({ project_id, cluster_id, namespace, release_name }) =>
  1655. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/buildconfig`
  1656. );
  1657. const updateGitActionConfig = baseApi<
  1658. {
  1659. git_action_config: {
  1660. git_branch: string;
  1661. };
  1662. },
  1663. {
  1664. project_id: number;
  1665. cluster_id: number;
  1666. namespace: string;
  1667. release_name: string;
  1668. revision?: 0; // Always update latest
  1669. }
  1670. >(
  1671. "PATCH",
  1672. ({ project_id, cluster_id, namespace, release_name, revision = 0 }) =>
  1673. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/${revision}/git_action_config`
  1674. );
  1675. const reRunGHWorkflow = baseApi<
  1676. {},
  1677. {
  1678. project_id: number;
  1679. cluster_id: number;
  1680. git_installation_id: number;
  1681. owner: string;
  1682. name: string;
  1683. branch?: string;
  1684. filename?: string;
  1685. release_name?: string;
  1686. }
  1687. >(
  1688. "POST",
  1689. ({
  1690. project_id,
  1691. git_installation_id,
  1692. owner,
  1693. name,
  1694. cluster_id,
  1695. filename,
  1696. release_name,
  1697. branch,
  1698. }) => {
  1699. const queryParams = new URLSearchParams();
  1700. if (branch) {
  1701. queryParams.set("branch", branch);
  1702. }
  1703. if (release_name) {
  1704. queryParams.set("release_name", release_name);
  1705. }
  1706. if (filename) {
  1707. queryParams.set("filename", filename);
  1708. }
  1709. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${owner}/${name}/clusters/${cluster_id}/rerun_workflow?${queryParams.toString()}`;
  1710. }
  1711. );
  1712. const triggerPreviewEnvWorkflow = baseApi<
  1713. {},
  1714. { project_id: number; cluster_id: number; deployment_id: number }
  1715. >(
  1716. "POST",
  1717. ({ project_id, cluster_id, deployment_id }) =>
  1718. `/api/projects/${project_id}/clusters/${cluster_id}/deployments/${deployment_id}/trigger_workflow`
  1719. );
  1720. const getTagsByProjectId = baseApi<{}, { project_id: number }>(
  1721. "GET",
  1722. ({ project_id }) => `/api/projects/${project_id}/tags`
  1723. );
  1724. const createTag = baseApi<
  1725. { name: string; color: string },
  1726. { project_id: number }
  1727. >("POST", ({ project_id }) => `/api/projects/${project_id}/tags`);
  1728. const updateReleaseTags = baseApi<
  1729. {
  1730. tags: string[];
  1731. },
  1732. {
  1733. project_id: number;
  1734. cluster_id: number;
  1735. namespace: string;
  1736. release_name: string;
  1737. }
  1738. >(
  1739. "PATCH",
  1740. ({ project_id, cluster_id, namespace, release_name }) =>
  1741. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/update_tags`
  1742. );
  1743. const getGitProviders = baseApi<{}, { project_id: number }>(
  1744. "GET",
  1745. ({ project_id }) => `/api/projects/${project_id}/integrations/git`
  1746. );
  1747. const getGitlabRepos = baseApi<
  1748. {},
  1749. { project_id: number; integration_id: number }
  1750. >(
  1751. "GET",
  1752. ({ project_id, integration_id }) =>
  1753. `/api/projects/${project_id}/integrations/gitlab/${integration_id}/repos`
  1754. );
  1755. const getGitlabBranches = baseApi<
  1756. {},
  1757. {
  1758. project_id: number;
  1759. integration_id: number;
  1760. repo_owner: string;
  1761. repo_name: string;
  1762. }
  1763. >(
  1764. "GET",
  1765. ({ project_id, integration_id, repo_owner, repo_name }) =>
  1766. `/api/projects/${project_id}/integrations/gitlab/${integration_id}/repos/${repo_owner}/${repo_name}/branches`
  1767. );
  1768. const getGitlabFolderContent = baseApi<
  1769. {
  1770. dir: string;
  1771. },
  1772. {
  1773. project_id: number;
  1774. integration_id: number;
  1775. repo_owner: string;
  1776. repo_name: string;
  1777. branch: string;
  1778. }
  1779. >(
  1780. "GET",
  1781. ({ project_id, integration_id, repo_owner, repo_name, branch }) =>
  1782. `/api/projects/${project_id}/integrations/gitlab/${integration_id}/repos/${repo_owner}/${repo_name}/${branch}/contents`
  1783. );
  1784. // STACKS
  1785. const createStack = baseApi<
  1786. CreateStackBody,
  1787. {
  1788. project_id: number;
  1789. cluster_id: number;
  1790. namespace: string;
  1791. }
  1792. >(
  1793. "POST",
  1794. ({ project_id, cluster_id, namespace }) =>
  1795. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks`
  1796. );
  1797. const listStacks = baseApi<
  1798. {},
  1799. { project_id: number; cluster_id: number; namespace: string }
  1800. >(
  1801. "GET",
  1802. ({ project_id, cluster_id, namespace }) =>
  1803. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks`
  1804. );
  1805. const getStack = baseApi<
  1806. {},
  1807. {
  1808. project_id: number;
  1809. cluster_id: number;
  1810. namespace: string;
  1811. stack_id: string;
  1812. }
  1813. >(
  1814. "GET",
  1815. ({ project_id, cluster_id, namespace, stack_id }) =>
  1816. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}`
  1817. );
  1818. const getStackRevision = baseApi<
  1819. {},
  1820. {
  1821. project_id: number;
  1822. cluster_id: number;
  1823. namespace: string;
  1824. stack_id: string;
  1825. revision_id: number;
  1826. }
  1827. >(
  1828. "GET",
  1829. ({ project_id, cluster_id, namespace, stack_id, revision_id }) =>
  1830. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/${revision_id}`
  1831. );
  1832. const rollbackStack = baseApi<
  1833. {
  1834. target_revision: number;
  1835. },
  1836. {
  1837. project_id: number;
  1838. cluster_id: number;
  1839. namespace: string;
  1840. stack_id: string;
  1841. }
  1842. >(
  1843. "POST",
  1844. ({ project_id, cluster_id, namespace, stack_id }) =>
  1845. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/rollback`
  1846. );
  1847. const deleteStack = baseApi<
  1848. {},
  1849. {
  1850. project_id: number;
  1851. cluster_id: number;
  1852. namespace: string;
  1853. stack_id: string;
  1854. }
  1855. >(
  1856. "DELETE",
  1857. ({ project_id, cluster_id, namespace, stack_id }) =>
  1858. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}`
  1859. );
  1860. const updateStackSourceConfig = baseApi<
  1861. {
  1862. source_configs: SourceConfig[];
  1863. },
  1864. {
  1865. project_id: number;
  1866. cluster_id: number;
  1867. namespace: string;
  1868. stack_id: string;
  1869. }
  1870. >(
  1871. "PUT",
  1872. ({ project_id, cluster_id, namespace, stack_id }) =>
  1873. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/source`
  1874. );
  1875. const getGithubStatus = baseApi<{}, {}>("GET", ({}) => `/api/status/github`);
  1876. // Bundle export to allow default api import (api.<method> is more readable)
  1877. export default {
  1878. checkAuth,
  1879. connectECRRegistry,
  1880. connectGCRRegistry,
  1881. connectDORegistry,
  1882. getAWSIntegration,
  1883. getGCPIntegration,
  1884. getAzureIntegration,
  1885. getGitlabIntegration,
  1886. createAWSIntegration,
  1887. overwriteAWSIntegration,
  1888. updateClusterName,
  1889. createAzureIntegration,
  1890. createGitlabIntegration,
  1891. createEmailVerification,
  1892. createEnvironment,
  1893. deleteEnvironment,
  1894. createPreviewEnvironmentDeployment,
  1895. reenablePreviewEnvironmentDeployment,
  1896. listEnvironments,
  1897. getEnvironment,
  1898. toggleNewCommentForEnvironment,
  1899. createGCPIntegration,
  1900. createInvite,
  1901. createNamespace,
  1902. createPasswordReset,
  1903. createPasswordResetVerify,
  1904. createPasswordResetFinalize,
  1905. createProject,
  1906. createConfigMap,
  1907. deleteCluster,
  1908. deleteConfigMap,
  1909. deleteInvite,
  1910. deleteNamespace,
  1911. deletePod,
  1912. deleteProject,
  1913. deleteRegistryIntegration,
  1914. deleteSlackIntegration,
  1915. updateNotificationConfig,
  1916. getNotificationConfig,
  1917. createSubdomain,
  1918. deployTemplate,
  1919. deployAddon,
  1920. destroyInfra,
  1921. updateDatabaseStatus,
  1922. detectBuildpack,
  1923. detectGitlabBuildpack,
  1924. getBranchContents,
  1925. getBranches,
  1926. getMetadata,
  1927. postWelcome,
  1928. getChart,
  1929. getCharts,
  1930. getChartComponents,
  1931. getChartControllers,
  1932. getClusterIntegrations,
  1933. getClusters,
  1934. getCluster,
  1935. getClusterNodes,
  1936. getClusterNode,
  1937. getConfigMap,
  1938. getPRDeploymentList,
  1939. getPRDeploymentByEnvironment,
  1940. getPRDeployment,
  1941. getGHAWorkflowTemplate,
  1942. getGitRepoList,
  1943. getGitRepoPermission,
  1944. getGitRepos,
  1945. getImageRepos,
  1946. getImageTags,
  1947. listInfraTemplates,
  1948. getInfraTemplate,
  1949. getInfra,
  1950. provisionInfra,
  1951. deleteInfra,
  1952. updateInfra,
  1953. listOperations,
  1954. getOperation,
  1955. getOperationLogs,
  1956. retryCreateInfra,
  1957. retryDeleteInfra,
  1958. getInfraState,
  1959. getInfraRawState,
  1960. getInfraByID,
  1961. getInfraDesired,
  1962. getInfraCurrent,
  1963. getIngress,
  1964. getInvites,
  1965. getJobs,
  1966. getJobStatus,
  1967. getJobPods,
  1968. getPodByName,
  1969. getMatchingPods,
  1970. getMetrics,
  1971. getNamespaces,
  1972. getNGINXIngresses,
  1973. getOAuthIds,
  1974. getPodEvents,
  1975. getProcfileContents,
  1976. getGitlabProcfileContents,
  1977. getProjectClusters,
  1978. getProjectRegistries,
  1979. getProjectRepos,
  1980. getProjects,
  1981. getPrometheusIsInstalled,
  1982. getRegistryIntegrations,
  1983. getReleaseToken,
  1984. getReleaseSteps,
  1985. getRepoIntegrations,
  1986. getSlackIntegrations,
  1987. getRepos,
  1988. getRevisions,
  1989. getTemplateInfo,
  1990. getTemplateUpgradeNotes,
  1991. getTemplates,
  1992. getHelmRepos,
  1993. getChartsFromHelmRepo,
  1994. getChartInfoFromHelmRepo,
  1995. linkGithubProject,
  1996. getGithubAccounts,
  1997. listConfigMaps,
  1998. logInUser,
  1999. logOutUser,
  2000. registerUser,
  2001. rollbackChart,
  2002. uninstallTemplate,
  2003. updateUser,
  2004. renameConfigMap,
  2005. updateConfigMap,
  2006. upgradeChartValues,
  2007. deleteJob,
  2008. stopJob,
  2009. updateInvite,
  2010. listAPITokens,
  2011. getAPIToken,
  2012. revokeAPIToken,
  2013. createAPIToken,
  2014. createPolicy,
  2015. getAvailableRoles,
  2016. getCollaborators,
  2017. updateCollaborator,
  2018. removeCollaborator,
  2019. getPolicyDocument,
  2020. createWebhookToken,
  2021. getUsage,
  2022. getCustomerToken,
  2023. getHasBilling,
  2024. getOnboardingState,
  2025. saveOnboardingState,
  2026. getOnboardingInfra,
  2027. getOnboardingRegistry,
  2028. detectPorterAgent,
  2029. installPorterAgent,
  2030. getKubeEvents,
  2031. getKubeEvent,
  2032. getLogBuckets,
  2033. getLogBucketLogs,
  2034. getCanCreateProject,
  2035. createEnvGroup,
  2036. updateEnvGroup,
  2037. listEnvGroups,
  2038. getEnvGroup,
  2039. deleteEnvGroup,
  2040. addApplicationToEnvGroup,
  2041. removeApplicationFromEnvGroup,
  2042. provisionDatabase,
  2043. getDatabases,
  2044. getPreviousLogsForContainer,
  2045. getIncidents,
  2046. getIncidentsByReleaseName,
  2047. getIncidentById,
  2048. getIncidentLogsByLogId,
  2049. upgradePorterAgent,
  2050. deletePRDeployment,
  2051. updateBuildConfig,
  2052. updateGitActionConfig,
  2053. reRunGHWorkflow,
  2054. triggerPreviewEnvWorkflow,
  2055. getTagsByProjectId,
  2056. createTag,
  2057. updateReleaseTags,
  2058. getGitProviders,
  2059. getGitlabRepos,
  2060. getGitlabBranches,
  2061. getGitlabFolderContent,
  2062. // STACKS
  2063. listStacks,
  2064. getStack,
  2065. getStackRevision,
  2066. createStack,
  2067. rollbackStack,
  2068. deleteStack,
  2069. updateStackSourceConfig,
  2070. // STATUS
  2071. getGithubStatus,
  2072. };