api.tsx 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870
  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. provider?: string;
  2181. },
  2182. {}
  2183. >("POST", (pathParams) => {
  2184. return `/api/onboarding_step`;
  2185. });
  2186. const updateStackStep = baseApi<
  2187. {
  2188. step: string;
  2189. stack_name?: string;
  2190. },
  2191. {
  2192. project_id: number;
  2193. cluster_id: number;
  2194. }
  2195. >("POST", (pathParams) => {
  2196. let { project_id, cluster_id } = pathParams;
  2197. return `/api/projects/${project_id}/clusters/${cluster_id}/stacks/analytics`;
  2198. });
  2199. // STACKS
  2200. const createStack = baseApi<
  2201. CreateStackBody,
  2202. {
  2203. project_id: number;
  2204. cluster_id: number;
  2205. namespace: string;
  2206. }
  2207. >(
  2208. "POST",
  2209. ({ project_id, cluster_id, namespace }) =>
  2210. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks`
  2211. );
  2212. const updateStack = baseApi<
  2213. {
  2214. name: string;
  2215. },
  2216. {
  2217. project_id: number;
  2218. cluster_id: number;
  2219. namespace: string;
  2220. stack_id: string;
  2221. }
  2222. >(
  2223. "PATCH",
  2224. ({ project_id, cluster_id, namespace, stack_id }) =>
  2225. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}`
  2226. );
  2227. const listStacks = baseApi<
  2228. {},
  2229. { project_id: number; cluster_id: number; namespace: string }
  2230. >(
  2231. "GET",
  2232. ({ project_id, cluster_id, namespace }) =>
  2233. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks`
  2234. );
  2235. const getStack = baseApi<
  2236. {},
  2237. {
  2238. project_id: number;
  2239. cluster_id: number;
  2240. namespace: string;
  2241. stack_id: string;
  2242. }
  2243. >(
  2244. "GET",
  2245. ({ project_id, cluster_id, namespace, stack_id }) =>
  2246. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}`
  2247. );
  2248. const getStackRevision = baseApi<
  2249. {},
  2250. {
  2251. project_id: number;
  2252. cluster_id: number;
  2253. namespace: string;
  2254. stack_id: string;
  2255. revision_id: number;
  2256. }
  2257. >(
  2258. "GET",
  2259. ({ project_id, cluster_id, namespace, stack_id, revision_id }) =>
  2260. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/${revision_id}`
  2261. );
  2262. const rollbackStack = baseApi<
  2263. {
  2264. target_revision: number;
  2265. },
  2266. {
  2267. project_id: number;
  2268. cluster_id: number;
  2269. namespace: string;
  2270. stack_id: string;
  2271. }
  2272. >(
  2273. "POST",
  2274. ({ project_id, cluster_id, namespace, stack_id }) =>
  2275. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/rollback`
  2276. );
  2277. const deleteStack = baseApi<
  2278. {},
  2279. {
  2280. project_id: number;
  2281. cluster_id: number;
  2282. namespace: string;
  2283. stack_id: string;
  2284. }
  2285. >(
  2286. "DELETE",
  2287. ({ project_id, cluster_id, namespace, stack_id }) =>
  2288. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}`
  2289. );
  2290. const updateStackSourceConfig = baseApi<
  2291. {
  2292. source_configs: SourceConfig[];
  2293. },
  2294. {
  2295. project_id: number;
  2296. cluster_id: number;
  2297. namespace: string;
  2298. stack_id: string;
  2299. }
  2300. >(
  2301. "PUT",
  2302. ({ project_id, cluster_id, namespace, stack_id }) =>
  2303. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/source`
  2304. );
  2305. const addStackAppResource = baseApi<
  2306. CreateStackBody["app_resources"][0],
  2307. {
  2308. project_id: number;
  2309. cluster_id: number;
  2310. namespace: string;
  2311. stack_id: string;
  2312. }
  2313. >(
  2314. "PATCH",
  2315. ({ project_id, cluster_id, namespace, stack_id }) =>
  2316. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/add_application`
  2317. );
  2318. const removeStackAppResource = baseApi<
  2319. {},
  2320. {
  2321. project_id: number;
  2322. cluster_id: number;
  2323. namespace: string;
  2324. stack_id: string;
  2325. app_resource_name: string;
  2326. }
  2327. >(
  2328. "DELETE",
  2329. ({ project_id, cluster_id, namespace, stack_id, app_resource_name }) =>
  2330. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/remove_application/${app_resource_name}`
  2331. );
  2332. const addStackEnvGroup = baseApi<
  2333. CreateStackBody["env_groups"][0],
  2334. {
  2335. project_id: number;
  2336. cluster_id: number;
  2337. namespace: string;
  2338. stack_id: string;
  2339. }
  2340. >(
  2341. "PATCH",
  2342. ({ project_id, cluster_id, namespace, stack_id }) =>
  2343. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/add_env_group`
  2344. );
  2345. const removeStackEnvGroup = baseApi<
  2346. {},
  2347. {
  2348. project_id: number;
  2349. cluster_id: number;
  2350. namespace: string;
  2351. stack_id: string;
  2352. env_group_name: string;
  2353. }
  2354. >(
  2355. "DELETE",
  2356. ({ project_id, cluster_id, namespace, stack_id, env_group_name }) =>
  2357. `/api/v1/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/stacks/${stack_id}/remove_env_group/${env_group_name}`
  2358. );
  2359. const getGithubStatus = baseApi<{}, {}>("GET", ({ }) => `/api/status/github`);
  2360. const createSecretAndOpenGitHubPullRequest = baseApi<
  2361. {
  2362. github_app_installation_id: number;
  2363. github_repo_owner: string;
  2364. github_repo_name: string;
  2365. open_pr: boolean;
  2366. branch: string;
  2367. porter_yaml_path: string;
  2368. },
  2369. {
  2370. project_id: number;
  2371. cluster_id: number;
  2372. stack_name: string;
  2373. }
  2374. >(
  2375. "POST",
  2376. ({ project_id, cluster_id, stack_name }) =>
  2377. `/api/projects/${project_id}/clusters/${cluster_id}/stacks/${stack_name}/pr`
  2378. );
  2379. // Bundle export to allow default api import (api.<method> is more readable)
  2380. export default {
  2381. checkAuth,
  2382. connectECRRegistry,
  2383. connectGCRRegistry,
  2384. connectDORegistry,
  2385. getAWSIntegration,
  2386. getGCPIntegration,
  2387. getAzureIntegration,
  2388. getGitlabIntegration,
  2389. createAWSIntegration,
  2390. overwriteAWSIntegration,
  2391. updateCluster,
  2392. renameCluster,
  2393. createAzureIntegration,
  2394. createGitlabIntegration,
  2395. createEmailVerification,
  2396. createEnvironment,
  2397. updateEnvironment,
  2398. deleteEnvironment,
  2399. createPreviewEnvironmentDeployment,
  2400. reenablePreviewEnvironmentDeployment,
  2401. listEnvironments,
  2402. getEnvironment,
  2403. toggleNewCommentForEnvironment,
  2404. validatePorterYAML,
  2405. createGCPIntegration,
  2406. createInvite,
  2407. createNamespace,
  2408. createPasswordReset,
  2409. createPasswordResetVerify,
  2410. createPasswordResetFinalize,
  2411. createProject,
  2412. // PORTER APP
  2413. getPorterApps,
  2414. getPorterApp,
  2415. createPorterApp,
  2416. deletePorterApp,
  2417. rollbackPorterApp,
  2418. getLogsWithinTimeRange,
  2419. createConfigMap,
  2420. deleteCluster,
  2421. deleteConfigMap,
  2422. deleteInvite,
  2423. deleteNamespace,
  2424. deletePod,
  2425. deleteProject,
  2426. deleteRegistryIntegration,
  2427. deleteSlackIntegration,
  2428. updateNotificationConfig,
  2429. getNotificationConfig,
  2430. createSubdomain,
  2431. deployTemplate,
  2432. deployAddon,
  2433. destroyInfra,
  2434. updateDatabaseStatus,
  2435. detectBuildpack,
  2436. detectGitlabBuildpack,
  2437. getBranchContents,
  2438. getBranches,
  2439. getMetadata,
  2440. postWelcome,
  2441. getChart,
  2442. getCharts,
  2443. getChartComponents,
  2444. getChartControllers,
  2445. getClusterIntegrations,
  2446. getClusters,
  2447. getCluster,
  2448. getClusterNodes,
  2449. getClusterNode,
  2450. getClusterStatus,
  2451. getConfigMap,
  2452. getPRDeploymentList,
  2453. getPRDeploymentByID,
  2454. getGHAWorkflowTemplate,
  2455. getGitRepoList,
  2456. getGitRepoPermission,
  2457. getGitRepos,
  2458. getImageRepos,
  2459. getImageTags,
  2460. listInfraTemplates,
  2461. getInfraTemplate,
  2462. getInfra,
  2463. provisionCluster,
  2464. provisionInfra,
  2465. deleteInfra,
  2466. updateInfra,
  2467. listOperations,
  2468. getOperation,
  2469. getOperationLogs,
  2470. retryCreateInfra,
  2471. retryDeleteInfra,
  2472. getInfraState,
  2473. getInfraRawState,
  2474. getInfraByID,
  2475. getInfraDesired,
  2476. getInfraCurrent,
  2477. getIngress,
  2478. getInvites,
  2479. getJobs,
  2480. getJobStatus,
  2481. getJobPods,
  2482. getPodByName,
  2483. getMatchingPods,
  2484. getAllReleasePods,
  2485. getClusterState,
  2486. getMetrics,
  2487. getNamespaces,
  2488. getNGINXIngresses,
  2489. getOAuthIds,
  2490. getPodEvents,
  2491. getProcfileContents,
  2492. getPorterYamlContents,
  2493. getGitlabProcfileContents,
  2494. getProjectClusters,
  2495. getProjectRegistries,
  2496. getProjectRepos,
  2497. getProjects,
  2498. getPrometheusIsInstalled,
  2499. getRegistryIntegrations,
  2500. getReleaseToken,
  2501. getReleaseSteps,
  2502. getRepoIntegrations,
  2503. getSlackIntegrations,
  2504. getRepos,
  2505. getRevisions,
  2506. getTemplateInfo,
  2507. getTemplateUpgradeNotes,
  2508. getTemplates,
  2509. getHelmRepos,
  2510. getChartsFromHelmRepo,
  2511. getChartInfoFromHelmRepo,
  2512. linkGithubProject,
  2513. inviteAdmin,
  2514. getGithubAccounts,
  2515. listConfigMaps,
  2516. logInUser,
  2517. logOutUser,
  2518. registerUser,
  2519. rollbackChart,
  2520. uninstallTemplate,
  2521. updateUserInfo,
  2522. updateUser,
  2523. renameConfigMap,
  2524. updateConfigMap,
  2525. upgradeChartValues,
  2526. deleteJob,
  2527. stopJob,
  2528. updateInvite,
  2529. listAPITokens,
  2530. getAPIToken,
  2531. revokeAPIToken,
  2532. createAPIToken,
  2533. createPolicy,
  2534. getAvailableRoles,
  2535. getCollaborators,
  2536. updateCollaborator,
  2537. removeCollaborator,
  2538. getPolicyDocument,
  2539. createWebhookToken,
  2540. getUsage,
  2541. getCustomerToken,
  2542. getHasBilling,
  2543. getOnboardingState,
  2544. saveOnboardingState,
  2545. getOnboardingInfra,
  2546. getOnboardingRegistry,
  2547. detectPorterAgent,
  2548. installPorterAgent,
  2549. getKubeEvents,
  2550. getKubeEvent,
  2551. getLogBuckets,
  2552. getLogBucketLogs,
  2553. getCanCreateProject,
  2554. createEnvGroup,
  2555. cloneEnvGroup,
  2556. updateEnvGroup,
  2557. listEnvGroups,
  2558. getEnvGroup,
  2559. deleteEnvGroup,
  2560. addApplicationToEnvGroup,
  2561. removeApplicationFromEnvGroup,
  2562. provisionDatabase,
  2563. preflightCheckAWSUsage,
  2564. getDatabases,
  2565. getPreviousLogsForContainer,
  2566. upgradePorterAgent,
  2567. deletePRDeployment,
  2568. updateBuildConfig,
  2569. updateGitActionConfig,
  2570. reRunGHWorkflow,
  2571. getGHWorkflowLogs,
  2572. getGHWorkflowLogById,
  2573. triggerPreviewEnvWorkflow,
  2574. getTagsByProjectId,
  2575. createTag,
  2576. updateReleaseTags,
  2577. updateCanonicalName,
  2578. getGitProviders,
  2579. getGitlabRepos,
  2580. getGitlabBranches,
  2581. getGitlabFolderContent,
  2582. getLogPodValues,
  2583. getLogs,
  2584. listPorterEvents,
  2585. listPorterJobEvents,
  2586. listIncidents,
  2587. getIncident,
  2588. getIncidentEvents,
  2589. createContract,
  2590. getContracts,
  2591. deleteContract,
  2592. createSecretAndOpenGitHubPullRequest,
  2593. // TRACKING
  2594. updateOnboardingStep,
  2595. updateStackStep,
  2596. // STACKS
  2597. listStacks,
  2598. getStack,
  2599. getStackRevision,
  2600. createStack,
  2601. updateStack,
  2602. rollbackStack,
  2603. deleteStack,
  2604. updateStackSourceConfig,
  2605. addStackAppResource,
  2606. removeStackAppResource,
  2607. addStackEnvGroup,
  2608. removeStackEnvGroup,
  2609. getFeedEvents,
  2610. // STATUS
  2611. getGithubStatus,
  2612. };