api.tsx 51 KB

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