api.tsx 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869
  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, PorterAppOptions } from "./types";
  5. import {
  6. CreateStackBody,
  7. SourceConfig,
  8. } from "main/home/cluster-dashboard/stacks/types";
  9. import { Contract } from "@porter-dev/api-contracts";
  10. /**
  11. * Generic api call format
  12. * @param {string} token - Bearer token.
  13. * @param {Object} params - Body params.
  14. * @param {Object} pathParams - Path params.
  15. * @param {(err: Object, res: Object) => void} callback - Callback function.
  16. */
  17. const checkAuth = baseApi("GET", "/api/users/current");
  18. const connectECRRegistry = baseApi<
  19. {
  20. name: string;
  21. aws_integration_id: string;
  22. },
  23. { id: number }
  24. >("POST", (pathParams) => {
  25. return `/api/projects/${pathParams.id}/registries`;
  26. });
  27. const connectGCRRegistry = baseApi<
  28. {
  29. name: string;
  30. gcp_integration_id: string;
  31. url: string;
  32. },
  33. { id: number }
  34. >("POST", (pathParams) => {
  35. return `/api/projects/${pathParams.id}/registries`;
  36. });
  37. const connectDORegistry = baseApi<
  38. {
  39. name: string;
  40. do_integration_id: string;
  41. url: string;
  42. },
  43. { project_id: number }
  44. >("POST", (pathParams) => {
  45. return `/api/projects/${pathParams.project_id}/registries`;
  46. });
  47. const getAWSIntegration = baseApi<{}, { project_id: number }>(
  48. "GET",
  49. ({ project_id }) => `/api/projects/${project_id}/integrations/aws`
  50. );
  51. const getGCPIntegration = baseApi<{}, { project_id: number }>(
  52. "GET",
  53. ({ project_id }) => `/api/projects/${project_id}/integrations/gcp`
  54. );
  55. const getAzureIntegration = baseApi<{}, { project_id: number }>(
  56. "GET",
  57. ({ project_id }) => `/api/projects/${project_id}/integrations/azure`
  58. );
  59. const getGitlabIntegration = baseApi<{}, { project_id: number }>(
  60. "GET",
  61. ({ project_id }) => `/api/projects/${project_id}/integrations/gitlab`
  62. );
  63. const preflightCheckAWSUsage = baseApi<
  64. {
  65. target_arn: string;
  66. region: string;
  67. },
  68. { id: number }
  69. >("POST", (pathParams) => {
  70. return `/api/projects/${pathParams.id}/integrations/aws/preflight/usage`;
  71. });
  72. const createAWSIntegration = baseApi<
  73. {
  74. aws_region?: string;
  75. aws_cluster_id?: string;
  76. aws_access_key_id?: string;
  77. aws_secret_access_key?: string;
  78. aws_assume_role_arn?: string;
  79. aws_target_arn?: string;
  80. aws_external_id?: string;
  81. },
  82. { id: number }
  83. >("POST", (pathParams) => {
  84. return `/api/projects/${pathParams.id}/integrations/aws`;
  85. });
  86. const overwriteAWSIntegration = baseApi<
  87. {
  88. aws_integration_id: number;
  89. aws_access_key_id: string;
  90. aws_secret_access_key: string;
  91. cluster_id: number;
  92. },
  93. {
  94. project_id: number;
  95. }
  96. >("POST", (pathParams) => {
  97. return `/api/projects/${pathParams.project_id}/integrations/aws/overwrite`;
  98. });
  99. const updateCluster = baseApi<
  100. {
  101. name?: string;
  102. aws_cluster_id?: string;
  103. agent_integration_enabled?: boolean;
  104. preview_envs_enabled?: boolean;
  105. },
  106. {
  107. project_id: number;
  108. cluster_id: number;
  109. }
  110. >("POST", (pathParams) => {
  111. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
  112. });
  113. const renameCluster = baseApi<
  114. {
  115. name: string;
  116. },
  117. {
  118. project_id: number;
  119. cluster_id: number;
  120. }
  121. >("POST", (pathParams) => {
  122. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}/rename`;
  123. });
  124. const createAzureIntegration = baseApi<
  125. {
  126. azure_client_id: string;
  127. azure_subscription_id: string;
  128. azure_tenant_id: string;
  129. service_principal_key: string;
  130. },
  131. { id: number }
  132. >("POST", (pathParams) => {
  133. return `/api/projects/${pathParams.id}/integrations/azure`;
  134. });
  135. const createGitlabIntegration = baseApi<
  136. {
  137. instance_url: string;
  138. client_id: string;
  139. client_secret: string;
  140. },
  141. { id: number }
  142. >("POST", (pathParams) => {
  143. return `/api/projects/${pathParams.id}/integrations/gitlab`;
  144. });
  145. const createEmailVerification = baseApi<{}, {}>("POST", (pathParams) => {
  146. return `/api/email/verify/initiate`;
  147. });
  148. const getPorterApps = baseApi<
  149. {},
  150. {
  151. project_id: number;
  152. cluster_id: number;
  153. }
  154. >("GET", (pathParams) => {
  155. let { project_id, cluster_id } = pathParams;
  156. return `/api/projects/${project_id}/clusters/${cluster_id}/stacks`;
  157. });
  158. const getPorterApp = baseApi<
  159. {},
  160. {
  161. project_id: number;
  162. cluster_id: number;
  163. name: string;
  164. }
  165. >("GET", (pathParams) => {
  166. let { project_id, cluster_id, name } = pathParams;
  167. return `/api/projects/${project_id}/clusters/${cluster_id}/stacks/${name}`;
  168. });
  169. const createPorterApp = baseApi<
  170. PorterAppOptions,
  171. {
  172. project_id: number;
  173. cluster_id: number;
  174. stack_name: string;
  175. }
  176. >("POST", (pathParams) => {
  177. let { project_id, cluster_id, stack_name } = pathParams;
  178. return `/api/projects/${project_id}/clusters/${cluster_id}/stacks/${stack_name}`;
  179. });
  180. const deletePorterApp = baseApi<
  181. {},
  182. {
  183. project_id: number;
  184. cluster_id: number;
  185. name: string;
  186. }
  187. >("DELETE", (pathParams) => {
  188. let { project_id, cluster_id, name } = pathParams;
  189. return `/api/projects/${project_id}/clusters/${cluster_id}/stacks/${name}`;
  190. });
  191. const rollbackPorterApp = baseApi<
  192. {
  193. revision: number;
  194. },
  195. {
  196. project_id: number;
  197. cluster_id: number;
  198. stack_name: string;
  199. }
  200. >("POST", (pathParams) => {
  201. let { project_id, cluster_id, stack_name } = pathParams;
  202. return `/api/projects/${project_id}/clusters/${cluster_id}/stacks/${stack_name}/rollback`;
  203. });
  204. const getLogsWithinTimeRange = baseApi<
  205. {
  206. chart_name?: string;
  207. limit: number;
  208. start_range?: string;
  209. end_range?: string;
  210. search_param?: string;
  211. revision?: string;
  212. namespace?: string;
  213. pod_selector?: string;
  214. },
  215. {
  216. project_id: number;
  217. cluster_id: number;
  218. }
  219. >(
  220. "GET",
  221. ({ project_id, cluster_id }) =>
  222. `/api/projects/${project_id}/clusters/${cluster_id}/stacks/logs`
  223. );
  224. const getFeedEvents = baseApi<
  225. {},
  226. {
  227. project_id: number;
  228. cluster_id: number;
  229. stack_name: string;
  230. page?: number;
  231. }
  232. >("GET", (pathParams) => {
  233. let { project_id, cluster_id, stack_name, page } = pathParams;
  234. return `/api/projects/${project_id}/clusters/${cluster_id}/stacks/${stack_name}/events?page=${page || 1}`;
  235. });
  236. const createEnvironment = baseApi<
  237. {
  238. name: string;
  239. mode: "auto" | "manual";
  240. disable_new_comments: boolean;
  241. git_repo_branches: string[];
  242. namespace_labels: Record<string, string>;
  243. git_deploy_branches: string[];
  244. },
  245. {
  246. project_id: number;
  247. cluster_id: number;
  248. git_installation_id: number;
  249. git_repo_owner: string;
  250. git_repo_name: string;
  251. }
  252. >("POST", (pathParams) => {
  253. let {
  254. project_id,
  255. cluster_id,
  256. git_installation_id,
  257. git_repo_owner,
  258. git_repo_name,
  259. } = pathParams;
  260. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${git_repo_owner}/${git_repo_name}/clusters/${cluster_id}/environment`;
  261. });
  262. const updateEnvironment = baseApi<
  263. {
  264. mode: "auto" | "manual";
  265. disable_new_comments: boolean;
  266. git_repo_branches: string[]; // Array with branch names
  267. namespace_labels: Record<string, string>;
  268. git_deploy_branches: string[];
  269. },
  270. {
  271. project_id: number;
  272. cluster_id: number;
  273. environment_id: number;
  274. }
  275. >(
  276. "PATCH",
  277. ({ project_id, cluster_id, environment_id }) =>
  278. `/api/projects/${project_id}/clusters/${cluster_id}/environments/${environment_id}/settings`
  279. );
  280. const deleteEnvironment = baseApi<
  281. {
  282. name: string;
  283. },
  284. {
  285. project_id: number;
  286. cluster_id: number;
  287. git_installation_id: number;
  288. git_repo_owner: string;
  289. git_repo_name: string;
  290. }
  291. >("DELETE", (pathParams) => {
  292. let {
  293. project_id,
  294. cluster_id,
  295. git_installation_id,
  296. git_repo_owner,
  297. git_repo_name,
  298. } = pathParams;
  299. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${git_repo_owner}/${git_repo_name}/clusters/${cluster_id}/environment`;
  300. });
  301. const createPreviewEnvironmentDeployment = baseApi<
  302. PullRequest,
  303. { project_id: number; cluster_id: number }
  304. >(
  305. "POST",
  306. ({ project_id, cluster_id }) =>
  307. `/api/projects/${project_id}/clusters/${cluster_id}/deployments/pull_request`
  308. );
  309. const reenablePreviewEnvironmentDeployment = baseApi<
  310. {},
  311. {
  312. project_id: number;
  313. cluster_id: number;
  314. deployment_id: number;
  315. }
  316. >(
  317. "PATCH",
  318. ({ project_id, cluster_id, deployment_id }) =>
  319. `/api/projects/${project_id}/clusters/${cluster_id}/deployments/${deployment_id}/reenable`
  320. );
  321. const listEnvironments = baseApi<
  322. {},
  323. {
  324. project_id: number;
  325. cluster_id: number;
  326. }
  327. >("GET", (pathParams) => {
  328. let { project_id, cluster_id } = pathParams;
  329. return `/api/projects/${project_id}/clusters/${cluster_id}/environments`;
  330. });
  331. const getEnvironment = baseApi<
  332. {},
  333. {
  334. project_id: number;
  335. cluster_id: number;
  336. environment_id: number;
  337. }
  338. >("GET", (pathParams) => {
  339. let { project_id, cluster_id, environment_id } = pathParams;
  340. return `/api/projects/${project_id}/clusters/${cluster_id}/environments/${environment_id}`;
  341. });
  342. const toggleNewCommentForEnvironment = baseApi<
  343. {
  344. disable: boolean;
  345. },
  346. {
  347. project_id: number;
  348. cluster_id: number;
  349. environment_id: number;
  350. }
  351. >("PATCH", (pathParams) => {
  352. let { project_id, cluster_id, environment_id } = pathParams;
  353. return `/api/projects/${project_id}/clusters/${cluster_id}/environments/${environment_id}/toggle_new_comment`;
  354. });
  355. const validatePorterYAML = baseApi<
  356. {
  357. branch?: string;
  358. },
  359. {
  360. project_id: number;
  361. cluster_id: number;
  362. environment_id: number;
  363. }
  364. >("GET", (pathParams) => {
  365. const { project_id, cluster_id, environment_id } = pathParams;
  366. return `/api/projects/${project_id}/clusters/${cluster_id}/environments/${environment_id}/validate_porter_yaml`;
  367. });
  368. const createGCPIntegration = baseApi<
  369. {
  370. gcp_key_data: string;
  371. gcp_project_id: string;
  372. },
  373. {
  374. project_id: number;
  375. }
  376. >("POST", (pathParams) => {
  377. return `/api/projects/${pathParams.project_id}/integrations/gcp`;
  378. });
  379. const createInvite = baseApi<
  380. {
  381. email: string;
  382. kind: string;
  383. },
  384. {
  385. id: number;
  386. }
  387. >("POST", (pathParams) => {
  388. return `/api/projects/${pathParams.id}/invites`;
  389. });
  390. const inviteAdmin = baseApi<{}, { project_id: number }>(
  391. "POST",
  392. (pathParams) => {
  393. return `/api/projects/${pathParams.project_id}/invite_admin`;
  394. }
  395. );
  396. const createPasswordReset = baseApi<
  397. {
  398. email: string;
  399. },
  400. {}
  401. >("POST", (pathParams) => {
  402. return `/api/password/reset/initiate`;
  403. });
  404. const createPasswordResetVerify = baseApi<
  405. {
  406. email: string;
  407. token: string;
  408. token_id: number;
  409. },
  410. {}
  411. >("POST", (pathParams) => {
  412. return `/api/password/reset/verify`;
  413. });
  414. const createPasswordResetFinalize = baseApi<
  415. {
  416. email: string;
  417. token: string;
  418. token_id: number;
  419. new_password: string;
  420. },
  421. {}
  422. >("POST", (pathParams) => {
  423. return `/api/password/reset/finalize`;
  424. });
  425. const createProject = baseApi<{ name: string }, {}>("POST", (pathParams) => {
  426. return `/api/projects`;
  427. });
  428. const createSubdomain = baseApi<
  429. {},
  430. {
  431. id: number;
  432. release_name: string;
  433. namespace: string;
  434. cluster_id: number;
  435. }
  436. >("POST", (pathParams) => {
  437. let { cluster_id, id, namespace, release_name } = pathParams;
  438. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/subdomain`;
  439. });
  440. const deleteCluster = baseApi<
  441. {},
  442. {
  443. project_id: number;
  444. cluster_id: number;
  445. }
  446. >("DELETE", (pathParams) => {
  447. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
  448. });
  449. const deleteInvite = baseApi<{}, { id: number; invId: number }>(
  450. "DELETE",
  451. (pathParams) => {
  452. return `/api/projects/${pathParams.id}/invites/${pathParams.invId}`;
  453. }
  454. );
  455. const deletePod = baseApi<
  456. {},
  457. { name: string; namespace: string; id: number; cluster_id: number }
  458. >("DELETE", (pathParams) => {
  459. let { id, name, cluster_id, namespace } = pathParams;
  460. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}`;
  461. });
  462. const getPodEvents = baseApi<
  463. {},
  464. { name: string; namespace: string; id: number; cluster_id: number }
  465. >("GET", (pathParams) => {
  466. let { id, name, cluster_id, namespace } = pathParams;
  467. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}/events`;
  468. });
  469. const deleteProject = baseApi<{}, { id: number }>("DELETE", (pathParams) => {
  470. return `/api/projects/${pathParams.id}`;
  471. });
  472. const deleteRegistryIntegration = baseApi<
  473. {},
  474. {
  475. project_id: number;
  476. registry_id: number;
  477. }
  478. >("DELETE", (pathParams) => {
  479. return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}`;
  480. });
  481. const deleteSlackIntegration = baseApi<
  482. {},
  483. {
  484. project_id: number;
  485. slack_integration_id: number;
  486. }
  487. >("DELETE", (pathParams) => {
  488. return `/api/projects/${pathParams.project_id}/slack_integrations/${pathParams.slack_integration_id}`;
  489. });
  490. const updateNotificationConfig = baseApi<
  491. {
  492. payload: any;
  493. },
  494. {
  495. project_id: number;
  496. cluster_id: number;
  497. namespace: string;
  498. name: string;
  499. }
  500. >("POST", (pathParams) => {
  501. let { project_id, cluster_id, namespace, name } = pathParams;
  502. return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/notifications`;
  503. });
  504. const getPRDeploymentList = baseApi<
  505. {
  506. environment_id?: number;
  507. },
  508. {
  509. cluster_id: number;
  510. project_id: number;
  511. }
  512. >("GET", (pathParams) => {
  513. const { cluster_id, project_id } = pathParams;
  514. return `/api/projects/${project_id}/clusters/${cluster_id}/deployments`;
  515. });
  516. const getPRDeploymentByID = baseApi<
  517. {
  518. id: number;
  519. },
  520. {
  521. cluster_id: number;
  522. project_id: number;
  523. environment_id: number;
  524. }
  525. >("GET", (pathParams) => {
  526. const { cluster_id, project_id, environment_id } = pathParams;
  527. return `/api/projects/${project_id}/clusters/${cluster_id}/environments/${environment_id}/deployment`;
  528. });
  529. const deletePRDeployment = baseApi<
  530. {},
  531. {
  532. cluster_id: number;
  533. project_id: number;
  534. deployment_id: number;
  535. }
  536. >("DELETE", (pathParams) => {
  537. const { cluster_id, project_id, deployment_id } = pathParams;
  538. return `/api/projects/${project_id}/clusters/${cluster_id}/deployments/${deployment_id}`;
  539. });
  540. const getNotificationConfig = baseApi<
  541. {},
  542. {
  543. project_id: number;
  544. cluster_id: number;
  545. namespace: string;
  546. name: string;
  547. }
  548. >("GET", (pathParams) => {
  549. let { project_id, cluster_id, namespace, name } = pathParams;
  550. return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/notifications`;
  551. });
  552. const getGHAWorkflowTemplate = baseApi<
  553. {
  554. release_name: string;
  555. github_action_config: FullActionConfigType;
  556. },
  557. {
  558. cluster_id: number;
  559. project_id: number;
  560. namespace: string;
  561. }
  562. >("POST", (pathParams) => {
  563. const { cluster_id, project_id, namespace } = pathParams;
  564. return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/gha_template`;
  565. });
  566. const deployTemplate = baseApi<
  567. {
  568. template_name: string;
  569. template_version: string;
  570. image_url?: string;
  571. values?: any;
  572. name: string;
  573. git_action_config?: FullActionConfigType;
  574. build_config?: any;
  575. synced_env_groups?: string[];
  576. },
  577. {
  578. id: number;
  579. cluster_id: number;
  580. namespace: string;
  581. repo_url?: string;
  582. }
  583. >("POST", (pathParams) => {
  584. let { cluster_id, id, namespace, repo_url } = pathParams;
  585. if (repo_url) {
  586. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases?repo_url=${repo_url}`;
  587. }
  588. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases`;
  589. });
  590. const deployAddon = baseApi<
  591. {
  592. template_name: string;
  593. template_version: string;
  594. values?: any;
  595. name: string;
  596. },
  597. {
  598. id: number;
  599. cluster_id: number;
  600. namespace: string;
  601. repo_url?: string;
  602. }
  603. >("POST", (pathParams) => {
  604. let { cluster_id, id, namespace, repo_url } = pathParams;
  605. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/addons?repo_url=${repo_url}`;
  606. });
  607. const detectBuildpack = baseApi<
  608. {},
  609. {
  610. project_id: number;
  611. git_repo_id: number;
  612. kind: string;
  613. owner: string;
  614. name: string;
  615. branch: string;
  616. }
  617. >("GET", (pathParams) => {
  618. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id
  619. }/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name
  620. }/${encodeURIComponent(pathParams.branch)}/buildpack/detect`;
  621. });
  622. const detectGitlabBuildpack = baseApi<
  623. { dir: string },
  624. {
  625. project_id: number;
  626. integration_id: number;
  627. repo_owner: string;
  628. repo_name: string;
  629. branch: string;
  630. }
  631. >(
  632. "GET",
  633. ({ project_id, integration_id, repo_name, repo_owner, branch }) =>
  634. `/api/projects/${project_id}/integrations/gitlab/${integration_id}/repos/${repo_owner}/${repo_name}/${branch}/buildpack/detect`
  635. );
  636. const getBranchContents = baseApi<
  637. {
  638. dir: string;
  639. },
  640. {
  641. project_id: number;
  642. git_repo_id: number;
  643. kind: string;
  644. owner: string;
  645. name: string;
  646. branch: string;
  647. }
  648. >("GET", (pathParams) => {
  649. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id
  650. }/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name
  651. }/${encodeURIComponent(pathParams.branch)}/contents`;
  652. });
  653. const getProcfileContents = baseApi<
  654. {
  655. path: string;
  656. },
  657. {
  658. project_id: number;
  659. git_repo_id: number;
  660. kind: string;
  661. owner: string;
  662. name: string;
  663. branch: string;
  664. }
  665. >("GET", (pathParams) => {
  666. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id
  667. }/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name
  668. }/${encodeURIComponent(pathParams.branch)}/procfile`;
  669. });
  670. const getPorterYamlContents = baseApi<
  671. {
  672. path: string;
  673. },
  674. {
  675. project_id: number;
  676. git_repo_id: number;
  677. kind: string;
  678. owner: string;
  679. name: string;
  680. branch: string;
  681. }
  682. >("GET", (pathParams) => {
  683. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id
  684. }/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name
  685. }/${encodeURIComponent(pathParams.branch)}/porteryaml`;
  686. });
  687. const getGitlabProcfileContents = baseApi<
  688. {
  689. path: string;
  690. },
  691. {
  692. project_id: number;
  693. integration_id: number;
  694. owner: string;
  695. name: string;
  696. branch: string;
  697. }
  698. >(
  699. "GET",
  700. ({ project_id, integration_id, owner, name, branch }) =>
  701. `/api/projects/${project_id}/integrations/gitlab/${integration_id}/repos/${owner}/${name}/${encodeURIComponent(
  702. branch
  703. )}/procfile`
  704. );
  705. const getBranches = baseApi<
  706. {},
  707. {
  708. project_id: number;
  709. git_repo_id: number;
  710. kind: string;
  711. owner: string;
  712. name: string;
  713. }
  714. >("GET", (pathParams) => {
  715. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name}/branches`;
  716. });
  717. const getChart = baseApi<
  718. {},
  719. {
  720. id: number;
  721. cluster_id: number;
  722. namespace: string;
  723. name: string;
  724. revision: number;
  725. }
  726. >("GET", (pathParams) => {
  727. let { id, cluster_id, namespace, name, revision } = pathParams;
  728. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}`;
  729. });
  730. const getCharts = baseApi<
  731. {
  732. limit: number;
  733. skip: number;
  734. byDate: boolean;
  735. statusFilter: string[];
  736. },
  737. {
  738. id: number;
  739. cluster_id: number;
  740. namespace: string;
  741. }
  742. >("GET", (pathParams) => {
  743. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/releases`;
  744. });
  745. const getChartComponents = baseApi<
  746. {},
  747. {
  748. id: number;
  749. cluster_id: number;
  750. namespace: string;
  751. name: string;
  752. revision: number;
  753. }
  754. >("GET", (pathParams) => {
  755. let { id, cluster_id, namespace, name, revision } = pathParams;
  756. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}/components`;
  757. });
  758. const getChartControllers = baseApi<
  759. {},
  760. {
  761. id: number;
  762. cluster_id: number;
  763. namespace: string;
  764. name: string;
  765. revision: number;
  766. }
  767. >("GET", (pathParams) => {
  768. let { id, cluster_id, namespace, name, revision } = pathParams;
  769. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}/controllers`;
  770. });
  771. const getClusterIntegrations = baseApi("GET", "/api/integrations/cluster");
  772. const getClusters = baseApi<{}, { id: number }>("GET", (pathParams) => {
  773. return `/api/projects/${pathParams.id}/clusters`;
  774. });
  775. const getCluster = baseApi<
  776. {},
  777. {
  778. project_id: number;
  779. cluster_id: number;
  780. }
  781. >("GET", (pathParams) => {
  782. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
  783. });
  784. const getClusterStatus = baseApi<
  785. {},
  786. {
  787. project_id: number;
  788. cluster_id: number;
  789. }
  790. >("GET", (pathParams) => {
  791. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}/status`;
  792. });
  793. const getClusterNodes = baseApi<
  794. {},
  795. {
  796. project_id: number;
  797. cluster_id: number;
  798. }
  799. >("GET", (pathParams) => {
  800. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}/nodes`;
  801. });
  802. const getClusterNode = baseApi<
  803. {},
  804. {
  805. project_id: number;
  806. cluster_id: number;
  807. nodeName: string;
  808. }
  809. >(
  810. "GET",
  811. (pathParams) =>
  812. `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}/nodes/${pathParams.nodeName}`
  813. );
  814. const getGitRepoList = baseApi<
  815. {},
  816. {
  817. project_id: number;
  818. git_repo_id: number;
  819. }
  820. >("GET", (pathParams) => {
  821. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos`;
  822. });
  823. const getGitRepoPermission = baseApi<
  824. {},
  825. {
  826. project_id: number;
  827. git_repo_id: number;
  828. }
  829. >("GET", (pathParams) => {
  830. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/permissions`;
  831. });
  832. const getGitRepos = baseApi<
  833. {},
  834. {
  835. project_id: number;
  836. }
  837. >("GET", (pathParams) => {
  838. return `/api/projects/${pathParams.project_id}/gitrepos`;
  839. });
  840. const getImageRepos = baseApi<
  841. {},
  842. {
  843. project_id: number;
  844. registry_id: number;
  845. }
  846. >("GET", (pathParams) => {
  847. return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories`;
  848. });
  849. const getImageTags = baseApi<
  850. {},
  851. {
  852. project_id: number;
  853. registry_id: number;
  854. repo_name: string;
  855. }
  856. >("GET", (pathParams) => {
  857. return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories/${pathParams.repo_name}`;
  858. });
  859. const getInfra = baseApi<
  860. {
  861. version?: string;
  862. },
  863. {
  864. project_id: number;
  865. }
  866. >("GET", (pathParams) => {
  867. return `/api/projects/${pathParams.project_id}/infra`;
  868. });
  869. const listInfraTemplates = baseApi<
  870. {},
  871. {
  872. project_id: number;
  873. }
  874. >("GET", (pathParams) => {
  875. return `/api/projects/${pathParams.project_id}/infras/templates`;
  876. });
  877. const getInfraTemplate = baseApi<
  878. {},
  879. {
  880. project_id: number;
  881. name: string;
  882. version: string;
  883. }
  884. >("GET", (pathParams) => {
  885. let { project_id, name, version } = pathParams;
  886. return `/api/projects/${project_id}/infras/templates/${name}/${version}`;
  887. });
  888. const provisionCluster = baseApi<
  889. {
  890. project_id: number;
  891. cluster_id?: number;
  892. cloud_provider: string;
  893. cloud_provider_credentials_id: string;
  894. cluster_settings: {
  895. cluster_name: string;
  896. cluster_version: string;
  897. cidr_range: string;
  898. region: string;
  899. node_groups: [
  900. {
  901. instance_type: string;
  902. min_instances: number;
  903. max_instances: number;
  904. node_group_type: number;
  905. },
  906. {
  907. instance_type: string;
  908. min_instances: number;
  909. max_instances: number;
  910. node_group_type: number;
  911. }
  912. ];
  913. };
  914. },
  915. {
  916. project_id: number;
  917. }
  918. >("POST", ({ project_id }) => {
  919. return `/api/projects/${project_id}/provision/cluster`;
  920. });
  921. const createContract = baseApi<Contract, { project_id: number }>(
  922. "POST",
  923. ({ project_id }) => {
  924. return `/api/projects/${project_id}/contract`;
  925. }
  926. );
  927. const getContracts = baseApi<{ cluster_id?: number }, { project_id: number }>(
  928. "GET",
  929. ({ project_id }) => {
  930. return `/api/projects/${project_id}/contracts`;
  931. }
  932. );
  933. const deleteContract = baseApi<{}, { project_id: number; revision_id: string }>(
  934. "DELETE",
  935. ({ project_id, revision_id }) => {
  936. return `/api/projects/${project_id}/contracts/${revision_id}`;
  937. }
  938. );
  939. const getClusterState = baseApi<{}, { project_id: number; cluster_id: number }>(
  940. "GET",
  941. ({ project_id, cluster_id }) => {
  942. return `/api/projects/${project_id}/clusters/${cluster_id}/state`;
  943. }
  944. );
  945. const provisionInfra = baseApi<
  946. {
  947. kind: string;
  948. values: any;
  949. aws_integration_id?: number;
  950. gcp_integration_id?: number;
  951. do_integration_id?: number;
  952. azure_integration_id?: number;
  953. cluster_id?: number;
  954. },
  955. {
  956. project_id: number;
  957. }
  958. >("POST", ({ project_id }) => {
  959. return `/api/projects/${project_id}/infras`;
  960. });
  961. const updateInfra = baseApi<
  962. { values?: any },
  963. {
  964. project_id: number;
  965. infra_id: number;
  966. }
  967. >("POST", (pathParams) => {
  968. let { project_id, infra_id } = pathParams;
  969. return `/api/projects/${project_id}/infras/${infra_id}/update`;
  970. });
  971. const retryCreateInfra = baseApi<
  972. {
  973. aws_integration_id?: number;
  974. gcp_integration_id?: number;
  975. do_integration_id?: number;
  976. values?: any;
  977. },
  978. {
  979. project_id: number;
  980. infra_id: number;
  981. }
  982. >("POST", (pathParams) => {
  983. let { project_id, infra_id } = pathParams;
  984. return `/api/projects/${project_id}/infras/${infra_id}/retry_create`;
  985. });
  986. const retryDeleteInfra = baseApi<
  987. { values?: any },
  988. {
  989. project_id: number;
  990. infra_id: number;
  991. }
  992. >("POST", (pathParams) => {
  993. let { project_id, infra_id } = pathParams;
  994. return `/api/projects/${project_id}/infras/${infra_id}/retry_delete`;
  995. });
  996. const deleteInfra = baseApi<
  997. {},
  998. {
  999. project_id: number;
  1000. infra_id: number;
  1001. }
  1002. >("DELETE", (pathParams) => {
  1003. let { project_id, infra_id } = pathParams;
  1004. return `/api/projects/${project_id}/infras/${infra_id}`;
  1005. });
  1006. const listOperations = baseApi<
  1007. {},
  1008. {
  1009. project_id: number;
  1010. infra_id: number;
  1011. }
  1012. >("GET", (pathParams) => {
  1013. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/operations`;
  1014. });
  1015. const getOperation = baseApi<
  1016. {},
  1017. {
  1018. project_id: number;
  1019. infra_id: number;
  1020. operation_id: string;
  1021. }
  1022. >("GET", (pathParams) => {
  1023. let { project_id, infra_id, operation_id } = pathParams;
  1024. return `/api/projects/${project_id}/infras/${infra_id}/operations/${operation_id}`;
  1025. });
  1026. const getOperationLogs = baseApi<
  1027. {},
  1028. {
  1029. project_id: number;
  1030. infra_id: number;
  1031. operation_id: string;
  1032. }
  1033. >("GET", (pathParams) => {
  1034. let { project_id, infra_id, operation_id } = pathParams;
  1035. return `/api/projects/${project_id}/infras/${infra_id}/operations/${operation_id}/logs`;
  1036. });
  1037. const getInfraState = baseApi<
  1038. {},
  1039. {
  1040. project_id: number;
  1041. infra_id: number;
  1042. }
  1043. >("GET", (pathParams) => {
  1044. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/state`;
  1045. });
  1046. const getInfraRawState = baseApi<
  1047. {},
  1048. {
  1049. project_id: number;
  1050. infra_id: number;
  1051. }
  1052. >("GET", (pathParams) => {
  1053. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/raw_state`;
  1054. });
  1055. const getInfraByID = baseApi<
  1056. {},
  1057. {
  1058. project_id: number;
  1059. infra_id: number;
  1060. }
  1061. >("GET", (pathParams) => {
  1062. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}`;
  1063. });
  1064. const getInfraDesired = baseApi<
  1065. {},
  1066. {
  1067. project_id: number;
  1068. infra_id: number;
  1069. }
  1070. >("GET", (pathParams) => {
  1071. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/desired`;
  1072. });
  1073. const getInfraCurrent = baseApi<
  1074. {},
  1075. {
  1076. project_id: number;
  1077. infra_id: number;
  1078. }
  1079. >("GET", (pathParams) => {
  1080. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/current`;
  1081. });
  1082. const getIngress = baseApi<
  1083. {},
  1084. { namespace: string; cluster_id: number; name: string; id: number }
  1085. >("GET", (pathParams) => {
  1086. let { id, name, cluster_id, namespace } = pathParams;
  1087. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/ingresses/${name}`;
  1088. });
  1089. const getInvites = baseApi<{}, { id: number }>("GET", (pathParams) => {
  1090. return `/api/projects/${pathParams.id}/invites`;
  1091. });
  1092. const getJobs = baseApi<
  1093. {},
  1094. { namespace: string; cluster_id: number; release_name: string; id: number }
  1095. >("GET", (pathParams) => {
  1096. let { id, release_name, cluster_id, namespace } = pathParams;
  1097. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/jobs`;
  1098. });
  1099. const getJobStatus = baseApi<
  1100. {},
  1101. { namespace: string; cluster_id: number; release_name: string; id: number }
  1102. >("GET", (pathParams) => {
  1103. let { id, release_name, cluster_id, namespace } = pathParams;
  1104. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/jobs/status`;
  1105. });
  1106. const getJobPods = baseApi<
  1107. {},
  1108. { name: string; namespace: string; id: number; cluster_id: number }
  1109. >("GET", (pathParams) => {
  1110. let { id, name, cluster_id, namespace } = pathParams;
  1111. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}/pods`;
  1112. });
  1113. const getPodByName = baseApi<
  1114. {},
  1115. {
  1116. project_id: number;
  1117. cluster_id: number;
  1118. namespace: string;
  1119. name: string;
  1120. }
  1121. >(
  1122. "GET",
  1123. ({ project_id, cluster_id, namespace, name }) =>
  1124. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}`
  1125. );
  1126. const getMatchingPods = baseApi<
  1127. {
  1128. namespace: string;
  1129. selectors: string[];
  1130. },
  1131. { id: number; cluster_id: number }
  1132. >("GET", (pathParams) => {
  1133. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/pods`;
  1134. });
  1135. const getAllReleasePods = baseApi<
  1136. {},
  1137. {
  1138. id: number;
  1139. name: string;
  1140. namespace: string;
  1141. cluster_id: number;
  1142. }
  1143. >("GET", (pathParams) => {
  1144. const { id, name, cluster_id, namespace } = pathParams;
  1145. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0/pods/all`;
  1146. });
  1147. const getMetrics = baseApi<
  1148. {
  1149. metric: string;
  1150. shouldsum: boolean;
  1151. pods?: string[];
  1152. kind?: string; // the controller kind
  1153. name?: string;
  1154. percentile?: number;
  1155. namespace: string;
  1156. startrange: number;
  1157. endrange: number;
  1158. resolution: string;
  1159. },
  1160. {
  1161. id: number;
  1162. cluster_id: number;
  1163. }
  1164. >("GET", (pathParams) => {
  1165. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/metrics`;
  1166. });
  1167. const getNamespaces = baseApi<
  1168. {},
  1169. {
  1170. id: number;
  1171. cluster_id: number;
  1172. }
  1173. >("GET", (pathParams) => {
  1174. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces`;
  1175. });
  1176. const getNGINXIngresses = baseApi<
  1177. {},
  1178. {
  1179. id: number;
  1180. cluster_id: number;
  1181. }
  1182. >("GET", (pathParams) => {
  1183. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/prometheus/ingresses`;
  1184. });
  1185. const getOAuthIds = baseApi<
  1186. {},
  1187. {
  1188. project_id: number;
  1189. }
  1190. >("GET", (pathParams) => {
  1191. return `/api/projects/${pathParams.project_id}/integrations/oauth`;
  1192. });
  1193. const getProjectClusters = baseApi<{}, { id: number }>("GET", (pathParams) => {
  1194. return `/api/projects/${pathParams.id}/clusters`;
  1195. });
  1196. const getProjectRegistries = baseApi<{}, { id: number }>(
  1197. "GET",
  1198. (pathParams) => {
  1199. return `/api/projects/${pathParams.id}/registries`;
  1200. }
  1201. );
  1202. const getProjectRepos = baseApi<{}, { id: number }>("GET", (pathParams) => {
  1203. return `/api/projects/${pathParams.id}/repos`;
  1204. });
  1205. const getProjects = baseApi("GET", "/api/projects");
  1206. const getPrometheusIsInstalled = baseApi<
  1207. {},
  1208. {
  1209. id: number;
  1210. cluster_id: number;
  1211. }
  1212. >("GET", (pathParams) => {
  1213. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/prometheus/detect`;
  1214. });
  1215. const getRegistryIntegrations = baseApi("GET", "/api/integrations/registry");
  1216. const getReleaseToken = baseApi<
  1217. {},
  1218. { name: string; id: number; namespace: string; cluster_id: number }
  1219. >("GET", (pathParams) => {
  1220. let { id, cluster_id, namespace, name } = pathParams;
  1221. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/webhook`;
  1222. });
  1223. const getReleaseSteps = baseApi<
  1224. {},
  1225. { name: string; id: number; namespace: string; cluster_id: number }
  1226. >("GET", (pathParams) => {
  1227. let { id, cluster_id, namespace, name } = pathParams;
  1228. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/steps`;
  1229. });
  1230. const destroyInfra = baseApi<
  1231. {},
  1232. {
  1233. project_id: number;
  1234. infra_id: number;
  1235. }
  1236. >("DELETE", (pathParams) => {
  1237. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}`;
  1238. });
  1239. const updateDatabaseStatus = baseApi<
  1240. {
  1241. status: string;
  1242. },
  1243. {
  1244. project_id: number;
  1245. infra_id: number;
  1246. }
  1247. >("POST", (pathParams) => {
  1248. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/database`;
  1249. });
  1250. const getRepoIntegrations = baseApi("GET", "/api/integrations/repo");
  1251. const getRepos = baseApi<{}, { id: number }>("GET", (pathParams) => {
  1252. return `/api/projects/${pathParams.id}/repos`;
  1253. });
  1254. const getSlackIntegrations = baseApi<{}, { id: number }>(
  1255. "GET",
  1256. (pathParams) => {
  1257. return `/api/projects/${pathParams.id}/slack_integrations`;
  1258. }
  1259. );
  1260. const getRevisions = baseApi<
  1261. {},
  1262. { id: number; cluster_id: number; namespace: string; name: string }
  1263. >("GET", (pathParams) => {
  1264. let { id, cluster_id, namespace, name } = pathParams;
  1265. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/history`;
  1266. });
  1267. const getTemplateInfo = baseApi<
  1268. {
  1269. repo_url?: string;
  1270. },
  1271. { project_id: number; name: string; version: string }
  1272. >("GET", (pathParams) => {
  1273. return `/api/v1/projects/${pathParams.project_id}/templates/${pathParams.name}/versions/${pathParams.version}`;
  1274. });
  1275. const getTemplateUpgradeNotes = baseApi<
  1276. {
  1277. repo_url?: string;
  1278. prev_version: string;
  1279. },
  1280. { project_id: number; name: string; version: string }
  1281. >("GET", (pathParams) => {
  1282. return `/api/v1/projects/${pathParams.project_id}/templates/${pathParams.name}/versions/${pathParams.version}/upgrade_notes`;
  1283. });
  1284. const getTemplates = baseApi<
  1285. {
  1286. repo_url?: string;
  1287. },
  1288. {
  1289. project_id: number;
  1290. }
  1291. >("GET", (pathParams) => {
  1292. return `/api/v1/projects/${pathParams.project_id}/templates`;
  1293. });
  1294. const getHelmRepos = baseApi<
  1295. {},
  1296. {
  1297. project_id: number;
  1298. }
  1299. >("GET", (pathParams) => {
  1300. return `/api/projects/${pathParams.project_id}/helmrepos`;
  1301. });
  1302. const getChartsFromHelmRepo = baseApi<
  1303. {},
  1304. {
  1305. project_id: number;
  1306. helm_repo_id: number;
  1307. }
  1308. >("GET", (pathParams) => {
  1309. return `/api/projects/${pathParams.project_id}/helmrepos/${pathParams.helm_repo_id}/charts`;
  1310. });
  1311. const getChartInfoFromHelmRepo = baseApi<
  1312. {},
  1313. { project_id: number; helm_repo_id: number; name: string; version: string }
  1314. >("GET", (pathParams) => {
  1315. return `/api/projects/${pathParams.project_id}/helmrepos/${pathParams.helm_repo_id}/charts/${pathParams.name}/${pathParams.version}`;
  1316. });
  1317. const getMetadata = baseApi<{}, {}>("GET", () => {
  1318. return `/api/metadata`;
  1319. });
  1320. const postWelcome = baseApi<{
  1321. email: string;
  1322. isCompany: boolean;
  1323. name: string;
  1324. company: string;
  1325. role: string;
  1326. }>("POST", () => {
  1327. return `/api/welcome`;
  1328. });
  1329. const linkGithubProject = baseApi<
  1330. {},
  1331. {
  1332. project_id: number;
  1333. }
  1334. >("GET", (pathParams) => {
  1335. return `/api/oauth/projects/${pathParams.project_id}/github`;
  1336. });
  1337. const getGithubAccounts = baseApi<{}, {}>("GET", () => {
  1338. return `/api/integrations/github-app/accounts`;
  1339. });
  1340. const logInUser = baseApi<{
  1341. email: string;
  1342. password: string;
  1343. }>("POST", "/api/login");
  1344. const logOutUser = baseApi("POST", "/api/logout");
  1345. const registerUser = baseApi<{
  1346. email: string;
  1347. password: string;
  1348. first_name: string;
  1349. last_name: string;
  1350. company_name: string;
  1351. }>("POST", "/api/users");
  1352. const rollbackChart = baseApi<
  1353. {
  1354. revision: number;
  1355. },
  1356. {
  1357. id: number;
  1358. name: string;
  1359. namespace: string;
  1360. cluster_id: number;
  1361. }
  1362. >("POST", (pathParams) => {
  1363. let { id, name, cluster_id, namespace } = pathParams;
  1364. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0/rollback`;
  1365. });
  1366. const uninstallTemplate = baseApi<
  1367. {},
  1368. {
  1369. id: number;
  1370. name: string;
  1371. cluster_id: number;
  1372. namespace: string;
  1373. }
  1374. >("DELETE", (pathParams) => {
  1375. let { id, name, cluster_id, namespace } = pathParams;
  1376. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0`;
  1377. });
  1378. const updateUserInfo = baseApi<
  1379. {
  1380. first_name: string;
  1381. last_name: string;
  1382. company_name: string;
  1383. },
  1384. {}
  1385. >("POST", (pathParams) => {
  1386. return `/api/users/update/info`;
  1387. });
  1388. const updateUser = baseApi<
  1389. {
  1390. rawKubeConfig?: string;
  1391. allowedContexts?: string[];
  1392. },
  1393. { id: number }
  1394. >("PUT", (pathParams) => {
  1395. return `/api/users/${pathParams.id}`;
  1396. });
  1397. const upgradeChartValues = baseApi<
  1398. {
  1399. values: string;
  1400. version?: string;
  1401. latest_revision?: number;
  1402. },
  1403. {
  1404. id: number;
  1405. name: string;
  1406. namespace: string;
  1407. cluster_id: number;
  1408. }
  1409. >("POST", (pathParams) => {
  1410. let { id, name, cluster_id, namespace } = pathParams;
  1411. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0/upgrade`;
  1412. });
  1413. const listEnvGroups = baseApi<
  1414. {},
  1415. {
  1416. id: number;
  1417. namespace: string;
  1418. cluster_id: number;
  1419. }
  1420. >("GET", (pathParams) => {
  1421. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/envgroup/list`;
  1422. });
  1423. const listConfigMaps = baseApi<
  1424. {},
  1425. {
  1426. id: number;
  1427. namespace: string;
  1428. cluster_id: number;
  1429. }
  1430. >("GET", (pathParams) => {
  1431. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/list`;
  1432. });
  1433. const getEnvGroup = baseApi<
  1434. {},
  1435. {
  1436. id: number;
  1437. namespace: string;
  1438. cluster_id: number;
  1439. name: string;
  1440. version?: number;
  1441. }
  1442. >("GET", (pathParams) => {
  1443. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id
  1444. }/namespaces/${pathParams.namespace}/envgroup?name=${pathParams.name}${pathParams.version ? "&version=" + pathParams.version : ""
  1445. }`;
  1446. });
  1447. const getConfigMap = baseApi<
  1448. {
  1449. name: string;
  1450. },
  1451. {
  1452. id: number;
  1453. namespace: string;
  1454. cluster_id: number;
  1455. }
  1456. >("GET", (pathParams) => {
  1457. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap`;
  1458. });
  1459. const createEnvGroup = baseApi<
  1460. {
  1461. name: string;
  1462. variables: Record<string, string>;
  1463. secret_variables?: Record<string, string>;
  1464. },
  1465. {
  1466. id: number;
  1467. cluster_id: number;
  1468. namespace: string;
  1469. }
  1470. >("POST", (pathParams) => {
  1471. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/envgroup/create`;
  1472. });
  1473. const cloneEnvGroup = baseApi<
  1474. {
  1475. name: string;
  1476. namespace: string;
  1477. clone_name: string;
  1478. version: number;
  1479. },
  1480. {
  1481. id: number;
  1482. namespace: string;
  1483. cluster_id: number;
  1484. }
  1485. >("POST", (pathParams) => {
  1486. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/envgroup/clone`;
  1487. });
  1488. const updateEnvGroup = baseApi<
  1489. {
  1490. name: string;
  1491. variables: { [key: string]: string };
  1492. secret_variables?: { [key: string]: string };
  1493. },
  1494. {
  1495. project_id: number;
  1496. cluster_id: number;
  1497. namespace: string;
  1498. }
  1499. >(
  1500. "POST",
  1501. ({ cluster_id, project_id, namespace }) =>
  1502. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/envgroup/create`
  1503. );
  1504. const createConfigMap = baseApi<
  1505. {
  1506. name: string;
  1507. variables: Record<string, string>;
  1508. secret_variables?: Record<string, string>;
  1509. },
  1510. {
  1511. id: number;
  1512. cluster_id: number;
  1513. namespace: string;
  1514. }
  1515. >("POST", (pathParams) => {
  1516. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/create`;
  1517. });
  1518. const updateConfigMap = baseApi<
  1519. {
  1520. name: string;
  1521. variables: Record<string, string>;
  1522. secret_variables?: Record<string, string>;
  1523. },
  1524. {
  1525. id: number;
  1526. cluster_id: number;
  1527. namespace: string;
  1528. }
  1529. >("POST", (pathParams) => {
  1530. let { id, cluster_id } = pathParams;
  1531. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/update`;
  1532. });
  1533. const renameConfigMap = baseApi<
  1534. {
  1535. name: string;
  1536. new_name: string;
  1537. },
  1538. {
  1539. id: number;
  1540. cluster_id: number;
  1541. namespace: string;
  1542. }
  1543. >("POST", (pathParams) => {
  1544. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/rename`;
  1545. });
  1546. const deleteEnvGroup = baseApi<
  1547. {
  1548. name: string;
  1549. },
  1550. {
  1551. id: number;
  1552. namespace: string;
  1553. cluster_id: number;
  1554. }
  1555. >("DELETE", (pathParams) => {
  1556. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/envgroup`;
  1557. });
  1558. const deleteConfigMap = baseApi<
  1559. {
  1560. name: string;
  1561. },
  1562. {
  1563. id: number;
  1564. namespace: string;
  1565. cluster_id: number;
  1566. }
  1567. >("DELETE", (pathParams) => {
  1568. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/delete`;
  1569. });
  1570. const createNamespace = baseApi<
  1571. {
  1572. name: string;
  1573. },
  1574. { id: number; cluster_id: number }
  1575. >("POST", (pathParams) => {
  1576. let { id, cluster_id } = pathParams;
  1577. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/create`;
  1578. });
  1579. const deleteNamespace = baseApi<
  1580. {},
  1581. {
  1582. id: number;
  1583. cluster_id: number;
  1584. namespace: string;
  1585. }
  1586. >("DELETE", (pathParams) => {
  1587. let { id, cluster_id, namespace } = pathParams;
  1588. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}`;
  1589. });
  1590. const deleteJob = baseApi<
  1591. {},
  1592. { name: string; namespace: string; id: number; cluster_id: number }
  1593. >("DELETE", (pathParams) => {
  1594. let { id, name, cluster_id, namespace } = pathParams;
  1595. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}`;
  1596. });
  1597. const stopJob = baseApi<
  1598. {},
  1599. { name: string; namespace: string; id: number; cluster_id: number }
  1600. >("POST", (pathParams) => {
  1601. let { id, name, namespace, cluster_id } = pathParams;
  1602. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}/stop`;
  1603. });
  1604. const listAPITokens = baseApi<{}, { project_id: number }>(
  1605. "GET",
  1606. ({ project_id }) => `/api/projects/${project_id}/api_token`
  1607. );
  1608. const getAPIToken = baseApi<{}, { project_id: number; token: string }>(
  1609. "GET",
  1610. ({ project_id, token }) => `/api/projects/${project_id}/api_token/${token}`
  1611. );
  1612. const revokeAPIToken = baseApi<{}, { project_id: number; token: string }>(
  1613. "POST",
  1614. ({ project_id, token }) =>
  1615. `/api/projects/${project_id}/api_token/${token}/revoke`
  1616. );
  1617. const createAPIToken = baseApi<
  1618. {
  1619. name: string;
  1620. policy_uid: string;
  1621. expires_at?: string;
  1622. },
  1623. { project_id: number }
  1624. >("POST", ({ project_id }) => `/api/projects/${project_id}/api_token`);
  1625. const createPolicy = baseApi<
  1626. {
  1627. name: string;
  1628. policy: PolicyDocType[];
  1629. },
  1630. { project_id: number }
  1631. >("POST", ({ project_id }) => `/api/projects/${project_id}/policy`);
  1632. const getAvailableRoles = baseApi<{}, { project_id: number }>(
  1633. "GET",
  1634. ({ project_id }) => `/api/projects/${project_id}/roles`
  1635. );
  1636. const updateInvite = baseApi<
  1637. { kind: string },
  1638. { project_id: number; invite_id: number }
  1639. >(
  1640. "POST",
  1641. ({ project_id, invite_id }) =>
  1642. `/api/projects/${project_id}/invites/${invite_id}`
  1643. );
  1644. const getCollaborators = baseApi<{}, { project_id: number }>(
  1645. "GET",
  1646. ({ project_id }) => `/api/projects/${project_id}/collaborators`
  1647. );
  1648. const updateCollaborator = baseApi<
  1649. {
  1650. kind: string;
  1651. user_id: number;
  1652. },
  1653. { project_id: number }
  1654. >("POST", ({ project_id }) => `/api/projects/${project_id}/roles`);
  1655. const removeCollaborator = baseApi<{ user_id: number }, { project_id: number }>(
  1656. "DELETE",
  1657. ({ project_id }) => `/api/projects/${project_id}/roles`
  1658. );
  1659. const getPolicyDocument = baseApi<{}, { project_id: number }>(
  1660. "GET",
  1661. ({ project_id }) => `/api/projects/${project_id}/policy`
  1662. );
  1663. const createWebhookToken = baseApi<
  1664. {},
  1665. {
  1666. project_id: number;
  1667. chart_name: string;
  1668. namespace: string;
  1669. cluster_id: number;
  1670. }
  1671. >(
  1672. "POST",
  1673. ({ project_id, chart_name, namespace, cluster_id }) =>
  1674. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${chart_name}/0/webhook`
  1675. );
  1676. const getUsage = baseApi<{}, { project_id: number }>(
  1677. "GET",
  1678. ({ project_id }) => `/api/projects/${project_id}/usage`
  1679. );
  1680. // Used for billing purposes
  1681. const getCustomerToken = baseApi<{}, { project_id: number }>(
  1682. "GET",
  1683. ({ project_id }) => `/api/projects/${project_id}/billing/token`
  1684. );
  1685. const getHasBilling = baseApi<{}, { project_id: number }>(
  1686. "GET",
  1687. ({ project_id }) => `/api/projects/${project_id}/billing`
  1688. );
  1689. const getOnboardingState = baseApi<{}, { project_id: number }>(
  1690. "GET",
  1691. ({ project_id }) => `/api/projects/${project_id}/onboarding`
  1692. );
  1693. const saveOnboardingState = baseApi<{}, { project_id: number }>(
  1694. "POST",
  1695. ({ project_id }) => `/api/projects/${project_id}/onboarding`
  1696. );
  1697. const getOnboardingInfra = baseApi<
  1698. {},
  1699. { project_id: number; registry_infra_id: number }
  1700. >(
  1701. "GET",
  1702. ({ project_id, registry_infra_id }) =>
  1703. `/api/projects/${project_id}/infras/${registry_infra_id}`
  1704. );
  1705. const getOnboardingRegistry = baseApi<
  1706. {},
  1707. { project_id: number; registry_connection_id: number }
  1708. >(
  1709. "GET",
  1710. ({ project_id, registry_connection_id }) =>
  1711. `/api/projects/${project_id}/registries/${registry_connection_id}`
  1712. );
  1713. const detectPorterAgent = baseApi<
  1714. {},
  1715. { project_id: number; cluster_id: number }
  1716. >(
  1717. "GET",
  1718. ({ project_id, cluster_id }) =>
  1719. `/api/projects/${project_id}/clusters/${cluster_id}/agent/detect`
  1720. );
  1721. const installPorterAgent = baseApi<
  1722. {},
  1723. { project_id: number; cluster_id: number }
  1724. >(
  1725. "POST",
  1726. ({ cluster_id, project_id }) =>
  1727. `/api/projects/${project_id}/clusters/${cluster_id}/agent/install`
  1728. );
  1729. const getKubeEvents = baseApi<
  1730. {
  1731. skip: number;
  1732. resource_type: string;
  1733. owner_type?: string;
  1734. owner_name?: string;
  1735. namespace?: string;
  1736. },
  1737. { project_id: number; cluster_id: number }
  1738. >("GET", ({ project_id, cluster_id }) => {
  1739. return `/api/projects/${project_id}/clusters/${cluster_id}/kube_events`;
  1740. });
  1741. const getKubeEvent = baseApi<
  1742. {},
  1743. { project_id: number; cluster_id: number; kube_event_id: number }
  1744. >(
  1745. "GET",
  1746. ({ project_id, cluster_id, kube_event_id }) =>
  1747. `/api/projects/${project_id}/clusters/${cluster_id}/kube_events/${kube_event_id}`
  1748. );
  1749. const getLogBuckets = baseApi<
  1750. {},
  1751. { project_id: number; cluster_id: number; kube_event_id: number }
  1752. >(
  1753. "GET",
  1754. ({ project_id, cluster_id, kube_event_id }) =>
  1755. `/api/projects/${project_id}/clusters/${cluster_id}/kube_events/${kube_event_id}/log_buckets`
  1756. );
  1757. const getLogBucketLogs = baseApi<
  1758. { timestamp: number },
  1759. { project_id: number; cluster_id: number; kube_event_id: number }
  1760. >(
  1761. "GET",
  1762. ({ project_id, cluster_id, kube_event_id }) =>
  1763. `/api/projects/${project_id}/clusters/${cluster_id}/kube_events/${kube_event_id}/logs`
  1764. );
  1765. const getCanCreateProject = baseApi<{}, {}>(
  1766. "GET",
  1767. () => "/api/can_create_project"
  1768. );
  1769. const addApplicationToEnvGroup = baseApi<
  1770. {
  1771. name: string; // Env Group name
  1772. app_name: string;
  1773. },
  1774. { project_id: number; cluster_id: number; namespace: string }
  1775. >(
  1776. "POST",
  1777. ({ cluster_id, namespace, project_id }) =>
  1778. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/envgroup/add_application`
  1779. );
  1780. const removeApplicationFromEnvGroup = baseApi<
  1781. {
  1782. name: string; // Env Group name
  1783. app_name: string;
  1784. },
  1785. { project_id: number; cluster_id: number; namespace: string }
  1786. >(
  1787. "POST",
  1788. ({ cluster_id, namespace, project_id }) =>
  1789. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/envgroup/remove_application`
  1790. );
  1791. const provisionDatabase = baseApi<
  1792. {
  1793. username: string;
  1794. password: string;
  1795. machine_type: string;
  1796. db_storage_encrypted: boolean;
  1797. db_name: string;
  1798. db_max_allocated_storage: string;
  1799. db_family: string;
  1800. db_engine_version: string;
  1801. db_allocated_storage: string;
  1802. },
  1803. { project_id: number; cluster_id: number; namespace: string }
  1804. >(
  1805. "POST",
  1806. ({ project_id, cluster_id, namespace }) =>
  1807. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/provision/rds`
  1808. );
  1809. const getDatabases = baseApi<
  1810. {},
  1811. {
  1812. project_id: number;
  1813. cluster_id: number;
  1814. }
  1815. >(
  1816. "GET",
  1817. ({ project_id, cluster_id }) =>
  1818. `/api/projects/${project_id}/clusters/${cluster_id}/databases`
  1819. );
  1820. const getPreviousLogsForContainer = baseApi<
  1821. {
  1822. container_name: string;
  1823. },
  1824. {
  1825. project_id: number;
  1826. cluster_id: number;
  1827. namespace: string;
  1828. pod_name: string;
  1829. }
  1830. >(
  1831. "GET",
  1832. ({ cluster_id, namespace, pod_name: name, project_id }) =>
  1833. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/pod/${name}/previous_logs`
  1834. );
  1835. const upgradePorterAgent = baseApi<
  1836. {},
  1837. { project_id: number; cluster_id: number }
  1838. >(
  1839. "POST",
  1840. ({ project_id, cluster_id }) =>
  1841. `/api/projects/${project_id}/clusters/${cluster_id}/agent/upgrade`
  1842. );
  1843. const updateBuildConfig = baseApi<
  1844. BuildConfig,
  1845. {
  1846. project_id: number;
  1847. cluster_id: number;
  1848. namespace: string;
  1849. release_name: string;
  1850. }
  1851. >(
  1852. "POST",
  1853. ({ project_id, cluster_id, namespace, release_name }) =>
  1854. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/buildconfig`
  1855. );
  1856. const updateGitActionConfig = baseApi<
  1857. {
  1858. git_action_config: {
  1859. git_branch: string;
  1860. };
  1861. },
  1862. {
  1863. project_id: number;
  1864. cluster_id: number;
  1865. namespace: string;
  1866. release_name: string;
  1867. revision?: 0; // Always update latest
  1868. }
  1869. >(
  1870. "PATCH",
  1871. ({ project_id, cluster_id, namespace, release_name, revision = 0 }) =>
  1872. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/${revision}/git_action_config`
  1873. );
  1874. const reRunGHWorkflow = baseApi<
  1875. {},
  1876. {
  1877. project_id: number;
  1878. cluster_id: number;
  1879. git_installation_id: number;
  1880. owner: string;
  1881. name: string;
  1882. branch?: string;
  1883. filename?: string;
  1884. release_name?: string;
  1885. }
  1886. >(
  1887. "POST",
  1888. ({
  1889. project_id,
  1890. git_installation_id,
  1891. owner,
  1892. name,
  1893. cluster_id,
  1894. filename,
  1895. release_name,
  1896. branch,
  1897. }) => {
  1898. const queryParams = new URLSearchParams();
  1899. if (branch) {
  1900. queryParams.set("branch", branch);
  1901. }
  1902. if (release_name) {
  1903. queryParams.set("release_name", release_name);
  1904. }
  1905. if (filename) {
  1906. queryParams.set("filename", filename);
  1907. }
  1908. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${owner}/${name}/clusters/${cluster_id}/rerun_workflow?${queryParams.toString()}`;
  1909. }
  1910. );
  1911. const getGHWorkflowLogs = baseApi<
  1912. {},
  1913. {
  1914. project_id: number;
  1915. cluster_id: number;
  1916. git_installation_id: number;
  1917. owner: string;
  1918. name: string;
  1919. filename?: string;
  1920. release_name?: string;
  1921. }
  1922. >(
  1923. "GET",
  1924. ({
  1925. project_id,
  1926. git_installation_id,
  1927. owner,
  1928. name,
  1929. cluster_id,
  1930. filename,
  1931. release_name,
  1932. }) => {
  1933. const queryParams = new URLSearchParams();
  1934. if (release_name) {
  1935. queryParams.set("release_name", release_name);
  1936. }
  1937. if (filename) {
  1938. queryParams.set("filename", filename);
  1939. }
  1940. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${owner}/${name}/clusters/${cluster_id}/get_logs_workflow?${queryParams.toString()}`;
  1941. }
  1942. );
  1943. const getGHWorkflowLogById = baseApi<
  1944. {},
  1945. {
  1946. project_id: number;
  1947. cluster_id: number;
  1948. git_installation_id: number;
  1949. owner: string;
  1950. name: string;
  1951. filename?: string;
  1952. run_id: string;
  1953. release_name?: string;
  1954. }
  1955. >(
  1956. "GET",
  1957. ({
  1958. project_id,
  1959. git_installation_id,
  1960. owner,
  1961. name,
  1962. cluster_id,
  1963. filename,
  1964. run_id,
  1965. release_name,
  1966. }) => {
  1967. const queryParams = new URLSearchParams();
  1968. if (release_name) {
  1969. queryParams.set("release_name", release_name);
  1970. }
  1971. if (filename) {
  1972. queryParams.set("filename", filename);
  1973. }
  1974. if (run_id) {
  1975. queryParams.set("run_id", run_id);
  1976. }
  1977. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${owner}/${name}/clusters/${cluster_id}/workflow_run_id?${queryParams.toString()}`;
  1978. }
  1979. );
  1980. const triggerPreviewEnvWorkflow = baseApi<
  1981. {},
  1982. { project_id: number; cluster_id: number; deployment_id: number }
  1983. >(
  1984. "POST",
  1985. ({ project_id, cluster_id, deployment_id }) =>
  1986. `/api/projects/${project_id}/clusters/${cluster_id}/deployments/${deployment_id}/trigger_workflow`
  1987. );
  1988. const getTagsByProjectId = baseApi<{}, { project_id: number }>(
  1989. "GET",
  1990. ({ project_id }) => `/api/projects/${project_id}/tags`
  1991. );
  1992. const createTag = baseApi<
  1993. { name: string; color: string },
  1994. { project_id: number }
  1995. >("POST", ({ project_id }) => `/api/projects/${project_id}/tags`);
  1996. const updateReleaseTags = baseApi<
  1997. {
  1998. tags: string[];
  1999. },
  2000. {
  2001. project_id: number;
  2002. cluster_id: number;
  2003. namespace: string;
  2004. release_name: string;
  2005. }
  2006. >(
  2007. "PATCH",
  2008. ({ project_id, cluster_id, namespace, release_name }) =>
  2009. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/update_tags`
  2010. );
  2011. const updateCanonicalName = baseApi<
  2012. {
  2013. canonical_name: string;
  2014. },
  2015. {
  2016. project_id: number;
  2017. cluster_id: number;
  2018. namespace: string;
  2019. release_name: string;
  2020. }
  2021. >(
  2022. "PATCH",
  2023. ({ project_id, cluster_id, namespace, release_name }) =>
  2024. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/update_canonical_name`
  2025. );
  2026. const getGitProviders = baseApi<{}, { project_id: number }>(
  2027. "GET",
  2028. ({ project_id }) => `/api/projects/${project_id}/integrations/git`
  2029. );
  2030. const getGitlabRepos = baseApi<
  2031. {},
  2032. { project_id: number; integration_id: number }
  2033. >(
  2034. "GET",
  2035. ({ project_id, integration_id }) =>
  2036. `/api/projects/${project_id}/integrations/gitlab/${integration_id}/repos`
  2037. );
  2038. const getGitlabBranches = baseApi<
  2039. {},
  2040. {
  2041. project_id: number;
  2042. integration_id: number;
  2043. repo_owner: string;
  2044. repo_name: string;
  2045. }
  2046. >(
  2047. "GET",
  2048. ({ project_id, integration_id, repo_owner, repo_name }) =>
  2049. `/api/projects/${project_id}/integrations/gitlab/${integration_id}/repos/${repo_owner}/${repo_name}/branches`
  2050. );
  2051. const getGitlabFolderContent = baseApi<
  2052. {
  2053. dir: string;
  2054. },
  2055. {
  2056. project_id: number;
  2057. integration_id: number;
  2058. repo_owner: string;
  2059. repo_name: string;
  2060. branch: string;
  2061. }
  2062. >(
  2063. "GET",
  2064. ({ project_id, integration_id, repo_owner, repo_name, branch }) =>
  2065. `/api/projects/${project_id}/integrations/gitlab/${integration_id}/repos/${repo_owner}/${repo_name}/${branch}/contents`
  2066. );
  2067. const getLogPodValues = baseApi<
  2068. {
  2069. namespace?: string;
  2070. revision?: string;
  2071. match_prefix?: string;
  2072. start_range?: string;
  2073. end_range?: string;
  2074. },
  2075. {
  2076. project_id: number;
  2077. cluster_id: number;
  2078. }
  2079. >(
  2080. "GET",
  2081. ({ project_id, cluster_id }) =>
  2082. `/api/projects/${project_id}/clusters/${cluster_id}/logs/pod_values`
  2083. );
  2084. const getLogs = baseApi<
  2085. {
  2086. limit?: number;
  2087. start_range?: string;
  2088. end_range?: string;
  2089. revision?: string;
  2090. pod_selector: string;
  2091. namespace?: string;
  2092. search_param?: string;
  2093. direction?: string;
  2094. },
  2095. {
  2096. project_id: number;
  2097. cluster_id: number;
  2098. }
  2099. >(
  2100. "GET",
  2101. ({ project_id, cluster_id }) =>
  2102. `/api/projects/${project_id}/clusters/${cluster_id}/logs`
  2103. );
  2104. const listPorterEvents = baseApi<
  2105. {
  2106. release_name?: number;
  2107. release_namespace?: string;
  2108. type?: string;
  2109. },
  2110. {
  2111. project_id: number;
  2112. cluster_id: number;
  2113. }
  2114. >(
  2115. "GET",
  2116. ({ project_id, cluster_id }) =>
  2117. `/api/projects/${project_id}/clusters/${cluster_id}/events`
  2118. );
  2119. const listPorterJobEvents = baseApi<
  2120. {
  2121. release_name?: number;
  2122. release_namespace?: string;
  2123. type?: string;
  2124. job_name: string;
  2125. },
  2126. {
  2127. project_id: number;
  2128. cluster_id: number;
  2129. }
  2130. >(
  2131. "GET",
  2132. ({ project_id, cluster_id }) =>
  2133. `/api/projects/${project_id}/clusters/${cluster_id}/events/job`
  2134. );
  2135. const listIncidents = baseApi<
  2136. {
  2137. release_name?: number;
  2138. release_namespace?: string;
  2139. status?: string;
  2140. },
  2141. {
  2142. project_id: number;
  2143. cluster_id: number;
  2144. }
  2145. >(
  2146. "GET",
  2147. ({ project_id, cluster_id }) =>
  2148. `/api/projects/${project_id}/clusters/${cluster_id}/incidents`
  2149. );
  2150. const getIncident = baseApi<
  2151. {},
  2152. {
  2153. project_id: number;
  2154. cluster_id: number;
  2155. incident_id: string;
  2156. }
  2157. >(
  2158. "GET",
  2159. ({ project_id, cluster_id, incident_id }) =>
  2160. `/api/projects/${project_id}/clusters/${cluster_id}/incidents/${incident_id}`
  2161. );
  2162. const getIncidentEvents = baseApi<
  2163. {
  2164. incident_id?: string;
  2165. pod_prefix?: string;
  2166. },
  2167. {
  2168. project_id: number;
  2169. cluster_id: number;
  2170. }
  2171. >(
  2172. "GET",
  2173. ({ project_id, cluster_id }) =>
  2174. `/api/projects/${project_id}/clusters/${cluster_id}/incidents/events`
  2175. );
  2176. // TRACKING
  2177. const updateOnboardingStep = baseApi<
  2178. {
  2179. step: string;
  2180. },
  2181. {}
  2182. >("POST", (pathParams) => {
  2183. return `/api/onboarding_step`;
  2184. });
  2185. const updateStackStep = baseApi<
  2186. {
  2187. step: string;
  2188. stack_name?: string;
  2189. },
  2190. {
  2191. project_id: number;
  2192. cluster_id: number;
  2193. }
  2194. >("POST", (pathParams) => {
  2195. let { project_id, cluster_id } = pathParams;
  2196. return `/api/projects/${project_id}/clusters/${cluster_id}/stacks/analytics`;
  2197. });
  2198. // STACKS
  2199. const createStack = baseApi<
  2200. CreateStackBody,
  2201. {
  2202. project_id: number;
  2203. cluster_id: number;
  2204. namespace: string;
  2205. }
  2206. >(
  2207. "POST",
  2208. ({ project_id, cluster_id, namespace }) =>
  2209. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks`
  2210. );
  2211. const updateStack = baseApi<
  2212. {
  2213. name: string;
  2214. },
  2215. {
  2216. project_id: number;
  2217. cluster_id: number;
  2218. namespace: string;
  2219. stack_id: string;
  2220. }
  2221. >(
  2222. "PATCH",
  2223. ({ project_id, cluster_id, namespace, stack_id }) =>
  2224. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}`
  2225. );
  2226. const listStacks = baseApi<
  2227. {},
  2228. { project_id: number; cluster_id: number; namespace: string }
  2229. >(
  2230. "GET",
  2231. ({ project_id, cluster_id, namespace }) =>
  2232. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks`
  2233. );
  2234. const getStack = baseApi<
  2235. {},
  2236. {
  2237. project_id: number;
  2238. cluster_id: number;
  2239. namespace: string;
  2240. stack_id: string;
  2241. }
  2242. >(
  2243. "GET",
  2244. ({ project_id, cluster_id, namespace, stack_id }) =>
  2245. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}`
  2246. );
  2247. const getStackRevision = baseApi<
  2248. {},
  2249. {
  2250. project_id: number;
  2251. cluster_id: number;
  2252. namespace: string;
  2253. stack_id: string;
  2254. revision_id: number;
  2255. }
  2256. >(
  2257. "GET",
  2258. ({ project_id, cluster_id, namespace, stack_id, revision_id }) =>
  2259. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/${revision_id}`
  2260. );
  2261. const rollbackStack = baseApi<
  2262. {
  2263. target_revision: number;
  2264. },
  2265. {
  2266. project_id: number;
  2267. cluster_id: number;
  2268. namespace: string;
  2269. stack_id: string;
  2270. }
  2271. >(
  2272. "POST",
  2273. ({ project_id, cluster_id, namespace, stack_id }) =>
  2274. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/rollback`
  2275. );
  2276. const deleteStack = baseApi<
  2277. {},
  2278. {
  2279. project_id: number;
  2280. cluster_id: number;
  2281. namespace: string;
  2282. stack_id: string;
  2283. }
  2284. >(
  2285. "DELETE",
  2286. ({ project_id, cluster_id, namespace, stack_id }) =>
  2287. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}`
  2288. );
  2289. const updateStackSourceConfig = baseApi<
  2290. {
  2291. source_configs: SourceConfig[];
  2292. },
  2293. {
  2294. project_id: number;
  2295. cluster_id: number;
  2296. namespace: string;
  2297. stack_id: string;
  2298. }
  2299. >(
  2300. "PUT",
  2301. ({ project_id, cluster_id, namespace, stack_id }) =>
  2302. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/source`
  2303. );
  2304. const addStackAppResource = baseApi<
  2305. CreateStackBody["app_resources"][0],
  2306. {
  2307. project_id: number;
  2308. cluster_id: number;
  2309. namespace: string;
  2310. stack_id: string;
  2311. }
  2312. >(
  2313. "PATCH",
  2314. ({ project_id, cluster_id, namespace, stack_id }) =>
  2315. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/add_application`
  2316. );
  2317. const removeStackAppResource = baseApi<
  2318. {},
  2319. {
  2320. project_id: number;
  2321. cluster_id: number;
  2322. namespace: string;
  2323. stack_id: string;
  2324. app_resource_name: string;
  2325. }
  2326. >(
  2327. "DELETE",
  2328. ({ project_id, cluster_id, namespace, stack_id, app_resource_name }) =>
  2329. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/remove_application/${app_resource_name}`
  2330. );
  2331. const addStackEnvGroup = baseApi<
  2332. CreateStackBody["env_groups"][0],
  2333. {
  2334. project_id: number;
  2335. cluster_id: number;
  2336. namespace: string;
  2337. stack_id: string;
  2338. }
  2339. >(
  2340. "PATCH",
  2341. ({ project_id, cluster_id, namespace, stack_id }) =>
  2342. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/add_env_group`
  2343. );
  2344. const removeStackEnvGroup = baseApi<
  2345. {},
  2346. {
  2347. project_id: number;
  2348. cluster_id: number;
  2349. namespace: string;
  2350. stack_id: string;
  2351. env_group_name: string;
  2352. }
  2353. >(
  2354. "DELETE",
  2355. ({ project_id, cluster_id, namespace, stack_id, env_group_name }) =>
  2356. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/remove_env_group/${env_group_name}`
  2357. );
  2358. const getGithubStatus = baseApi<{}, {}>("GET", ({ }) => `/api/status/github`);
  2359. const createSecretAndOpenGitHubPullRequest = baseApi<
  2360. {
  2361. github_app_installation_id: number;
  2362. github_repo_owner: string;
  2363. github_repo_name: string;
  2364. open_pr: boolean;
  2365. branch: string;
  2366. porter_yaml_path: string;
  2367. },
  2368. {
  2369. project_id: number;
  2370. cluster_id: number;
  2371. stack_name: string;
  2372. }
  2373. >(
  2374. "POST",
  2375. ({ project_id, cluster_id, stack_name }) =>
  2376. `/api/projects/${project_id}/clusters/${cluster_id}/stacks/${stack_name}/pr`
  2377. );
  2378. // Bundle export to allow default api import (api.<method> is more readable)
  2379. export default {
  2380. checkAuth,
  2381. connectECRRegistry,
  2382. connectGCRRegistry,
  2383. connectDORegistry,
  2384. getAWSIntegration,
  2385. getGCPIntegration,
  2386. getAzureIntegration,
  2387. getGitlabIntegration,
  2388. createAWSIntegration,
  2389. overwriteAWSIntegration,
  2390. updateCluster,
  2391. renameCluster,
  2392. createAzureIntegration,
  2393. createGitlabIntegration,
  2394. createEmailVerification,
  2395. createEnvironment,
  2396. updateEnvironment,
  2397. deleteEnvironment,
  2398. createPreviewEnvironmentDeployment,
  2399. reenablePreviewEnvironmentDeployment,
  2400. listEnvironments,
  2401. getEnvironment,
  2402. toggleNewCommentForEnvironment,
  2403. validatePorterYAML,
  2404. createGCPIntegration,
  2405. createInvite,
  2406. createNamespace,
  2407. createPasswordReset,
  2408. createPasswordResetVerify,
  2409. createPasswordResetFinalize,
  2410. createProject,
  2411. // PORTER APP
  2412. getPorterApps,
  2413. getPorterApp,
  2414. createPorterApp,
  2415. deletePorterApp,
  2416. rollbackPorterApp,
  2417. getLogsWithinTimeRange,
  2418. createConfigMap,
  2419. deleteCluster,
  2420. deleteConfigMap,
  2421. deleteInvite,
  2422. deleteNamespace,
  2423. deletePod,
  2424. deleteProject,
  2425. deleteRegistryIntegration,
  2426. deleteSlackIntegration,
  2427. updateNotificationConfig,
  2428. getNotificationConfig,
  2429. createSubdomain,
  2430. deployTemplate,
  2431. deployAddon,
  2432. destroyInfra,
  2433. updateDatabaseStatus,
  2434. detectBuildpack,
  2435. detectGitlabBuildpack,
  2436. getBranchContents,
  2437. getBranches,
  2438. getMetadata,
  2439. postWelcome,
  2440. getChart,
  2441. getCharts,
  2442. getChartComponents,
  2443. getChartControllers,
  2444. getClusterIntegrations,
  2445. getClusters,
  2446. getCluster,
  2447. getClusterNodes,
  2448. getClusterNode,
  2449. getClusterStatus,
  2450. getConfigMap,
  2451. getPRDeploymentList,
  2452. getPRDeploymentByID,
  2453. getGHAWorkflowTemplate,
  2454. getGitRepoList,
  2455. getGitRepoPermission,
  2456. getGitRepos,
  2457. getImageRepos,
  2458. getImageTags,
  2459. listInfraTemplates,
  2460. getInfraTemplate,
  2461. getInfra,
  2462. provisionCluster,
  2463. provisionInfra,
  2464. deleteInfra,
  2465. updateInfra,
  2466. listOperations,
  2467. getOperation,
  2468. getOperationLogs,
  2469. retryCreateInfra,
  2470. retryDeleteInfra,
  2471. getInfraState,
  2472. getInfraRawState,
  2473. getInfraByID,
  2474. getInfraDesired,
  2475. getInfraCurrent,
  2476. getIngress,
  2477. getInvites,
  2478. getJobs,
  2479. getJobStatus,
  2480. getJobPods,
  2481. getPodByName,
  2482. getMatchingPods,
  2483. getAllReleasePods,
  2484. getClusterState,
  2485. getMetrics,
  2486. getNamespaces,
  2487. getNGINXIngresses,
  2488. getOAuthIds,
  2489. getPodEvents,
  2490. getProcfileContents,
  2491. getPorterYamlContents,
  2492. getGitlabProcfileContents,
  2493. getProjectClusters,
  2494. getProjectRegistries,
  2495. getProjectRepos,
  2496. getProjects,
  2497. getPrometheusIsInstalled,
  2498. getRegistryIntegrations,
  2499. getReleaseToken,
  2500. getReleaseSteps,
  2501. getRepoIntegrations,
  2502. getSlackIntegrations,
  2503. getRepos,
  2504. getRevisions,
  2505. getTemplateInfo,
  2506. getTemplateUpgradeNotes,
  2507. getTemplates,
  2508. getHelmRepos,
  2509. getChartsFromHelmRepo,
  2510. getChartInfoFromHelmRepo,
  2511. linkGithubProject,
  2512. inviteAdmin,
  2513. getGithubAccounts,
  2514. listConfigMaps,
  2515. logInUser,
  2516. logOutUser,
  2517. registerUser,
  2518. rollbackChart,
  2519. uninstallTemplate,
  2520. updateUserInfo,
  2521. updateUser,
  2522. renameConfigMap,
  2523. updateConfigMap,
  2524. upgradeChartValues,
  2525. deleteJob,
  2526. stopJob,
  2527. updateInvite,
  2528. listAPITokens,
  2529. getAPIToken,
  2530. revokeAPIToken,
  2531. createAPIToken,
  2532. createPolicy,
  2533. getAvailableRoles,
  2534. getCollaborators,
  2535. updateCollaborator,
  2536. removeCollaborator,
  2537. getPolicyDocument,
  2538. createWebhookToken,
  2539. getUsage,
  2540. getCustomerToken,
  2541. getHasBilling,
  2542. getOnboardingState,
  2543. saveOnboardingState,
  2544. getOnboardingInfra,
  2545. getOnboardingRegistry,
  2546. detectPorterAgent,
  2547. installPorterAgent,
  2548. getKubeEvents,
  2549. getKubeEvent,
  2550. getLogBuckets,
  2551. getLogBucketLogs,
  2552. getCanCreateProject,
  2553. createEnvGroup,
  2554. cloneEnvGroup,
  2555. updateEnvGroup,
  2556. listEnvGroups,
  2557. getEnvGroup,
  2558. deleteEnvGroup,
  2559. addApplicationToEnvGroup,
  2560. removeApplicationFromEnvGroup,
  2561. provisionDatabase,
  2562. preflightCheckAWSUsage,
  2563. getDatabases,
  2564. getPreviousLogsForContainer,
  2565. upgradePorterAgent,
  2566. deletePRDeployment,
  2567. updateBuildConfig,
  2568. updateGitActionConfig,
  2569. reRunGHWorkflow,
  2570. getGHWorkflowLogs,
  2571. getGHWorkflowLogById,
  2572. triggerPreviewEnvWorkflow,
  2573. getTagsByProjectId,
  2574. createTag,
  2575. updateReleaseTags,
  2576. updateCanonicalName,
  2577. getGitProviders,
  2578. getGitlabRepos,
  2579. getGitlabBranches,
  2580. getGitlabFolderContent,
  2581. getLogPodValues,
  2582. getLogs,
  2583. listPorterEvents,
  2584. listPorterJobEvents,
  2585. listIncidents,
  2586. getIncident,
  2587. getIncidentEvents,
  2588. createContract,
  2589. getContracts,
  2590. deleteContract,
  2591. createSecretAndOpenGitHubPullRequest,
  2592. // TRACKING
  2593. updateOnboardingStep,
  2594. updateStackStep,
  2595. // STACKS
  2596. listStacks,
  2597. getStack,
  2598. getStackRevision,
  2599. createStack,
  2600. updateStack,
  2601. rollbackStack,
  2602. deleteStack,
  2603. updateStackSourceConfig,
  2604. addStackAppResource,
  2605. removeStackAppResource,
  2606. addStackEnvGroup,
  2607. removeStackEnvGroup,
  2608. getFeedEvents,
  2609. // STATUS
  2610. getGithubStatus,
  2611. };