api.tsx 52 KB

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